Opened 8 years ago

Closed 7 years ago

Last modified 6 years ago

#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)

simpletest.tar.gz (1.2 KB) - added by dante 8 years ago.
unpack as sibling of dojo/ dijit/ dojox/

Download all attachments as: .zip

Change History (17)

Changed 8 years ago by dante

Attachment: simpletest.tar.gz added

unpack as sibling of dojo/ dijit/ dojox/

comment:1 Changed 8 years ago by dante

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 Changed 8 years ago by bill

Version: 1.6.11.7.0

Isn't it a user error for a layer to depend on itself?

comment:3 in reply to:  2 Changed 8 years ago by dante

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 8 years ago by Kenneth G. Franqueiro

Priority: normalhigh

comment:5 Changed 8 years ago by Rawld Gill

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 8 years ago by Rawld Gill

Milestone: 1.7.11.8
Priority: highlow

comment:7 Changed 8 years ago by Rawld Gill

Status: newassigned

comment:8 Changed 8 years ago by Rawld Gill

Milestone: 1.81.7.1

comment:9 Changed 8 years ago by bill

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 8 years ago by bill

Milestone: 1.7.11.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 8 years ago by Rawld Gill

Component: BuildSystemDocumentation
Type: defecttask

comment:12 Changed 8 years ago by Colin Snover

Milestone: 1.7.21.7.3

1.7.2 RC released, bumping milestone on remaining tickets.

comment:13 Changed 7 years ago by Colin Snover

Keywords: needsdocs added

Looks like this should simply be documented in release notes and closed fixed yes?

comment:14 Changed 7 years ago by Colin Snover

Milestone: 1.7.31.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 7 years ago by Kitson Kelly

Resolution: fixed
Status: assignedclosed

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 6 years ago by jan schatz

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.

Note: See TracTickets for help on using tickets.