Comment

Comment by samwillis

Not mentioned in the article but CodeMirror has a brilliant story for realtime collaborative editing. You have two options:

- An Operational Transform (OT) based system built by Marijn (the creator of CodeMirror)

- A Conflict Free Replicated Datatype (CRDT) based system using Yjs built by Kevin Jahns (the creator of Yjs) - https://github.com/yjs/y-codemirror

OT Demo: https://codemirror.net/6/examples/collab/

Yjs Demo: https://demos.yjs.dev/codemirror/codemirror.html

Both are brilliant, but I'm a huge fan of Yjs - the number of different bindings to different editors (and state systems) is incredible. It's a great platform to build collaborative tools on and the big plus is offline editing support, you can have a document diverge significantly while offline and still merge successfully. OTs are a little more difficult to make work well for a significant period offline.

I don't know which of the above Replit use, I would suspect the OT version as they mention building a OT system for Ace in the article.

parent samwillis 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton