Page MenuHomePhabricator

Bundle Extension:CodeMirror with MediaWiki core
Closed, ResolvedPublicFeature

Description

Mentioned at https://www.mediawiki.org/wiki/Suggestions_for_extensions_to_be_integrated#CodeMirror

I think CodeMirror is an obvious candidate for bundling - it's a widely-used extension (including on most Wikimedia sites), and it works nicely with both VisualEditor and WikiEditor. The relatively new "Used by" template lets us see the popularity of extensions among different wiki farms and distributions, and as you can see, CodeMirror is used by 5 of the current 7 selections, - indicating that many people consider it an essential part of the MediaWiki experience. Yaron Koren (talk) 15:12, 21 July 2022 (UTC)

Support integration to core Krabina (talk) 09:20, 13 January 2023 (UTC)
Update - now it's 7 out of 14 for "Used by", which I think is still an impressively high number. Yaron Koren (talk) 13:34, 13 March 2023 (UTC)
Support bundling or core. --鈴音雨 (talk) 13:14, 2 May 2024 (UTC)
Support. Essential. Indispensible especially for writing templates using combinations of tags, parser functions, magic words and what not (for instance, it gives you a better clue about the position of your opening and closing braces, which can be incredibly hard to tell apart if everything has the same dark colour). Cavila 07:04, 9 August 2024 (UTC)
Support * Pppery * it has begun 15:54, 17 August 2024 (UTC)

https://www.mediawiki.org/wiki/Extension:CodeMirror

The CodeMirror extension provides syntax highlighting in MediaWiki wikitext editors using the CodeMirror library. For usage and a list of features, see Help:Extension:CodeMirror.

Checklist:

  • Passed discussion or already Wikimedia deployed
  • Passed security review or already Wikimedia deployed
  • Voting CI structure tests
  • Runs MediaWiki-CodeSniffer
  • Runs phan
  • Supports MySQL, SQLite, and Postgres (if there are schema changes)
  • GPL v2 or later compatible license
  • Extension's default configuration provides optimal experience
  • Tested with web installer
  • Any relevant dependencies also bundled

(subtask of T333405)

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Add CodeMirror to the MediaWiki tarball for 1.47repos/releng/release!273jforresterT391926main
Customize query in GitLab

Event Timeline

We should wait until T373711: Add support for Scribunto, JavaScript, CSS, JSON and Vue to CodeMirror 6 is resolved. There is no reason to bundle both CodeEditor and CodeMirror.

Peachey88 subscribed.

(subtask of T333405)

Please actually set Subtask status, instead of just describing it in the text.

• taavi raised the priority of this task from Medium to Needs Triage.Apr 15 2025, 8:28 AM
• taavi subscribed.

Please do not set priorities unless you actually plan to work on something.

We should wait until T373711: Add support for Scribunto, JavaScript, CSS, JSON and Vue to CodeMirror 6 is resolved. There is no reason to bundle both CodeEditor and CodeMirror.

CodeEditor is not used for wikitext. CodeMirror is. The vast majority of installs probably would want CodeMirror and not CodeEditor. But the price of inclusion seems fairly low, so I'm not really sure why you'd advocate for one and not the other.

MusikAnimal subscribed.

Thanks for filing this task! I was going to create one as well, eventually. We are still in "beta" for CodeMirror 6. I'd say it makes more sense to wait until that is finished before bundling. We are on track to have everything done by MW 1.45 (December).

T373711: Add support for Scribunto, JavaScript, CSS, JSON and Vue to CodeMirror 6 should be completed in a month or so. Then any discussion about replacing CodeEditor will follow, and that discussion will probably dictate whether or not the bundle should include CodeEditor or not.

Agree that this should be bundled, but wait till v6 is out of beta.

Agree that this should be bundled, but wait till v6 is out of beta.

CM6 is now out of beta and has completely replaced CM5. Time to move forward with this? I see there's only one item left on the checklist in the task description.

Also, we should consider removing CodeEditor from the bundle, although IIRC there are still one or two things CodeEditor handles that CodeMirror doesn't, so maybe wait till CodeMirror supports those cases; regardless, it should probably be a separate task.

My goal is to get all remaining CodeEditor integrations replaced by CodeMirror before MW 1.47, but that is not a promise. Whether or not we meet that goal, I think it's sensible to include CodeMirorr in the bundle.

CodeMirror should install just fine with the web installer, given it has no additional installation steps. What is odd though is that no one gets syntax highlighting at all unless it is manually turned on individually by each user – that, and all the integrations (JsonConfig, TemplateStyles, etc) still force users into CodeEditor unless a sysadmin configures it otherwise.

T400014 won't be resolved come the branch cut for MW 1.47, but I'm still hoping to get CodeMirror bundled. If MW ships with both CodeMirror and CodeEditor, then we aught to have the config settings favouring CodeMirror, methinks. This will offer a nicer out-of-the-box experience for the LTS release.

Change #1354065 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] RELEASE-NOTES-1.47: Mention that CodeMirror is now bundled

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

Change #1354065 merged by jenkins-bot:

[mediawiki/core@master] RELEASE-NOTES-1.47: Mention that CodeMirror is now bundled

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