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

6,757 commits

Author SHA1 Message Date
Sheraff
ad808b62a9
test(router-plugin): headers and titles say what the tests check, without design-doc references
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:39:27 +01:00
Sheraff
15a5c9bc7a
docs(compiler-test-utils): the oracle README says which checks share Yuku with a compiler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:39:27 +01:00
Sheraff
34f9d75283
test(router-plugin): braces in the page-side code of route-app
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:39:27 +01:00
Sheraff
b326834dc0
test(router-plugin): drop the negative controls of route-unrecognized-fixes
Review S9. Its two 'is reported nothing' tests pass on main only because main has no such report; their positive cases fail on main. The file comes with the PR that brings the reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:34:11 +01:00
Sheraff
32cc29c26b
test(router-plugin): extracted-export chunking asserts outcomes only, for the function case it tests
Review S8. The header and fixture lose the class case the slice does not test. The user-side chunk group now leaves out every module id with a query, instead of matching the compiler's split query (`tsr-split=export---` is #8817's id format), and 'unreported' means no warning names the route file, instead of a match on the warning's text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:34:11 +01:00
Sheraff
52f98bdf02
fix(compiler-test-utils): a page that fails to open frees its slot, and a client run is bounded
Review S7. openPage closes its context (and frees its slot) when a step after opening it fails, e.g. a refused navigation: callers without registerCleanup (runInBrowser) had nothing to close, and after openPageLimit such failures every later openPage waited forever. runInBrowser races the page's load and script against a timeout (default 25 s, below the tiers' 30 s test timeout; run(script, { timeout })), as runInPage does. Two controls fail before the fix (both time out) and pass after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:33:16 +01:00
Sheraff
c051f66f56
test(compiler-test-utils): drop what nothing in the slice uses
Review S6. Removed: the TSR_COMPILER_VERIFY variable (nothing on main reads it) and its self-test; the @tanstack/history build dependency of test:integration; the budgets of packages that do not use the reporter here; settlePage and the hmr-sync scripts with their self-test (the slice uses trackRequests only); reorderings, reorderedRecords and expectDeterministic with their self-tests (the slice uses expectRelocatable only). describeHmr stays: the dev-server harness's own controls use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:30:03 +01:00
Sheraff
c035cbc3f2
docs(compiler-test-utils): the harness docs say what holds on main
Review S5. KNOWN-BUGS.md drops the rows that call Babel and unplugin bugs fixed (they are live on main) and the rows whose pins or workarounds sit in test files main does not have. The harness AGENTS.md drops the Start hosts, the integration-alone process and the react-start build, which only the later suites need. The known-bugs test files no longer say each test is a bug today's compiler fixes, nor point at KNOWN-BUGS sections that are not here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:28:02 +01:00
Sheraff
7083a064ff
test(router-plugin): keep main's Solid/Vue route HMR check and the malformed split id error
Review S3 and S4. The ported page test only checks that a Solid or Vue route compiled with HMR stays valid and renders; main's test that the route HMR plugin adds its Vite HMR handling (without code splitting) stays next to the webpack one. Main's test of the error for a split module id without a split value (router-code-splitter-plugin.ts) stays too, with its helper (createCodeSplitterTransforms) back in regression-helpers.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:27:05 +01:00
Sheraff
76f0a4d38e
test(router-plugin): esbuild's autoCodeSplitting refusal is asserted with its message again
Review S2. Main's test that tanstackRouter({ autoCodeSplitting: true }) throws comes back in esbuild.test.ts, with main's message. The either-or build test's comment no longer calls the refusal a bug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:26:36 +01:00
Sheraff
301cbd8896
docs(router-plugin): AGENTS.md describes the test tiers, not the snapshot suite this PR deletes
Review S1. The snapshot guidance and the invariant-suite pointer go with the suite; the two tiers, behaviour tests through loadRoute, no output snapshots and the unit-main project come in. The route HMR bullets stay: main's HMR tests stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:26:17 +01:00
Sheraff
bccb26e619
test(router-plugin): re-sync the slice with #8817 ac17b427d3
Takes #8817's test changes since 5bd66855c3 that apply on main's
compilers:

- harness: the pin check (a pin passes only on an assertion error), edits
  without their outcome fail as assertions, child Node runs report the
  step they were in and time out below the test timeout, watch rebuilds
  wait for the build that saw the edit, binary app files, map helpers for
  the new map-source test, and its new controls (`pins`, `run-directory`);
