distributed computing - Which CRDTs can be used to implement a full-featured collaborative rich text editor? -


i have been studying crdts , understand have been used build collaborative editors, including ritzy, treedoc, woot , logoot.

i'm interested in building such editor, , need know if crdts known able handle problem in generality.

to elaborate: rich text document (think html) has tree structure, nodes heterogeneous. there block elements, inline elements, tables, lists , on. further, there may styles , stylesheets (e.g. css) embedded in document. finally, undo essential.

the editors listed above not handle more advanced features, such tables, embedded stylesheets , undo/redo.

the ritzy documentation links paper describing crdt-based causal trees (pdf) don't understand paper.

what basic principle behind causal tree crdt? powerful enough handle heterogeneous trees described above? alternatively, there other crdts handle scenario?

the implementation of crdt rich-text not straight forward. crdts can used build trees. naive approach rich-text build tree. node represent block of text formats such 'italic'. in order format text, have delete it, , insert new node format. not work expected: example, if 2 users concurrently format same text, formatted text inserted 2 times after convergence (user1 deletes text, , inserts new node. user2 deletes same text, , inserts new node). knowledge there no crdts solve problem.

actually crdt linear structure suffice. can realize formats markers (i.e. format start, , format end). has advantage expected result when 2 users concurrently format/insert text.

for working implementation of approach can check out yjs. examples section contains working example of rich text editor.

(full disclosure: author of yjs)


Comments