This is Epic task for the CodeMirror 6 upgrade. This is a complete rewrite of the library that fixes many of the fundamental issues with CodeMirror 5. Specifically, accessibility issues, mobile compatibility, and RTL support should largely be addressed.
Checklist
These tasks are considered vital to retiring CodeMirror 5.
- Add new lib files and necessary packages and set them up in the ResourceLoader config (T317243)
- Make sure jQuery.textSelection still integrates cleanly (tackled as part of T317243)
- Port the MediaWiki "mode" to a CodeMirror 6 stream-parser (T348019)
- Verify performance is as good if not better than the old version and optimize accordingly (it's noticeably faster, even before we added new features)
- Ensure RTL support is up to snuff (T170001)
- Add bidi isolation to HTML tags in RTL languages (T358804)
- Update integration with 2017 wikitext editor (T357482)
- Update any CodeMirror integration that exists in other deployed MediaWiki extensions and skins (T357794)
- Come up with general solution for gadget/user script integrations (T214989)
- Come up with a way to toggle on/off CodeMirror when there is no toolbar (T190108)
- Come up with a more fitting icon (T174145)
- CodeMirror preferences panel (T359498)
- Autocompletion (T95100)
- Template folding (T30684)
- Revive instrumentation (T373710)
- Deprecate use of CodeMirror 5 (T373720)
Deployment task: T357795
Beta feature task: T376735
Post-migration
Nice-to-haves, but not necessary for rolling out CodeMirror 6 on the WMF cluster, or retiring CodeMirror 5.
- Librarization of the MediaWiki stream parser
Explore introducing new features
- Themes (T163533)
Add support for more content models
Consider replacing other syntax highlighting systems
We should consider replacing other syntax highlighting systems (i.e. Ace) with CodeMirror to reduce maintenance burden and keep code DRY. (Tasks to be created once CodeMirror 6 has proven itself.)
- CodeEditor could theoretically be completely replaced by CodeMirror.
- AbuseFilter has a mode for the Ace syntax highlighter.
- VisualEditor has a widget for the Ace syntax highlighter.
- WikiLambda has a Vue component for the Ace syntax highlighter.
- SyntaxHighlight could possibly tie into CodeMirror so that we get the correct syntax highlighting within the <syntaxhighlight> tag while editing (when the language is supported).