Opened 11 years ago
Closed 11 years ago
#12432 closed enhancement (fixed)
Granular dependency lists
Reported by: | Kris Zyp | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | General | Version: | 1.6.0 |
Keywords: | Cc: | ben hockey | |
Blocked By: | Blocking: |
Description (last modified by )
When possible Dojo code should be upgraded to use precise dependency references rather than namespace properties and reliance on assuming base being loaded. Modules that precisely indicate there dependencies can be used in builds where only needed code is built and the entirety of base does not need to be used. This is important for very lightweight mobile applications. Using dependency references also reduces property lookups at runtime, as target functions can be directly as local variables. For example, old code might look like:
define(["dojo"], function(dojo){ dojo.connect(...); });
Upgraded code:
define(["dojo/_base/connect"], function(connect){ connect(...); });
The connect call is faster because there is no property lookup, and a build can be created that only loads dojo/_base/connect and not the entire base.
Change History (35)
comment:1 Changed 11 years ago by
Cc: | ben hockey added |
---|
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
comment:4 Changed 11 years ago by
Type: | enhancement → defect |
---|
comment:5 Changed 11 years ago by
Component: | General → DojoX Mobile |
---|
comment:6 Changed 11 years ago by
Keywords: | 1.7-mobile added |
---|
comment:7 Changed 11 years ago by
Keywords: | 1.7-mobile removed |
---|
comment:9 Changed 11 years ago by
Type: | defect → enhancement |
---|
comment:11 Changed 11 years ago by
comment:12 Changed 11 years ago by
Priority: | normal → high |
---|
comment:14 Changed 11 years ago by
comment:15 Changed 11 years ago by
comment:16 Changed 11 years ago by
(In [25087]) Convert parser to granular dependencies (although it ends up pulling in most of dojo/_base anyway).
Previously the parser was using dojo.query() in certain cases but not pulling it in, so that apps could pick to include/exclude it. That's no longer possible, but as an alternate they can just set the default query engine to be a stub file (see dojo/query.js).
Refs #12432 !strict.
comment:17 Changed 11 years ago by
comment:18 Changed 11 years ago by
comment:19 Changed 11 years ago by
comment:20 Changed 11 years ago by
comment:22 Changed 11 years ago by
comment:23 Changed 11 years ago by
comment:24 Changed 11 years ago by
comment:25 Changed 11 years ago by
comment:26 Changed 11 years ago by
(In [25613]) Remove dojo/query dependency from manager.js, and move deprecated getDependents() from _WidgetBase to _Widget so that _WidgetBase doesn't have dependency on dojo.query() either. Also, the explicit NodeList dependency in each of those files was unnecessary since NodeList wasn't being used directly.
Refs #12432 !strict
comment:27 Changed 11 years ago by
comment:28 Changed 11 years ago by
comment:29 Changed 11 years ago by
comment:30 Changed 11 years ago by
comment:31 Changed 11 years ago by
Description: | modified (diff) |
---|
comment:32 Changed 11 years ago by
comment:33 Changed 11 years ago by
(In [25787]) Make AdapterRegistry?'s dependency list more granular. refs #12432 !strict
comment:35 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [24472]) Removed query and query-sizzle as part of query delegation refactor, refs #12432