Opened 12 years ago
Closed 12 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 12 years ago by
comment:2 follow-up: 3 Changed 12 years ago by
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 Changed 12 years ago by
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 referencedojo
?
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 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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.
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.