9 ms·
Differential synchronisation works very well indeed for plain text, but as Neil himself has pointed out, it doesn't necessarily work well for tree-structured da
by cpcallen 8y ago
Differential synchronisation works very well indeed for plain text, but as Neil himself has pointed out, it doesn't necessarily work well for tree-structured data (like XML or JSON) because there's no guarantee that the combination of separate syntactic-validity-preserving edits will necessarily be syntactically valid.
- pg_bot 8y agoThe solution to this problem is to add a translation layer from the tree structure to plain text. If you can do that you can work on any arbitrary data structure easily. I'll leave it up to the reader how to figure out how to do it ;)
- Reinmar 8y agoWe've been there (although, in case of OT). When implementing CKEditor 5, we started with a linear model and just a couple type of operations (the usual set). At that time, we weren't able to transform that linear model to a tree model because conflict resolution based on that simple set of operations was too dumb. As I mentioned in the other comment about CRDT vs OT, we'd still consider having a linear + tree model duet, but so far it's purely theoretical discussion whether it has a chance to work.
- jacobush 8y agoI have proof it works, but there’s no room?
- scofalik 8y agoUsing diffs was our very first approach. It was quite naive (not to say dumb) solution but we also came to a conclusion that it will be problematic for tree-structured data and there were also performance issues (for example when you bolded the whole document). So instead of trying to fix those issues, we tried a different approach.
- carry_bit 8y agoDoesn't implementing diff and fuzzy patch operations that work on your data structure (not plain text) solve that? It worked fine in my specific case.