0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
Commit graph

6,743 commits

Author SHA1 Message Date
Manuel Schiller
8665a8edfa test(e2e): fail the installed run when a Start package is still linked
`run-as-installed.mjs` now checks, before it runs the command, that every
`@tanstack/*` dependency of the project resolves to a package inside the
`pnpm deploy` copy. If a change to pnpm's settings or to `deploy` left a
link into `packages/*`, the run would test the linked workspace again and
still pass. `run-as-installed.md` says how the run is part of CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:45:56 +01:00
Manuel Schiller
e2340871e8 fix(start): pre-bundle Router Core's browser deps in test runs, wait for the callback in runInRequest
- A browser test run found `cookie-es`, `seroval` and
  `seroval-plugins/web` only when a test imported them, because Start's
  packages are not pre-bundled and Vite's start-up scan does not look
  into them. Vite then pre-bundled them and reloaded the page, and in CI
  a test iframe did not start ("did not become ready within 60000ms").
  The test-run plan now includes them by a path from the Start package.
- `runInRequest` resolved before the callback had finished when a
  request middleware did not wait for `next()`, and reported that the
  middleware had ended the request. It now keeps the callback's promise
  and always waits for it. That replaces two flags.
- The generator test compared route file paths built with `path.join`,
  which fails on Windows: the generator names them with forward slashes.
- Simpler: the mock registries register their maps with the setup file
  instead of a snapshot function each, the client function of a
  middleware is wrapped only when it has one, and the scope no longer
  carries a handler type that was always `router`.
- Docs: tests that run concurrently share the mocks registered outside
  `runInRequest`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:39:12 +01:00
Manuel Schiller
6ddaed9f70 feat(start): experimental Vitest support and typed test helpers
- With `tanstackStart()` in a config that Vitest loads, test files are
  compiled as the app's code is: for the client in browser mode, jsdom
  and happy-dom, for the server in Node. A test run sets up no dev
  server, preview server or build. A project needs no router entry and
  no routes. The route tree is generated once, and route files are never
  written.
- `mockServerFn` and `resetServerFnMocks` in `<framework>-start/testing`:
  in a client test a server function call goes to a mock that is typed
  from the function, in place of a request.
- `runInRequest`, `mockMiddleware` and `runMiddleware` in
  `<framework>-start/testing/server`: a server test runs server functions
  and middleware for a request it describes.
- Mocks end with the test that registered them. The plugin adds a setup
  file to every Vitest project for that.
- In a test run the server finds a server function by its id alone.
  Vitest serves compiled modules from its cache from the second run on,
  so the compiler has no record of them.
- In a test run Start names its packages in `resolve.noExternal` with
  regular expressions. Vitest's translation of the wildcards does not
  match a `-`, so jsdom and Node tests of an installed project ran
  `@tanstack/start-client-core` uncompiled.
- `@tanstack/react-start` pre-bundles `@tanstack/react-store` by a path
  that also resolves from a project that depends on Start only.
- `scripts/e2e/run-as-installed.mjs` runs an e2e project from a
  `pnpm deploy` copy, where `@tanstack/*` are in `node_modules` as in a
  user's project.
- `e2e/react-start/vitest-library` and `e2e/react-start/vitest-app` run
  their tests with an empty Vitest cache, from the warm cache and as an
  installed project.