- new passing code-splitting tests: `build-map-sources` (it replaces the
  copy of main's webpack/Rspack map-name check), `build-js-extension-assets`,
  `code-splitter-other-names`, `-pure-framework-calls` (Vue, Solid),
  `-unreadable-loader`, `-value-own-writes`, `-const-chains`,
  `-effect-timing` (decorators), `route-unrecognized-fixes`,
  `vite-unanalysed-modules`, 14 new shapes of `code-splitter-state-read-at-load`
  and one effectful-declaration row;
- `code-splitter-reexported-factory` goes as in #8817: main passes it only
  because its compile crashes on a duplicate `createFileRoute`;
- the `integrationProject` refactor of router-plugin's Vitest config.

Left out because they fail on main: #8817's new rows of
`build-source-maps`, `plugin-options` (esbuild), `code-splitter-route-options`
(object loaders with a spread) and the failing rows of the new files. Left
out because they need #8817's core: the compiler stats check of
`test-scope-setup` and its `TSR_COMPILER_STATS` knob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 13:03:50 +01:00
Sheraff
4a1c8b2d53
Merge branch 'main' into test/compiler-harness-splitting
Takes main's pnpm 12 upgrade (#8912), the RSC dependency bump (#8919) and
the react-start HMR e2e fix (#8913).

The lockfile is main's, regenerated with pnpm 12 for the slice's packages.
pnpm 12 merges a version a package names directly into the other
packages' ranges, so two ranges of the slice are set to the versions main
already resolves, to leave every other package's resolution as on main:
the harness's `esbuild` (^0.28.1; ^0.28.2 added a second esbuild and moved
webpack's peer variant) and router-plugin's `@babel/preset-typescript`
(7.27.1; ^7.28.5 moved esbuild-plugin-solid's preset and the preset's own
helpers). The only change left outside the slice's packages is the css-modules
e2e apps' sass bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:22:02 +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
Sheraff
88a0b64d09
test(router-plugin): run the integration tier in 4 CI shards; per-file run pages (#8817 5bd66855c3)
Takes #8817's test infrastructure changes since 294b3f36e1 that apply here:

- router-plugin's `test:integration` runs as four Nx shard targets
  (Vitest `--shard`), and `test:integration:whole` runs the tier in one
  Vitest run, for file filters and budget measurements;
- each test file gets its own run pages and browser context, closed when
  the file ends (`onFileFinished` in `test-scope`), so a later file
  inherits none of their memory or cache;
- SPEC and the harness notes, as in #8817.

#8817's new splitting tests (`code-splitter-effect-timing`) and the changed
`code-splitter-kept-reports` fail on main, so they stay out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 00:00:23 +01:00
Sheraff
5905b947e3
Merge branch 'main' into test/compiler-harness-splitting
Takes #8907, which restores main's start-plugin-core build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:35:35 +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
Sheraff
3b69f7b1ac
test(router-plugin): keep main's no-mode warning and webpack/Rspack map-name checks
The slice has no test for two behaviours main guards: a webpack or Rspack
production build whose configuration has no `mode` ships no splitter
warning (#8269), and on webpack and Rspack the maps of a split component
and of shared code name the route file, not the `?tsr-split` id (#8860).
Keep those cases of main's tests, cut to what the slice does not cover:
the `mode: 'production'` rows, the line mapping and Vite's dev server are
asserted in the integration tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:21:20 +01:00
autofix-ci[bot]
33bf9b56b4
ci: apply automated fixes 2026-11-08 16:16:30 +00:00
Sheraff
e298c9b744
test(router-plugin): implementation-agnostic code-splitting tests and the compiler test harness
Adds `@tanstack/compiler-test-utils`, the harness of #8817's compiler test
suite: real Vite, Rsbuild, Rspack and webpack builds and dev servers, route
apps in pages of a real Chromium, and one merged diagnostic channel. Only the
parts the route code splitting tests use come along.

Adds #8817's route code splitting tests that pass on main's compilers: whole
files where every test passes, and the passing describe groups and table
rows of mixed files. Its one pin that main passes (Rolldown, a `var`
declared again in a head or a pattern) lands as an ordinary test. The slow
tier runs as router-plugin `test:integration`.

Deletes main's Babel-specific splitting tests the new ones replace: the
code-splitter snapshot matrix (except the four fixtures that cover shapes
the new tests do not reach yet), shared-bindings-helpers, utils,
delete-nodes, the old regression suites, production-warnings and
source-maps. Main's route HMR tests stay, in their own `unit-babel`
project, until the route HMR slice replaces them.

Takes #8817's sass bump of the css-modules e2e apps, so that the harness and
the plugins load one copy of vite and vitest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:12:33 +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