I've been reading about Operational Transformations a lot, and figured the best way to understand is to build. Jot Pad (for the lack of a better name) uses QuillJS and Firebase Realtime Database.
Understanding OT is tricky, and implementing it is slightly trickier. That said, this visualization helped. Click on the arrow heads when a delta is sent to the server. Took me a while to figure that out. And the home page here seems truncated, but it is my understanding that it may be just a quirky design.
Credit to @CJEnright for a neater implementation of OT for Quill.
- Build single player mode
- Compose socket events
- Build a queue of deltas server-side
- Emit transactions via Socket IO
- Apply transformations via Quill
- Put each stream of delta modification and update events in a separate socket room