- Docs: `docs/start/framework/react/guide/testing.md`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-15 17:10:33 +01:00
Flo
0b6d4f3f6b
perf(start-plugin-core): count imported modules once in the Rsbuild manifest pass (#8926)
The static-dependency pass behind the Rsbuild Start manifest runs after
every client compilation, dev updates included. It walked every
connection of every module of every chunk and read the imported module's
chunks each time. Count an imported module once per chunk, from its
first active connection, and read a module's chunks once per
compilation (memoized on the resolver created per compilation).

The manifest is unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:28:55 +01:00
Ciarán Curley
e7358c36d8
fix(react-start-rsc): bump RSC bundler deps for RSC (#8919)
fix(react-start-rsc): bump RSC bundler deps for React Server Components advisories

Raise @vitejs/plugin-rsc to ^0.5.39 (peer >=0.5.38) and
react-server-dom-rspack to ^0.1.1 (peer >=0.1.1) so both bundled React
Flight runtimes include the fixes for GHSA-xqc2-xf4c-x3h3
(CVE-2026-126187, unauthenticated RCE) and GHSA-h3gv-c5rc-p453 (server
function DoS).

Bump the react/react-dom catalog to ~19.2.9. Stay on 19.2.x because
React 19.3 currently fails the rsc-deferred-hydration e2e suite.
2026-11-12 09:33:28 +01:00
Manuel Schiller
113b1a1f08
chore(pnpm): upgrade to pnpm 12 (#8912)
* chore(pnpm): upgrade to pnpm 12

* ci: use native pnpm 12 bootstrap for compiler jobs

* fix(benchmarks): invoke the Nx CLI directly

* refactor(benchmarks): run Nx through pnpm exec
2026-11-09 13:24:08 +01:00
Manuel Schiller
fd5b0b8fad
test(react-start): wait for SSR between HMR saves (#8913) 2026-11-09 12:57:45 +01:00
Flo
70bbd11025
fix(start-plugin-core): restore the build of the Rsbuild virtual modules (#8907)
#8889 wrote the Rsbuild dev manifest with the eager `paths.manifest`.
#8868, merged after it, replaced `paths` with the lazy `pathsOf()`, which
builds the virtual paths from the resolved root on first use. Neither PR
saw the other, so main fails to type-check with "Cannot find name 'paths'".

Read the manifest path through `pathsOf()`, like every other use.
`updateManifest` runs after a client compile, so the root is resolved by
then, and the path is the same one `manifestPath` returns for the RSC
manifest rebuild.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:34:35 +01:00
Flo
c156097786
fix(start-plugin-core): Rsbuild manifests list only a route's own chunks (#8876)
A chunk counted as a static dependency of a shared chunk when any one of
the shared chunk's groups had it. When two routes share a module in a
chunk of its own and a module that module imports is duplicated into each
route's chunk, the shared chunk depended on both route chunks, so each
route's manifest entry preloaded the other route's chunk and linked its
stylesheet. A chunk now counts as available only when every group of the
shared chunk (or one of its ancestors) has it.

Taken from #8817.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:42:43 +01:00
Flo
df6ac30406
fix(start-plugin-core): write Rsbuild virtual modules under the app's root, not the working directory (#8868)
* fix(start-plugin-core): write Rsbuild virtual modules under the app's root

The Rsbuild plugin read `resolvedStartConfig.root || process.cwd()` at
setup, before `modifyRsbuildConfig` resolves the root, so Start's virtual
modules always went under `<cwd>/node_modules/.virtual`. Run from another
directory (`rsbuild build --root <app>` from a monorepo root), the packages
those modules import did not resolve there: an RSC app failed with "Module
not found" on its serialization adapters. The virtual paths are now built
from the resolved root when the first Rspack config is built.

From #8817.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(start-plugin-core): resolve a relative Rsbuild root before building virtual paths

Rsbuild accepts a relative `root` (resolved against its `cwd`) but passes
it to `modifyRsbuildConfig` as written. Start stored it as is, so the
virtual modules' paths were relative and resolved against each importer:
the build failed with "Module not found". Take Rsbuild's resolved
`api.context.rootPath` unless the root is already absolute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): leave the temporary working directory before removing it

`onTestFinished` callbacks run last first, so the directory was removed
while it was still the working directory, which Windows refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(start-plugin-core): use a canonical Rsbuild root for the virtual modules' paths

Rsbuild keeps `root` as written, trailing separator included (`/app/`,
and `rootPath` of a relative `app/`), so the virtual paths had `//` while
Rspack's module identifiers have one separator: the dev rebuild of the
server-fn resolver (substring match) skipped it. Resolve the root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): the relative-root Rsbuild app renders its index page

The test only checked that the build finished. Render `/` through the
built server's `fetch` handler, which also reads the server manifest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:42:24 +01:00
Flo
2ebc0f3586
fix(start-plugin-core): refuse custom server-fn ids that never worked over HTTP, deprecate the rest outside the unreserved set (#8858)
* refactor(start-plugin-core): derive server-fn ids from the stable key, with 22-character defaults

`serverFns.generateFunctionId` now receives the server function's
stable name (`greetUser`) as `functionName` instead of the generated
handler name (`greetUser_createServerFn_handler`). Repeats of the same
variable name in one file get `#1`, `#2`, ...

Default production ids are the first 22 base64url characters of the
SHA256 of `<file>#<stable key>` instead of the full 64-character hex
digest.

Split out of #8817, which derives ids the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(start-plugin-core): keep generateFunctionId's handler-name input, reject custom ids that aren't one URL path segment

Follows #8817's current id contract:

- `generateFunctionId` receives the generated handler name again
  (`greetUser_createServerFn_handler`, `_1`, `_2`… for repeats), with
  characters outside `[A-Za-z0-9_$]` as `_`. The handler export keeps its
  name.
- The default id stays 22 base64url characters of
  `sha256("<root-relative file>#<variable name>")`, `#n` for repeats.
- A custom id outside RFC 3986's unreserved characters and `$` (or `.`,
  `..`, empty) fails the build, naming the file, the function and the id.
- The e2e id maps return to main's keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(start-plugin-core): a repeated server function name loses leading and doubled underscores

The generator's `functionName` for a repeated name goes through the old
increment rule, which strips leading underscores and collapses runs of
underscores (a second `_x` gets `x_createServerFn_handler_1`). Say so,
and pin it with `_x` twice and `café` then `caf_`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(start-plugin-core): names that become equal after the `_` replacement get suffixes too

`café` and `caf_` both give `caf__createServerFn_handler`, so the later
one gets `caf_createServerFn_handler_1`, like a repeated variable name.
Describe the replacement first, then the suffix rule for any resulting
duplicate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(start-plugin-core): keep main's server-fn ids; refuse custom ids that never worked over HTTP

#8817 now prints main's default ids and passes main's functionName to
generateFunctionId, so this reverts the shorter default ids, the
generator-name split and the empty-id failure. What stays is #8817's
custom-id check: an id the URL never carries whole fails the build, one
with other characters outside the unreserved set and $ builds with a
deprecation warning, and the resolver manifest escapes a `'` in an id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:42:06 +01:00
Flo
3cc054c374
fix(start-plugin-core): find Start libraries from Vite's root, not the working directory (#8866)
* fix(start-plugin-core): find Start libraries from Vite's root

Start bundles the Start libraries (dependencies with a peer dependency on
Start) in the SSR build so its compiler compiles their server fns. It
crawled the working directory's package.json, so `vite build <app>` run
from another directory left them external and uncompiled: their server
fns returned undefined during SSR. Crawl Vite's root, which the plugin
already uses for its own root.

From #8817.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(start-plugin-core): resolve a relative Vite root before crawling for Start libraries

The `config` hook sees Vite's root as configured, which can be relative
(`root: '.'`, `vite build .`). vitefu then walked up from the relative
path and stopped at the working directory, missing a Start library
hoisted to a monorepo's `node_modules` above it. Resolve it as Vite does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): leave the temporary working directory before removing it

`onTestFinished` callbacks run last first, so the directory was removed
while it was still the working directory, which Windows refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(start-plugin-core): crawl Start libraries from the physical Vite root

A root through a symlink (`vite build "$PWD"` in a symlinked directory)
made vitefu walk up the symlink's parents and miss a Start library
hoisted above the physical app directory, where Vite resolves the app's
imports from. main crawled `process.cwd()`, which is physical. Take the
root's realpath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): leave the symlinked directory before removing it

The symlinked-root test removed `linkParent` while the working directory
was still inside it (`onTestFinished` callbacks run last first), which
Windows refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:41:37 +01:00
github-actions[bot]
ed86c440c5
ci: Version Packages (#8891)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-08 10:47:39 +01:00
Manuel Schiller
f8709334ac
chore(deps): bump @rsbuild/core to 2.3.1 (#8890)
Bump the workspace catalog and every e2e, example and benchmark
devDependency to ^2.3.1 so the lockfile resolves a single Rsbuild version.
Published peer ranges are unchanged.

The newer Rspack types allow falsy entries in a rule's `use` array, so the
Rsbuild RSC SWC integration now skips them instead of treating them as
loaders.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:47:24 +01:00
Manuel Schiller
559c7ded6e
fix(start-plugin-core): restore CSS in Rsbuild RSC dev SSR (#8892)
fix(start-plugin-core): rebuild the Rsbuild RSC dev manifest after the client build

#8889 moved the Rsbuild dev manifest from a build-process global into the
server's manifest module. With React Server Components the client and server
compile concurrently, so the manifest is written while the server
compilation is already running, and dev SSR kept the fallback manifest
without CSS.

Run the existing RSC finishMake manifest rebuild in dev too. In dev it only
rebuilds when the manifest was written since this compiler last rebuilt it.

Add an Rsbuild dev mode to the rsc e2e app (test:e2e:dev:rsbuild). On main,
nine CSS tests fail in it; with this change the full suite passes. Also
accept Rsbuild dev's CSS module class names in the scoped-class assertion.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:33:30 +01:00
Manuel Schiller
3f226869e0
fix(start-plugin-core): include CSS in Rsbuild dev SSR when the server runs in workerd (#8889)
fix(start-plugin-core): write Rsbuild dev manifest into the server module

In Rsbuild dev, the start manifest was stored on the build process's
globalThis and read from there by the SSR manifest module. When the server
environment runs in another runtime, such as workerd with
rsbuild-plugin-cloudflare, that global is invisible, so SSR fell back to a
manifest without CSS and pages rendered unstyled.

Write the dev manifest into the server's manifest virtual module instead,
only when its content changes. Add rsbuild dev variants (Node and workerd)
to the css-modules e2e app to cover it.

Fixes #8886

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:05:42 +01:00
github-actions[bot]
7dbce0807d
ci: Version Packages (#8854) @tanstack/vue-start@1.169.5 release-2026-11-08-0104 @tanstack/react-router-devtools@1.167.3 @tanstack/react-start-client@1.168.45 @tanstack/react-start-rsc@0.1.66 @tanstack/react-start@1.169.5 @tanstack/router-cli@1.168.0 @tanstack/router-devtools-core@1.168.3 @tanstack/router-devtools@1.167.3 @tanstack/router-generator@1.168.0 @tanstack/router-plugin@1.169.0 @tanstack/router-utils@1.163.0 @tanstack/router-vite-plugin@1.167.49 @tanstack/solid-router-devtools@1.167.3 @tanstack/solid-start@1.169.5 @tanstack/start-plugin-core@1.171.56 @tanstack/vue-router-devtools@1.167.3
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-08 02:00:36 +01:00
Manuel Schiller
bbf9b75808
fix(router-devtools-core): restore embedded panel styling (#8888)
* fix(router-devtools-core): restore embedded panel styling

All devtools size tokens are `calc(var(--tsrd-font-size) * n)`, but only the
floating devtools set `--tsrd-font-size` (via JS). The embedded
TanStackRouterDevtoolsPanel never had it defined, so every size declaration
was dropped: inherited font sizes, zero padding/gap/indentation and invisible
route status dots. Regressed in #1222 (v1.17.0).

Fall back to `1rem` when the variable is unset. Floating behavior is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(react-router): read devtools mode from a validated search param

Use root route validateSearch + useSearch instead of raw URLSearchParams,
and render the shadow DOM panel through a portal instead of mounting the
whole app in a shadow root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(react-router): validate devtools search param with zod

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(react-router): add links to switch devtools variants

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:55:41 +01:00
Tanner Linsley
19037cc8c6
docs(start): troubleshoot server and client execution boundaries (#8394) 2026-11-05 21:26:23 -07:00
Tanner Linsley
78001ec0ef
docs(start): troubleshoot Cloudflare deployment config (#8396) 2026-11-05 21:26:13 -07:00
Tanner Linsley
ee7dab26e2
docs(start): record verified Query recipe versions (#8387)
* docs(start): record verified Query recipe versions

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-11-05 21:26:02 -07:00
Tanner Linsley
b2ab16c22e
docs(router): clarify when Start helps with data loading (#8388)
docs(router): clarify when to use Start for data loading
2026-11-05 21:25:30 -07:00
Pujitha Paladugu
c5320d7ca2
fix(start-plugin-core): define TSS_SHELL in Rsbuild dev for SPA mode (#8805)
* fix(start-plugin-core): define TSS_SHELL in Rsbuild dev for SPA mode

In Rsbuild dev mode, `source.define` now sets `process.env.TSS_SHELL` and `import.meta.env.TSS_SHELL` from `startConfig.spa?.enabled` (`"true"` when SPA mode is enabled, `"false"` otherwise). Before this, Rsbuild dev never defined `TSS_SHELL`, so with `spa: { enabled: true }` it server-rendered the matched route and ran its loader on the server instead of serving only the shell. Build and preview are unchanged: the define is added only when `isDev` is true.

Changes:
- `packages/start-plugin-core/src/rsbuild/plugin.ts`: add the dev-only `TSS_SHELL` defines to the Rsbuild define block.
- `packages/start-plugin-core/tests/rsbuild/spa-shell-define.test.ts`: new test that calls the plugin's `modifyRsbuildConfig` hook. It checks that `TSS_SHELL` is `"true"` in dev with SPA enabled, `"false"` in dev without SPA, and not defined in build.
- `.changeset/rsbuild-spa-dev-shell.md`: patch changeset for `@tanstack/start-plugin-core`.

Fixes #8543

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)

* test(start-plugin-core): check the SPA shell on a real Rsbuild dev server

- `src/rsbuild/plugin.ts`: the `TSS_SHELL` define gets #8817's comment.
- The regression test serves a real app with `rsbuild dev` (a new
  `startRsbuildDevServer` in `tests/integration/start-app.ts`) and fetches
  its `/` route: with `spa.enabled` the loader no longer runs on the
  server; without it, the control still renders the route there. This is
  #8817's `integration/rsbuild/dev-server-config.test.ts` scenario, and it
  replaces the unit test that stubbed the plugin API.
- The changeset says what users see.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): the SPA dev test checks the shell and counts loader runs

The SPA test only checked a 200 without `MARK_SERVER`, which an empty
answer or a loader run whose output the shell drops would also pass.
The root route now renders its own text, so the SPA answer must hold it
without the `/` route's; the loader counts its runs on `globalThis`
(Rsbuild dev runs the server bundle in the test's process), so the SPA
test asserts none and the control asserts one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(react-start): check the dev SPA shell with an e2e on Vite and Rsbuild

Replace the synthetic Rsbuild integration test with one e2e in
e2e/react-start/basic, run against both dev servers:
test:e2e--vite-spa--dev and test:e2e--rsbuild-spa--dev
(playwrightModes with E2E_DEV_SERVER, no app build, the shared dev
server prewarm). spa-shell.spec.ts checks that the raw document is the
shell, that the route's loader and beforeLoad run in the browser, and
that client navigation works from the shell. It runs in the prod SPA
mode too.

tests/integration/start-app.ts is back to main's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Sheraff <me@florianpellet.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:28:58 +01:00
Flo
d05c6c66e7
fix(vue-start): pre-bundle @tanstack/vue-store so a cold dev start doesn't reload the page (#8869)
fix(vue-start): pre-bundle @tanstack/vue-store so a cold dev start doesn't reload

Vue Start excludes `@tanstack/vue-router` from optimization, so Vite's
scanner never sees its `@tanstack/vue-store` import. Discovered while the
first page loads, it imports `vue` and re-chunks the already optimized
`vue`: Vite logs "optimized dependencies changed. reloading" and reloads
the page on every cold start. Declare it through `optimizeDeps.include`,
as React Start does for `@tanstack/react-store`.

From #8817.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:38:11 +01:00
Flo
ff157f0079
fix(router-utils): parse decorators after export (#8867)
The shared Babel parser options set `decoratorsBeforeExport: true`, so
`export @dec class Store {}` failed to parse. The route generator logged
the error and wrote no route tree, and the code splitter left the route
unsplit. Start's compilers use the same options.

Dropping the option lets Babel accept decorators on either side of
`export`; decorators before `export` still print where they were.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:36:34 +01:00
Flo
f420d4a6da
fix(router-plugin): write import.meta.hot.accept( out in Vite route HMR (#8870)
* fix(router-plugin): write `import.meta.hot.accept(` out in Vite route HMR

Vite's import analysis marks a module as a hot boundary only when its
code spells `import.meta.hot.accept(` out. The route HMR code called it
through `const hot = import.meta.hot`, so a route module no framework
plugin accepted (a `.ts` route file, or an app without
`@vitejs/plugin-react`) reloaded the page on every edit.

The React HMR code also declared a top-level `const hot`, which made a
route file with its own `hot` binding fail with `Duplicate declaration
"hot"`. Both now read `import.meta.hot` directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(router-plugin): keep the user's `hot` binding in the module under test

Split, the component reading `hot` moves to its chunk, and with it the
user's `const hot`, so the served route module no longer holds the
binding the HMR code could collide with. Serve the route unsplit and
assert the declaration is still there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:31:55 +01:00
Flo
545a8d3790
fix(start-plugin-core): require exsolve ^1.1.3, and see new entry files after a dev server restart (#8871)
* fix(start-plugin-core): require exsolve ^1.1.3 and bypass its cache for entry lookups

exsolve caches a failed `try: true` lookup as an Error in its
process-wide cache. Before 1.1.2 that Error kept its call sites, and
with them its callers, alive for the life of the process (unjs/exsolve#63),
so each build in one process left its objects behind. Require ^1.1.3.

The cache also kept misses: Start looks up its optional entries
(`src/start.ts`, `src/client.tsx`, `src/server.ts`) once per plugin
instance, and a dev server restart got the cached miss for an entry
created since. Entry lookups now pass `cache: false`.

From #8817.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changeset): narrow the exsolve memory claim

exsolve still caches lookups, and other packages in an app's build (for
example Nitro, which bundles an older exsolve) share its process-wide
cache. Say what the bump fixes: Start's cached failed lookups no longer
keep each build's objects alive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:28:02 +01:00
Sarah Gerrard
1ba19a0445
fix(router-plugin): omit browser warnings from production bundles (#8269)
* fix(router-plugin): omit browser warnings from production bundles

* fix(router-plugin): only the bundler's mode keeps the warning out of the page

The code splitter always passes isProduction, so the NODE_ENV fallback in the compiler was reachable only from direct test calls. The changeset now names the bug users see.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(router-plugin): real webpack and Rspack production builds ship no splitter warning

Builds an app whose route exports its component, with mode 'production' and with mode left out, and checks that no emitted JS names the app's absolute path. Fails on main. Replaces the fake-compiler matrix in router-plugin-context.test.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Sheraff <me@florianpellet.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 11:30:55 +01:00
Flo
01fab5a6c8
fix(start-plugin-core): keep the app's server.compress on Rsbuild (#8863)
* fix(start-plugin-core): keep the app's server.compress on Rsbuild

The Rsbuild plugin always set `server.compress: false`, so an app's
`server: { compress: true }` had no effect (#8544). It now sets it only
when the app leaves it unset: a compressed streamed page reaches the
browser only once the stream ends.

From #8817. Rsbuild merges its defaults (`compress: true`) into the
config before `modifyRsbuildConfig`, so the check reads the app's own
config through `api.getRsbuildConfig('original')`.

Fixes #8544

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(start-plugin-core): require @rsbuild/core ^2.0.5 for Start's Rsbuild plugin

Now that an app's `server.compress: true` takes effect, Rsbuild 2.0.0 to
2.0.4 would corrupt SSR response headers: their compression middleware
reads the raw header array `writeHead` form as an object. Rsbuild 2.0.5
fixed it (web-infra-dev/rsbuild#7613). Raise the optional peer of
start-plugin-core, react-start, solid-start and vue-start to ^2.0.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 08:10:22 +01:00
Flo
da8c28c498
fix(start-plugin-core): pass Start's router options through to the generator and code splitter (#8861)
* fix(start-plugin-core): pass Start's router options through to the generator and splitter

- `router.plugins` reach the route generator (#7768): one shared
  `startGeneratorConfig` (from #8817) appends them after Start's own
  generator plugins, on Vite and Rsbuild.
- A function-form `routeTreeFileFooter` is called at every print; Vite
  no longer caches its first result.
- Rsbuild's server build keeps `codeSplittingOptions.deleteNodes`.
- Vite matches the client route tree by its exact id (#8839), not by an
  unescaped `new RegExp(path)`.

Regression tests build and serve real Start apps with the built
`@tanstack/react-start` plugins (`tests/integration/start-app.ts`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): link the test apps' packages with junctions on Windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): run the real-build tests in their own test:integration target

The cross-platform unit-test job (Linux arm64, Windows) timed out in the
Vite dev footer test: the dev server never picked up the new route file.
`test:unit` goes back to main's dependencies (`^build`); the real-build
tests move to a `test:integration` target that builds this package and
`@tanstack/react-start` first. `test:pr`/`test:ci` run it, so it runs in
the Linux `Test` job only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): wait for the dev server's file watcher before adding a route

The generator prints the first route tree in `configResolved`, before
Vite creates its watcher, so the first tree says nothing about the
watcher being ready. A route file written during the watcher's initial
scan is taken as an existing file and never reported (no `add`), which
is how the footer test timed out on Linux arm64 and Windows. The test
now writes a file the generator ignores until the watcher reports it,
then adds the route once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:39:54 +01:00
Flo
b5e2ac9c4c
fix(router-plugin): point split routes' source maps at the route file (#8860)
* test(router-plugin): split routes' source maps point at the route file

Real webpack and Rspack builds, and Vite's dev server: a throw in a split
component, and in code it shares, maps to its line in the route file, and
the map names the route file rather than its ?tsr-split / ?tsr-shared id.
Fails on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-plugin): point split routes' source maps at the route file

- Require unplugin ^3.5.0: its webpack/Rspack transform loader dropped a
  plugin's map when no earlier loader passed one (unjs/unplugin#626).
- Name the route file, not the ?tsr-split / ?tsr-shared module id, as the
  source of split and shared modules' maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(router-plugin): wait for the compiler to close before removing the app

runCompiler settled before compiler.close finished, so the test could remove
the app while webpack or Rspack was still shutting down, and a close error
went unreported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:37:11 +01:00
Ethan Huo
d66a84ba0a
fix(react-start-client): call HydrationBoundary hooks before the visible() gate (#8653)
* fix(react-start-client): call HydrationBoundary hooks before the visible() gate

* fix(react-start-client): align the visible() fix with #8817 and test it through hydration

- Destructure only `o` and read `props.g` inline: keeps the deferred-hydration
  client gzip at main's (+6 B with both destructured after the reorder).
- Replace the client-render test with a hydration test that runs the
  intersection in each task around the boundary's first hydration attempt and
  asserts no recoverable error. It fails on main.
- Use the changeset wording of #8817.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Sheraff <me@florianpellet.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:36:11 +01:00
Flo
ad5b3b7a09
fix(router-generator): type route-group layouts with full path '/' (#8857)
* fix(router-generator): type route-group layouts with full path `'/'`

A pathless layout inside a route group (`/(group)/_layout`) strips down
to `/`, and dropping the trailing slash left `''` in `FileRoutesByPath`.
The router gives that layout the full path `/` at runtime, as it does for
a pathless layout outside a group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-generator): a childless route-group layout next to the index route still generates

With route-group layouts now typed with the full path `/`, a layout
without child routes yet (`(group)/_layout.tsx` or `(group)/route.tsx`)
next to `index.tsx` failed generation with "Conflicting configuration
paths", where it used to generate. Pathless and route-group layouts match
no URL of their own, so the full-path uniqueness check skips them, as
#8817 does. This also lets a childless `_auth.tsx` next to the index
route generate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-generator): a pathless layout that carries a path still conflicts

`foo/_layout.tsx` without `foo.tsx` is given `path: '/foo'`, so it
matches `/foo` like `(group)/foo.tsx` or `foo_.tsx` does. Main rejected
that pair as conflicting; the previous commit skipped every pathless
layout in the full-path uniqueness check and let both through. Skip only
the layouts the route tree gives no `path`, using the same condition the
tree printer uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-generator): keep main's full-path conflicts, change only the types

The route tree lists the index route before a pathless layout, and the
router then matches `/` to a childless `_auth.tsx` instead of the index
route. Main refused that pair; skipping pathless layouts in the
uniqueness check let it through. Keep the check on main's key instead: the
stripped full path, which is `''` for a route group's layout, so a
childless group layout still generates next to the index route as on
main. Only the types use `'/'`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:54:33 +01:00
Flo
446ce1b306
chore: require Node ^20.19.0 || >=22.12.0 in engines (#8855)
* chore: require Node ^20.19.0 || >=22.12.0 in engines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: say why the Node engines range narrows in the changeset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:15:33 +01:00
Flo
533ca27044
refactor(router-plugin): remove plugin.hmr.style and HmrOptions (#8856)
The option was undocumented. The webpack and Rspack entries overwrote it
with `'webpack'`, and on Vite `'webpack'` emitted `import.meta.webpackHot`,
which broke route HMR. The HMR style is now an internal parameter: the
composed plugin derives it from the bundler unplugin reports, and the
standalone webpack/Rspack code-splitter entries pass `'webpack'`.

Split out of #8817.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:54:15 +01:00
Flo
13b6256830
refactor(router-plugin): remove compilerPlugins and splitter internals from the root entry (#8853)
* refactor(router-plugin)!: remove `compilerPlugins` and splitter internals from the root entry

Remove the experimental `codeSplittingOptions.compilerPlugins` hook and
stop exporting the Babel splitter's internals from the package root:
`unpluginRouterCodeSplitterFactory`, `getObjectPropertyKeyName`,
`CodeSplitCompilerPlugin`, `ReferenceRouteCompilerPlugin`,
`ReferenceRouteCompilerPluginContext` and
`VirtualRouteSplitNodeCompilerPluginContext`.

Split out of #8817.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: make the changeset a patch

The removed option and exports were internal, not public API.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:38:08 +01:00
Flo
94f36c4a9e
fix(router-plugin): throw on autoCodeSplitting with esbuild (#8852)
* fix(router-plugin): throw on autoCodeSplitting with esbuild

The esbuild plugin silently bundled every route without splitting when
`autoCodeSplitting` was enabled. It now throws a clear error, and
`TanStackRouterCodeSplitterEsbuild` always throws. Route generation is
unchanged. Extracted from #8817.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(router-plugin): drop autoCodeSplitting from the esbuild skill example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:11:14 +01:00
Flo
d25081952d
chore(router-plugin): require Vite 6 or later in the peer range (#8851)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:28:45 +01:00
Flo
c28c7ebb38
test(router-utils): re-enable unit tests (#8849)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:07:57 +01:00
Manuel Schiller
f723f3b8be
update generated route trees (#8841) 2026-11-01 23:36:36 +01:00
Nicolas Beaussart
da2adec76d
ci: upgrade Nx and migrate worker configuration (#8807) 2026-10-25 01:21:10 +02:00
Tanner Linsley
78caf5f3b9
docs(start): use TanStack Markdown in rendering guide (#8808) 2026-10-24 14:38:14 -06:00
github-actions[bot]
6b9fe6d295
ci: Version Packages (#8745) release-2026-10-22-2011 @tanstack/start-static-server-functions@1.167.44 @tanstack/start-storage-context@1.167.41 @tanstack/solid-start@1.169.4 @tanstack/solid-start-client@1.168.42 @tanstack/start-server-core@1.169.45 @tanstack/vue-start-server@1.167.50 @tanstack/solid-router@1.170.43 @tanstack/vue-start-client@1.167.45 @tanstack/start-client-core@1.170.39 @tanstack/start-plugin-core@1.171.55 @tanstack/solid-start-server@1.167.50 @tanstack/vue-router@1.170.42 @tanstack/vue-start@1.169.4 @tanstack/react-start@1.169.4 @tanstack/router-cli@1.167.46 @tanstack/react-start-server@1.167.52 @tanstack/react-start-rsc@0.1.65 @tanstack/react-start-client@1.168.44 @tanstack/router-core@1.171.39 @tanstack/router-generator@1.167.46 @tanstack/router-plugin@1.168.48 @tanstack/router-vite-plugin@1.167.48 @tanstack/react-router@1.170.46
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-22 22:05:39 +02:00
Flo
08a419c109
chore: update Node.js to 26.12.1 (#8779) 2026-10-21 19:28:23 +02:00
Guru 🦄
ed5577593a
fix(start-plugin-core): skip the Rsbuild import-protection loader when disabled (#8748)
* fix(start-plugin-core): skip the Rsbuild import-protection loader when disabled

- With import protection disabled, the Rsbuild integration still added
  its post loader for every JS and TS module, node_modules included,
  plus its virtual modules plugin. The loader returned at once, but every
  module still paid for a loader step.
- Register nothing when import protection is disabled, as the Vite
  plugin does.

* test(start-plugin-core): drop the disabled import-protection unit test
2026-10-19 08:51:03 +02:00
Guru 🦄
63a886da90
fix(start-plugin-core): skip unchanged server function resolver rebuilds in Rsbuild dev (#8750)
* fix(start-plugin-core): skip unchanged server function resolver rebuilds in Rsbuild dev

- Skip the resolver rebuild at the end of make when the resolver has not
  been written since this compiler last rebuilt it. Rebuilding an
  unchanged resolver made Rspack rebuild the server chunk graph after
  every edit.
- Child compilations still rebuild every time and do not change the
  parent compiler's state.
- The RSC resolver hook skips unchanged writes in dev, like the non-RSC
  hook.

* docs: drop the COMPILER_ARCHITECTURE.md change
2026-10-19 08:50:39 +02:00
Shkumbin Hasani
d9b07e8d3b
perf(start-plugin-core): skip resolving member calls on non-namespace receivers (#8758)
* perf(start-plugin-core): skip resolving member calls on non-namespace receivers

A top-level `a.b()` initializer was a direct-call candidate for any `a`, so
`const Input = z.object({...})` resolved `z` and, in dev, loaded and parsed all
of zod through `?server-fn-module-lookup` while every compiled file waited.

For a receiver that is not a namespace import, resolution gives the call the
kind of the receiver itself, which only yields a candidate when the receiver
is an env-only factory and the code calls one of its properties. Skip those
calls; namespace calls, identifier calls and method chains resolve as before.

Refs #8757

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(start-plugin-core): cover member calls across compiler modes

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Sheraff <me@florianpellet.com>
2026-10-18 23:17:05 +02:00
Flo
a8f4dce5f4
ci: skip bundle size comment on fork pull requests (#8764) 2026-10-18 22:51:44 +02:00
Flo
336fdfba42
ci: skip labeler on fork pull requests (#8763) 2026-10-18 22:46:57 +02:00
Manuel Schiller
b1b111761b
bump node version to 26.10.0 (#8509)
* bump node version to 26.10.0

* run benchmarks on  .nvmrc changes

* Rename client-nav-benchmarks.yml to benchmarks.yml

* chore(ci): update references to the renamed benchmarks workflow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 17:04:18 +02:00