docs(Start): Revise migration guide for TanStack Start #5211
main fromrefs/pull/5211/head·merged by schiller-manuel(GitHub profile, opens in a new tab) Update installation instructions and routing configurations for TanStack Start.
Summary by CodeRabbit#
- Documentation
- Updated React migration guide from Next.js with current routing conventions and defaults.
- Adjusted installation guidance to reflect updated tooling and plugin placement.
- Clarified new project layout defaults (explicit src directory and routes location).
- Renamed and simplified example entry file and setup steps.
- Refreshed examples to use the new routing, link and server-function patterns for parity with Next.js App Router.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation
chribjel(GitHub profile, opens in a new tab) changed the title
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/start/framework/react/migrate-from-next-js.md (2)
118-118: Use internal relative docs links per repo guidelines.Replace absolute site links with paths relative to docs/.
-... [Routing Concepts](/router/latest/docs/framework/react/routing/routing-concepts) ... +... [Routing Concepts](../../../router/framework/react/routing/routing-concepts) ...-... [preloading functionality](/router/latest/docs/framework/react/guide/preloading) ... -... [caching staleness](/router/latest/docs/framework/react/guide/data-loading) ... +... [preloading functionality](../../../router/framework/react/guide/preloading) ... +... [caching staleness](../../../router/framework/react/guide/data-loading) ...-Learn more about the [Routing Concepts](/router/latest/docs/framework/react/routing/routing-concepts). +Learn more about the [Routing Concepts](../../../router/framework/react/routing/routing-concepts).-... [Dynamic and Catch-All Routes](/router/latest/docs/framework/react/routing/routing-concepts#dynamic-route-segments). +... [Dynamic and Catch-All Routes](../../../router/framework/react/routing/routing-concepts#dynamic-route-segments).-Learn more about the [Links](/router/latest/docs/framework/react/guide/navigation#link-component). +Learn more about the [Links](../../../router/framework/react/guide/navigation#link-component).Also applies to: 233-234, 264-264, 291-291, 305-305
270-285: Fix incorrect route path in dynamic route example.The path passed to createFileRoute should not include the
appfolder prefix. It should be the actual URL path.-export const Route = createFileRoute('/app/posts/$slug')({ +export const Route = createFileRoute('/posts/$slug')({ component: Page, })📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 06839407b9246f406615ba529c35b8fed8e753c1 and 66980e145fdf86b8954982caa45fc889032be110.
📒 Files selected for processing (1)
docs/start/framework/react/migrate-from-next-js.md(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)
Files:
docs/start/framework/react/migrate-from-next-js.md
docs/{router,start}/**
📄 CodeRabbit inference engine (AGENTS.md)
Place router docs under docs/router/ and start framework docs under docs/start/
Files:
docs/start/framework/react/migrate-from-next-js.md
🔇 Additional comments (3)
docs/start/framework/react/migrate-from-next-js.md (3)
114-114: LGTM: Clear note on routesDirectory default.Good clarification about the default and opting into
appfor Next.js parity.
217-231: LGTM: Introducing src/router.tsx is consistent with Start’s router setup.
103-111: Plugin order is correct — tanstackStart before @vitejs/plugin-reactTanStack docs recommend placing tanstackStart(...) before viteReact(); the snippet already follows that. Optionally set tanstackStart({ customViteReactPlugin: true }) to let it manage the React plugin integration.
@@ -55,5 +55,5 @@5555 TanStack Start leverages [Vite](https://vite.dev) and TanStack Router:56565757 ```sh58-npm i @tanstack/react-router @tanstack/react-start vite58+npm i @tanstack/react-router @tanstack/react-start vite @vitejs/plugin-react5959 ```🛠️ Refactor suggestion
Move Vite and plugin to devDependencies.
Build tooling should be dev-only. Keep runtime libs in deps; move Vite and @vitejs/plugin-react to -D.
-npm i @tanstack/react-router @tanstack/react-start vite @vitejs/plugin-react +npm i @tanstack/react-router @tanstack/react-start +npm i -D vite @vitejs/plugin-react📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
npm i @tanstack/react-router @tanstack/react-start npm i -D vite @vitejs/plugin-react🤖 Prompt for AI Agents
In docs/start/framework/react/migrate-from-next-js.md around lines 58 to 59, the install command currently installs Vite and @vitejs/plugin-react as regular dependencies; update the guidance to install runtime libraries as normal deps but move build tooling to devDependencies by changing the command so that vite and @vitejs/plugin-react are installed with the -D (or --save-dev) flag while keeping @tanstack/react-router and @tanstack/react-start as runtime dependencies.✅ Addressed in commit ec66fd3
yep thats better
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
schiller-manuel(GitHub profile, opens in a new tab)replied on
docs/start/framework/react/migrate-from-next-js.mdlines 58 to 59yep thats better
coderabbitai[bot](GitHub profile, opens in a new tab)replied on
docs/start/framework/react/migrate-from-next-js.mdlines 58 to 59Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
Sign in to join this conversation.
Walkthrough#
Documentation for migrating from Next.js to React with TanStack Start was updated: install lines and tooling moved Vite-related packages into Tailwind/JS tooling, added tanstackStart
srcDirectoryand changedroutesDirectorydefault toroutes(examples useapp), renamedsrc/start.tsx→src/router.tsx, and updated code examples to new public APIs (createFileRoute,Route.useParams(),Link to,createServerFn, server/handlers).Changes#
docs/start/framework/react/migrate-from-next-js.mdsrcDirectoryoption (default'src') and changedroutesDirectorydefault to'routes'(examples recommend'app'for Next parity). Updated examples: renamesrc/start.tsx→src/router.tsx; switch tocreateFileRoutefor route definitions; replaceparamsusage withRoute.useParams(); changeLink href→Link to; introducecreateServerFnand updated server route/handler patterns and imports.Sequence Diagram(s)#
Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem#
Pre-merge checks and finishing touches#
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 66980e145fdf86b8954982caa45fc889032be110 and ec66fd3e9cf3bc2a0386d7bec4710124ffb24cba.
📒 Files selected for processing (1)
docs/start/framework/react/migrate-from-next-js.md(3 hunks)🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/start/framework/react/migrate-from-next-js.mddocs/{router,start}/**
📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/start/framework/react/migrate-from-next-js.md🔇 Additional comments (14)
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.
❤️ Share