CodeMirror
 version 6

We are rewriting CodeMirror, the open-source code editor for the browser. The new code will provide solid accessibility, touchscreen support, and a modern interface, while matching the existing code in features and performance. This work is currently, fall 2018, in the prototype stage. We've raised money for another year of work, in which we hope to complete it.

Sponsors

These wonderful companies and organizations helped fund the work on CodeMirror 6:

Diamond

Automattic Mozilla Bundesministerium für Bildung und Forschung

Gold

Wikimedia Foundation

Silver

Cargo Dataiku Overleaf

Bronze

Andrew Lee Buildkite Nuclino Pobox superhi

The Future of CodeMirror

CodeMirror, as an open source project, has been going for over ten years. Since 2011, for versions 2 to 5, its architecture and programming interface have been more or less stable. In 2011 IE6 had a significant market share, Chrome was just getting started, and jQuery was considered the gold standard of interface design. It was a different time.

While CodeMirror's architecture has held up pretty well, its age is starting to show. Issues related to touchscreen support, accessibility, and bidirectional text have been piling up in the bug tracker because, with the current architecture, they are extremely hard to address.

On top of that, the JavaScript community's approach to modularity and taste in interfaces has matured a lot in this time. With another project—ProseMirror—we've seen how well a modular system and linear data flow architecture can work for an editor. From a current perspective, CodeMirror's current programming interface feels outdated and clunky.

So we've been working on a new version of the library, with new architecture intending to address the current system's shortcomings from the ground up.

This work is currently at the prototype stage, it's going to take a while more before it can be used in production. But it's already showing great promise.

If you're curious about the details, we've written more about the new architecture in the design document. The current code is on GitHub.

That's the good news. It does come with some bad news. The programming interface for the editor is going to change radically, so when the time comes to upgrade, that might be quite a bit of work. We do have plans to write a compatibility wrapper which will allow simple setups to just drop that in, but it probably won't cover the whole old interface, and might turn out to be too slow if you're using the interface intensively. Additionally, the browser DOM structure of the editor will necessarily change, so you'll have to adjust your styles.

The Work Ahead

The main areas of work that need to be addressed for this project to become a success are:

Demo

The editor below shows off the current state of our work. It is the new editor core, with the old JavaScript highlighter wired in and some plugins enabled, such as the undo history and a line number gutter.

Note that this is a first version, not a fully finished piece of software. If you find something that's broken, we're grateful for bug reports. For other feedback, please use this forum thread