Opened 11 years ago

Closed 10 years ago

#8018 closed defect (wontfix)

Use excludeStart for dojo._base boilerplate

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 1.3
Component: Core Version: 1.2.0
Keywords: Cc:
Blocked By: Blocking:

Description

Suggestion from Alex: Use some >>excludeStart build pragmas to wrap the standard function wrapping and var d = dojo; work we do in dojo._base modules.

Make sure the buildscripts/dojoGuardStart.jsfrag and the end one do the right thing and make sure the d alias is created.

This should help remove a little bit of code from built dojo.js files.

Change History (4)

comment:1 Changed 10 years ago by James Burke

Some of this work was done as part of the webkitMobile changes Alex has done. Should review the code, and possibly name webkitMobile to webkitOnly, and document it.

comment:2 Changed 10 years ago by david

Just noticed the following in _base/html.js, line 88:

//>>excludeStart("webkitMobile", kwArgs.webkitMobile);
(function(){
	var d = dojo;
//>>excludeEnd("webkitMobile");

Doesn't that mess things up since many of the functions are expecting d to reference dojo? For example, on line 125:

node = d.byId(node);

comment:3 in reply to:  2 Changed 10 years ago by bill

Replying to david:

Just noticed the following in _base/html.js, line 88 ...

Doesn't that mess things up since many of the functions are expecting d to reference dojo?

As per [16407] that's apparently OK because the build system generates a closure defining d as dojo.

Of course,the change has nothing to do with webkit.

comment:4 Changed 10 years ago by James Burke

Resolution: wontfix
Status: newclosed

Just did a test with this, manually removing the function wrappers and with [16637], the file savings is minimal.

With function wrappers, 80,621 KB minified, 27,265 gzipped.

Without function wrappers: 80,455 KB minified, 27,227 gzipped.

So not worth it since it may introduce bugs with all of those previously private spaces now sharing the same var space, and the additional >> build pragma pollution.

Note: See TracTickets for help on using tickets.