Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#15061 closed defect (fixed)

i18n preloadText not compatible with remapped package names

Reported by: ben hockey Owned by: Rawld Gill
Priority: high Milestone: 1.7.3
Component: BuildSystem Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

the require(["dojo/i18n"], ... call in the preloadText added in r27806 causes an extra http request to be made when the top-level package name for dojo has been remapped. this is because this call goes to the global require which is not aware of the packageMap for the layer/module being loaded.

Attachments (2)

15061.zip (11.1 KB) - added by ben hockey 8 years ago.
extract as sibling of dojo, dijit, et al and run build based on included profile
15061.2.zip (2.5 KB) - added by Rawld Gill 8 years ago.
enhanced example

Download all attachments as: .zip

Change History (13)

comment:1 Changed 8 years ago by ben hockey

Priority: undecidedhigh

comment:2 Changed 8 years ago by ben hockey

Milestone: tbd1.7.3

Changed 8 years ago by ben hockey

Attachment: 15061.zip added

extract as sibling of dojo, dijit, et al and run build based on included profile

comment:3 Changed 8 years ago by ben hockey

i've added a test case to demonstrate the problem and help with debugging.

comment:4 Changed 8 years ago by ben hockey

with the test case, you'll observe that the dojo/i18n module is included in the built layer but if you look at the network requests, you'll see that dojo/i18n is requested in addition to the built layer.

comment:5 Changed 8 years ago by Rawld Gill

Status: newassigned

comment:6 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [28456]:

reworked i18n preload algorithm to allow for mapped modules; see commentary in dojo/i18n.js; updated tests; updated dojo profile to not choke on test resources; included minor tweak to injectPlugin in dojo/dojo.js may may fix intermitent loader stalls with plugins as in #15137; fixes #15061; !strict

comment:7 Changed 8 years ago by Rawld Gill

In [28457]:

reworked i18n preload algorithm to allow for mapped modules; see commentary in dojo/i18n.js; updated tests; updated dojo profile to not choke on test resources; included minor tweak to injectPlugin in dojo/dojo.js may may fix intermitent loader stalls with plugins as in #15137; fixes #15061; !strict

comment:8 Changed 8 years ago by Rawld Gill

double commit above due to bash command line failure...should've been all one checkin

Changed 8 years ago by Rawld Gill

Attachment: 15061.2.zip added

enhanced example

comment:9 Changed 8 years ago by Rawld Gill

@neonstalwart: excellent test case! The current design doesn't provide for remapping built packages in a straight-forward way. I was able to come up with some hacks, but they were not acceptable in my mind. I've attached an expanded version of your example to include one localized bundle which is useful for exercising a few more paths.

[28456] + [28457] includes an enhanced preload design. See commentary in dojo/i18n for details. See dojo/tests/_base/loader/i18n-exhaustive/test-instructions.md for an example that exercises many code paths and builds several different kinds of targets. Inspecting the relatively small build output from that test is illustrative.

Note 1: Bundles can now be aggregated in boot layers (e.g., in dojo/dojo.js)

Note 2: The preload algorithms can be completely eliminated by setting the profile property localeList to falsy. Similarly, the preload code can be eliminated with the has feature "dojo-v1x-i18n-Api"

Note 3: The changes in injectPlugin() in dojo/dojo.js may eliminate intermittent loader stalls with plugins in a few, obscure cases.

Note 4: The loader cache has a new feature that allows for immediately applying a function upon cache load. See commentary in dojo/i18n.

Note 5: This work also included some expressive improvement...I managed to squeeze a few more bytes out of dojo/dojo and dojo/i18n

comment:10 Changed 8 years ago by Rawld Gill

Just to be clear in the previous comment "the current design" refers to trunk prior to [28456] + [28457]

comment:11 Changed 7 years ago by Rawld Gill

In [29654]:

fixed improper application of transform writeAmd.getLayerText() which changed in [28456]; refs #15061, refs #15856; !strict

Note: See TracTickets for help on using tickets.