Repository navigation
fix(octane): give a server descriptor list item with a portal child its item range - #2081
Merged
Merged
Conversation
…ts item range (#2028) serverDescNeedsBlocks did not count a portal as needing a block, while the client's descNeedsBlocks does. A host item whose child is a portal was then serialized through the plain descriptor path, which rejects a portal, instead of the block path whose range hydration expects. A portal now needs a block on the server as on the client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 15, 2026 12:15
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | a077920 | Commit Preview URL Branch Preview URL |
Oct 15 2026, 12:18 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | a077920 | Commit Preview URL Branch Preview URL |
Oct 15 2026, 12:17 PM |
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
Why
serverDescNeedsBlocksinruntime.server.tsdid not treatPORTAL_TAGas needing a block, while the client'sdescNeedsBlocksdoes. A<li>{createPortal(...)}</li>item in a descriptor list was routed through the plain descriptor path, which rejects a portal (Objects are not valid as an Octane child), instead of the block path that emits the range hydration reads.Changes
serverDescNeedsBlocksreturns true for a portal descriptor, matching the client predicate.descriptor-list-hydrate.test.ts: newPortalDescriptorRowsfixture and test. It server-renders host items whose only child is a portal, hydrates them, asserts no recoverable error, row identity, portaled content in the target, and a keyed reorder. It failed before the fix (server render threw) in both theoctaneandoctane-prodprojects.hydration-descriptor-list-itemschangeset now says "no component or portal inside it".The other #2044 Bugbot thread (4269852570, "Switch arms lose binding-view ranges") needs no code change.
dom-binding-program.js'sannotatesets_octaneBindingSiteonly on non-native elements,@if/IfStatement(including JSX ternaries viaconditionalJsxStatement),@forand@try. It never sets it onSwitchStatementorJSXSwitchExpression, andssrEmitSwitchreads no binding site, so a@switchis never a binding view.Validation
pnpm format:files:check(changed files)pnpm typecheck:files(changed files)pnpm test: not run in full locally; CI runs itdescriptor-list-hydrate.test.ts(34 passed),packages/octane/tests/{hydration,server,ssr}(17,882 passed),packages/octane/tests/conformance(5,562 passed),packages/octane/tests/*portal*(178 passed)perf-review:node scripts/perf-review-scan.mjs --base origin/nextreports no candidates. The change adds one property compare at the end of a server-only predicate, on the path a descriptor already falls through.concise-code: one-line predicate change that mirrors the client. I rejected handling a portal inssrDeoptItemContentinstead, because it would split the routing decision from the predicate thatselfDelimitsreads.Risk / follow-ups
Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Touches SSR/hydration routing for descriptor lists; scope is narrow (one predicate) but mismatches here cause client recovery or render failures.
Overview
Server descriptor-list serialization now treats portal children like the client hydration path, so a host list item whose only child is
createPortal(...)gets the comment item range the client expects instead of the plain descriptor path (which could fail or mismatch).serverDescNeedsBlocksinruntime.server.tsnow returns true forPORTAL_TAG, mirroring clientdescNeedsBlocks. The hydration changeset text is updated to say self-delimiting items exclude portals as well as components. A newPortalDescriptorRowshydration test covers SSR, hydrate without recoverable errors, portaled content, and keyed reorder.Reviewed by Cursor Bugbot for commit a077920. Bugbot is set up for automated code reviews on this repo. Configure here.