Skip to content

fix react server exports for start and react-router#7183

Merged
schiller-manuel merged 2 commits intomainfrom
fix-rsc-export-notfound
Apr 13, 2026
Merged

fix react server exports for start and react-router#7183
schiller-manuel merged 2 commits intomainfrom
fix-rsc-export-notfound

Conversation

@schiller-manuel
Copy link
Copy Markdown
Contributor

@schiller-manuel schiller-manuel commented Apr 13, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added React Server Component support with a new react-server export condition for proper handling of notFound() and redirect() in server functions.
    • Added example routes demonstrating server-side notFound() and redirect() behavior with support for both SSR and client-side navigation.
  • Tests

    • Added E2E tests validating server function notFound() and redirect() behavior across SSR and client-side navigation scenarios.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1dc6fc08-f185-4105-8095-d252a67342c6

📥 Commits

Reviewing files that changed from the base of the PR and between f1a4973 and 9f000db.

📒 Files selected for processing (11)
  • .changeset/neat-melons-worry.md
  • e2e/react-start/rsc/src/routeTree.gen.ts
  • e2e/react-start/rsc/src/routes/__root.tsx
  • e2e/react-start/rsc/src/routes/index.tsx
  • e2e/react-start/rsc/src/routes/rsc-server-not-found.tsx
  • e2e/react-start/rsc/src/routes/rsc-server-redirect.tsx
  • e2e/react-start/rsc/tests/rsc-server-not-found.spec.ts
  • e2e/react-start/rsc/tests/rsc-server-redirect.spec.ts
  • packages/react-router/package.json
  • packages/react-router/src/index.rsc.ts
  • packages/react-router/vite.config.ts

📝 Walkthrough

Walkthrough

React Server Component support is introduced to @tanstack/react-router via a new react-server root export that re-exports core functions from @tanstack/router-core. Two new test routes and corresponding e2e specs validate that server functions invoking notFound() or redirect() behave correctly across SSR and client navigation scenarios.

Changes

Cohort / File(s) Summary
Changeset Metadata
.changeset/neat-melons-worry.md
Patch release changeset documenting the addition of react-server root export for RSC support.
Package Configuration
packages/react-router/package.json, packages/react-router/vite.config.ts
Added react-server export condition pointing to new RSC entry files; extended Vite build entry list to include index.rsc.ts.
RSC Source Entrypoint
packages/react-router/src/index.rsc.ts
New RSC-safe module re-exporting all standard exports plus explicit re-exports of notFound, redirect, and related utilities from core package.
E2E Route Tree & Navigation
e2e/react-start/rsc/src/routeTree.gen.ts, e2e/react-start/rsc/src/routes/__root.tsx, e2e/react-start/rsc/src/routes/index.tsx
Generated route tree updated with two new routes; navigation links and example list entries added for /rsc-server-not-found and /rsc-server-redirect.
E2E Test Routes
e2e/react-start/rsc/src/routes/rsc-server-not-found.tsx, e2e/react-start/rsc/src/routes/rsc-server-redirect.tsx
New routes demonstrating server functions invoking notFound() and redirect() respectively, with dedicated boundary/component rendering.
E2E Test Specs
e2e/react-start/rsc/tests/rsc-server-not-found.spec.ts, e2e/react-start/rsc/tests/rsc-server-redirect.spec.ts
Playwright e2e test suites validating notFound and redirect behavior during both SSR and client-side navigation scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A server route speaks with a voice so clear,
When notFound() whispers, boundaries appear!
And redirect() dances, swift as a hare,
RSC flows now everywhere! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding React Server Component exports for the react-router package.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 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-export-notfound

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Apr 13, 2026

View your CI Pipeline Execution ↗ for commit 7740e34

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 13m 4s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-13 22:59:49 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

🚀 Changeset Version Preview

1 package(s) bumped directly, 4 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.168.19 → 1.168.20 Changeset
@tanstack/react-start 1.167.37 → 1.167.38 Dependent
@tanstack/react-start-client 1.166.36 → 1.166.37 Dependent
@tanstack/react-start-rsc 0.0.16 → 0.0.17 Dependent
@tanstack/react-start-server 1.166.37 → 1.166.38 Dependent

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Bundle Size Benchmarks

  • Commit: f1a4973d41dc
  • Measured at: 2026-04-13T22:47:35.611Z
  • Baseline source: history:7324b98d114b
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.33 KiB 0 B (0.00%) 274.58 KiB 75.97 KiB █▇▇▇▇▇▁▁▁▁▁
react-router.full 90.59 KiB 0 B (0.00%) 285.66 KiB 78.72 KiB ██████▁▁▁▁▁
solid-router.minimal 35.50 KiB 0 B (0.00%) 106.58 KiB 31.88 KiB █▇▇▇▇▇▁▁▁▁▁
solid-router.full 39.98 KiB 0 B (0.00%) 120.08 KiB 35.93 KiB ██████▁▁▁▁▁
vue-router.minimal 53.30 KiB 0 B (0.00%) 151.99 KiB 47.86 KiB ██████▁▁▁▁▁
vue-router.full 58.19 KiB 0 B (0.00%) 167.41 KiB 52.09 KiB ██████▁▁▁▁▁
react-start.minimal 101.73 KiB 0 B (0.00%) 322.31 KiB 87.94 KiB ██████▁▁▁▁▁
react-start.full 105.17 KiB 0 B (0.00%) 332.64 KiB 90.84 KiB █▇▇▇▇▇▁▁▁▁▁
solid-start.minimal 49.50 KiB 0 B (0.00%) 152.39 KiB 43.63 KiB ██████▁▁▁▁▁
solid-start.full 55.03 KiB 0 B (0.00%) 168.60 KiB 48.41 KiB ██████▁▁▁▁▁

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7183

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7183

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7183

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7183

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7183

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7183

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7183

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7183

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7183

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7183

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7183

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7183

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7183

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7183

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7183

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7183

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7183

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7183

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7183

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7183

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7183

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7183

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7183

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7183

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7183

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7183

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7183

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7183

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7183

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7183

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7183

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7183

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7183

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7183

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7183

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7183

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7183

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7183

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7183

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7183

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7183

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7183

commit: 7740e34

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 13, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing fix-rsc-export-notfound (7740e34) with main (7324b98)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (f1a4973) during the generation of this report, so 7324b98 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

nx-cloud[bot]

This comment was marked as outdated.

@schiller-manuel schiller-manuel merged commit c5ad329 into main Apr 13, 2026
15 of 16 checks passed
@schiller-manuel schiller-manuel deleted the fix-rsc-export-notfound branch April 13, 2026 22:48
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant