mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
probably now obsolete part for issue 9953
This commit is contained in:
parent
dacfbf69c5
commit
340fe25f47
3 changed files with 11 additions and 3 deletions
5
.changeset/tough-queens-travel.md
Normal file
5
.changeset/tough-queens-travel.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@astrojs/lit": patch
|
||||
---
|
||||
|
||||
Adds processing of declarative shadow DOMs (DSD) during view transitions for browsers that do not support DSD natively.
|
|
@ -2,7 +2,9 @@ async function polyfill() {
|
|||
const { hydrateShadowRoots } = await import(
|
||||
'@webcomponents/template-shadowroot/template-shadowroot.js'
|
||||
);
|
||||
window.addEventListener('DOMContentLoaded', () => hydrateShadowRoots(document.body), {
|
||||
const listener = () => hydrateShadowRoots(document.body);
|
||||
document.addEventListener('astro:after-swap', listener);
|
||||
window.addEventListener('DOMContentLoaded', listener, {
|
||||
once: true,
|
||||
});
|
||||
}
|
||||
|
|
5
packages/integrations/lit/client-shim.min.js
vendored
5
packages/integrations/lit/client-shim.min.js
vendored
|
@ -86,8 +86,9 @@ var S = i(() => {
|
|||
E();
|
||||
});
|
||||
async function N() {
|
||||
let { hydrateShadowRoots: t } = await Promise.resolve().then(() => (S(), v));
|
||||
window.addEventListener('DOMContentLoaded', () => t(document.body), { once: !0 });
|
||||
let { hydrateShadowRoots: t } = await Promise.resolve().then(() => (S(), v)),
|
||||
n = () => t(document.body);
|
||||
window.addEventListener('DOMContentLoaded', n, { once: !0 });
|
||||
}
|
||||
var R = new DOMParser()
|
||||
.parseFromString(
|
||||
|
|
Loading…
Reference in a new issue