Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#14819 closed defect (fixed)

Legacy build + 1.7.1 forces including deprecated files into build

Reported by: Karl Tiedt Owned by: bill
Priority: undecided Milestone: 1.8
Component: Dijit Version: 1.7.2rc1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

NOTE: this probably isnt really "BuildSystem" but it didnt really fit anywhere else either -- feel free to reassign more appropriately.

I discussed this with Bill last week, but figure I will open a ticket for posterity sake and see where the conversation goes.

Files likes AccordionContainer.js have code such as:

	// Back compat w/1.6, remove for 2.0
	if(!kernel.isAsync){
		ready(0, function(){
			var requires = ["dijit/layout/AccordionPane"];
			require(requires);	// use indirection so modules not rolled into a build
		});
	}

Because of this... if your production product is on limited hardware where you cannot ship a modular build (only include layers and necessary files) -- you are forced to roll AccordionPane.js into your build as well now.

This is far from an ideal situation... Note there are other files as well but I believe this is the only instance of a deprecated file being forced to load... Surely there is a better solution.

Change History (9)

comment:1 Changed 8 years ago by bill

Description: modified (diff)

Here are links to the first mailing list discussion and the second mailing list discussion.

I'm happy to remove that code altogether, but some would see it as a break in backwards-compatibility since in 1.0 dojo.require(dijit/layout/AccordionContainer); defined AccordionPane.

Another possibility is to add a has flag somewhere:

has.add("dijit-legacy-requires", !kernel.isAsync);

and then reference that in other modules, example from above:

	// Back compat w/1.6, remove for 2.0
	if(has("dijit-legacy-requires")){
		ready(0, function(){
			var requires = ["dijit/layout/AccordionPane"];
			require(requires);	// use indirection so modules not rolled into a build
		});
	}

That would allow you to strip all this code from your non-AMD build using staticHasFeatures in your build profile. What do you think?

comment:2 in reply to:  1 Changed 8 years ago by Rawld Gill

Replying to bill:

Another possibility is to add a has flag somewhere:

has.add("dijit-legacy-requires", !kernel.isAsync);

and then reference that in other modules, example from above:

	// Back compat w/1.6, remove for 2.0
	if(has("dijit-legacy-requires")){
          //etc.
	}

That would allow you to strip all this code from your non-AMD build using staticHasFeatures in your build profile. What do you think?

I think this is the best approach. Do you want to take the ticket?

comment:3 Changed 8 years ago by bill

Component: BuildSystemDijit
Milestone: tbd1.8
Owner: changed from Rawld Gill to bill
Status: newassigned

Sure.

comment:4 Changed 7 years ago by bill

Note that besides dijit this technique is used for dojo/dnd, although the files loaded there are very small.

comment:5 Changed 7 years ago by Karl Tiedt

Yes but only dijit loads deprecated files, I think most of dnd are files that would get used with dnd applications

comment:6 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28021]:

Introduce "dijit-legacy-requires" has() flag so that legacy builds can also suppress loading of modules the app didn't explicitly request. Fixes #14819 !strict.

comment:7 Changed 7 years ago by Rawld Gill

In [28049]:

improved processing v1.6- built, flattened bundles; refs #14819; !strict

comment:8 Changed 7 years ago by Rawld Gill

[28049] should have ref'd #14092

comment:9 Changed 7 years ago by bill

In [28116]:

fix typo from [28021], refs #14819 !strict

Note: See TracTickets for help on using tickets.