Repository navigation
fix(octane): scope JSX values and prevent deep SSR stack overflows - #361
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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 9a5c0e2. Configure here.
|
One remaining concern: root const value = (
<Outer foo={readA()}>
<Inner bar={readB()} />
</Outer>
);Here Would it be cleaner to defer the complete compiler-authored element record instead? For users who never inspect element objects, which is the normal and encouraged usage, JSX values would then have one simple semantic: the whole tree evaluates where it is rendered, with no root-versus-descendant exception. The less common |
|
@GabbeV Agreed—the root/descendant split was the wrong semantic boundary. This is addressed in 4892d3f: dynamic root component types, root props/getters/spreads, and descendant construction now resolve together in the element’s represented render scope. The less common descriptor-inspection paths ( I also added mirrored TSX/TSRX development/production coverage for direct-return SSR, hydration, root attributes/spreads/component props/tags, provider updates, shared descriptors, ErrorBoundary, and Suspense: 604 focused cases pass, as does the complete 10,346-test suite. The fixed 16-file production-codegen corpus remains byte-for-byte unchanged. |
Compiler-authored JSX values defer their non-literal props and children to the represented render scope (#361). The divergence doc framed this around providers and boundaries, but it also covers host-only markup, so a value that exists only while the building call runs is gone at render time. A Lexical DecoratorNode whose decorate() returns <span>{this.getLabel()}</span> throws in $getState because the label is read after Lexical's editor state is no longer active. Document the consequence with the Lexical example and the fixes: read the value into a local, use createElement, or read from a component. Pin all three forms in scoped-jsx-values for TSRX and TSX on client and server. Co-authored-by: Claude Opus 5.5 <[email protected]>

Summary
isValidElement,Children.only,cloneElement, and directtype/props/childreninspection resolve the record in the inspecting caller's current scope.createElement, fragment/indexed-child compatibility, native event/render-prop semantics, hydration identity, and existing client/server descriptor topology.Why
Deferring only descendants left root member tags, getter-backed attributes, component props, and spreads evaluating before their represented Provider, Suspense boundary, or ErrorBoundary. The server's direct
.tsxreturn path also exposed this mismatch as incorrect SSR markup and hydration disagreement. A lazy but normally inspectable complete descriptor resolves all of those cases uniformly without introducing additional component boundaries or hydration markers.Changes
createScopedValuehelpers for dynamic root records, retainingcreateScopedElementchild deferral and leaving statically provable JSX on its existing fast path.Validation
createScopedValueexports.Risk / follow-ups
createElement, and ordinary callbacks retain JavaScript evaluation timing.Follow-up to #353 and #355; addresses #353 (comment) and the latest review on #361.