Repository navigation
perf: stabilize SSR frame namespace shapes - #999
Merged
domgan-oai merged 3 commits intoSep 8, 2026
Merged
domgan-oai merged 3 commits into
domgan-oai merged 3 commits into
Conversation
# Conflicts: # packages/octane/src/runtime.server.ts
domgan-oai
marked this pull request as ready for review
September 8, 2026 19:05
Closed
68 of 84 tasks
14 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frame.namespaceas the last field in all four server frame literals, including canonical roots and discovery replays. Child frames now inherit the namespace within their literal instead of adding a property afterward. This addresses the SSR frame shape item in Track V8 performance audit findings across runtime, SSR, universal core, and compiler output #981.foreignObjectHTML, dynamic host attribute casing, and distinctuseIdvalues; include anoctanepatch changeset.Why
The former root and discovery frames lacked
namespacewhile child frames added it after allocation. V8 assigned different maps to the frames consumed by shared SSR paths and stored the child field in a separate property array. The new literal order is identical across all frame allocations.Validation
pnpm syncand generated-file checks on the initial fork-main base. After merging live upstreammain, the pinned install andpnpm syncare blocked by the configured registry returning 403 for@tsrx/[email protected]; direct version generation, package-inventory check, and context-budget check passed without generated changes.pnpm typecheck, source-scoped typecheck,git diff --check, and scoped formatting passed on the initial fork-main base. Post-merge typecheck and formatting require the missing pinned dependencies; the three-file diff against upstreammainhas no whitespace errors. The live-base current-head CI passed typecheck, lint, and the full test matrix.mainbefore the live-base merge (CONFIGS=waterfall node benchmarks/ssr-throughput/run.mjs 2 --quick): waterfall d1 median baseline 0.040750/0.041125 ms, candidate 0.040583/0.040917; d2 baseline 0.045625/0.045917 ms, candidate 0.045791/0.046042. Response bytes, hydration markers, and pass counts matched. The timing differences are within run noise; no throughput gain is claimed.namespaceoccupied aPropertyArray; candidate stores it in-object. This is mechanism evidence, not a workload speed claim.664b52a00bpassed 26/26 jobs (run 34267069614).Risk / follow-ups
Provenance
agent-authored)Note
Low Risk
Internal SSR frame allocation and typing only; behavior is guarded by a new foreign-content retry regression test with no auth or data-path changes.
Overview
SSR frame objects now always include
namespaceat creation time instead of adding it on child frames after allocation. TheFrametype treatsnamespaceas a required field that may beundefined, and every frame literal (root, child, and discovery replay) seeds it—children inherit viaexplicitNamespace ?? pf.namespacein the literal, replacing the oldframe.namespace = …assignment.This keeps a single V8 object shape across shared SSR paths while parser context (HTML vs SVG vs MathML) should behave the same through renders and suspense retries.
A new SSR test covers suspended retries inside
<svg>and<foreignObject>: SVG keeps kebab-case attributes, HTML keeps camelCase, anduseIdstays distinct per host.Reviewed by Cursor Bugbot for commit 664b52a. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.