Opened 7 years ago

Last modified 3 years ago

#16585 new task

[meta] don't use deprecated methods, features

Reported by: bill Owned by:
Priority: undecided Milestone: 1.15
Component: General Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

General ticket for refactors to avoid using deprecated methods like dojo.connect() in source code.

Excludes changes that would break backwards compatibility, and fixes to modules that are themselves deprecated.

Change History (72)

comment:1 Changed 7 years ago by bill

Description: modified (diff)

comment:2 Changed 7 years ago by bill

In [30378]:

stop using dojo/_base/connect, refs #16585 !strict

comment:3 Changed 7 years ago by bill

In [30379]:

oops, remove "debugger" statement, refs #16585

comment:4 Changed 7 years ago by bill

In [30380]:

Stop using dojo/_base/event.stop(), refs #16585 !strict. It would be nicer though if dojo/on had a similar convenience method.

comment:5 Changed 7 years ago by bill

In [30385]:

use dojo/sniff not dojo/_base/sniff, refs #16585 !strict.

comment:6 Changed 7 years ago by bill

In [30386]:

Stop using dojo/_base/json, refs #16585 !strict. Turns out I can't use dojo/json::parse() because the parser can take non-JSON for things like data-dojo-props.

comment:7 Changed 7 years ago by bill

In [30388]:

Use dojo/json instead of deprecated dojo/_base/json, refs #16585 !strict. Passes dojo/tests/_base unit tests on FF18/mac.

comment:8 Changed 7 years ago by bill

In [30393]:

remove unnecessary uses of dojo/ready, refs #16585 !strict.

comment:9 Changed 7 years ago by bill

In [30394]:

Use doh.run() rather than doh.runOnLoad(), since the latter depends on the deprecated dojo/ready module. Refs #16585 !strict. Not updating some tests for deprecated modules.

comment:10 Changed 7 years ago by bill

In [30395]:

Use dojo/domReady rather than dojo/ready, refs #16585 !strict.

comment:11 Changed 7 years ago by bill

In [30401]:

Use data-dojo-config instead of djConfig (as attribute passed to <script src=dojo.js>), and data-dojo-id instead of jsId. Demos, dijit, dojo, and util. Refs #16585.

comment:12 Changed 7 years ago by bill

In [30402]:

Use data-dojo-config instead of djConfig (as attribute passed to <script src=dojo.js>), and data-dojo-id instead of jsId. DojoX. Refs #16585.

comment:13 Changed 7 years ago by bill

In [30403]:

event="..." --> data-dojo-event="...", args="..." --> data-dojo-args="...", refs #16585

comment:14 Changed 7 years ago by bill

In [30408]:

Stop using deprecated API's in themeTester, including:

  • dijit/dijit and dijit/dijitAll rollup files
  • ItemFileReadStore and dijit/tree/ForestStoreModel
  • dojo and dijit globals
  • dojo/ready

Refs #16585

comment:15 Changed 7 years ago by bill

In [30410]:

Remove dependency on dojo/data/util/filter, since dojo.data is deprecated. I had to duplicate the patternToRegExp() function but when written concisely it's only a few lines (excluding comments). Refs #16585 !strict.

comment:16 Changed 7 years ago by bill

In [30420]:

use dojo/query not dojo/_base/query, refs #16585

comment:17 Changed 7 years ago by bill

In [30421]:

When possible without breaking backwards compatibility, use dojo/Deferred instead of dojo/_base/Deferred. I could actually change the other dojo/_base/Deferred usages too if I used a shim like dijit/Tree does, but it didn't seem worth it. Refs #16585 !strict

comment:18 Changed 7 years ago by bill

In [30448]:

remove usages of deprecated LinkPane from tests, refs #16585

comment:19 Changed 7 years ago by bill

In [30461]:

Monitor touchend in addition to mouseup, for mobile. Also, use this.own() with dojo/on instead of deprecated this.connect() . Refs #16622, #16585 !strict.

comment:20 Changed 7 years ago by bill

In [30463]:

For _TextBoxMixin too, monitor touchend in addition to mouseup. Also, use this.own() with dojo/on instead of deprecated this.connect() . Refs #16622, #16585 !strict.

comment:21 Changed 7 years ago by bill

In [30465]:

For _TemplatedMixin, use this.own() with dojo/on instead of deprecated this.connect() (which uses the deprecated dojo.connect()). Perhaps in the future we should setup a more standard way to map from strings to synthetic events, for example data-dojo-attach-event="dojo/mouse.enter: _onMouseEnter" instead of data-dojo-attach-event="mouseenter: _onMouseEnter". Refs #16585 !strict.

comment:22 Changed 7 years ago by bill

In [30466]:

For Editor, use this.own() with dojo/on instead of deprecated this.connect() (which uses the deprecated dojo.connect()). But still using dojo/_base/connect._keypress synthetic event. That will be removed in a later checkin. Refs #16585 !strict.

comment:23 Changed 7 years ago by bill

