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

I just wanted to quickly summarize my takeaways from the [Web Components F2F discussion](https://www.w3.org/2020/03/23-components-minutes.html) of declarative Shadow DOM on Monday:

- I think there was a generally positive response.
- it would seem that we need to make some allowances for allowing `attachShadow()` to blow away any existing declaratively-created shadow root. This is to avoid breaking existing components which assume `attachShadow()` will not throw, given that the component is hydrating the shadow root itself. This makes sense to me. There was a discussion about potentially making `attachShadow()` simply *return* the existing shadow root; however, this will likely also cause problems for components that then try to populate the shadow root and get collisions and duplicates.
- there is a related, though separate, request to add an accessor to `ElementInternals` for the `shadowRoot`, including **closed** shadow roots. This would allow components to properly deal with closed declarative shadow roots. A [new issue was opened](https://github.com/w3c/webcomponents/issues/871) for this. There has been some discussion of this point and the prior point on that issue.
- there was another discussion about leaving the template element in, vs. removing it, once the declarative shadow root is attached. I believe we reached agreement here that the complexity of leaving it in outweighs the "weirdness" of the `<template>` node being "converted" to the `#shadowroot`.
- there was another discussion about the lack of support for streaming (due to the shadow being attached upon the closing `</template>` tag). The implementers seemed to be on the same page that supporting streaming will be a significantly larger implementation effort.
- There was a question/suggestion that `getInnerHTML()` should have an option to pass in closed shadow roots that are allowed to be serialized. Otherwise, there is no way to serialize closed shadow roots without violating encapsulation.

Please let me know if I missed anything important above. Based on the above, I believe my only action items are:
 - change `attachShadow()` so that it removes existing content if called while a declarative shadowroot exists.
 - add an option to `getInnerHTML()` to pass in closed shadow roots.


-- 
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-604738917

Received on Thursday, 26 March 2020 23:31:31 UTC