Changes in new slate-yjs #357
Replies: 2 comments
-
@BitPhinix any updates on this? |
Beta Was this translation helpful? Give feedback.
-
Hi @tmathew0309, so sorry for the late reply - I was super busy over the past 2 weeks with personal stuff. The main reason for the re-write was to represent the document in a more 'yjs native' fashion. While legacy slate-yjs represented the document as nested Y.Array/Y.Map/Y.Text objects, the re-write solely relies on nested Y.XmlTexts to represent the slate content. This has multiple benefits like simpler handling of changes, but the biggest benefit is that the document is represented in a 'flatter' fashion which allows for a more intuitive merging of remote changes. If you e.g. add marks to a specific section of text, the old slate-yjs version would:
So if 2 users add marks to the same paragraph and then sync their changes a lot of duplication would happen. In modern slate-yjs, the entire paragraph would just be a single Y.XmlText so it will just add the marks to the desired part of the text and the changes will be merged as intended without any duplication. The modern version also contains a history plugin, a better way of handling cursors, and a lot of other quality of life changes and simplifications. This is just a very brief overview so if you have any more questions just let me know! |
Beta Was this translation helpful? Give feedback.
-
Hi is there a write up anywhere about the breaking changes in the new version of
slate-yjs
(post 3.2.0)? Looking for an explanation of what changed and what the motivations were / what improvements to expect when switching given that it will be a relatively large investment on our side.Beta Was this translation helpful? Give feedback.
All reactions