(wordgard.net)
One thing to note is that there is not an upgrade path. Many concepts are shared with prosemirror, but it seems that switching means doing quite some work (correct me if I am wrong). Obsidian is based on Code Mirror so I guess they won't be switching, but tiptap.dev and others do.
@merijn, maybe you could address why wordgard is worth the switching cost?
EDIT: I see many points are addressed in Merijns personal blog. I submitted (https://marijnhaverbeke.nl/blog/wordgard-0.1.html) to HN for better context.
It may not be. If you're happy with ProseMirror, continue to use ProseMirror. I have your back.
But as the blog posts describes, I had a whole pile of new design insights that avoid some of the issues I've ran into with ProseMirror, so I had the itch to build a new iteration.
I'll add a link to the blog post to the docs section of the website.
(It's marijn, not merijn.)
Also the decision to forego browser's selection and draw a custom layer.
All this makes reasoning about changes a lot more saner and intuitive. I've always wondered why prosemirror's transactions & steps couldn't be simplified further so I'm one vote up for the new design direction!
> (It's marijn, not merijn.)
oeps, sry!Wikipedia is intriguingly inconsistent - claims that Marijn is the Dutch variant of Marinus meaning 'marine' like Marius, Mario etc. but other pages claim Marius is more likely to be from 'mars' or 'male' than 'marine'.
> I'm not all that fond of the ProseMirror pun anymore either (it's CodeMirror but for prose, get it?)
So... It's time for someone to create Codegard, i guess?
> A ProseMirror 2.0 with an incompatible interface would amount to the same but make it ambiguous what people mean when referring to ProseMirror. Trying to graft stuff on in a backwards-compatible way as an 1.x version would produce a compromised win32-style mess.
Prosemirror doesn't really have any mechanism to do this, so i've ended up doing one of these two things:
1. Define the schema twice, once using Prosemirror and once using something like Zod. Then having a battery of equivalence tests to assert that the schemas match. 2. Build a meta schema definition layer that can output a Prosemirror schema, but conforms to the standard schema spec (https://standardschema.dev/), this approach is more viable if not using something like Tiptap.
I haven't tried using Wordgard yet, so I can't tell if it does anything to address this, but just calling it out as a pain point i'd love to see solved.
It is insane that there isn't a web standard implementation for this passed 15 years ago.
"just contenteditable" is really understating things. contenteditable is a god awful API full of bugs and inconsistencies. Making something reliable on top of it is a very significant amount of work.
For context: my day job for last 2 years has been building a new browser engine from scratch, and I think the contenteditable-based WYSIWYG editor I wrote 15 years ago might have been a harder project (albeit I was lot of less experienced then).
None of these modern editors (Wordgard, ProseMirror, Lexical, Slate) use contenteditable for the document model. Rather, they have their own internal document model and use contenteditable as a kind of input layer where the editor monitors what the browser does, then translates that into actual edits.
Early editors like FCKEditor and TinyMCE were only wrappers around contenteditable. They used the DOM as the real document model, then intercepted certain keypresses and events and "fixed" the behavior when it wasn't correct (e.g. double enter inside a bullet list should switch to paragraph mode).
The result was rife with bugs and inconsistencies, and didn't allow for a proper split between the model and the view (e.g. to represent columns, video embeds, and so on).
There is an entire YC company built on top of Prosemirror (Tiptap).
The thought that Prosemirror is no more in active development is scary.
From their blog: "I'm still proud of ProseMirror, and ProseMirror isn't going anywhere—it will continue to be maintained."
Which is a thing that I never said. In fact I went out of my way in all the announcements to stress that ProseMirror maintenance is continuing as it has been.
Also MIT-licensed software doesn't 'go away' all that easily. If a piano fell on my head tomorrow, interested parties would probably manage to continue development in a fork.
but as @john_strinlai as I have said it doesn't seem like Prosemirror is going unmaintained. It will continue to be maintained
but I think its worth thinking about the structure of the whole thing being so similar to the xkcd which is what might be the scary part of it.
I was searching for something like this recently but ended up rolling my own using a block-based OT to local server and diff sync to remote ones.
I’m reading the system guide and nodding along. It’s super validating to see the similarities and contrasts.
I'd really appreciate it this was something built in, not something I have to build based on the dinosaurs example. Every time I need to reach for one of these text editor libraries that is my no. 1 usecase, followed by WYSIWYG.
As would first class mobile support.
I haven't entirely decided what utilities I'm going to include in the core library, but mentions are definitely on the list for potential inclusion.
I'd pick prosemirror any day over Lexical.
But Claude is playing part of it.
I'll save you the trouble, you will not find one.
I've personally been hoping for something like this for a while now. Especially a toolset that is not just targeting yet another SaaS or LLM or social media clone interface.
I don't know if you ever used Draft.js that FB put out some time ago, but it was a horribly buggy monstrosity that was a heavy lift to move away from. One could not write several paragraphs and edit them without losing a lot of work. I wouldn't touch "Lexical" no matter the marketing they put on top. I wouldn't be half as critical if it wasn't one of the wealthiest companies on the planet known for injecting billions into black holes while they raid every area of your life they possibly can for data to be used to manipulate socio-political matters everywhere. If they're going to do that, and release open source libraries, then at least make them good enough to be seductive. They aren't.
ProseMirror and seemingly WordGard have real thought and care put into them by people who have long made the DOM/developer experience and the writing experience priorities– not just their "mind share" for whatever dark purposes drive companies like Meta.
I wonder how Wordgard compares in this aspect!
I am not sure if this makes things easier for react interop, but this piece might be of interest too:
> One of the biggest mistake blunders in ProseMirror is that the editor view does not get access to the transaction objects when updating, just the state. Wordgard does not repeat this mistake, and makes updates take transactions, not just a new state.
> This means that things like the DOM update logic and UI plugins can precisely observe what happened, and handle changes in a efficient and more effective way. The weird unexpected DOM redraws that are still a thing in ProseMirror should not occur. Only the precise DOM structure affected by the new transactions will be updated.
Anyways, it is great to see Merijn still going strong with his free work. Anyone needing interactive rich text on the web won't find anything better than his brain childs.They are also working on a collaborative editing suite for ProseMirror as an alternative to TipTap https://pitter-patter.dev/
My main gripe with WYSIWYG is that they can get in your way. When I create a verbatim block and can't leave that block anymore (looking at you Teams). I guess thats also why I enjoyed LaTeX as much as I did.
https://code.haverbeke.berlin/wordgard/wordgard/src/branch/m...
If the motivation for moving off GitHub was "GH is down too much", it might be worth tracking how many 9's of uptime is lost in the self-hosted case.
Also, though GitHub's lack of reliability was part of the motivation to self-host, it was only a minor factor. The way they are trying to make Copilot a thing, at the cost of everything else, the way they handle US sanctions by blocking everybody from entire countries, and the way the web interface feels ever more heavyweight and sloppy were also factors.
$ git clone https://code.haverbeke.berlin/wordgard/wordgard.git
Cloning into 'wordgard'...
remote: Enumerating objects: 8274, done.
remote: Counting objects: 100% (8274/8274), done.
remote: Compressing objects: 100% (4747/4747), done.
remote: Total 8274 (delta 6049), reused 5002 (delta 3464), pack-reused 0 (from 0)
Receiving objects: 100% (8274/8274), 1.61 MiB | 2.93 MiB/s, done.
Resolving deltas: 100% (6049/6049), done.Maybe something changed in the meantime, but I'm seeing what appears to be the code for it here: https://code.haverbeke.berlin/wordgard/wordgard/src/branch/m...
Android Chrome.
I wanted to clear the text box, so I marked the entire text and hit backspace. It only removes the last letter.
So then I marked the entire text and pressed a letter. That successfully replaced all the text with the one letter.
But then the editor broke completely. I cannot put newlines anymore, backspace is inconsistent, and the text cursor isn't shown.
(The editor breaking after marking all the text and pressing a letter is reproducible.)
At least on mobile the editor seems to still be unstable.