Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13080 closed defect (fixed)

Build Tool Pulls in Excessive dojo/dijit/dojox into Layer Files of Demos

Reported by: Ming Zhe Huang Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: BuildSystem Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:


OS: Win7 X64 Java: Java6 Optimizer: Shrinksafe JS Engine: Rhino Profile: demos-all Synopsis: Try to build using /demos/resources/ which uses demos-all profile. Check the output, especially mobileCharting, mobileGallery, mobileGauges, mobileOpenLayers. The size of src.js is not correct. It's much larger than it should be. I checked the content (uncompressed) and find that some excessive dojo/dijit/dojox modules are pulled. Besides, trying those demos will fail. Error messages are different, but I think those should be related to the build output of src.js

Attachments (1)

test_loader.html (201 bytes) - added by Ming Zhe Huang 10 years ago.
Test Case

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by Adam Peller

Can you give specifics?

comment:2 Changed 10 years ago by Rawld Gill

Status: newassigned

comment:3 Changed 10 years ago by Rawld Gill

I executed a build as per your report and inspected build-report.txt in release/demosite. The dependency list of demos/mobileCharting/src seems correct. Can you identify a particular module that you think should not be there?

I inspected release/demosite/demos/mobileCharting/src.js.uncompressed.js and it appears to reflect the report.


Changed 10 years ago by Ming Zhe Huang

Attachment: test_loader.html added

Test Case

comment:4 Changed 10 years ago by Ming Zhe Huang

The previous synopsis is obsolete. Please ignore it.

The root cause is how we load "." module. Please see the attached HTML. Put it under the root of the release build. Open it, inspect the network and you'll find there will be a 404 not found of dojox.js.

The dojox.js is derived from "." which is specified inside dojox/mobile.js which our test page requires. If we use inline JavaScript? (those embedded in HTML) to import dojox/mobile.js, the "." module will be treated as "dojox" and dojox.js will be loaded, which causes 404 error. AFAICS, "." is used in several dojo library files.

The interesting thing is that if we move those inline JavaScript? into an independent JavaScript? file and use <script> to import it, then there will NOT be such error. I already fixed the loading problem in mobileGallery, by just doing that.

If the correctness of inline JavaScript? cannot be guaranteed, then I guess we might break many existing applications. Some demo applications work well, just because there's no inline JavaScript? in their HTML pages.

comment:5 Changed 10 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

(In [25284]) removed obsolete requirejs behavior compat hack; fixes #13080; !strict

comment:6 Changed 10 years ago by Rawld Gill

The problem was relative paths being handled as per requirejs's algorithm. This could have been fixed by setting the has feature "dojo-requirejs-api" to false. However, since requirejs changed its behavior to be consistent with dojo, the feature test is not necessary and has been removed.

Verified the test file works OK with a build.

Thanks for the report!

comment:7 Changed 10 years ago by bill

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.