So, this is what I understand after a bit more than two weeks of working with ProseMirror:
There’s no built-in support for diffing in ProseMirror. Its support for interactive collaboration relies on rebasing & best-guess conflict handling. That’s fine for real-time collaboration because a user is in the loop and conflicts are generally minor (only a few seconds or so), but when documents have diverged significantly, you probably want to make conflict resolution interactive.
Here’s the blog post where ProseMirror’s author describes the library’s approach to collaborative editing. prosemirror-collab’s OT algorithm isn’t ideal and wastes a lot of bandwidth retransmitting steps unnecessarily - but it’s basically possible to implement any OT algorithm on top of prosemirror.
https://marijnhaverbeke.nl/blog/collaborative-editing.html
For rails-collab, I rewrote the collaboration algorithm based on Apache Wave/Google Doc’s approach to OT. I’ve actually extracted that into an npm module, prosemirror-collab-plus.
Here’s the blog post from Apache Wave that really led me to “get” the simplified OT algorithm Google uses.
If you’re not doing collaborative editing, you need to somehow generate the diffs yourself. Manuscripts app released a package to handle this - https://gitlab.com/mpapp-public/prosemirror-recreate-steps. It claims to be able to recreate Step
s that occured between two documents and then do an interactive merge between groups of steps. While I haven’t tried it myself, I’ve skimmed the source and it seems very well written.
We’ll likely be using prosemirror-recreate-steps to handle syncing after offline editing & branching