3 ms·
Databinding should be built into HTML/the DOM. Virtual DOMs wouldn't need to exist at all; things would perform better and also be standardized around one API
by brundolf 5y ago
Databinding should be built into HTML/the DOM.
Virtual DOMs wouldn't need to exist at all; things would perform better and also be standardized around one API for declarative updates. Even many apps out there could be made with vanilla JS (or in some cases, no JS at all). And the libraries/frameworks that did emerge would be much smaller and also compatible. You don't have to convert your utility JS when you move it to a project with a different framework; why should you have to convert your markup?
Think about all the native HTML elements that exist out there. Some of them, like <dialog> [1], exist only to be made dynamic with JavaScript. Imagine being able to leverage all of these with nothing but markup.
There are a number of reasons this would be hard to add on at this point (though I don't think it's impossible!), but I believe it would have resulted in a web that's an order of magnitude lighter and simpler.
[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...