Skip to content

Fix Nitro cleanup for React Router and add setup guides#2908

Merged
NathanColosimo merged 4 commits into
mainfrom
nathanc/add-nitro-react-router-docs-and-fix
Jul 14, 2026
Merged

Fix Nitro cleanup for React Router and add setup guides#2908
NathanColosimo merged 4 commits into
mainfrom
nathanc/add-nitro-react-router-docs-and-fix

Conversation

@NathanColosimo

@NathanColosimo NathanColosimo commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix React Router v7 and v8 production builds with Nitro v3, and add setup guides for both versions.

React Router creates a temporary Vite server during vite build. Its Nitro server and Workflow's esbuild contexts remained active, so the build finished but did not exit. This PR cleans up both after their output is written.

Testing

  • React Router 7.18 and 8.1 development and production builds
  • @workflow/nitro build and 32 tests
  • Docs links, code samples, build, and preview smoke tests

Docs Preview

Page Preview
React Router Open
React Router v7 Open
React Router v8 Open

Closes #821

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 14, 2026 3:50am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 14, 2026 3:50am
example-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-astro-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-express-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-fastify-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-hono-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-nitro-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workbench-vite-workflow Ready Ready Preview, Comment Jul 14, 2026 3:50am
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 14, 2026 3:50am
workflow-swc-playground Ready Ready Preview, Comment Jul 14, 2026 3:50am
workflow-tarballs Building Building Preview, Comment Jul 14, 2026 3:50am
workflow-web Ready Ready Preview, Comment Jul 14, 2026 3:50am

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fbb8267

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/nitro Patch
@workflow/nuxt Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

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

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1453 0 230 1683
✅ 💻 Local Development 1617 0 219 1836
✅ 📦 Local Production 1617 0 219 1836
✅ 🐘 Local Postgres 1617 0 219 1836
✅ 🪟 Windows 153 0 0 153
✅ 📋 Other 894 0 177 1071
✅ vercel-multi-region 27 0 0 27
Total 7378 0 1064 8442

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 126 0 27
✅ example 126 0 27
✅ express 126 0 27
✅ fastify 126 0 27
✅ hono 126 0 27
✅ nextjs-turbopack 150 0 3
✅ nextjs-webpack 150 0 3
✅ nitro 126 0 27
✅ nuxt 126 0 27
✅ sveltekit 145 0 8
✅ vite 126 0 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 153 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 128 0 25
✅ e2e-local-dev-tanstack-start- 128 0 25
✅ e2e-local-postgres-nest-stable 128 0 25
✅ e2e-local-postgres-tanstack-start- 128 0 25
✅ e2e-local-prod-nest-stable 128 0 25
✅ e2e-local-prod-tanstack-start- 128 0 25
✅ e2e-vercel-prod-tanstack-start 126 0 27
✅ vercel-multi-region
App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

📋 View full workflow run

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit fbb8267 · Tue, 14 Jul 2026 04:07:33 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1401 (+20%) 1665 🔴 1759 🔴 1882 🔴 30
TTFS hook + stream 1666 (+17%) 1923 🔴 1973 🔴 2048 🔴 30
STSO 1020 steps (1-20) 275 (-2.9%) 310 🔴 360 🔴 431 🔴 19
STSO 1020 steps (101-120) 466 (+4.6%) 453 🔴 569 🔴 1311 🔴 19
STSO 1020 steps (1001-1020) 1091 (+25%) 1144 🔴 1362 🔴 1845 🔴 19
WO stream 1401 (+20%) 1665 1759 1882 30
WO hook + stream 1666 (+17%) 1923 1973 2048 30
SL stream 4629 (-9.3%) 5205 🔴 5718 🔴 5818 🔴 30
SL hook + stream 4921 (-3.2%) 5149 🔴 5742 🔴 5815 🔴 30
📜 Previous results (3)

b2e31a0

