0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
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();