Opened 8 years ago
Closed 8 years ago
#16591 closed defect (fixed)
[patch][CCLA]the 1.7 build app does not generate the reference module of a loadInit plugin resource
Reported by: | Patrick Ruzand | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | BuildSystem | Version: | 1.7.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If a module contains a legacy api that requires a loadInitPlugin strategy, the resulting build is missing the "AMD-updated" reference module.\ Assuming there's myapp/foo module containing:
dojo.provide("myapp.foo"); dojo.requireIf(true, "some/module"); // just for testing ...
The result of a build gives only the loadInit plugin resource (that is, myapp/foo-loadInit.js), but the amd-updated version of the reference module (myapp/foo.js) is missing.
I think the problem lies in transforms/depsScan.js, l.589:
pluginResource = mix({}, mix(resource, { src:resource.src.substring(0, resource.src.length-3) + "-loadInit.js", dest:bc.getDestModuleInfo(mid).url, mid:mid, tag:{loadInitResource:1}, deps:[], getText:function(){ return pluginText; } }));
Indeed, instead of copying the original resource and _then_ mix in the new properties, the current implementation does the opposite: mix in the original resource the new properties (so it changes the reference module mid and text...), then copy it. And since the original resource mid is overriden, it is missing in the generation .
Instead, it should be:
pluginResource = mix(mix({}, resource), { src:resource.src.substring(0, resource.src.length-3) + "-loadInit.js", dest:bc.getDestModuleInfo(mid).url, mid:mid, tag:{loadInitResource:1}, deps:[], getText:function(){ return pluginText; } });
I attached a corresponding patch.
Attachments (1)
Change History (5)
Changed 8 years ago by
Attachment: | depsScan.js.patch added |
---|
comment:1 Changed 8 years ago by
Priority: | undecided → high |
---|---|
Summary: | the 1.7 build app does not generate the reference module of a loadInit plugin resource → [patch][CCLA]the 1.7 build app does not generate the reference module of a loadInit plugin resource |
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|
comment:3 Changed 8 years ago by
Status: | new → assigned |
---|
patch by pruzand (CCLA, IBM)