The new editor in Obsidian was made possible by CodeMirror 6, and it has been powering both the Live Preview mode (like Typora) and the source mode in Obsidian ever since.
It can be a bit overwhelming to get into first, but as we experimented more with it, we found it to be extremely extensible and powerful. It's also highly performant for large documents. Another major reason we chose CM 6 is that it's also one of the only code editors that work decently on mobile.
While developing the new editor, Marijn was also amazingly responsive in investigating and fixing all the big and little things we ran into, even relatively niche issues like IME input bugs.
Huh Pixi JS. I used to be a contributor many moons back. It's a great little library. Would love to read about challenges with d3 force and your wasm approach if obsidian has a tech blog.
CodeMirror 6 is an awesome piece of software and very flexible — I was even able to build a notebook UI with it — https://bqnpad.mechanize.systems/notebook — this is a notebook (WIP) for BQN[1].
The nice thing is that the whole notebook is a single CodeMirror editor with cells stored as ranges in CodeMirror state. This way intercell actions like selection/copy/paste are possible and still you can control execution per cell.
I'm not sure the over-exaggerations are necessary (one of the most important? Everyone's editors?), CodeMirror is plenty good to just stand on its own merits without over-hyping it.
It's exhausting to tailor language to the comments section. I once wrote a post called "the best programming font" and all the comments were about how it was not provably scientifically the best and it was just "my opinion." We're not writing math proofs here, let people express thoughts.
Sure, I'm not saying it doesn't power a lot of editors. But it doesn't even come close to powering the editors most people use daily, so your over-exaggeration just makes the praise feel less like adding value to conversation and like over-hyping something for no reason.
As some sort of reference, the most common (loved) editors are: neovim, vscode, rider, vim, emacs, intellij, ipython/jupyter, webstorm, pycharm, visual studio, rubymind, phpstorm, notepad++, xcode, sublime, android studio and so on.
> Question: Which development environments did you use regularly over the past year, and which do you want to work with over the next year? Please check all that apply.
Yes, CodeMirror is big and popular, and great overall. Again, I'm not saying otherwise. It's just hard to take comments seriously when they are obviously not factual, and it detracts from the message you want to convey.
Edit: To be a bit more constructive: Instead of saying "CodeMirror is what everyone uses!" or "This font is the best font for programming!", try to write out the reasons of why you think like that instead, and let people arrive to their own conclusions. Describe the cases you've seen where CodeMirror shines, or write why and in what cases the font truly stands out to you. And maybe then you'll get a warmer reception in your replies.
Yep, at the end of the day it's just text editor. I hope UX people with coding skills would re-visiting Paredit and make it mainstream. Designing keystroke for the mass is hard, especially for text heavy (e.g. docs) content.
This seems to go beyond choice of words. All you’re saying here is that context is exhausting. But sounds like you’d sooner exhaust your listeners with vagueness then try to exhaust yourself to find clarity.
What a coincidence. My master thesis "Projectional Editing of Internal Domain-Specific Languages" relies on CodeMirror 6 for its implementation, and I just happen to have handed in my thesis today, on the same day CodeMirror 6 is released. :)
This is great news! I know Obsidian uses CodeMirror 5 on desktop while using CodeMirror 6 on mobile, maybe the stable release will make them unite the versions again so 6 runs both on desktop and mobile? Would make life easier for writing plugins.
On a unrelated note, this irks me slightly:
> CodeMirror 6 is a new code editor library for the web, a from-scratch implementation
Why not just call it something different at that point? It's essentially CodeMirrorNext v1, if everything has been reimplemented from scratch and all the API interface intentionally changed.
That way there won't be any confusion what editor API you talk about when you say "CodeMirror". Instead, we now have to ask follow up question "Version 6 or older though?".
This seems to happen in a large part of the ecosystem. React Router for example has gone through a lot of API churn, where basically the first three/four versions of React Router all look different, and should instead have been just three/four different libraries instead of versions.
If Python 3 was just named Cobra 1, I guaranteed that Python 2 would have been “forked”
Increasing the version is a straightforward way to say “n is outdated, use n+1.” As a publisher I don’t want to start a new project with zero followers, especially if the project does the same exact thing my previous project did, just better.
> As a publisher I don’t want to start a new project with zero followers, especially if the project does the same exact thing my previous project did, just better.
Yeah, that's a good point and a lot of API interface churn we're seeing in the ecosystem makes sense to me now. People don't want to lose their social clout.
One could argue that that is exactly what happened in 2008, when the "sister language" meme was introduced. At that time, the Perl Porters basically abandoned all support for Perl 6 and started developing on Perl 5 again.
So development of Perl 6 basically fell back on just a handful of people, on the Parrot backend, which became less and less acceptable for Perl 6. And then people still wonder why it took so long?
I was only involved in one major project that relied heavily on CodeMirror since version 2.something. I participated in moving the project from version 2->3 and 3->4 (but not 4->5 which someone else did), and for those moves, the editor API didn't change very drastically as far as I can remember. Maybe the 4->5 migration was bigger?
Huge thanks to Marijn for all the work he's put into this.
We're currently integrating CodeMirror 6 into Overleaf [1], and you can try it out by joining our beta program [2] (which will give the option to select the beta source editor, which is the one built using CM6). If you do give it a try and spot any bugs/issues, please let us know, feedback is always much appreciated.
I’ve been working on CodeMirror 6 extensions for Typescript-based autocomplete, autoimport, hover tooltips, etc. The extension system is very deep, but there are APIs at many levels of abstraction. Marijn is also very quick to address feedback. CodeMirror is also much more usable on touch devices than Monaco (VS Code’s editor component).
In those days when developers tirelessly try to develop in their iPads, I think a library such as this one has great future.
This sixth version fully support touch input, that is unlike Monaco editor on vs code were you can have multiple online versions (self hosted, one hosted by Microsoft and GitHub code spaces) but none of them work well on the iPad.
I don’t know if there’s something similar to vs code already implemented with CodeMirror but I would tend to think there’s market (of free editor) for that.
A whole VS Code competitor is a lot of work, but I’ve been working on Typescript/JavaScript extensions for CodeMirror. My PR here has the latest: https://github.com/reactjs/reactjs.org/pull/4720
DiffLens developers here! (https://github.com/marketplace/difflens) We current use ACE for our editors, but we've always been interested in checking out CodeMirror too. When we initially started work on DiffLens, CodeMirror 6.0 wasn't "ready" yet, so we chose ACE. Congrats on the release! CodeMirror is so full of features.
Marijn has done much to make CM6 an accessible code editor. Now with Monaco (editor component of VS Code) and CM6 both being accessible, online code runners/playgrounds and interactive code examples in docs/courses are almost guaranteed to be accessible when they use one of those editors. This eliminates a big accessibility issue when you are learning to code and rely on assistive technologies.
That looks fantastic. It also looks like you also have Pyright running in the browser. Is that right? I thought Pyright only supported running on NodeJS.
Will definitely be taking a look at this release. I've alternated between CM and Ace for browser IDE purposes. I've got a new C#/DSL scripting environment I need to prototype, so I will give this a spin.
The new editor in Obsidian was made possible by CodeMirror 6, and it has been powering both the Live Preview mode (like Typora) and the source mode in Obsidian ever since.
It can be a bit overwhelming to get into first, but as we experimented more with it, we found it to be extremely extensible and powerful. It's also highly performant for large documents. Another major reason we chose CM 6 is that it's also one of the only code editors that work decently on mobile.
While developing the new editor, Marijn was also amazingly responsive in investigating and fixing all the big and little things we ran into, even relatively niche issues like IME input bugs.
If you find CM 6 useful, consider what you can to support the project! Funding link is here: https://marijnhaverbeke.nl/fund/