Giter VIP home page Giter VIP logo

Comments (2)

BitPhinix avatar BitPhinix commented on June 29, 2024 1

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:

  1. Delete the text the mark would be added to and all following text
  2. Re-insert that text with the added marks
  3. Re-insert the following text

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!

from slate-yjs.

tmathew0309 avatar tmathew0309 commented on June 29, 2024

@BitPhinix any updates on this?

from slate-yjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.