Re: [WICG/webcomponents] [scoped-registries] Interaction with declarative shadow DOM (#914)

> > > The aforementioned ordering issue, if it turns out that it is really needed, it looks to me like it is fatal.
> > 
> > I don't understand this statement. The top-down ordering is exactly what we already have. What's "fatal" about it?
> 
> @justinfagnani the main thing here is whether or not this new feature changes the existing behavior? (e.g.: order of upgrading)

Yeah, sorry I should have been more precise. It doesn't change the behavior of exiting websites.

> My question to @rniwa is the same, is that statement correct? can you provide an example? I don't think this feature is that disruptive, but as always, I want to understand more about his concern.

What I mean is that if you have nested custom elements that each use scoped custom element registry and declarative shadow DOM at the same time, then we can only upgrade inner custom elements after outer custom elements had been upgraded regardless of whether they're already available or not in terms of scripts because the browser wouldn't know when which registry will be used for which declarative shadow root.

e.g.

```
<some-element>
   <template shadowroot="open" customregistry>
          <some-scoped-element>
                <template shadowroot="open" customregistry>
                        <other-scoped-element></other-scoped-element>
                </template>
          </some-scoped-element>
   </template>
</some-element>
```

Then `other-scoped-element` can't be upgraded until `some-element` and `some-scoped-element` are both defined and upgraded.

This may hinder the ability to adopt scoped custom element registries and declarative shadow DOM in existing apps that use web components because now we're basically forcing the upgrading order to be top-down regardless of whether their respective custom element definitions are ready to go or not. For example, today, you can force bottom-up upgrades in the following tree with just declarative shadow tree if you first define `another-element` then `other-element` and `some-element` at the end, or out-of-order as those scripts arrive.

```
<some-element>
   <template shadowroot="open">
          <other-element>
                <template shadowroot="open">
                        <another-element></another-element>
                </template>
          </other-element>
   </template>
</some-element>
```

The inconsistency between when scoped custom element registry is used vs. not used seems problematic / not ergonomic to me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/914#issuecomment-800544722

Received on Tuesday, 16 March 2021 19:30:24 UTC