forge
forge copied to clipboard
support declarative shadow DOM
Describe the feature: With browsers starting to implement support for declarative shadow DOM, we should get a head start and adjust components to properly handle initialization for compatibility.
Current browser support: https://caniuse.com/?search=declarative%20shadow%20dom
Resources: https://web.dev/declarative-shadow-dom/
Describe any alternatives you've considered: None. These are new browser APIs.
Additional context:
This allows custom elements with shadow DOM to be server-side rendered, and serialize the shadow root content as a <template>
tag that is hydrated automatically by the browser during parsing on the client. This means that the shadowRoot
property will already be available when a custom element is instantiated, and no longer require the component to set up its internal template manually.