Repository navigation
fix(react-start-rsc): handle shared and cyclic slot preview arguments - #8274
LadyBluenotes wants to merge 7 commits into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Sanitizer reference caching packages/react-start-rsc/src/slotUsageSanitizer.ts, packages/react-start-rsc/tests/slotUsageSanitizer.test.tsx, .changeset/calm-crabs-turn.md |
sanitizeSlotArg uses a WeakMap to reuse cloned containers and prevent unbounded recursion. Tests cover shared values, cycles, sparse arrays, non-plain values, input immutability, and per-call isolation. |
End-to-end slot reference coverage e2e/react-start/rsc/src/routes/rsc-slot-jsx-args.tsx, e2e/react-start/rsc/tests/rsc-slot-jsx-args.spec.ts |
The RSC route passes CampaignMeta with shared nested references and a self-reference. The client renders the preservation result, and the test verifies the output text. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Sequence Diagram(s)
sequenceDiagram
participant RSCServerRoute
participant sanitizeSlotArgs
participant RSCClientSlot
RSCServerRoute->>sanitizeSlotArgs: pass CampaignMeta with shared references and a self-cycle
sanitizeSlotArgs->>sanitizeSlotArgs: cache cloned containers before recursion
sanitizeSlotArgs-->>RSCClientSlot: return metadata with preserved references and cycle
RSCClientSlot-->>RSCClientSlot: render reference-preservation result
Merge Risk: 
Minimal · up to e0352
-
Slot previews now preserve shared and cyclic argument references without mutating inputs, with coverage for sanitizer behavior and server-to-client rendering. No current merge-blocking risk is identified.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
-
❌ Failed checks (1 warning)
Check name Status Explanation Resolution Docstring Coverage ⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (4 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: handling shared and cyclic slot preview arguments in React Start RSC. Description check ✅ Passed The description explains the change, motivation, release impact, and changeset. It omits the required checklist item confirming local testing or explaining why tests do not apply, but the description … Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
-
- Create PR with unit tests
- Commit unit tests in branch
fix/rsc-slot-preview-graphs
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
View your CI Pipeline Execution ↗ for commit 7d9f399
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 1 bumped as dependents. 🟩 Patch bumps
|
Bundle Size BenchmarksThis pull request does not affect bundle size in any measured scenario. |
More templates
@tanstack/arktype-adapter
@tanstack/eslint-plugin-router
@tanstack/eslint-plugin-start
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-rsc
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-router-ssr-query
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-fn-stubs
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/vue-router
@tanstack/vue-router-devtools
@tanstack/vue-router-ssr-query
@tanstack/vue-start
@tanstack/vue-start-client
@tanstack/vue-start-server
@tanstack/zod-adapter
commit: |
Merging this PR will improve performance by 3.5%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
🦋 Changeset detectedLatest commit: 7d9f399 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🎯 Changes
Development RSC slot previews recursively cloned every occurrence of a shared object and overflowed the stack on cyclic arguments. Memoize sanitized objects and arrays per slot call so shared references reuse one clone and cycles terminate, while retaining React-element placeholders and leaving the input untouched.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
null, andundefined, without modifying the original data.