Page MenuHomePhabricator

Avoid jQuery & CE code in ve.dm.
Closed, ResolvedPublic

Description

In theory it should be possible to run the VE data model on a server with a virtual DOM, but no jQuery.

Event Timeline

Change 434053 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] $.isEmptyObject -> ve.isEmptyObject

https://gerrit.wikimedia.org/r/434053

Change 434056 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Don't use $.isNumeric in DM

https://gerrit.wikimedia.org/r/434056

Change 434057 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Avoid more jQuery in DM

https://gerrit.wikimedia.org/r/434057

Change 434053 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] $.isEmptyObject -> ve.isEmptyObject

https://gerrit.wikimedia.org/r/434053

Change 434056 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Don't use $.isNumeric in DM

https://gerrit.wikimedia.org/r/434056

Change 434057 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Avoid more jQuery in DM

https://gerrit.wikimedia.org/r/434057

Remaining uses are $.Deferred, $.parseHTML, $.getJSON, $.when, and $.noop.

I've deleted APIResults* in https://gerrit.wikimedia.org/r/#/c/434659/ (they were downstreamed to MW a while ago).

That leaves:

  • $.parseHTML in the DOMPurify code in ve.dm.Change. As that code only exists to protect clients, we could safely skip it on a server instance.
  • Deferred/promise code in surface fragments. We'll need to make sure our promise usage is compatible with other promise libraries so we can abstract this to ve.Deferred / ve.when etc.

I also recently put in some hacks to call out to the CE node in #toDomElements, these may need to be refactored.

Deskana triaged this task as Medium priority.May 23 2018, 11:29 AM

Change 434661 had a related patch set uploaded (by Jforrester; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (d214a66aa)

https://gerrit.wikimedia.org/r/434661

Change 434661 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (d214a66aa)

https://gerrit.wikimedia.org/r/434661

Vvjjkkii renamed this task from Avoid jQuery in ve.dm. to kncaaaaaaa.Jul 1 2018, 1:09 AM
Vvjjkkii removed Esanders as the assignee of this task.
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.

As of T178780 we have a reference to ve.ce.TextNode in ve.dm.Converter. This could probably be moved into a utility namespace

Esanders renamed this task from Avoid jQuery in ve.dm. to Avoid jQuery & CE code in ve.dm..Aug 21 2018, 2:01 PM
Esanders removed Esanders as the assignee of this task.

Change 462164 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Move whitespaceHtmlCharacters to ve.utils.js

https://gerrit.wikimedia.org/r/462164

Change 462164 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Move whitespaceHtmlCharacters to ve.utils.js and rename

https://gerrit.wikimedia.org/r/462164

Change 462321 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (7c9ceb939)

https://gerrit.wikimedia.org/r/462321

Change 462321 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (7c9ceb939)

https://gerrit.wikimedia.org/r/462321

Change 463235 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Avoid jQuery in ve.dm.Model.static.describeChange(s)

https://gerrit.wikimedia.org/r/463235

Change 463235 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Avoid jQuery in ve.dm.Model.static.describeChange(s)

https://gerrit.wikimedia.org/r/463235

Change 463299 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[VisualEditor/VisualEditor@master] eslint: Disable jquery environment expectation in DM code

https://gerrit.wikimedia.org/r/463299

Change 463355 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (5742a48a3)

https://gerrit.wikimedia.org/r/463355

Change 463355 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (5742a48a3)

https://gerrit.wikimedia.org/r/463355

Change 463299 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] eslint: Disable jQuery/browser environment expectation in DM code

https://gerrit.wikimedia.org/r/463299

Change 471985 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Abstract construction of Deferred objects and $.when

https://gerrit.wikimedia.org/r/471985

Change 463299 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] eslint: Disable jQuery/browser environment expectation in DM code

https://gerrit.wikimedia.org/r/463299

Change 471985 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Abstract construction of Deferred objects and $.when

https://gerrit.wikimedia.org/r/471985

Change 472417 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (0d1902e04)

https://gerrit.wikimedia.org/r/472417

Change 472417 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (0d1902e04)

https://gerrit.wikimedia.org/r/472417

@Esanders: All related patches in Gerrit have been merged. Can this task be resolved (via Add Action...Change Status in the dropdown menu), or is there more to do in this task? Asking as you are set as task assignee. Thanks in advance!

Yeah, this is now programmatically enforced.