Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13603 closed task (fixed)

dijit/registry, dijit/a11y, dijit/WidgetSet

Reported by: bill Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

Split off dijit registry, a11y related functions into separate AMD-friendly files:

  • dijit/registry
  • dijit/WidgetSet (deprecated class)
  • dijit/a11y (tabindex related functions)

dijit/_base/manager.js remains for backwards compatibility.

Change History (14)

comment:1 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed
Summary: dijit/registrydijit/registry, dijit/a11y, dijit/WidgetSet

(In [26050] Splits out tabindex related functions from dijit/_base/manager.js to separate dijit/a11y.js).

(In [26052]) Refactor dijit/_base/manager.js, putting common registry related methods into dijit/registry.js, and WidgetSet stuff in WidgetSet.js. WidgetSet is essentially deprecated, and dijit/_base/manager in general is unneeded; most widgets can just require dijit/registry to get the functions they need (byId(), byNode(), etc.) WidgetSet.js is still automatically loaded in legacy mode, when async:false, just in case some old app was depending on features like dijit.registry.forEach().

(In [26061]) dojo.registry.filter(...) ->dojo.forEach(dojo.registry.toArray(),...)

(In [26071]) Make dijit.byId() etc. available in legacy (non AMD) mode even when dojo/_base/manager not explicitly loaded.

comment:2 Changed 8 years ago by bill

In [26079]:

update dojox.calc to use dijit/registry, and _TextBoxMixin, refs #13603 !strict

comment:3 Changed 8 years ago by bill

In [26082]:

byte trimming, refs #13603 !strict

comment:4 in reply to:  1 Changed 8 years ago by ben hockey

Resolution: fixed
Status: closedreopened

Replying to bill:

(In [26071]) Make dijit.byId() etc. available in legacy (non AMD) mode even when dojo/_base/manager not explicitly loaded.

i'm having problems with this commit and since i don't fully understand all that its doing (or why its doing it the way it does) i'm not sure how to try and fix it.

the problem: the globals (dojo, dijit, dojox) can be remapped and the "naked" reference to the dojo global fails.

so, a better test might be if (typeof dojo !== "undefined" && dojo.ready && !dojo.isAsync) { ... }.

however, i'm not sure why you aren't just pulling in dojo/_base/kernel and using it to check for !dojo.isAsync in this case. that would also handle the case when the globals are remapped whereas the typeof check wouldn't work as intended if the globals are remapped. of course, you'd also need to add dojo/ready as a dependency to use it.

what am i missing that means this wouldn't work?

comment:5 Changed 8 years ago by bill

I could have pulled in dojo/_base/kernel, but I was just trying to minimize the amount of code, and I guess also I was trying to remove dojo/_base/kernel from the dependency lists of dijit modules, since dojo/_base/kernel in the dependency list usually indicates that a file wasn't fully converted to granular dependencies.

I didn't consider the remapping issue though. And I didn't consider that the condition:

if(dojo && ....)

will fail when dojo isn't defined because has("extend-dojo") is false.

So, feel free to update those modules (dijit, fx.js, dojo/dnd/Source.js, etc) to pull in and use dojo/_base/kernel (note that the dijit dependencies are in alphabetical order, and it always maps dojo/_base/kernel to the variable "kernel"), or alternately to change the if() condition as you listed above.

comment:6 Changed 8 years ago by bill

Rawld took the second approach for _WidgetBase.js in [26745], but the other files are still broken.

comment:7 Changed 8 years ago by ben hockey

Resolution: fixed
Status: reopenedclosed

i'm going to track this in #14033 - marked with high priority so it makes the 1.7 hot list.

comment:8 Changed 8 years ago by ben hockey

btw - my preference will be pulling in dojo/_base/kernel rather than what was done in r26745.

comment:9 Changed 8 years ago by bill

In [26781]:

Include WidgetSet from dijit/_base.js layer module, since it used to be part of base. Refs #13603, #14043 !strict.

comment:10 Changed 8 years ago by bill

In [26798]:

add deprecation comment, refs #13603

comment:11 Changed 8 years ago by bill

In [27065]:

Add tests for new dijit/registry module. Will keep dijit/tests/_base/manager.html around until 2.0, for testing the old API. Refs #13603.

comment:12 Changed 8 years ago by bill

In [27068]:

Move a11y test to top level since dijit/a11y is now top level, refs #13603.

comment:13 Changed 8 years ago by bill

In [27069]:

Missing dojo/domReady! dependency led to intermittent test failures, refs #13603.

comment:14 Changed 8 years ago by bill

In [27310]:

[27068] commented out some code by mistake, putting in back, refs #13603.

Note: See TracTickets for help on using tickets.