v0.6.2
Notable Changes
Web Components are dead, Long live the DOM (and Vanilla Components)
There are few parts to the Web Component spec:
-
HTML Imports - This was dead on arrival - albeit killed not unreasonably: they wanted to see how ES6 Modules pan out first.
-
Custom Elements - This is fine. But using a custom tag has been possible since forever.
You might think the lifecycle callbacks are new, but if you are interested in connected/disconnected/attributeChange there are MutationObservers. Also, those are mostly useless events. The only one lifecycle event that would have been super-useful to standardise is a single "render"/"update"/"draw". Actually, there's no thought given to how a component should update at all so far. By having a consistent contract across components as per the vanilla spec for example, it makes it trivial to compose completely unrelated components.
Without a real component model, none of the Web Components spec help with building interoperable components.
-
Shadow DOM - This was initially the most exciting. Practically, the only thing this gives you is style encapsulation. That's not much, and something you can do with a BEM-esque transform (s/:host/component-name/g) for upper boundaries, and a simple
>for lower boundaries (or other approaches, like inlining). But it was at least something you could progressively layer on if available. The open/closed divide has now made this a victim of design by committee, turning it into a poor man's iframe.
Since the future of "Web Components" now seems uncertain and lacking a clear direction, I've disabled the shadow module by default in rijs/fullstack (it's always been omitted in the client-only build rijs/minimal). This is very unfortunate to admit, as I've been very bullish in trying to align closely with them since the early days of the project. Thanks to the modular framework architecture however, this is as simple as commenting out one line, with no impact on applications. Chrome will now just render the same as Firefox/IE (no shadow roots, but custom tags still). I look forward to seeing how they continue to evolve, but currently they do not add any value and just degrade performance (in speed and size).
A few other notable aspects:
- Slots: Components generally transform data-to-markup. The distribution algorithm is essentially markup-to-markup. This is a very unexpressive, highly opinionated solution. Authoring a component based on HTML input is akin to DOM scraping. A lot of time was wasted on this area imho, which I doubt will catch on (contrast this approach to D3 joins for building a graph).
- Scrapping
[is]: This meant there was no way for a Web Component to participate in a<form>. So if you want<fancy-select>, you end up having to rewrite alot more than expected. - State Propagation: The ability to deeply propagate changes has been taken away in V1 (yes, even for open shadows). Without some low-level primitive to do this efficiently, this makes it untenable for any framework to adopt Shadow DOM V1.
Commits
- [
496436e] - Add identity import@
- [
774abae] - fix: correct return value
- [
8aa7bee] - feat: deprecate shadow, delay
- [
102ae81] - feat: use utilise/deb for debug logs
- [
9baeec8] - feat: use utilise/deb for debug logs
upload (new module)