Opened 12 years ago

Closed 12 years ago

#3180 closed defect (fixed)

Need layer option to not include some modules that are not in any layer file.

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 0.9beta
Component: BuildSystem Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

Need a way to not include some modules in a layer even if they are not in any other layer.

For instance, the dijit.dijit file ends up needing dojo.string. It should not include any core modules in its rollup file.

Maybe allow specifying a layer, but set a "x" property on the layer that indicates the layer should not be saved.

And/or, allow specifying an array of prefixes that should not be included in the specific layer.

Points to a larger problem that some files could have some dojo.provide() calls that satisfy a require() call, but they would be inside another file with a different dojo.provide() call. The end result is that you could load a layer file that has module X in it, but some other code asks for module X directly, so one of the definitions might override the other.

This could also be bad in the case where the specify module is loaded first, then later the layer file is loaded with the same module (in the widget case, you could destroy the widget manager).

I think the answer is "use layers at your own risk: track the dependencies", and for making official dojo builds, make sure we do not include modules from other repos in a specific repo's layer files.

Change History (2)

comment:1 Changed 12 years ago by James Burke

The concerns about redefinition are tracked and fixed in #3240.

comment:2 Changed 12 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [9137]) Fixes #3180. A layer can specify 'discard: true' to not save a layer, but to use it to make sure the modules in that layer are not included in other layers. Updated layers.profile.js to illustrate different layer concepts. Removed the dojo.js dependency in 0.9.profile.js since dojo.js is always an implicit dependency.

Note: See TracTickets for help on using tickets.