Repository navigation
fix: preserve render ownership for JSX values - #355
Merged
trueadm merged 4 commits intoJul 28, 2026
Merged
Conversation
|
@domgan-oai is attempting to deploy a commit to the Ripple Team Team on Vercel. A member of the Team first needs to authorize it. |
10 tasks done
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
octanepatch changeset.Root cause
Value-position JSX was lowered into eager
createElement(..., children)arguments. Calls in a represented host child therefore ran while constructing the enclosing descriptor, before its provider or wrapper boundary had entered its scope. Direct templates and statically lowered built-in ErrorBoundary did not have this problem because their child expressions ran inside a scoped render body. Scope-sensitive value expressions now retain their surrounding element shape and execute through one compiler-only component after their actual render scope is established.Validation
Passed locally:
node --check packages/octane/src/compiler/compile.js.node --experimental-strip-types --checkfor the client runtime, server runtime, both runtime entry points, and the new regression suite.node scripts/check-changesets.js.node scripts/check-test-markers.mjs.node scripts/check-tsrx-module-decls.mjs.git diff --cached --check.G.The exact frozen install cannot complete locally because the configured protected registry rejects the locked
@tsrx/[email protected]tarball with HTTP 403. The locked parser and registry credentials have not been changed or bypassed. The completepnpm format:check,pnpm typecheck, development/production Vitest suites, frozen-AST/source-origin checks, and browser/integration checks therefore need the upstream GitHub Actions environment.Performance and compatibility
Ordinary literal and identifier JSX children keep their current descriptor fast path and allocate no additional component or thunk. Only expressions capable of reading context, throwing, or suspending enter the scoped path. The protected-parser restriction prevents a trustworthy local benchmark, so this change does not claim a measured performance improvement.
Closes #353
Note
Medium Risk
Touches JSX lowering and the compiler/runtime ABI on paths that affect context, errors, and Suspense; behavior change is intentional but limited to expressions that can read context, throw, or suspend.
Overview
Fixes incorrect render timing when JSX subtrees live in variables, props, arrays, or other nested value positions: effectful child expressions (context via
use, throws,await/Suspense) were running while buildingcreateElementarguments, before the represented Provider, ErrorBoundary, or Suspense was active.The compiler now detects scope-sensitive JSX child expressions (
jsxChildNeedsRenderScope) and lowers them to arenderScopedValuedescriptor that evaluates a deferredreadthunk only after the owning boundary is entered. Plain literals/identifiers and function-valued children keep the existing fast path.Client and server runtimes gain matching
renderScopedValuehelpers (exported on the compiler ABI), and new TSRX/TSX tests cover context, error boundaries, Suspense, hydration, and ordinary element inspection/cloning.Reviewed by Cursor Bugbot for commit e22956b. Bugbot is set up for automated code reviews on this repo. Configure here.