Ticket #2386 (closed defect: fixed)

Opened 22 months ago

Last modified 18 months ago

Provide additional rollup files in addition to dojo.js

Reported by: jburke Owned by: jburke
Priority: normal Milestone:
Component: BuildSystem Version: 0.4.1
Severity: normal Keywords:
Cc:

Description (last modified by alex) (diff)

Allow the build system to generate multiple roll up files that contain a set of modules, in addition to dojo.js. The other rollup files should not include modules that are in dojo.js.

The work for this was started in a previous commit (forget which one), but was not fully fleshed out.

Some complications:

  • How to dynamically load these rollup files? Allow mapping the modules in the rollup file via djConfig.modulePaths (could be verbose) or create the rollup module with a specific resource name (like dojo.rollup1), and have the application change their code to use dojo.require("rollup1") instead of the other requires? That goes against the idea of the build system where you don't need to modify your code (except top level djConfig/dojo.js script line). So favor configuration via djConfig.modulePaths.
  • Need to divine the correct subset of modules that should be in dojo.js. For instance if rollup1.js has a dependency on dojo.foo and so does rollup2.js, then we should include dojo.foo in dojo.js even if they don't explicitly mention that module for dojo.js.

Attachments

2386.patch (11.8 kB) - added by jburke 21 months ago.
In progress patch, does not include i18n flattening or compression.
layers.profile.js (0.8 kB) - added by jburke 20 months ago.
Example profile with layers in it.

Change History

Changed 22 months ago by robert.coup@…

I think we could use a simpler approach: Rather than specifying what goes into dojo.js by combining rollups, why not just have the rollup be defined based on what is not already in dojo.js?

Calculate the dependencies for the profile, then remove those that are already in the base (eg. ajax) profile. What's left over needs to go in the rollup.

Since getDependencyList() just prints a list of strings (well, last time I looked) this filtering could happen later in the process and so we wouldn't need to change the profile format. Specifying -DbaseProfile="ajax" to Ant could let the base profile dependencies be calculated, followed by the actual profile, then change the resulting dependency list.

In the page the files could be loaded using normal script tags:

<script src="js/dojo/dojo-ajax.js" type="text/javascript"></script>
<script src="js/my-rollup.js" type="text/javascript"></script>

Future enhancements - specifying the base profile in the profile js file (is this even a good idea?), module paths, resource names, multiple base profiles, ...

Rob :)

Changed 22 months ago by jburke

Just uploaded a patch that gets the basic mechanism working. It supports creating "dojoLayerN.js" files. intern-strings also works for these files, but some things that do not:

  • compression via Dojo Compressor
  • Including flattened i18n bundles for these files at the top-level nls folder. Not sure we would want this anyway, but something to talk about.

If this patch holds up, we can get rid of:

  • buildscripts/buildUtilExt.js
  • buildscripts/profiles/multi.*.js

The patch was created against the 0.4 branch, but it should be applicable to the trunk too.

Changed 21 months ago by jburke

Removed old patches since they are against old code, and inferior. New patch and profile structure allows specifying which other layers a layer depends on. Still need to work out the proper thing for i18n bundle flattening and for compression, and it hasn't been tested, but an improvement over the old patch approach.

Changed 21 months ago by jburke

In progress patch, does not include i18n flattening or compression.

Changed 21 months ago by jburke

Just updated the patch to something that actually works. Patch was done against 0.4 branch.

It does not flatten i18n bundles for the layered files or compress them. But if strip-resource-comments ant task is run, the files do get minified.

Changed 20 months ago by jburke

Example profile with layers in it.

Changed 20 months ago by alex

  • description modified (diff)

Changed 20 months ago by jburke

  • milestone changed from 0.9 to 0.4.3

Changed 20 months ago by jburke

(In [7738]) Refs #2386: Can do layered builds. No support for compression or i18n bundle matching, but still useful.

Changed 20 months ago by jburke

(In [7739]) (merge from 0.4 branch) Refs #2386: Can do layered builds. No support for compression or i18n bundle matching, but still useful.

Changed 20 months ago by jburke

(In [7907]) Fixes #2407 and Refs #2386. dojo compressing now works over multiple files in the same process. Layer files are now compressed, and it is possible to compress all files in the src directory via the strip-resource-comments ant task. Specify that task and a -Dstrip_and_compress=true to ant.

Changed 20 months ago by jburke

(In [7908]) (merge from 0.4 branch) Fixes #2407 and Refs #2386. dojo compressing now works over multiple files in the same process. Layer files are now compressed, and it is possible to compress all files in the src directory via the strip-resource-comments ant task. Specify that task and a -Dstrip_and_compress=true to ant.

Changed 20 months ago by jburke

(In [7909]) (merge from 0.4 branch) Fixes #2407 and Refs #2386. dojo compressing now works over multiple files in the same process. Layer files are now compressed, and it is possible to compress all files in the src directory

Changed 20 months ago by jburke

(In [7911]) Refs #2386. Create xd files for layered files.

Changed 20 months ago by jburke

(In [7912]) (merge from 0.4 branch) Refs #2386. Create xd files for layered files.

Changed 20 months ago by jburke

(In [7920]) Refs #2386. Copyright parsing is flawed and takes way too much time. A copyright text is passed in to this method, so there is a way to set a specific copyright.

Changed 20 months ago by jburke

(In [7921]) (merge from 0.4 branch) Refs #2386. Copyright parsing is flawed and takes way too much time. A copyright text is passed in to this method, so there is a way to set a specific copyright.

Changed 20 months ago by jburke

(In [7922]) (merge from 0.4 branch) Refs #2386. Copyright parsing is flawed and takes way too much time. A copyright text is passed in to this method, so there is a way to set a specific copyright.

Changed 19 months ago by jburke

  • status changed from new to closed
  • resolution set to fixed

Marking fixed now. Basic support in there now. Layered support might be expanded, but that work will happen in 0.9.

Changed 18 months ago by anonymous

  • milestone deleted

Milestone 0.4.3 deleted

Note: See TracTickets for help on using tickets.