Repository navigation
perf: skip SSR transition arm scans without candidates - #1000
Merged
domgan-oai merged 2 commits intoSep 8, 2026
Merged
Conversation
Closed
68 of 84 tasks
domgan-oai
marked this pull request as ready for review
September 8, 2026 19:43
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
vtSsrClaimArmHTML scan when the active SSR pass has rendered no ViewTransition candidate. This addresses the no-ViewTransition Suspense arm item in Track V8 performance audit findings across runtime, SSR, universal core, and compiler output #981.@trycontent, fallback, and revealed markup; include anoctanepatch changeset.Why
Every ordinary Suspense/
@trycontent or fallback arm currently searches its rendered HTML for a candidate attribute even on pages with no ViewTransition. On nested boundaries this repeatedly flattens the same cons-string subtree. The existing pass flag is set by ViewTransition before an arm is claimed, and is saved/restored for retries and nested renders, so a false value rules out renderer-generated candidates.The first PR head exposed a release timing failure in the required Three compatibility job:
[email protected]was published before matching@types/three, so the previous@types/[email protected]install could not resolve. The adjusted lane retains typechecking against a matching pair and exercises the newest runtime independently.Validation
mainbaseline and this branch in development and production: ordinary content/fallback output and a real ViewTransitionvt-enterclaim behaved as expected. A source-only streaming shell and decoded reveal segment matched on both heads. Mutants that drop no-candidate arm HTML or skip actual candidates each turned the corresponding behavioral assertion red; the restored implementation passed.ssrTryboundaries around 1,000 spans, 3,000 warmups and five 10,000-render rounds per sample, chargingBuffer.byteLengthfor response flattening. Median per render baseline 0.02102 / 0.02063 ms, candidate 0.00512 / 0.00515 ms. Both builds emitted exactly 35,416 bytes, 24 opening markers and the same SHA-256. This isolates the arm-scan cost; it is not a claim about typical application throughput.git diff --check, direct version generation, package inventory, and context-budget checks passed. The changed TS/Markdown files passed scoped Prettier formatting with the repository's base settings and without its unavailable plugins.pnpm sync, Vitest, and typecheck: the configured local registry returned 403 for pinned@tsrx/[email protected]and could not supply@tsrx/[email protected]offline. The current-head CI will run these checks.91e48e7e6b37840bf663061b619230f22a97e583: all 26 jobs passed, including the repaired Three compatibility lane, all Node and React parity shards, typecheck, lint, browser integration, and CI provenance. Cursor Bugbot passed with no review comments.Risk / follow-ups
vt-*-xattributes are internal staging names; on a no-ViewTransition buffered arm this change leaves them untouched rather than claiming them, while other emission paths may still strip them.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Conservative guard on an internal SSR optimization path; ViewTransition claiming is unchanged when candidates exist, with new regression coverage for ordinary Suspense output.
Overview
SSR no longer scans every Suspense
@tryarm HTML for ViewTransition markers when the render pass never emitted any.vtSsrClaimArmnow returns the arm HTML unchanged whenVT_SSR_HAS_CANDIDATESis false, avoiding repeated tag parsing on nested boundaries on pages withoutViewTransition. Behavior when transitions are present is unchanged because the flag is still set during annotation/claim.A new Vitest case covers ordinary buffered and streamed Suspense content, fallback, and post-reveal markup so non–ViewTransition arms stay intact. An
octanepatch changeset documents the fix.Reviewed by Cursor Bugbot for commit 726e42b. Bugbot is set up for automated code reviews on this repo. Configure here.