In [30467]:

For non-deprecated dijit widgets, use this.own() with dojo/on or dojo/aspect, instead of deprecated this.connect() (which uses the deprecated dojo.connect()). Refs #16585 !strict.

comment:24 Changed 7 years ago by bill

In [30468]:

Intermediate checkin for StackContainer to stop using deprecated this.subscribe(). In a later checkin I'd like to get rid of using topics altogether. Also need to stop using deprecated synthetic keypress event. Refs #16585 !strict.

comment:25 Changed 7 years ago by bill

In [30470]:

Move StackContainer/StackController to use native keydown/keypress events, rather than synthetic dojo/_base/connect::_keypress event. The onkeypress data-dojo-attach-event's in the templates technically still map to dojo/_base/connect::_keypress, but the code is no longer depending on evt.charOrCode, or for keypress events to fire for non-printables. Also clearing dangling uses of deprecated this.connect(). Refs #16585 !strict.

comment:26 Changed 7 years ago by bill

In [30471]:

Remove uses of this.connect() from Editor plugins, but leave definition of _Plugin::connect() method for backwards compatibility.
Plugins (and Editor) still using synthetic dojo/_base/connect::_keypress event in a few places. Refs #16585 !strict.

comment:27 Changed 7 years ago by bill

In [30480]:

Deprecate typematic's charOrCode option, and un-deprecate keyCode and charCode, making keyCode use on(node, "keydown", ...), and charCode use on(node, "keypress", ...). Dijit only uses keyCode.

This reversal of the original plan is because dojo/_base/connect itself is deprecated, so if typematic is carried over to version 2, it cannot support charOrCode. Using on(node, "keydown", ...) solves the problem mentioned in #6667 about the left parenthesis being treated as the down arrow.

Refs #6667, #16585 !strict.

comment:16 Changed 7 years ago by bill

In [30483]:

Seems "keydown" is better than "keypress" for catching Ctrl-W (to close a tab), refs #16585 !strict.

comment:17 Changed 7 years ago by bill

In [30484]:

Update varioius widgets to use native keydown event and evt.keyCode rather than synthetic keypress event and evt.charOrCode. Didn't touch the code in _TextBoxMixin that calls this._onInput() with a homegrown synthetic event though.

Refs #16585 !strict.

comment:18 Changed 7 years ago by bill

In [30485]:

Make Editor use native keydown instead of synthetic dojo/_base/connect._keypress event, refs #16585 !strict.

comment:19 Changed 7 years ago by bill

In [30502]:

fix themeTester breakage from [30408], fixes #16642, refs #16585

comment:20 Changed 7 years ago by bill

In [30503]:

Stop using deprecated dojo/_base/event::stop(). This leaves lots of places calling both evt.stopPropagation() and evt.preventDefault(), somewhat bloating the code, but I think many of those cases can be changed to just calling either evt.stopPropagation() or evt. preventDefault().

Also doing coding style fixes.

Refs #16585 !strict.

comment:21 Changed 7 years ago by bill

In [30508]:

Rollback spurious indentation changes from [30483], refs #16585 !strict. I'd rather check them in separately instead of mixed with real changes.

comment:22 Changed 7 years ago by bill

In [30509]:

Rollback spurious indentation changes from [30503], refs #16585 !strict. I'd rather check them in separately, rather than mixed with real changes.

comment:23 Changed 7 years ago by bill

In [30510]:

Rollback spurious indentation changes from [30503], refs #16585 !strict. I'd rather check them in separately, rather than mixed with real changes.

comment:24 Changed 7 years ago by bill

In [30511]:

Rollback spurious indentation changes from [30474], refs #16585 !strict.

comment:25 Changed 7 years ago by bill

In [30512]:

For dojo/store, use dojo/when in preference to deprecated dojo/_base/Deferred::when, and also change one usage of dojo/_base/Deferred to dojo/Deferred (without breaking backwards compatibility), refs #16585 !strict.

comment:26 Changed 7 years ago by bill

In [30554]:

use aspect.after() rather than deprecated this.connect() method, refs #16585.

comment:27 Changed 7 years ago by bill

In [30672]:

remove use of deprecated dojo/_base/unload::addOnWindowUnload, refs #16585 !strict

comment:28 Changed 7 years ago by bill

In [30768]:

Fix data-dojo-attach-event on widgets (as opposed to DOMNodes), fixes #16798, refs #16585 !strict.

comment:29 Changed 7 years ago by bill

In [30769]:

Fix data-dojo-attach-event on widgets for DTL. Also stop using deprecated signature of _attachNodes() where you pass an array of widgets rather than a DOMNode. Refs #16798, #16585 !strict.

comment:30 Changed 7 years ago by bill

In [30793]:

use _WidgetBase rather than _Widget in tests, refs #16585

comment:31 Changed 7 years ago by bill

In [30800]:

remove calls to deprecated this.disconnect() method, refs #16585 !strict

comment:32 in reply to:  17 Changed 7 years ago by ben hockey

