mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
🐛 removed deprecated items from lit integration (#11164)
* 🐛 removed deprecated items from lit integration * 🚀 update minified * 🐛 need `Document`
This commit is contained in:
parent
369069a173
commit
cf9b2ff796
3 changed files with 9 additions and 17 deletions
5
.changeset/gold-meals-march.md
Normal file
5
.changeset/gold-meals-march.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@astrojs/lit": minor
|
||||
---
|
||||
|
||||
Removes deprecated `template` attribute and replaces deprecated domparser function
|
|
@ -7,14 +7,8 @@ async function polyfill() {
|
|||
});
|
||||
}
|
||||
|
||||
const polyfillCheckEl = new DOMParser()
|
||||
.parseFromString(
|
||||
`<p><template shadowroot="open" shadowrootmode="open"></template></p>`,
|
||||
'text/html',
|
||||
{
|
||||
includeShadowRoots: true,
|
||||
}
|
||||
)
|
||||
const polyfillCheckEl = Document
|
||||
.parseHTMLUnsafe(`<p><template shadowrootmode="open"></template></p>`)
|
||||
.querySelector('p');
|
||||
|
||||
if (!polyfillCheckEl?.shadowRoot) {
|
||||
|
|
11
packages/integrations/lit/client-shim.min.js
vendored
11
packages/integrations/lit/client-shim.min.js
vendored
|
@ -8,7 +8,7 @@ var b = (t, n) => {
|
|||
function s() {
|
||||
if (d === void 0) {
|
||||
let t = document.createElement('div');
|
||||
(t.innerHTML = '<div><template shadowroot="open" shadowrootmode="open"></template></div>'),
|
||||
(t.innerHTML = '<div><template shadowrootmode="open"></template></div>'),
|
||||
(d = !!t.firstElementChild.shadowRoot);
|
||||
}
|
||||
return d;
|
||||
|
@ -79,13 +79,6 @@ async function g() {
|
|||
let { hydrateShadowRoots: t } = await Promise.resolve().then(() => (S(), v));
|
||||
window.addEventListener('DOMContentLoaded', () => t(document.body), { once: true });
|
||||
}
|
||||
var x = new DOMParser()
|
||||
.parseFromString(
|
||||
'<p><template shadowroot="open" shadowrootmode="open"></template></p>',
|
||||
'text/html',
|
||||
{
|
||||
includeShadowRoots: !0,
|
||||
}
|
||||
)
|
||||
var x = Document.parseHTMLUnsafe('<p><template shadowrootmode="open"></template></p>')
|
||||
.querySelector('p');
|
||||
(!x || !x.shadowRoot) && g();
|
||||
|
|
Loading…
Reference in a new issue