Re: [w3c/webcomponents] Discussion: child elements cannot determine whether they are "active" or not (#817)

@annevk the original post is here: https://dev.to/richharris/why-i-don-t-use-web-components-2cia (specifically, 5. Composition section). The example he uses is the following:

```html
<p>Toggle the section for more info:</p>
<toggled-section>
  <html-include src="./more-info.html"/>
</toggled-section>
```

Whether `html-include` component is defined or not is irrelevant, what is relevant is that with shadow DOM, that component must be instantiated (while other frameworks don't do that), but I don't think that's something we can address at this point. In our analysis (after looking at few thousands components at salesforce), it seems that if `html-include` is able to detect and observe its state in terms of slotting, to determine whether or not it is visible/slotted, it could decide whether or not to populate its shadow. By cutting the DOM tree branches shorts, we can avoid doing unnecessary job, that seems enough. Imagine that the component will instantiate conditionally dozens of components as part of its shadow root.

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

Received on Wednesday, 17 July 2019 15:55:46 UTC