- From: Matias Trujillo <notifications@github.com>
- Date: Fri, 14 Feb 2020 07:02:21 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/831/586325290@github.com>
@georges-gomes I think the use of a tag that associates the shadowdom has already been evaluated and there are [interesting conclusions about this](https://github.com/mfreed7/declarative-shadow-dom/blob/master/README.md#-prior-discussion-at-tokyo-f2f).
I like more the idea of declaring the fragment attribute on the template tag, with the aim of associating a persistent fragment to the `<host> 'node and being indifferent to the use of shadowDom for native SSR declarations
```jsx
<host>
<template shadowroot="open">
<h1>...</h1>
</template >
<template fragment>
<h1>...</h1>
</template>
<h1>...</h1>
</host>
```
```js
host.childFragments; // NodeList[#fragment];
```
This only materializes as an attribute what has already been mentioned in the issue https://github.com/whatwg/dom/issues/736 de @WebReflection.
The benefit of this is that multiple libraries attach their fragments in the same node eg:
```html
<host>
<template fragment="block-react">...</template>
<template fragment="block-lit">...</template>
</host>
```
```js
host.childFragments.get("block-react"); // #fragment
```
--
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-586325290
Received on Friday, 14 February 2020 15:02:34 UTC