Re: [whatwg/dom] Declarative Shadow DOM (#831)

> Ideally it would somehow perform better or at least no slower than comparable non-WC hydration solutions.

I think it's worth emphasising that custom elements cannot, in the general case, rely on the declarative shadow DOM a) existing and b) matching the component author's expectations. You might be able to rely on that situation if you're a framework that controls the components and the page, like Stencil, but not if (for example) you're writing a distributable widget. 

Because of that, I'd expect it to become common that component authors would simplify their lives by using approaches like `this.shadowRoot.innerHTML = '...'`, which seems like it's more or less guaranteed to result in worse performance than existing (non-WC) hydration strategies (not to mention the aforementioned issues around losing transient state like focus).

> CSS scoping is all we'd even hope to gain from a declarative shadow DOM proposal. CSS scoping on the light DOM sounds like what we'd prefer.

This is my position also. Regarding whether or not declarative shadow DOM is useful for people not already using it, @stubbornella made [this comment](https://twitter.com/stubbornella/status/1227393829206020096) the other day:

> it’s not enough to build features for folks already using web components. We want to make sure new features are broadly considered useful by all kinds of different developers.

I think this is an essential point. Ideally, a new feature like this would grant new capabilities to web developers at large. I hope that feedback like mine — that this proposal *wouldn't* provide a reason to start using web components — is received as being constructive, as is my intent.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/831#issuecomment-585955132

Received on Thursday, 13 February 2020 20:25:46 UTC