astro/packages/renderers/renderer-lit/client-shim.js
Matthew Phillips 48851c9d25
Adds support for a Lit renderer (#665)
* Adds support for a Lit renderer

This adds `@astrojs/renderer-lit`. An experimental Lit renderer.

* Removed cached submodule, mistake

* Prevent globals clobbering

* Add docs on globals
2021-07-13 08:27:40 -04:00

9 lines
No EOL
354 B
JavaScript

async function polyfill() {
const { hydrateShadowRoots } = await import('@webcomponents/template-shadowroot/template-shadowroot.js');
hydrateShadowRoots(document.body);
}
if(!(new DOMParser().parseFromString(`<p><template shadowroot="open"></template></p>`, 'text/html', {
includeShadowRoots: true
}).querySelector('p')?.shadowRoot))
polyfill();