The client half of banira's Declarative Shadow DOM prerender (see
createPrerenderer/banira prerender). Call it from a custom element's
constructor or connectedCallback:
If the parser already attached a non-empty shadow root (from DSD), it is
adopted as-is — no re-render, so the prerendered markup never flashes.
Otherwise a shadow root is created and template is rendered into it.
In both cases any styles are adopted, since constructable stylesheets are
not part of the serialized DSD markup. Returns the shadow root and whether it
was hydrated, so callers can skip re-binding already-bound prerendered nodes.
The client half of banira's Declarative Shadow DOM prerender (see
createPrerenderer/banira prerender). Call it from a custom element's constructor orconnectedCallback:templateis rendered into it.In both cases any
stylesare adopted, since constructable stylesheets are not part of the serialized DSD markup. Returns the shadow root and whether it was hydrated, so callers can skip re-binding already-bound prerendered nodes.