Bring Real Time Collaboration to ActionText


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.


Useful links:

GitHub - ball-hayden/ot.rb: A Ruby port of the Operational Transformation library ot.js

GitHub - Operational-Transformation/ot.js

GitHub - automerge/automerge: A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.

GitHub - benaubin/rails-collab: Collaborative Editing on Rails (using ProseMirror)


I’ve been following this space pretty closely for the last few years, and I have a few suggestions for anybody else that is interested:

Some general resources on realtime collaboration:

I think you’ll find this thread interesting

It doesn’t have anything specific about real time collaboration but it does touch on the subject of actiontext in the long run