How did you implement collaborative editing?

I have been researching collaborative editing in ProseMirror, and it seems that there are mainly two approaches: building it yourself (DIY) or using open-source CRDT bindings for ProseMirror.

So far, I have looked into:

  1. y-prosemirror
  2. yorkie
  3. The collab-example from the official docs

y-prosemirror appears to be the leading library in this area, but it has many open issues, and the author has initiated a funding campaign for a rewrite.

Yorkie is another CRDT adapter library I found, but its ProseMirror example is not documented, though the code for it exists in the source.

The source code for the collab-example is straightforward and easy to understand, but I am unsure how much additional effort is needed to add features like active user cursors, connection status management, and so on.

I would be grateful if you could share your experiences.

I use YJS. I have not really noticed any issues yet.

yjs, automerge, loro all have prosemirror-bindings; I would consider what features your editor needs, and pick a collaborative backend based on that.

1 Like

Prosemirror-py - works great with Django. I used jsonpatch as well for a long time. Building a backend is really not that difficult.

What is more work is dealing with users that go offline for a while and continue editing and suddenly you have multiple versions of the document that are somewhat incompatible and all of the writers expect that their changes will be preserved. For that we’ve created a relatively complex merge editor based on our own tracked changes system.

1 Like

why not disallow this behavior? eg, if the user’s current version is behind by X minutes or Y changes, force a full reload.

Because this is something that users want to do. Just deleting their changes will mean that they never again will touch our editor. Mobile connections in places like German traons are just npt very reliable.