3 ms·
They're fantastic for a lot of purposes. I've been experimenting with web-components for a couple of months now. It's not really "prime-time" ready, IMHO, but i
by elcritch 11y ago
They're fantastic for a lot of purposes. I've been experimenting with web-components for a couple of months now. It's not really "prime-time" ready, IMHO, but it's cool to see how quickly it's progressing now that Mozilla is more on board [1] and Microsoft's Edge is implementing core features [2a] and supporting WC's generally [2b]. (PS Vote on the MS's Edge website for implementing WC features! Seems they actually look at the votes some to determine features).
One of the biggest hangups for my team has been Firefox/Mozilla opting not to enable HTML imports (it's implemented) which causes quite a bit of annoyance when developing and using piece-meal web-components. They list there reasons [3] but their perspective seems to be driven from a "Javascript" first mentality with HTML being second class. My code is all driven by web-compoents though. The difficulty comes from getting the WC polyfills to load before Firefox tries to load your dom-modules (in Polymer terms). I want to separate out my HTML into modules and not require loading polyfills before I can include static HTML pages that might not even have Javascript in them.
There will probably be a lot of resistance, or rather, misuse of web-components for a while unless web-developers start switching to a "data first" mentality which is gaining traction from React and ClojureScript. It also feels pretty very heavy-weight if you're using Polymer currently.
BTW, anyone know how the shadow DOM affects performance of the entire browser window? Mainly, I'd be curious to know if updates to a shadow-DOM is isolated from causing Light DOM updates (e.g. updates to the shadow DOM could be isolated to generally not affect the parent window, or could be batched). This would yield much of the benefits of React's Virtual DOM. Just not sure where to look in the Webkit docs to find where this would be documented.
[1]: https://hacks.mozilla.org/2015/06/the-state-of-web-components/ https://hacks.mozilla.org/2015/06/the-state-of-web-component...
[2a]: https://dev.modern.ie/platform/status/templateelement/ https://dev.modern.ie/platform/status/templateelement/
[2b]: https://blogs.windows.com/msedgedev/2015/07/15/microsoft-edge-and-web-components/ https://blogs.windows.com/msedgedev/2015/07/15/microsoft-edg...
[3]: https://hacks.mozilla.org/2014/12/mozilla-and-web-components/ https://hacks.mozilla.org/2014/12/mozilla-and-web-components...