Opened 6 years ago

Closed 6 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)

depsScan.js.patch (825 bytes) - added by Patrick Ruzand 6 years ago.
patch by pruzand (CCLA, IBM)

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Patrick Ruzand

Attachment: depsScan.js.patch added

patch by pruzand (CCLA, IBM)

comment:1 Changed 6 years ago by Patrick Ruzand

Priority: undecidedhigh
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 6 years ago by Patrick Ruzand

Milestone: tbd1.9

comment:3 Changed 6 years ago by Rawld Gill

Status: newassigned

comment:4 Changed 6 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [31275]:

fixed typo bug that caused synthetic load-init module to squelch its depending resource; thanks pruzand; fixes #16591; !strict

Note: See TracTickets for help on using tickets.