Possibility to calculate diff without applying the changes (patching) to the dom
See original GitHub issueI would like to calculate the diff between two trees, without patching, because it will be done in a webworker (without access to the DOM).
Similarly to what is done here: https://github.com/Matt-Esch/virtual-dom
var patches = diff(tree, newTree);
rootNode = patch(rootNode, patches);
Can this be done in this vdom implementation?
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Is there a way in React to update a DOM witout constructing ...
Is there a way in React to skip this creation of Virtual Tree and calculate diff? Like the following: shouldComponentUpdate will return false...
Read more >Reconciliation - React
When building up a new tree, new DOM nodes are inserted into the DOM. Component instances receive UNSAFE_componentWillMount() and then componentDidMount() . Any ......
Read more >Delta Compression: A practical guide to diff algorithms and ...
Discover how diff algorithms can be used to support your diff/delta/patch functionality, and how they are used in developer tools such as Git....
Read more >Making the Virtual DOM. Faster. - Aiden Bai
The patch function takes an existing DOM node, old virtual node, and new virtual node. The implementation is as follows: Calculate the difference...
Read more >Building a Simple Virtual DOM from Scratch
Imagine we have a function diff (oldVTree, newVTree) which calculate the differences between the two virtual trees; return a patch function ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cjh9 i randomly stumbled upon this [1] today, which sounds like exactly what you’re asking for.
[1] https://github.com/Gozala/dominion
open devtools and run
document.querySelectorAll("*").length