0
Fork 0
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
  • TypeScript 98.2%
  • JavaScript 1.2%
  • CSS 0.4%
  • Vue 0.1%
  • HTML 0.1%
Find a file
Sheraff 5e88a91c81
refactor(compiler): stage computePlacement
`computePlacement` was one 2,075-line closure whose phases shared ~100
locals; the fixed point called helpers declared 300-500 lines below it and
invalidated lazy memos by hand. It is now the composition of seven stages
in `placement/`, each a function of the data the previous ones produced:

- clusters.ts: union-find, the write table, ordered evaluation, the
  materialised clusters, the one mutation predicate (`mutatedOutside`) and
  the readers of mutable state (computed with the `ordered-effect`
  fallbacks in one pass over the eager reads, instead of a lazy memo)
- reads.ts: memoised reads and successors per output, `reach`
- roots.ts: the roots planners and the module declare, extraction
  candidates, provenance
- settle.ts: the env-roots / movable / extraction fixed point, helpers
  above the loop; the dev fold of extracted exports
- kept.ts: the kept declarations and their causes
- homes.ts: homes, the single-writer rule, env-declared roots
- inclusion.ts: inclusion, imports and exports

The union-find no longer leaves stage 1: a claimed region is in its
owner's cluster, so a writer's cluster is `clusterOfRegion` and every rule
compares cluster ids. The generated reads `importStays` asks about are
collected only in route modules, when asked.

No behaviour change: identical outputs, maps, edges and diagnostics over
the compiler-perf apps (14,216 outputs) and 5,000 fuzz-generated modules
(353,990 outputs). Micro-bench: -1.7 to -3.2 % per module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
History 2026-10-29 20:55:53 +01:00
.agents/skills
.changeset
.devcontainer
.github
.nx
_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 Router

TanStack Router

A modern router designed for type safety, data‑driven navigation, and seamless developer experience.

  • End‑to-end type safety (routes, params, loaders)
  • Schema‑driven search params with validation
  • Built‑in caching, prefetching & invalidation
  • Nested layouts, transitions & error boundaries

Read the Router Docs →

TanStack Start

TanStack Start

A full‑stack framework built on Router, designed for server rendering, streaming, and production‑ready deployments.

  • Full‑document SSR & streaming
  • Server functions & end‑to‑end type safety
  • Deployment‑ready bundling & builds
  • All the power of TanStack Router, plus full‑stack features

Read the Start Docs →


npm downloads GitHub stars Bundle size

semantic-release Best of JS Follow @TanStack

Get Involved

Partners

CodeRabbit Cloudflare Netlify
Neon Clerk Convex
Sentry Prisma Strapi
Router & you?

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 CHAT

Explore the TanStack Ecosystem

… and more at TanStack.com »