#14947 closed defect (worksforme)
dojo/i18n is loaded separately even if it's included in a layer
Reported by: | liucougar | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | low | Milestone: | 1.8 |
Component: | BuildSystem | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
extract all the files in the attached archive into dojo/
run build script under util/buildscript:
./build.sh releaseDir=../ releaseName=buildingrelease action=release profile=../../dojo/my.profile.js
load /buildingrelease/dojo/my.html in browser, notice that i18n is requested separately after my.js layer is loaded, although i18n.js is already inlined in the my.js layer
if I manually add "*noref":1 to the require({cache:{...}}
in the built my.js layer file, then i18n won't be separately loaded again
it seems to me that if a layer has all the dependency modules included, builder should ensure the built layer does not need to 're-load' modules which are already baked into the layer
this is related to #13612
Attachments (1)
Change History (4)
Changed 9 years ago by
Attachment: | my.tar.bz2 added |
---|
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Summary: | module is loaded separately even if it's included in a layer → dojo/i18n is loaded separately even if it's included in a layer |
comment:2 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
comment:3 Changed 9 years ago by
Hi rawld,
does this workaround still applies to 1.8 ? (I have the same error with 1.8 custom build and just want to be sure it is indeed expected). Thx
Hi Cougar! Thanks for the report. This is a little tricky...
Normally the loader will consume all modules built into a layer; however, the dojo/i18n layer is the one exception. Since preloadLocalizations is necessarily called before the layer module is defined (e.g., dojo/my in your example), dojo/i18n is needed before the loader can consume the cache. Recall the cache is consumed when a module is defined, which allows for module remapping.
The best solution is to build dojo/i18n into dojo.js. Here is the layer config that does that
I tested this and it seems to work correctly.