Replying to bill:

In [30484]:

Update varioius widgets to use native keydown event and evt.keyCode rather than synthetic keypress event and evt.charOrCode. Didn't touch the code in _TextBoxMixin that calls this._onInput() with a homegrown synthetic event though.

Refs #16585 !strict.

umm... what happened to the templates during this commit? they have some strange whitespace now.

comment:33 Changed 7 years ago by bill

Oh, that's annoying. My IDE did that; I accidentally clicked a weird checkbox and it updated the files during checkin. I'll revert that. Actually, I reverted most of the spurious reformatting already but didn't notice the templates.

comment:34 Changed 7 years ago by bill

In [30879]:

revert unintended spacing changes from [30484], refs #16585 !strict

comment:35 Changed 7 years ago by bill

In [30934]:

Move code to remove attach points and events to separate method, so it can be called independently of destroyRendering(), fixes #16889 !strict.

Also removing redundant call to this.own(), from [30465], refs #16585.

comment:36 Changed 7 years ago by bill

In [31168]:

after [30480] kernel dependency no longer used, refs #16585

comment:37 Changed 7 years ago by bill

In [31172]:

commenting some code for deletion in 2.0, refs #16585 !strict.

comment:38 Changed 7 years ago by bill

In [31173]:

Add tests for LayoutContainer's new API: LayoutContainer.design and children using region and layoutPriority. Note that for backwards compatibility, "design" shouldn't affect children that set layoutAlign instead of region. This is basically "accidentally" working due to the way _getOrderedChildren() happens to be written. Refs #16770 !strict.

Also convert uses of deprecated layoutAlign in calls to utils.layoutChildren() to region, refs #16585 !strict.

comment:39 Changed 7 years ago by bill

Milestone: tbd1.10

comment:40 Changed 7 years ago by bill

In [31398]:

don't depend on programmatic instantiation picking up id from DOMNode, refs #16585

comment:41 Changed 7 years ago by bill

In [31404]:

don't use domConstruct.create() to setup event listeners, refs #16585 !strict

comment:42 Changed 7 years ago by bill

In [31405]:

use data-dojo-attach-point rather than dojoAttachPoint, refs #16585

comment:43 Changed 7 years ago by bill

In [31406]:

use dojo/dnd/common.getCopyKey() rather than dojo/_base/connect.isCopyKey(), refs #16585 !strict

comment:44 Changed 7 years ago by bill

In [31407]:

Modules are supposed to list their NLS resources in the define() dependencies. RangeBoundTextBox is missing "dojo/i18n!./nls/validate". I guess it gets pulled in by a superclass but it's standard practice to list it explicitly. Plus necessary, starting in 2.0. Refs #16585 !strict.

comment:45 Changed 7 years ago by bill

In [31408]:

use data-dojo-attach-point rather than dojoAttachPoint, refs #16585

comment:46 Changed 7 years ago by bill

In [31410]:

Various themeTester cleanup:

  1. use boilerplate.js rather than _testCommon.js
  2. don't list expected globals as stray globals
  3. don't use parser's auto-load
  4. don't use deprecated dijit/layout/LinkPane

Refs #16585, #17022.

comment:47 Changed 7 years ago by bill

In [31416]:

stop using _WidgetBase.connect() and other deprecated methods in test files, refs #16585

comment:48 Changed 7 years ago by bill

In [31420]:

Fix TimeSpinner to use keydown rather than keypress, fixes #30484 and refs #16585 on 1.9 branch !strict.

comment:49 Changed 7 years ago by bill

In [31421]:

Fix TimeSpinner? to use keydown rather than keypress, fixes #30484 and refs #16585 on trunk !strict.

comment:50 Changed 7 years ago by bill

Oops, above two changes form #17101, not #30484.

comment:51 Changed 7 years ago by bill

In [31424]:

Fix TimeSpinner? to use keydown rather than keypress, fixes #30484 and refs #16585 on trunk !strict.

comment:52 Changed 7 years ago by bill

Oops, [31424] actually fixed #17033 and had nothing to do with this ticket.

comment:53 Changed 7 years ago by Bill Keese <bill@…>

In e154822ddab4c272332f9fb8ffddac56560322b3/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:54 Changed 6 years ago by Bill Keese <bill@…>

In 0bd911d395e08c929f5b252a2fec18d688fb27b6/util:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:55 Changed 6 years ago by Bill Keese <bill@…>

In 5d4d2d35032f3ff8d173320b1d2df317cea775ce/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:56 Changed 6 years ago by dylan

Milestone: 1.101.11

comment:57 Changed 6 years ago by Bill Keese <bill@…>

In 16f55ebe526ecd839f672a4affbbf3f674b24175/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:58 Changed 5 years ago by Bill Keese <bill@…>

In c535128334b5a130b78c79b87d2b236ab0490d9b/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:59 Changed 4 years ago by dylan

Milestone: 1.111.12

meta ticket, moving to 1.12.

comment:60 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.