From e5aaea52b3241e5366797cbeb2250cc71150d20f Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 9 Aug 2023 10:01:02 -0400 Subject: [PATCH] fix: update types --- packages/astro/src/runtime/server/astro-island.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/runtime/server/astro-island.ts b/packages/astro/src/runtime/server/astro-island.ts index 63ada49d4..ef928b40b 100644 --- a/packages/astro/src/runtime/server/astro-island.ts +++ b/packages/astro/src/runtime/server/astro-island.ts @@ -14,7 +14,10 @@ declare const Astro: { { // @ts-ignore - (self.Astro || (self.Astro = {})).assign = (script,value) => Object.assign(script.parentElement,value); + (self.Astro || (self.Astro = {})).assign = (script,value) => { + Object.assign(script.parentElement,value); + script.remove(); + }; if (!customElements.get('astro-island')) { customElements.define( @@ -28,6 +31,7 @@ declare const Astro: { public rendererUrl = ''; public componentUrl = ''; public componentExport = 'default'; + public beforeHydrationUrl = ''; connectedCallback() { if (!this.hasAttribute('await-children') || this.firstChild) { @@ -44,11 +48,12 @@ declare const Astro: { } } async childrenConnectedCallback() { - let { beforeHydrationUrl } = this as any; + let { beforeHydrationUrl } = this; if (beforeHydrationUrl) { await import(beforeHydrationUrl); } this.start(); + this.removeAttribute('await-children'); } start() { const { opts } = this;