Fix regression in rendering strings (#4967)

This commit is contained in:
Matthew Phillips 2022-10-03 18:21:34 -04:00 committed by GitHub
parent adff3c45f2
commit e6a881081f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -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.

View file

@ -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) {