Page MenuHomePhabricator

Make ext.CodeMirror classes VE-agnostic
Open, In Progress, Needs TriagePublic

Description

Background

See r1319919 for context. A VE-specific allowlist of extensions is currently hard-coded into CodeMirrorExtensionRegistry, and similarly there are VE checks in CodeMirror and CodeMirrorPreferences, integrations should be able to say what they want up front. ext.CodeMirror shouldn't know about any specific integration – plain and simple.

The CodeMirror constructor actually accepts a content editable, but only textareas are documented, with VE's content editable as silently supported. We should be supporting content editables anyway, as the upstream lib doesn't care regardless. Textareas are useful in forms, but there are other applications where a content editable may be preferred.

Acceptance criteria

  • Make ext.CodeMirror agnostic to integrations
  • Accept content editable in addition to textareas

Stretch goals

  • Make CodeMirrorVisualEditorHighlight extend CodeMirror, doing only what is minimal and removing CM cruft, along with reliance on the EditorView.

Related Objects

StatusSubtypeAssignedTask
OpenGoalNone
In ProgressMusikAnimal

Event Timeline

MusikAnimal changed the task status from Open to In Progress.

Change #1322162 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirror: support contenteditable elements, decouple VisualEditor

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

Change #1323083 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirror: rename the textarea property to editable

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

Change #1323083 abandoned by MusikAnimal:

[mediawiki/extensions/CodeMirror@master] CodeMirror: rename the textarea property to editable

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

Change #1324493 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirror: move the VisualEditor classes to visualEditor/

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

Change #1325843 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirror: take an Editor rather than an EditorView

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

Change #1325851 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirrorVisualEditorHighlight: extend CodeMirrorVisualEditor

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

Change #1325863 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirrorPreferences: apply preferences as well as persist them

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

Change #1324493 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] Move the VisualEditor classes to visualEditor/

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

Change #1322162 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirror: accept a ve.ui.Surface and decouple VisualEditor

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

Change #1325970 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirrorVisualEditorHighlight: defer to the parent lifecycle

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

Change #1325976 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/CodeMirror@master] VisualEditor: Hide the surface text again under the overlay

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

Change #1325843 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirror: take an Editor rather than an EditorView

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

Change #1325976 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] VisualEditor: Put the overlay beside the surface text, not inside it

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

Change #1325851 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirrorVisualEditorHighlight: extend CodeMirrorVisualEditor

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