diff options
author | 2022-10-03 18:21:34 -0400 | |
---|---|---|
committer | 2022-10-03 18:21:34 -0400 | |
commit | e6a881081f456b83294e1d85179b20951d7677e9 (patch) | |
tree | e749307b85ebcfc4032081ad766f24924e716bcd | |
parent | adff3c45f25a4d28b27aca10b657b98901b33eb7 (diff) | |
download | astro-e6a881081f456b83294e1d85179b20951d7677e9.tar.gz astro-e6a881081f456b83294e1d85179b20951d7677e9.tar.zst astro-e6a881081f456b83294e1d85179b20951d7677e9.zip |
Fix regression in rendering strings (#4967)
-rw-r--r-- | .changeset/breezy-teachers-clean.md | 7 | ||||
-rw-r--r-- | packages/astro/src/runtime/server/render/any.ts | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/.changeset/breezy-teachers-clean.md b/.changeset/breezy-teachers-clean.md new file mode 100644 index 000000000..f6c841530 --- /dev/null +++ b/.changeset/breezy-teachers-clean.md @@ -0,0 +1,7 @@ +--- +'astro': patch +--- + +Final perf fix from 1.3.0 regression + +A regression in rendering perf happened in 1.3.0. This is the final fix for the underlying issue. diff --git a/packages/astro/src/runtime/server/render/any.ts b/packages/astro/src/runtime/server/render/any.ts index f4ffc21af..1a19ef519 100644 --- a/packages/astro/src/runtime/server/render/any.ts +++ b/packages/astro/src/runtime/server/render/any.ts @@ -1,4 +1,4 @@ -import { escapeHTML, HTMLString, markHTMLString } from '../escape.js'; +import { escapeHTML, isHTMLString, markHTMLString } from '../escape.js'; import { AstroComponent, renderAstroComponent } from './astro.js'; import { SlotString } from './slot.js'; @@ -9,7 +9,7 @@ export async function* renderChild(child: any): AsyncIterable<any> { yield* child.instructions; } yield child; - } else if (child instanceof HTMLString) { + } else if (isHTMLString(child)) { yield child; } else if (Array.isArray(child)) { for (const value of child) { |