Comments (7)
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.
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.
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.
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.
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.
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.
Thanks for your help.
from diffdom.
Related Issues (20)
- highlight of the newly added elements and about to be removed elements HOT 1
- Wrong diff results for TEXTAREA nodes with existing value/content
- Question: Does it visually show the diff result? HOT 1
- Publish non-minified JS files on npm HOT 14
- Complex diff result HOT 1
- diffDOM Demo bug HOT 2
- Applying diff to VDOM (updated title) HOT 11
- Iframes HOT 8
- Problem processing the following html HOT 7
- nodeToObj, stringToObj uppercase mishaps HOT 5
- Difficulties Combining JSDOM with diff-dom for Full HTML Comparisons HOT 2
- Seeking guidance on skipping specific nodes when diffing and applying diffs HOT 2
- Diff does not capture `on{event}` handlers HOT 6
- Content from iframes is still not fully supported HOT 5
- warnings from `diff-dom` regarding calc values in svg HOT 1
- Facing issue with skipping difference - preVirtualDiffApply HOT 1
- onNodeAdded hook like Morphdom
- Work with jsdom without global values HOT 1
- Incorrect diff for element containing multiple text nodes HOT 1
- Compare two HTML strings and highlight differences HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffdom.