3 ms·
Virtual DOM is pure overhead* * Compared to doing static analysis and optimizing your UI updates at build time. While I certainly agree that svelte's approach
by nemothekid 7y ago
Virtual DOM is pure overhead*
* Compared to doing static analysis and optimizing your UI updates at build time.
While I certainly agree that svelte's approach may be the future, I think React and others, are very much a needed stepping stone (especially when you consider all the work done transpiling JS code).
The Virtual DOM was the most performant solution that applied generally to many a large number of cases. The reason almost everyone did `x.innerHtml = html` is that it was the most general and widely available solution.
- floatboth 7y agoNo, you don't need to do anything at build time! (You don't even have to have a build time.) You can just… instantiate a template, remembering where the "holes" are, to get precise update functions for every data field that gets inserted into the template. This is what lit-html does, and it's such an obvious approach I'm really surprised that VDOM took off before it. https://lit-element.polymer-project.org https://lit-element.polymer-project.org