So it’s almost 2021 and there still nothing magic out of the box to add Real Time Collaboration to a Rails stack.
But as far as i know, we almost have everything to make it happen:
- ActionCable for websockets client/server communication.
- ActionText based on top of trix.js is using a document model,
- OT algorithm or CRDT algorithm to solve collaboration conflicts. (Probably need to create new trix.js api’s to access operations)
- Using a jsonb column instead storing the rendered html, we could store the solved document model for all nodes and broadcast it and restore the client document.
- Adding multi cursor support + tooltip (to display who is editing name) to trix.js
- ActiveStorage would be compatible since it’s just modifying the document model.
Am i missing anything ?
Does the rails team has any plan on implementing something of that nature ? That would make the world a better place and enabled collaboration for everyone.
GitHub - benaubin/rails-collab: Collaborative Editing on Rails (using ProseMirror)