mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
🤖 A client-first, server-capable, fully type-safe router and full-stack framework for the web (React and more).
https://tanstack.com/router
framework
fullstack
javascript
react
route
router
routing
rpc
search
searchparams
server-functions
ssr
state-management
typesafe
typescript
url
- TypeScript 98.2%
- JavaScript 1.2%
- CSS 0.4%
- Vue 0.1%
- HTML 0.1%
User ruling 2026-10-18 (test infrastructure must not re-implement other
tools or packages). The build harness no longer writes a hand-written
`@tanstack/react-start` into the app: `node_modules/@tanstack/react-start`
links the built workspace package (`startRuntimeLinks`), and its
dependencies (start-client-core, start-server-core, start-storage-context,
router-core, ...) resolve from its real path. The `test:unit` target now
depends on `@tanstack/react-start:build` (task-level dependsOn, no project
dependency, so no cycle). The Vite and Rsbuild dev harnesses link it too.
Stand-ins kept, only where the test process cannot run the real piece,
each checked against the real runtime:
- request context: SSR scripts and in-process server calls run in a
`StartStorageContext` (typed against the real one) of a request to `/`
(`inRequestContext`, `runInRequestContext`); contract test
build-harness.test.ts "SSR scripts run in a request context that Start's
runtime reads".
- the network: a client call's requests are observed through the call's
public `fetch` option (`requestsOf`); contract test "a server fn is
Start's RPC on the client ...".
- the server-fn HTTP handler: by-id calls resolve, call with
`{ data, method }` and unwrap `{ result }`/`{ error }` like
`handleServerAction` (`callByIdPrelude`, `callServerFnById`).
- Vite dev client evaluation loads start-client-core through Node
(`servedStartRuntime`): the root entry imports React (CommonJS), which only
Vite's dependency optimizer (off in the harness) serves to a browser.
- Rsbuild compiler-only dev server defines `TSS_SERVER_FN_BASE` like
Start's plugin; its VM gets the WinterTC web APIs a browser has.
- hydrate-build keeps its own `@tanstack/react-start` (Hydrate rendered by
a string JSX runtime); new contract test: its names are the real
package's.
Harness realism: Vite builds run in the app's directory, as `vite build`
does (Start's plugin crawls the working directory's package.json for Start
libraries to bundle in SSR); the build harness records Rsbuild's
`output.module` for the dangling-name check.
Status changes, each investigated:
- Tests that relied on the fake (`functionId`, client RPCs throwing
"client RPC <id>", `getServerFnById(id)({})` returning the bare result,
middleware `.server()` stubs, uncompiled `handler(rpc)` returning `rpc`):
rewritten to Start's real API (`serverFnMeta.id`, `url`, requests the call
sends, `{ result }` unwrapping). The library-server-fn tests passed
vacuously on Vite: the library stayed external and uncompiled in SSR,
and the stand-in's uncompiled `handler(fn)` returned `fn`. The apps now
depend on their library, as installed ones.
- Route-tree type test: the `@tanstack/react-start` d.ts stand-in is
replaced by the real package's types.
- Pins re-verified red for the same reason (with `.fails` removed, failure
messages compared to baseline
|
History
|
|
|---|---|---|
| .agents/skills | ||
| .changeset | ||
| .devcontainer | ||
| .github | ||
| .nx/workflows | ||
| _artifacts | ||
| benchmarks | ||
| docs | ||
| e2e | ||
| examples | ||
| gpt | ||
| media | ||
| packages | ||
| scripts | ||
| skills/bundle-size-optimization | ||
| .coderabbit.yaml | ||
| .gitattributes | ||
| .gitignore | ||
| .npmrc | ||
| .nvmrc | ||
| .prettierignore | ||
| AGENTS.md | ||
| CONTRIBUTING.md | ||
| DEBUGGING.md | ||
| eslint.config.js | ||
| how-to-guides-implementation-plan.md | ||
| how-to-testing-plan.md | ||
| knip.json | ||
| labeler-config.yml | ||
| LICENSE | ||
| nx.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| prettier.config.js | ||
| README.md | ||
| top-10-how-to-guides.md | ||
| tsconfig.json | ||
TanStack RouterA modern router designed for type safety, data‑driven navigation, and seamless developer experience.
Read the Router Docs → |
TanStack StartA full‑stack framework built on Router, designed for server rendering, streaming, and production‑ready deployments.
Read the Start Docs → |
Get Involved
- We welcome issues and pull requests!
- Participate in GitHub discussions
- Chat with the community on Discord
- See CONTRIBUTING.md for setup instructions
Partners
|
|
|
|
|
|
|
|
|
|
|
|
We're looking for TanStack Router & Start Partners to join our mission! Partner with us to push the boundaries of TanStack Router & Start and build amazing things together.
LET'S CHATExplore the TanStack Ecosystem
- TanStack Config – Tooling for JS/TS packages
- TanStack DB – Reactive sync client store
- TanStack DevTools – Unified devtools panel
- TanStack Form – Type‑safe form state
- TanStack Pacer – Debouncing, throttling, batching
- TanStack Query – Async state & caching
- TanStack Ranger – Range & slider primitives
- TanStack Store – Reactive data store
- TanStack Table – Headless datagrids
- TanStack Virtual – Virtualized rendering
… and more at TanStack.com »