#14262 closed task (fixed)
[regression] built layer doesn't include everything
Reported by: | dante | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | low | Milestone: | 1.7.4 |
Component: | Documentation | Version: | 1.7.0 |
Keywords: | needsdocs | Cc: | |
Blocked By: | Blocking: |
Description
Prior to Dojo 1.7, building a "layer" using the layer as a dependency of itself would cause the one "layer" file to include every non-base-dojo module required. After 1.7 this is no longer the case.
Attached is a simple namespace showing the issue. Before a build, dojo.js is loaded and many many many modules are loaded. After a build, dojo.js is larger, layer.js has some resources included, but a good portion of dijit/_base appears to be left out.
Run the included build.sh for profile settings and whatnot. manually adjusting the simpletest.html to point to a dojo.js or release/trunk/dojo.js is all that is required.
You can ignore the attempt at triggering another bug regarding _Templated not coming in, it is from another bug I am trying to reproduce as well.
Attachments (1)
Change History (17)
Changed 11 years ago by
Attachment: | simpletest.tar.gz added |
---|
comment:1 Changed 11 years ago by
additionally, if you notice in the profile.json file ... I attempted to leave out the dojox prefix to avoid having to copy over that whole directory for a small dijit example, and after build there is an error fetching /dojox.js, causing the page to break. May file that as another ticket ...
comment:2 follow-up: 3 Changed 11 years ago by
Version: | 1.6.1 → 1.7.0 |
---|
Isn't it a user error for a layer to depend on itself?
comment:3 Changed 11 years ago by
Replying to bill:
Isn't it a user error for a layer to depend on itself?
No, I meant the profile listing the layer as the only dependency (a very common pattern I've been using for ... )
layers:[ { name: "../foo/bar.js", dependencies: [ "foo.bar" ] }, ], prefixes: [ "foo", "../foo"]
comment:4 Changed 11 years ago by
Priority: | normal → high |
---|
comment:5 Changed 11 years ago by
The problem relates to the way dijit/_Widget is implemented. If you look at the bottom of that resource, you'll see
// For back-compat, remove in 2.0. if(!kernel.isAsync){ ready(0, function(){ var requires = ["dijit/_base"]; require(requires); // use indirection so modules not rolled into a build }); }
This has the net effect of hiding dijit/_base from the build system. If you change your layer to include dijit/_base like this:
layers: [ { name: "../simpletest/layer.js", dependencies: [ "simpletest.layer", "dijit._base" ] } ],
...you'll get a minimal load.
So, I think this is a release note issue?
comment:6 Changed 11 years ago by
Milestone: | 1.7.1 → 1.8 |
---|---|
Priority: | high → low |
comment:7 Changed 11 years ago by
Status: | new → assigned |
---|
comment:8 Changed 11 years ago by
Milestone: | 1.8 → 1.7.1 |
---|
comment:9 Changed 11 years ago by
I talked to Pete and he didn't have a strong opinion. We both feel that it's a tough call. So please just update the release notes (migration section, at the end) to tell people to either (1) use AMD or (2) include dijit/base etc. in their build profiles.
comment:10 Changed 11 years ago by
Milestone: | 1.7.1 → 1.7.2 |
---|
These didn't make it into the 1.7.1RC, so bumping them to 1.7.2 (as stated in the email I sent yesterday).
comment:11 Changed 10 years ago by
Component: | BuildSystem → Documentation |
---|---|
Type: | defect → task |
comment:12 Changed 10 years ago by
Milestone: | 1.7.2 → 1.7.3 |
---|
1.7.2 RC released, bumping milestone on remaining tickets.
comment:13 Changed 10 years ago by
Keywords: | needsdocs added |
---|
Looks like this should simply be documented in release notes and closed fixed yes?
comment:14 Changed 10 years ago by
Milestone: | 1.7.3 → 1.7.4 |
---|
1.7.3 has been tagged. Moving tickets to next milestone. Ticket owners, if you are not planning on addressing this issue in 1.7.x branch please do something with your ticket.
comment:15 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I changed the release notes for this in the 1.7, 1.8 and master branches of the documents for releasenotes/1.7.rst
comment:16 Changed 9 years ago by
I think adding a hint to the release notes is not sufficient, because dijit/_base is by far not the only module pulled in in this way. After adding dijit/_base to my build profile my website was still loading five modules via XHR and it was not at all obvious who required these modules.
For example dojo/dnd/AutoSource was required by dojo/dnd/Source which was required by dojox/grid/_View which was required by dojox/grid/_Grid which was required by dojox/grid/DataGrid which was required by a custom widget.
unpack as sibling of dojo/ dijit/ dojox/