It's written by the team behind https://tiptap.dev, which is an amazing WYSIWYG text editor, but HocusPocus does a great job of syncing state of a variety of WYSIWYG editors out of the box. Getting the server running is a couple of minutes worth of work and scaling it is quite easy.
In addition to editor state, it also has built-in support for 'Awareness' (info on current users), as well as any other Y.js datatype, including other things with a bridge into Y.js.
I'm not completely sure, but I think at ProseMirror they're using Yjs [2] for the collaborative editing part. If not, checking out Yjs is worth it in and of itself.
> Yjs is a CRDT implementation that exposes its internal data structure as shared types. Shared types are common data types like Map or Array with superpowers: changes are automatically distributed to other peers and merged without merge conflicts.
> Yjs is network agnostic (p2p!), supports many existing rich text editors, offline editing, version snapshots, undo/redo and shared cursors. It scales well with an unlimited number of users and is well suited for even large documents.
> Conflict-free replicated data types (CRDT) for collaborative editing are an alternative approach to operational transformation (OT). [3]
OT was what Google Wave was based on and I think current colab editing in Google Docs and other of their office products use this.
[0] https://prosemirror.net/examples/collab/#edit-Example
[1] https://marijnhaverbeke.nl/blog/collaborative-editing.html
No, ProseMirror has its own approach to sync.
> OT was what Google Wave was based on and I think current colab editing in Google Docs and other of their office products use this.
Yep.
The team behind TipTap (built on top of ProseMirror), created the Hocuspocus server backend for Yjs and collaborative text editing.
So I’ve had to implement a system where a new yDoc is created when the session begins, and then is converted back into a string when the session ends.
Did you have to do anything similar? And if so was it easy with hocuspocus? I wasn’t able to get a clear answer from the docs.
edit: also, I couldn't get a good look at their documentation outside of the paywall, so I have no idea how they implement the backend. It's important, because I need to persist my documents as html strings, not as y docs.
Supabase and Replicache can absolutely help with (1). But for (2) you will need OT or CRDT.
https://docs.yjs.dev/getting-started/a-collaborative-editor is a good place to start - it uses Quill and CRDTs for (2) and can have a persistence layer built in (or custom written, to work on top of Supabase etc.) for (1).
https://elixir-lang.org/blog/2020/11/17/real-time-collaborat...
https://www.youtube.com/watch?v=HTB4mQyMAmg
And supabase uses elixir to listen to database changes and push then over websockets.
I like the simplicity and clarity of just directly charging for the valuable thing. Nothing wrong with the other models, they just aren't for us.
Happy to have a chat on collaborative editing anytime if that'd be helpful (email in profile).
… general availability of Realtime's multiplayer features, Broadcast and Presence.
- 25 concurrent channels
- 25 channel joins per second
- 200 concurrent connections
- 100 broadcast messages per second avg over 60 seconds (not including db changes) (aka 6,000 per minute rolling)
I think these are probably pretty close to where we'll land for free projects. They can be changed per project so if you (or anyone) needs a limit increased in the short term we can do that.
Im Steven, co-founder of Liveblocks. Thanks for your feedback on pricing. We try to have a fair pricing for everyone and for companies of all sizes.
We’re working on a new pricing that will make this much more affordable, even free in most cases.
Would love to get your feedback on that if you’re up for it?
Thanks!
Phoenix Framework gives you presence and CDRTs out of the box. I’m not sure if they’re also using Phoenix, but there’s a well-known, heavily used open source solution for the core of this offering and I’d be shocked if they didn’t at least study and/or borrow from it.
Edit: yep, according to the page they’re advised by Chris McCord, the creator of Phoenix.
My real trouble is the fact that this is an existing application, with hundreds of thousands of pre-existing documents, all stored as html strings. I've been trying to extract the html on the server, but it's incredibly difficult. I've actually given up for the time being, and using a hacky workaround.
I almost want to scrap all of my code and move it to Supabase. Congrats to the team on this launch, very cool.
edit: actually, after thinking it through, I'm not clear on what Supabase is calling multiplayer. Presence is one thing, but when I think multiplayer, I'm thinking conflict resolution. Is this an OT/CRDT implementation? Or is it just presence?