3 ms·
VDOMs were created precisely because the native DOM was too slow. This is no longer the case and a tiny web component framework like Lit significantly outperfo
by lima 4y ago
VDOMs were created precisely because the native DOM was too slow.
This is no longer the case and a tiny web component framework like Lit significantly outperforms[1] React relying entirely on the browser DOM and template literals for re-rendering... so what you're asking for, has already happened :-)
But even the big frameworks are really fast thanks to modern JIT JS engines.
[1]: https://www.thisdot.co/blog/showcase-react-vs-lit-element-rendering-performance https://www.thisdot.co/blog/showcase-react-vs-lit-element-re...
- pier25 4y agoYes, I know Lit exists, and yes it's fast. But I think you're missing the point. I'm not talking about one JS implementation vs another or if JS solutions are fast enough from the end user perspective. The fastest JS solution (VDOM, Svelte, Lit, whatever) will still be bottlenecked by the browser. If JS could send a single function call to mutate/morph a chunk of the DOM, and that was solved natively, we'd see massive efficiency wins. When you consider the massive scale of the web with billions of users, this surely will have an impact in the emissions of the electricity needed to run all that JS. And (again) even if there were no perf improvements possible, you're avoiding the JS size argument. Lit still can be improved. Svelte generally produces smaller bundles than Lit. Eg see: https://krausest.github.io/js-framework-benchmark/current.html https://krausest.github.io/js-framework-benchmark/current.ht... But, again, if all the DOM mutation was solved natively there would be huge savings in the amount of JS shipped globally.