3 ms·
The missing cornerstone is native databinding. That's it. If we had native reactive HTML templating, 80% of the world's JavaScript could go away. The fundamenta
by brundolf 6y ago
The missing cornerstone is native databinding. That's it. If we had native reactive HTML templating, 80% of the world's JavaScript could go away. The fundamental problem of the web as an application platform is that any element-state is trapped inside a single element, so you have to use JavaScript to dig it out and do something with it.
For example, HTML has a native <dialog> element, did you know that? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...
Most people don't, because it's completely useless without some JavaScript to toggle its "open" attribute. This was by design. The requisite interactivity across elements simply can't happen without a) databinding, or b) a whole turing-complete language. Since we don't have a, we use b.
- datagram 6y agoI understand the point you're making, but the bigger reason that <dialog> isn't being used is because it's still locked behind a feature flag in Firefox since they haven't fully implemented it. For a recent project I was actually looking forward to using using it and would be more than happy to add the bit of JS necessary to toggle it, but ended up having to reinvent the wheel and make my own modal component. If all we needed was a bit of JS to wire up state between HTML elements like <dialog> and <details> I think we would still be in a great place, even if we didn't have native data-binding. The bigger issue IMO is that in many cases native elements can't be used either because they fall short of the desired UX and can't be extended/enhanced (e.g. <select multiple>), or browser support isn't widespread enough (e.g. <details>).