Patch the DOM in the most efficient way possible.
var html = '<h1>Hello, World</h1>';
var dom = new DOMParser().parseFromString(html, 'text/html');
dompatch(document, dom);
Patch the DOM in the most efficient way possible.
License: GNU General Public License v3.0
If we're generating and abandoning a large number of documents and nodes in a short time, garbage collection can be a major performance bottleneck.
Technically, this problem is out of the scope of this project, as dompatch only compares two documents/elements and updates them accordingly. But in practical terms, it'd be great to have an example that gets around this bottleneck, and the solution may likely need changes made to dompatch to allow this workaround.
Alternatively, this may be an acceptable limitation of dompatch's overall approach. If so, we may need to add a warning about it, that dompatch can be janky in some circumstances.
You usually can't change the type of an input, so I'll need to test that and maybe have a special condition on input elements.
Apparently older Internet Explorer won't allow the name attribute to change either so will need to test that.
Perhaps a generic solution would be to catch errors in updating attributes or child nodes, and simply revert to replacing the element in that case. That'd probably make it future-proof in case HTML6+ introduces any read-only attributes or other such restrictions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.