Coder Social home page Coder Social logo

Comments (7)

johanneswilm avatar johanneswilm commented on May 10, 2024

By extension, yes. The exit you get is an object which is labeled according to whether it contains a text node or whatever. You can manipulate that, and then also hook something in on the receiving end to handle it according to your setup.

What is the idea of doing it that way? Is it to save bandwidth by sending less data?

from diffdom.

marcelklehr avatar marcelklehr commented on May 10, 2024

Nope, Concurrent editing with intention preservation.

You want your a to be inserted right after the p, not to set the text content to some 100 chars.
I think working with diffs, this is easier to achieve.

from diffdom.

johanneswilm avatar johanneswilm commented on May 10, 2024

If it's not bandwidth, then do it at the end, not the beginning. You can easily create a diff there by comparing the old and the new text that are both present in the object.That's how we use it. No need to overcomplicate things.

from diffdom.

johanneswilm avatar johanneswilm commented on May 10, 2024

As for what you mention there - that is an entirely different operation (inserting new DOM elements) that has nothing to do with changing text nodes. Have you tried the library out?

from diffdom.

marcelklehr avatar marcelklehr commented on May 10, 2024

Good point, creating a diff on all sites instead of once is a trade off though, imo.

Yea, I have tried the library. Sorry if that came across wrong, I did mean modifying a text node. I'm currently trying to wrap my mind around which operations provide which properties and how they're supposed to work by reverse engineering the diffs and poking around in the code base. Do you have that documented somewhere by any chance?

from diffdom.

johanneswilm avatar johanneswilm commented on May 10, 2024

There is no more documentation then the code itself which is quite readable. I don't think creating the diff in several places is a significant tradeoff if this is about collaborative editing.But you can of course filter the output, and just take the diff of modified text nodes and change do the calculation already on th sending end and then also override the receiving end.

from diffdom.

marcelklehr avatar marcelklehr commented on May 10, 2024

Thanks for your help.

from diffdom.

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.