Opened 10 years ago
Closed 5 years ago
#13338 closed enhancement (patchwelcome)
Usage of require in dojox/app prevents build tools from fully optimizing code
Reported by: | ddumont | Owned by: | Dustin Machi |
---|---|---|---|
Priority: | high | Milestone: | 1.11 |
Component: | DojoX App | Version: | 1.7.0b1 |
Keywords: | Cc: | zhangyp | |
Blocked By: | Blocking: |
Description
./dojox/app/main.js:51 ./dojox/app/scene.js:98
If there is a way to perhaps require the components to provide a lazyload function to load the deps where they can be declared as string literals instead of by reference it would help the process.
Perhaps something like
config.loadDeps = function(cb) { require(['application', 'specific', 'deps'], function() { cb(); }); };
And in main you would do:
config.loadDeps(function() { var modules=[Application]; for(var i=0;i<config.modules.length;i++){ modules.push(arguments[i]); } ... etc });
Change History (4)
comment:1 Changed 10 years ago by
Cc: | zhangyp added |
---|---|
Component: | Dojox → DojoX Mobile |
Owner: | changed from Adam Peller to Dustin Machi |
comment:2 Changed 10 years ago by
Status: | new → assigned |
---|
comment:3 Changed 9 years ago by
Component: | DojoX Mobile → DojoX App |
---|
comment:4 Changed 5 years ago by
Milestone: | tbd → 1.11 |
---|---|
Resolution: | → patchwelcome |
Status: | assigned → closed |
dojox/app is mostly abandoned. Would accept a pull request if someone wants to work on this.
Note: See
TracTickets for help on using
tickets.
As dojox/app gets a little bit further along, I'll be releasing some wrapping scripts that can make a build with layers based on the config itself, which will address this concern. For now however, it falls back to reading that info from the config.