Tue, 14 Jul 2026 00:24:00 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1143 (+10.0%) 1624 🔴 1741 🔴 1943 🔴 30
TTFS hook + stream 1606 (+12%) 1972 🔴 2105 🔴 2172 🔴 30
STSO 1020 steps (1-20) 307 (+2.2%) 344 🔴 463 🔴 497 🔴 19
STSO 1020 steps (101-120) 432 (-2.4%) 429 🔴 594 🔴 717 🔴 19
STSO 1020 steps (1001-1020) 845 (-1.1%) 884 🔴 932 🔴 946 🔴 19
WO stream 1143 (+10.0%) 1624 1741 1943 30
WO hook + stream 1606 (+12%) 1972 2105 2172 30
SL stream 4585 (±0%) 5436 🔴 5587 🔴 5796 🔴 30
SL hook + stream 4630 (-6.6%) 5273 🔴 5379 🔴 5522 🔴 30

e506f40

Mon, 13 Jul 2026 23:04:58 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1441 (+1.1%) 1668 🔴 1706 🔴 3011 🔴 30
TTFS hook + stream 1498 (-12%) 1879 🔴 1934 🔴 2104 🔴 30
STSO 1020 steps (1-20) 295 (+12%) 316 🔴 487 🔴 515 🔴 19
STSO 1020 steps (101-120) 465 (+17%) 462 🔴 740 🔴 758 🔴 19
STSO 1020 steps (1001-1020) 1054 (+26%) 1001 🔴 1298 🔴 4108 🔴 19
WO stream 1441 (+1.1%) 1668 1706 3011 30
WO hook + stream 1498 (-12%) 1879 1934 2104 30
SL stream 4859 (-4.8%) 5293 🔴 5784 🔴 5871 🔴 30
SL hook + stream 5056 (+3.5%) 5538 🔴 5629 🔴 5878 🔴 30

02e7587

Mon, 13 Jul 2026 22:34:08 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1154 (-19%) 1633 🔴 1649 🔴 1678 🔴 30
TTFS hook + stream 1533 (-9.5%) 1963 🔴 2022 🔴 2254 🔴 30
STSO 1020 steps (1-20) 278 (+5.3%) 344 🔴 405 🔴 416 🔴 19
STSO 1020 steps (101-120) 391 (-1.5%) 409 🔴 517 🔴 558 🔴 19
STSO 1020 steps (1001-1020) 892 (+6.7%) 970 🔴 1074 🔴 1168 🔴 19
WO stream 1154 (-19%) 1633 1649 1678 30
WO hook + stream 1533 (-9.5%) 1963 2022 2254 30
SL stream 4193 (-18%) 5603 🔴 5756 🔴 5890 🔴 30
SL hook + stream 4702 (-3.8%) 5582 🔴 5704 🔴 5759 🔴 30

Avg deltas compare against the most recent benchmark run on main at the time of this run.

Metrics — TTFS: time to first step body execution · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (time outside step bodies, client start → last step body exit) · SL: stream latency (first chunk write → visible to the reader)

Scenarios — stream: one step that streams chunks back to the client; no hooks, so the run stays in turbo mode · hook + stream: registers a hook before the same streaming step, which exits turbo mode · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges

🟢/🔴 mark percentiles within/above target. Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · STSO (1-20) 20/30/60 · STSO (101-120) 30/45/90 · STSO (1001-1020) 40/60/120

TTFS/WO compare client vs deployment clocks and SL compares the step runner’s clock vs the client’s (NTP-synced in CI). WO ends at the last step body exit, the closest observable proxy for the final step-completion request.

@NathanColosimo
NathanColosimo merged commit 3589958 into main Jul 14, 2026
172 of 174 checks passed
@NathanColosimo
NathanColosimo deleted the nathanc/add-nitro-react-router-docs-and-fix branch July 14, 2026 20:34
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2923. Merge conflicts were resolved by AI — please review carefully. (backport job run)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doesn't work in a react-router v7 project

2 participants