aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/css-stress-test/bun-framework-next/renderDocument.tsx2
-rw-r--r--demos/css-stress-test/bun-framework-next/server.development.tsx1
-rw-r--r--src/js_parser/js_parser.zig24
3 files changed, 15 insertions, 12 deletions
diff --git a/demos/css-stress-test/bun-framework-next/renderDocument.tsx b/demos/css-stress-test/bun-framework-next/renderDocument.tsx
index 9fd2e8e07..a25e5d273 100644
--- a/demos/css-stress-test/bun-framework-next/renderDocument.tsx
+++ b/demos/css-stress-test/bun-framework-next/renderDocument.tsx
@@ -356,7 +356,7 @@ export async function render({
pages[name] = [path];
}
- pages[pathname] = [route.scriptSrc];
+ pages[pathname] = [route.scriptSrc, ...pageStylesheets];
if (appStylesheets.length > 0) {
if (pages["/_app"]) {
diff --git a/demos/css-stress-test/bun-framework-next/server.development.tsx b/demos/css-stress-test/bun-framework-next/server.development.tsx
index 1f0eaee50..54181c271 100644
--- a/demos/css-stress-test/bun-framework-next/server.development.tsx
+++ b/demos/css-stress-test/bun-framework-next/server.development.tsx
@@ -1,3 +1,4 @@
+globalThis.global = globalThis;
import { render } from "./renderDocument";
let buildId = 0;
diff --git a/src/js_parser/js_parser.zig b/src/js_parser/js_parser.zig
index a06277b5e..4d6189cbc 100644
--- a/src/js_parser/js_parser.zig
+++ b/src/js_parser/js_parser.zig
@@ -10545,18 +10545,20 @@ pub fn NewParser(
// ...props,
// children: []
// }
- for (e_.children[0..children_count]) |child, i| {
- e_.children[i] = p.visitExpr(child);
- }
- const children_key = Expr{ .data = jsxChildrenKeyData, .loc = expr.loc };
- props.append(G.Property{
- .key = children_key,
- .value = p.e(E.Array{
- .items = e_.children,
- .is_single_line = e_.children.len < 2,
- }, expr.loc),
- }) catch unreachable;
+ if (children_count > 0) {
+ for (e_.children[0..children_count]) |child, i| {
+ e_.children[i] = p.visitExpr(child);
+ }
+ const children_key = Expr{ .data = jsxChildrenKeyData, .loc = expr.loc };
+ props.append(G.Property{
+ .key = children_key,
+ .value = p.e(E.Array{
+ .items = e_.children,
+ .is_single_line = e_.children.len < 2,
+ }, expr.loc),
+ }) catch unreachable;
+ }
args[1] = p.e(E.Object{
.properties = props.toOwnedSlice(),