Announcing: Work has started on CodeMirror 6

Are you accepting questions about your CM6 repo?

I didn’t find instructions for building and running the tests in there so I did a little poking around. Also I didn’t know much about TypeScript or rollup before seeing your repo using them.

I found the following seems to build view/test/test_built.js but there are many options to rollup so maybe I’m missing something important.

rollup -c rollup.view-tests.config.js --format iife

Changing directory to view/test and loading some npm modules at that level then let me start a simple file server from that directory and low and beyond, a beautiful test result page appeared in a new Chrome window on my mac showing 112 or 113 tests passed.

This was your only announcement for CM6 and the git log shows you are very busy working this new version so perhaps you don’t need or want anyone running tests with browsers on a mac yet (am on OSX 10.13.6). I would open new discussions if you are interested in the Chrome investigation and then possible Safari investigations on the same OS. I hesitated even bringing this up but when all but one unit test is passing, it made me think you like to keep your unit tests passing on at least some subset of platforms while you are developing.

Hi Frank. The way I build the in-browser tests is with npm run watch-view-tests, which runs the command listed in package.json for continually rebuilding the test bundle when the source changes. You can then simply use a file:// url to go to view/test/index.html to run the tests. I do indeed usually keep them passing on Chrome and Firefox for Linux, but don’t routinely test on macOS. Opening an issue or investigating further is definitely welcome!

It would be handy if you had a :root CSS class and handled basic styling such as backgrounds and borders with var()

We’ll continue to support some browsers (IE11) without CSS variables, so we won’t use those.

What about

.SomeClass {
    background-color: brown;
    background-color: var(--my-brown-color);

It would just ignore the var, wouldn’t it?

([sigh] the good things we can’t have because … IE!)

Can your on() functions return a handle consisting of the function arguments to make it easier to use off()?

// create listener	
    var myEnterListener = CodeMirror.on(this.container, "keydown", function(e) {
		if("KeyDown") && e.keyCode == 13 ) {
			tools["data-action")].call(tools, e);
			return false;

// remove listener, myEnterListener);

And maybe write off() so it accepts an array as a single arg so you don’t have to use apply()?

Hello here! I use CodeMirror in our Projects like a CodePlay, Codium and another. Now CodeMirror is very slow. Performance - 0%. I listened about version 6. I hope - you create it! (Yes I’m not English)

Hi guys! Codemirror has been a lifesaver for us and we would not be able to achive any kind of success anytime soon without it - we are releasing mobile coding app.
We plan to experiment with version 6 when it’s good enough to use without plugins - we don’t need them - what we need is to deal with the Do you know when could first stable plugin-less version be ready?

Hi Adam, I’m trying not to make any concrete promises about release dates yet since those tend to only cause disappointment—the plan is to have some kind of usable release (not necessarily an API-stable one) in 2019, but that’s all I can say at this point. And, of course, a new codebase will have new issues, so you’ll have to be cautious in how quickly you adopt it.

I think its a mistake not to use css vars , ie11 is < 3% , if a consumer of cm wants to support that , they can just continue to use v5

The demo looks great ! I played around it a bit and found that when pressing tab key, it does not indent but focuses out of the editing. As I read that this version is very mobile focused, is this something you are going to take care of ?

This is probably going to be the default behavior—it’s really awkward for non mouse users (such as blind people) to escape a control that captures tab, so it’s an accessibility issue. You can, of course, define your own key bindings, and maybe we’ll find a reasonable way to finesse it and have both our tab key and an easily discoverable way to escape the editor, but I haven’t found a good approach for that yet.

For inspiration, Jupyter does auto-indent only at the beginning of the line, auto-complete if inside the line. So auto-complete or focus change depending on the position inside the line might be worth a try.

I’m very excited about CodeMirror 6 after using ProseMirror. My current editor choice is monaco for both code and markdown, but I’m replacing the markdown editor with ProseMirror, and I really want to replace the code editor with CodeMirror. I wonder if now is a good time to do that? Is it stable?

No, still not stable, or even documented, at all. I recommend waiting.

One feature I like is being able to highlight text - however I hate how you have to use Ctrl commands or inserting @h@ to highlight rows. I would like to mark lines like you do in Visual studio where you click on the numbered row and it highlights on the fly

There’s now documentation, and an npm package. There’s still features missing and bugs, and things will no doubt continue to change in breaking ways, but going forward those will be documented in the change log.

@marijn, will CM6 support running highlighter/tokenizer in a web worker out of the box? These are expensive operations so instead of debouncing via setTimeout it’d be awesome to run them in parallel instead.

No — communicating with web workers is still awkward and/or wasteful (either need to put data in a flat array or copy everything), I didn’t find a practical way to do that.

communicating with web workers is still awkward and/or wasteful (either need to put data in a flat array or copy everything),

You mean ideologically, I guess, right? Because performance-wise copying+transferring should be totally negligible compared to the actual parsing/highlighting both duration-wise and CPU-wise. That’s when there’s a lot of text, of course, so it might make sense to auto-switch to the worker mode when last several highlighting jobs ran longer than some threshold.