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

Compare commits

...

266 commits

Author SHA1 Message Date
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)
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)
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
Flo
76cd9e178d
ci: keep bundle-size measurement out of the Test workflow (#8669)
The measurement target was named `build`, so `test:pr`/`test:ci` and
`build:all` picked it up via `--targets=...,build`. Its cache entry was
never reused: the Bundle Size workflow runs with NX_NO_CLOUD and
--skipRemoteCache. Rename it to `measure` (with explicit `cache: true`,
previously inherited from the `build` target default).

Since dependency-only changes no longer reach this target through
`nx affected`, add `.nvmrc`, `package.json` and `pnpm-lock.yaml` to the
Bundle Size workflow path filters so toolchain bumps are still measured.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:35:23 +02:00
Flo
647cb737a5
refactor(router-plugin): remove enableRouteGeneration option (#8737)
Disabling route generation also silently disabled autoCodeSplitting,
because the code splitter relies on route metadata populated by the
generator. Remove the option instead of patching the interaction, so the
generator always runs.

Closes #5087

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:22:15 +02:00
Flo
32a3360cba
docs(skills): reference cross-package skills by intent ID (#8670)
@tanstack/intent 0.5.4 rejects SKILL.md links that resolve outside the
owning package, which fails the "Validate intent skills" CI job. Replace
those relative links with `<package>#<skill>` identifiers that
`intent load` resolves regardless of node_modules layout.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:10:53 +02:00
Flo
689a7c5419
fix(react-router): publish agent skills (#8671)
The skills added in #6866 were never published for @tanstack/react-router
because its `files` list, unlike the other packages with skills, omitted
`skills`.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:11:16 +02:00
github-actions[bot]
caaf32da35
ci: Version Packages (#8733)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-16 23:05:28 +02:00
Max Katz
18154b1c45
perf: lower manifest script preload priority (#8212)
* perf: lower manifest script preload priority

* fix(start-server-core): forward fetchPriority into static Early Hints

Static script hints were built from getScriptPreloadAttrs but copied only
href, rel, as and crossOrigin, so Chromium started hinted preloads at
MEDIUM before the HTML's fetchPriority="low" arrived. Build them with the
shared addEarlyHintFetchAttrs helper, which the dynamic hint path already
uses, so fetchPriority (and crossOrigin) are carried into 103 hints and the
response Link header.

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

* test: cover low-priority manifest preloads in Solid and Vue

Add a Solid server-suite SSR test for module and IIFE preloads and assert
fetchpriority="low" on rendered preloads in the Solid and Vue HeadContent
tests.

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

* docs: note low-priority JavaScript Early Hints

Mention that JavaScript Early Hints carry fetchpriority=low and extend the
changeset to start-server-core.

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

---------

Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:35:33 +02:00
Manuel Schiller
7a06725038
chore(deps): upgrade Vitest to 5 and migrate benchmarks to the bench fixture (#8723) 2026-10-16 00:41:32 +02:00
Flo
6777b8b0a5
add AI rules to CONTRIBUTING.md (#8714) 2026-10-14 17:40:27 +02:00
github-actions[bot]
140efa4347
ci: Version Packages (#8701)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-14 16:46:30 +02:00
Flo
fdc10fa13f
chore(deps): bump srvx to ^1.0.0 and @vitejs/plugin-rsc to ^0.5.37 (#8708)
* chore(deps): bump srvx to ^1.0.0

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

* chore(deps): bump @vitejs/plugin-rsc to ^0.5.37

0.5.37 depends on srvx ^1.0.5, which drops the last srvx 0.11 copy from
the lockfile. It is temporarily excluded from minimumReleaseAge until it
is 24h old.

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

* chore: drop minimumReleaseAge exclusion for @vitejs/plugin-rsc

0.5.37 is now older than the 24h minimum release age.

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

* test(ci): TEMP experiment - rsc e2e on srvx 0.10 (revert before merge)

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

* Revert "test(ci): TEMP experiment - rsc e2e on srvx 0.10 (revert before merge)"

This reverts commit 2c7279a0b9.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:24:04 +02:00
Flo
08181cc1f7
test(rsc): make progressive streaming e2e tests independent of fixed sleeps (#8713)
test(rsc): wait for streamed notifications instead of fixed sleeps

The progressive-streaming tests slept 500ms and expected the initial batch
of 3 notifications to be rendered. React throttles Suspense reveals by
300ms, so the batch can legitimately land after that window. Wait for the
3rd notification, assert the stream is still open with fewer than all
notifications, then wait for the next one and for completion.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:04:11 +02:00
Flo
71d9694da6
chore(deps): bump fetchdts to ^0.2.0 (#8710)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 00:53:46 +02:00
Flo
a80cd74105
chore(router-cli): replace yargs with cac (#8711)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 00:51:58 +02:00
Flo
923d98b18b
chore(deps): bump diff to ^9.0.0 (#8709)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 00:28:28 +02:00
github-actions[bot]
4ff63eb8a4
ci: Version Packages (#8700)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-13 01:43:37 +02:00
Manuel Schiller
ff85a51deb
docs (#8699) 2026-10-13 01:35:59 +02:00
Manuel Schiller
740b0ce177
perf: skip unused Start request setup (#8451)
Create the request middleware deduplication set only when request
middleware is configured, and pass Start's serialization adapters to the
router without copying them when the router adds none.

Server route handlers and route middleware now receive the router's
decoded pathname, the one used for route matching.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:33:36 +02:00
Manuel Schiller
d6ba115d57
perf: reuse prepared SSR request locations (#8441) 2026-10-13 01:33:36 +02:00
github-actions[bot]
80e2eabf48
ci: Version Packages (#8661)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-13 01:14:33 +02:00
Sarah Gerrard
4104b8ef11
fix(start-plugin-core): preload transitive static imports and fix Rsbuild shared-chunk CSS (#8695)
* fix(start-plugin-core): preload transitive static imports and fix Rsbuild shared-chunk CSS

Route preloads read a chunk's `imports` as a complete list, which only
holds when the bundler hoists transitive imports. Walk the static import
graph instead, and derive Rsbuild chunk imports from the module graph
rather than chunk-group siblings so shared chunks stop attaching
unrelated route CSS to the SSR response.

Fixes #8415
Fixes #8511

* refactor(start-plugin-core): share one static import walk for preloads and CSS

The manifest builder walked the static import graph twice, once breadth-first
for preloads and once recursively for stylesheets. A single memoized
depth-first walk now records discovered file names for preloads and chunks in
post-order for stylesheets, which also keeps every chunk in an import cycle
seeing the whole cycle instead of a partially cached result.

The Rsbuild adapter resolved static dependency chunks again for every CSS-only
chunk reached from each importer; the resolution is now memoized per chunk.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* docs(start-plugin-core): drop Rollup from the imports contract comments

Rollup is no longer a supported client bundler, so the `imports` contract is
described in terms of the direct-imports-only lists Rolldown and Rsbuild emit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 01:07:27 +02:00
Manuel Schiller
f243c61e95
Start stable (#8696) 2026-10-13 00:45:16 +02:00
Manuel Schiller
021e05da71
chore: remove experimental Nitro v2 Vite plugin (#8537) 2026-10-13 00:42:07 +02:00
Manuel Schiller
550f478810
refactor(start)!: remove the deprecated inputValidator (#8694)
* refactor(start)!: remove the deprecated inputValidator

createServerFn().inputValidator() and createMiddleware().inputValidator()
were deprecated aliases of validator(). Remove both, the inputValidator
option the builders set, and the compiler's deprecation warnings, so
validator() is the only way to declare a validator. Server functions now
store their validator under the key middleware reads.

The compiler test of diagnostic locations across line terminators now
checks the code frame of the destructuring diagnostic instead of the
removed warning.

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

* docs(agents): do not test that a removed API is gone

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:32:10 +02:00
Manuel Schiller
94d6d8e496
response reconciliation (#7588) 2026-10-13 00:01:04 +02:00
Flo
f3d7ee3374
fix(start-plugin-core): declare image and news namespaces in sitemap.xml (#8692)
The sitemap writer emitted image:* and news:* elements, but <urlset> only
declared the default sitemap namespace and xmlns:xhtml. xmlbuilder2
serialized those elements with xmlns="" and an undeclared prefix, so
sitemaps with images or news were not namespace-well-formed XML. Declare
xmlns:image and xmlns:news on <urlset>.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 22:38:03 +02:00
Flo
19524ccdd7
fix(start-plugin-core): keep prerender-specific properties out of public pages.json (#8691)
* fix(start-plugin-core): keep prerender credentials out of public pages.json

pages.json and sitemap.xml are now built from schema-validated public page
fields, so prerender headers and extra data returned by prerender.onSuccess
are stripped from the published files. Invalid sitemap metadata returned by
prerender.onSuccess now fails the build with an error naming the page and
the offending field.

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

* docs(changeset): describe previous onSuccess sitemap behavior accurately

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 19:43:29 +02:00
Flo
57bd1a92f9
fix(router-generator): don't scaffold over a route file mid in-place save (#8664)
* fix(router-generator): don't scaffold over a route file mid in-place save

An in-place save truncates the file and then writes it. If the generator
reads the route file in between, it sees empty content and scaffolds a
template. Its mtime guard before renaming the template into place does not
catch the completed save, because the truncation and the write usually share
one mtime tick on Linux, so the user's content was replaced by the template.

Route file writes now also confirm the file still has the content the
generator read before replacing it.

This was the main cause of flaky tanstack-react-start-e2e-hmr runs, where SSR
rendered `Hello "/route"!` after the test restored a route file.

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

* fix(router-generator): check for concurrent saves right before the rename

safeFileWrite compared the target's mtime and content before preparing the
temporary file's mode and owner, so a save completing during those steps was
still replaced. Run the check last, immediately before the rename.

The regression test now also completes the save during the temporary file
stat, and keeps the generator's tmpDir inside the test directory so the
rename never crosses filesystems (EXDEV on CI).

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

* test(router-generator): match generator paths on Windows in concurrent save test

The generator reads route files through forward-slash paths, also on Windows,
so compare resolved paths when injecting the concurrent save.

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

* perf(router-generator): only read files whose content is compared

The final concurrent-change check before the rename read the whole target
file even for the route tree, whose content is never compared. Stat it
instead, as before, and read only route files.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:23:54 +02:00
Guru 🦄
e66da18266
fix(router-plugin): remove redundant string excludes from the reference filter (#8655)
* fix(router-plugin): remove redundant string excludes from the reference filter

* fix(router-plugin): remove unused tsrShared import
2026-10-10 19:51:17 +02:00
Flo
4fea98aff8
test(start-plugin-core): match Rolldown module ids on Windows in bundled dev styles test (#8660)
Rolldown module ids use forward slashes on Windows, so looking up the
native entry path never matched and the test waited until it timed out.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 18:27:40 +02:00
Flo
e26735166f
ci: test the compilers on Windows, macOS, Linux arm64 and musl (#8626)
* ci: test the compilers on Windows, macOS, Linux arm64 and musl

The main PR workflow only runs on Linux x64 (glibc). The compilers load a
native Yuku binary per platform and handle platform-specific paths, so run
their unit tests and Vite and Rsbuild production builds of the React Start
e2e app on the other platforms we ship to. Runs on PRs touching the
compiler packages or the lockfile, weekly, and on demand.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci: run all compiler platforms in one matrix job and keep LF on Windows

Merge the musl job into the matrix through a matrix container, so the
install, test and build steps exist once. Disable autocrlf before checkout:
Windows runners otherwise check out the LF snapshot files as CRLF and every
file snapshot mismatches.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci: check out LF on Windows compiler runs

With `* text=auto`, disabling core.autocrlf alone still converts text files
to the native (CRLF) eol on Windows, so also set core.eol=lf.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 17:23:18 +02:00
Flo
42a7914cd5
test: format compiler output before comparing snapshots (#8658)
* test: format compiler output before comparing file snapshots

The router-plugin and start-plugin-core compiler snapshots record the
layout choices of the code generator (object wrapping, blank lines,
parentheses around JSX) along with the emitted program, so swapping the
code generator rewrites most snapshot files even when the output is the
same.

Format the output with Prettier before comparing it: fixed options,
`objectWrap: 'collapse'`, and blank lines outside template literals
removed. Comments are kept. Output that does not parse is compared as is.

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

* test: regenerate compiler snapshots with formatted output

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

* test: format inline compiler snapshots before comparing them

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 14:09:42 +02:00
github-actions[bot]
c79c620bf4
ci: Version Packages (#8580)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-10 09:25:30 +02:00
Manuel Schiller
41916400b9
fix(start): preserve dev SSR CSS order (#7830)
* fix(start): preserve dev SSR CSS order

fixes #7794

* add e2e tests for solid and vue, handle vue style urls

* test(start): cover bundled dev styles and SSR reload lifecycle

* fix(start): use completed bundled graph for dev SSR styles

* fix(start): preserve import reachability across bundled dev variants

* test(start): cover layered inline CSS without build observers

* test(start): wait for bundled HMR route registration

* test(start): await HMR readiness in both Vite modes

* test(start): trace initial bundled HMR update in CI

* test(start): trace native bundled HMR watcher in CI

* test(start): inspect initial native watch registrations

* fix(start): support the latest bundled dev toolchain
2026-10-10 09:18:39 +02:00
Flo
f6d21de12b
revert: keep server-rendered pending UI of no-SSR routes through hydration (#8643) (#8646)
This reverts commit ff9f753c09.

#8643 introduced a React hydration mismatch for `ssr: false` and
`ssr: 'data-only'` routes without a pending component: the client load can
commit before React hydrates the route's Suspense boundary, which then
hydrates the route component against the server's pending UI. Revert while a
proper fix is worked on.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 21:41:47 +02:00
Flo
ff9f753c09
fix: keep server-rendered pending UI of no-SSR routes through hydration (#8643)
* fix: keep server-rendered pending UI of no-SSR routes through hydration

Fixes #8640. The server rendered a no-SSR match's pending UI in a
ClientOnly fallback, while the hydrating client renders the presented
pending match through MatchInner. After hydration the switch replaced
(React: hid and duplicated) the server node. Render the server pending UI
through the same MatchInner pending path and drop the ClientOnly wrapper.

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

* test: cover terminal no-SSR boundaries through hydration

Add error, notFound and URL not-found cases for `ssr: 'data-only'` and
`ssr: false` boundaries (plus a terminal child below a data-only boundary)
in React, Solid and Vue. Each case asserts the server payload, that the
server skeleton is the only one and is held for `pendingMinMs`, and that no
hydration mismatch is reported. The hold check catches mismatches that React
and Solid error boundaries replace silently.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 20:40:06 +02:00
Flo
17a3121ff4
chore: add AI contribution guidance to GitHub templates (#8641) 2026-10-08 20:45:44 +02:00
VihaanAgarwal
663282b0eb
fix(router-core): avoid null bytes in dehydrated SSR match ids (#7654)
* fix(router-core): avoid null bytes in dehydrated SSR match ids

dehydrateSsrMatchId replaced "/" with U+0000 so dehydrated ids would not
look like crawlable URLs (#6739). U+0000 is forbidden in the HTML input
stream though, so the inlined hydration payload tripped a
control-character-in-input-stream parse error and failed markup
validation. Encode with U+FFFD instead, which is valid in HTML and which
hydrateSsrMatchId already decodes back to "/".

* test(router-core): cover legacy null-byte decode in hydrateSsrMatchId

The codec keeps the U+0000 -> "/" decode branch so SSR payloads from a deploy before the U+FFFD switch still hydrate. That branch was the one path the suite didn't exercise, so add a test for it.

* fix(router-core): compare SSR match ids in encoded form

Encode slashes as U+FFFD with no further escaping, and have the client
encode its own match id instead of decoding the server's. Payload and
client always ship from the same build, so the legacy null-byte decode
and the reversible escape scheme are no longer needed.

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

* perf(router-core): keep dehydrated SSR match ids one-byte

A U+FFFD delimiter made V8 widen the encoded ids, and every HTML string
concatenated with them, to two-byte strings, slowing Solid SSR
serialization by ~5%. Use ASCII `|` instead.

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

* fix(router-core): delimit dehydrated SSR match ids with '#'

`|` is a valid static route character, so `/a/b` and `/a|b` encoded to
the same id. A decoded pathname keeps `%23` encoded and params encode
`#`, so a matched id cannot get a '#' from the URL. Seroval emits it
unescaped and it keeps the HTML one-byte.

Tighten the regression test to reject any non-whitespace control
character and any char above U+00FF in the inlined hydration HTML.

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

---------

Co-authored-by: Flo <me@florianpellet.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 08:27:20 +02:00
Flo
5a641d859c
test: cover compiler output validity and edge cases for code splitting, Hydrate, server functions and the route generator (#8629)
* test(router-plugin, start-plugin-core): cover compiler output regressions

Add engine-agnostic regression tests for compiler output found while
reviewing the compiler migration (#8504). They only use the public
compiler entry points and validate emitted code with Vite's Oxc
transform/parser (TypeScript erased, parsed as a JS module with semantic
checks), so they run unchanged against any compiler implementation.

router-plugin:
- every emitted code-splitter module stays valid for re-exported imports,
  partially exported destructuring and anonymous default exports
- self-/mutually-referencing side effects stay in the reference module
- namespace imports used by `import X = ns.X` and decorator placement
  before `export` are preserved
- React Refresh hoisting keeps closures in scope, hoists the root route
  component, and declares hoisted components before use

start-plugin-core:
- self-referencing user code survives client and server compilation
- nested and switch-case createServerFn keep provider modules valid
- aliased createClientOnlyFn re-exports are transformed in SSR
- Hydrate split modules: parent/fallback-only bindings are removed, text
  children render decoded entities, `'use client'` stays first

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test: require hoisting and declared bindings in compiler regression tests

- The React Refresh ordering test now requires the inline pendingComponent
  to be hoisted instead of passing when it stays inline, since main hoists it
  and React Refresh needs a top-level binding.
- The self-referencing side-effect tests also assert that each binding the
  callbacks use is still declared. The module validator does not report
  references to undeclared names. The Start variant now validates the module.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin, start-plugin-core, router-generator, react-start-rsc): cover compiler edge cases

Engine-agnostic tests through public compiler entry points, passing on
main. They cover:

- code-splitter module state shared with exported functions, `var`
  declared inside top-level statements, long method chains, duplicate
  split keys, split options that read `Route`, route options declared
  in a variable, re-exports, type-only syntax, private class members,
  and namespace JSX tags
- the code-splitter plugin pipeline: analysis cache keys and eviction,
  plugin-level `splitBehavior`, config `deleteNodes`, and the
  non-split HMR plugin for Solid and Vue
- the route generator transform with parenthesized call parts, and
  byte-exact edits after a BOM or astral characters
- the Start compiler: dev-mode server function ids, provider
  directives, handler name versioning, provider export removal,
  cross-module factory resolution, invalidation, and diagnostic
  locations
- Hydrate children with block-bodied callbacks, self-closing
  boundaries, captures, split attributes, and the virtual module cache
- import-protection exports, member-chain boundaries, source-mapped
  locations, and executed denied-import rewrites
- RSC CSS transform import shapes and argument unwrapping

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core): port Next.js server actions fixtures to createServerFn

Translate the scenarios of Next.js's server-actions transform fixtures
(crates/next-custom-transforms/tests/fixture/server-actions) to the
createServerFn client, SSR caller and provider outputs: captured module
bindings, shadowing, destructuring, handler forms, directives, export
forms, non-ASCII names and client/server-only code side by side.

The destructuring default and computed-key cases pass on main and fail
with the Yuku compiler (#8504), which keeps every sibling of a live
destructuring and with it a server-only import in the client output.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin): port Next.js SSG and React Router route-chunk splitting scenarios

Translate edge cases from Next.js's SSG transform fixtures and React Router's
route-chunks / remove-exports tests into code-splitter coverage: imports used
in JSX positions, shadowed names, transitive pruning of every declaration
kind, destructurings and multi-declarator statements split across groups,
mutually recursive shared helpers, nested-scope dependency analysis, helpers
shared with the loader, top-level calls on imports and split chunk source
maps. All scenarios already behave correctly; these tests pin them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core, router-plugin): port Qwik optimizer extraction edge cases

Port capture and extraction scenarios from the Qwik optimizer test suite
(QwikDev/qwik, packages/optimizer/core/src/test.rs) to the Hydrate split
transform, server function extraction and route code splitting. All of
them pass with both the Babel and the Yuku compiler.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin, start-plugin-core): cover real-world compiler shapes

Adds regression coverage derived from a differential audit of in-repo
examples/e2e apps and open-source TanStack Router/Start apps:

- split chunks import exported route-file bindings instead of copying them
- declarations and imports only referenced from TypeScript types survive
  (classic JSX runtime React imports, side-effecting initializers)
- TypeScript type and value exports sharing a name compile
- file-level JSX pragmas stay in split chunks and Start compiler output
- ambient declarations are not imported from the shared module
- chained comparisons in plain JavaScript route files keep their operands
- real-world route file names go through the code-splitter plugin pipeline

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin, start-plugin-core): port React Compiler fixture shapes

Wrap component bodies adapted from the React Compiler fixture corpus into
route files and Start modules:

- split route components and Hydrate chunks render like the original for
  labeled breaks, shadowing catch params and function names, destructuring
  defaults, getters/computed keys, hoisted functions, optional call chains,
  tagged templates and classes with static blocks/private fields
- server function handlers that read a server-only import through unusual
  syntax positions keep it off the client
- unused locals with side-effectful initializers (hook calls) in shared route
  modules and Hydrate chunks still run; these fail on the Yuku migration,
  which removes them

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test: cover exported route variables in split chunks and JSX pragma forms

- Split chunks import exported route-file variables (contexts, stores and
  caches built from private bindings) from the route module instead of
  redeclaring them.
- The Start compiler keeps JSX pragmas in the Hydrate chunk, line-comment and
  license-header forms, classic `@jsx` with `@jsxFrag`, and after a
  `'use client'` directive.

Both pass on main and on #8504 after its fixes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core): port SolidStart directive and Waku allowServer edge cases

Translate SolidStart's "use server" directive compiler tests and helpers
(type-only import specifiers, rejected server fn positions, captured
this/arguments/super/private members, id stability and opacity, Hydrate
closure captures) and Waku's allowServer transform tests (dependency
pruning, aliasing, default exports, untouched look-alikes, zero-argument
factories, trailing comments) into Start compiler coverage for React and
Solid.

The import-alias namespace test passes on main and fails on the Yuku
compiler (#8504), which deletes the aliased namespace.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin): port React Refresh and solid-refresh scenarios to route HMR

Covers which route component shapes React Refresh registers after the HMR
transforms (checked with Vite's Oxc React Refresh transform), hook
signatures, @refresh reset, generated-name collisions, and the module shape
solid-refresh expects (registrable components, @refresh reload/skip,
top-level createContext).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin, start-plugin-core, react-start-rsc): port @vitejs/plugin-rsc transform edge cases

Port scope, hoisting, export-shape, export * and directive scenarios from
@vitejs/plugin-rsc's transform tests (vitejs/vite-plugin-react, MIT) to the
Start compiler (server fn providers and callers, env-only functions, Hydrate
chunks), the route code splitter and the RSC CSS transforms.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test: port babel-dead-code-elimination and Turbopack tree-shaker scenarios

Port dead-code-elimination scenarios (pcattori/babel-dead-code-elimination)
and Turbopack tree-shaker analyzer fixtures (vercel/next.js) to the code
splitter and the Start compiler: import specifier pruning, initially unused
declarations and cycles, SCC removal, write-only bindings, nested patterns
with rests and defaults, empty parameter patterns, var declarations nested
in top-level statements, import attributes, typeof references, enum IIFEs,
shared mutable state and statement order in the provider.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin): share compiler regression test helpers

The regression suites each re-implemented the same plumbing. Move it into
`tests/regression-helpers.ts`:

- `compileRouteModules` (reference, virtual chunks and shared module, with
  optional route HMR, Solid target or file name) and `expectValidModules`,
  previously copied into 12 files
- `buildAndRun`, the Vite build-and-run harness copied into 5 files
- `createCodeSplitterTransforms` and `transformWithRouteHmrPlugin`, which
  drive the bundler plugins the way a bundler does
- `evaluateModule`, the JSX-to-text module evaluator copied into 3 files

No test is added, removed or renamed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core): share compiler regression test helpers

The regression suites each built their own `StartCompiler`, output compiler,
Start runtime stubs and `<Hydrate>` chunk loader. Move them into
`tests/regression-helpers.ts`:

- `createStartCompiler`, `compileFor`, `compileCode` and `compileAll` (client,
  SSR caller and provider outputs, validated), previously built in 10 files
- `importModule`, `callProvider`, `importSources` and `settle`, with one
  minimal Start runtime instead of four variants
- `compileHydrate`, `getChunkParams`, `getChunkIds`, `loadChunk`,
  `evaluateModule` and `renderChunk`, previously copied into 6 files

No test is added, removed or renamed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(react-start-rsc): share the RSC CSS transform compile helper

Both RSC CSS transform regression suites defined the same compile helper
and a copy of the module validator; move the helper into
`tests/regression-helpers.ts` and reuse start-plugin-core's validator.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin): merge duplicated compiler regression tests

Remove tests whose input shape and assertions another suite already covers,
folding any unique assertion into the surviving test:

- code-splitter-real-world: the two "split chunks share exported route-file
  bindings" compile checks duplicate code-splitter-exported-bindings (the
  built-app check stays); "file-level JSX pragmas" duplicates the
  @jsxImportSource cases of code-splitter-jsx-pragmas, which now also check
  that Oxc selects the pragma's JSX runtime for every split chunk.
- ported-react-compiler-fixtures: "a catch parameter shadowing a module
  binding" duplicates the plugin-rsc "next to a catch parameter of the same
  name" case, which now names both sources.
- ported-nextjs-ssg: "moves one declarator of a multi-declarator statement
  into the split chunk" duplicates the React Router "plain declarators" case,
  which now also asserts where each declarator is declared.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core): merge duplicated compiler regression tests

- The SolidStart "local types used by split children are not passed as
  props" Hydrate test duplicates the Qwik "local types used by the children
  are not captured as values" test; the Qwik test now also covers JSX type
  arguments and asserts that no type is passed as a prop.
- start-compiler-edge-cases "does not duplicate a directive the module
  already has" becomes a case of the plugin-rsc "provider module directives"
  table, which also checks the prologue and module validity.
- The single test of aliased-env-only-fns.test.ts moves to the
  "cross-module factory resolution" tests of start-compiler-edge-cases, where
  its output is also validated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-generator): merge the parenthesized route call transform tests

transform-parenthesized.test.ts duplicated the `transform` harness of
transform-preservation.test.ts; move its tests there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin): keep covering configs without the router plugin

Before the code-splitter transforms were shared, the real-world file-name
test resolved a Vite config that did not list the router plugin, which
covers the early return of the plugin-order check. Let the shared helper
take the config's plugins and keep that case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-plugin): regroup compiler regression tests by behaviour

Dissolve the ported-* and code-splitter edge-case files into behaviour
files (dead code, imports/exports, module state, pragmas, route options,
scope), drop duplicate cases and vacuous assertions, and replace the five
real Vite builds with one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core): regroup compiler regression tests by behaviour

Dissolve the ported-* and start-compiler edge-case files into behaviour
files (server fn caller dead code, declaration sites, exports and
directives, handler scope, Hydrate captures, factories, user code kept),
drop duplicate cases and vacuous assertions, and compile through a single
harness. The RSC external-transform scope cases move into compiler.test.ts,
replacing react-start-rsc's ported-vite-plugin-rsc.test.tsx.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(router-generator): move transform edge cases into transform.test.ts

Merge the five parenthesized-call cases into one test next to the existing
outer-parens test and fold the remaining preservation cases into
transform.test.ts, reusing its makeNode helper.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(react-start-rsc): move RSC CSS transform edge cases into rscCssTransform.test.tsx

Keep the cases with unique coverage (the @tanstack/react-start-rsc import
source, transparent JSX wrappers, non-JSX arguments) next to the existing
tests and drop the separate helper, which imported start-plugin-core tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test: keep regression tests valid once known compiler bugs are fixed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test: share the build and React Refresh helpers

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(start-plugin-core): link Hydrate chunks to their parent however a fix imports it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 16:21:29 +02:00
Flo
30fc108a5e
test(benchmarks): pin React's scheduler clock in the hydration benchmark (#8621)
React's scheduler ends a time slice after 5 ms of performance.now(). The
hydration harness evaluates the client bundle in a jsdom window, whose
performance.now() is the real wall clock. Under CodSpeed's CPU simulation
the wall clock advances by a runner-dependent amount per instruction, so
identical samples yielded a varying number of times, each yield adding a
scheduler task and event-loop turn (CodSpeed sysCount alternated between
~3.6k and ~5.4k for the same code).

Freeze the window's performance.now() so React yields only to paint after
commits. Date.now(), used by the Router for match timestamps, is unchanged.
The hydration test now asserts every sample uses the same number of
scheduler tasks.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 18:08:21 +02:00
Ciarán Curley
df8bbf217f
docs: use new query methods (#7100)
docs: use queryClient.query() in guides and agent skills

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 17:59:20 +02:00
Flo
793514d5e4
test(benchmarks): disable Maglev in CodSpeed memory runs (#8625)
CodSpeed's --no-opt only disables TurboFan on Node 24, so Maglev still
compiles. Under --predictable those compiles run synchronously inside the
triggering request, and the forced GC before the measured call can discard
optimized code so recompiles land in the measured window. Maglev's malloc'd
Zone scratch (32 KiB segments) then dominates allocation metrics and varies
with per-process feedback state.

The bimodal +32,792 B / +1 alloc in `mem server error-paths unmatched
(react)` is one Maglev Zone segment allocated while compiling React Fizz's
per-request stream `write` closure; ~97% of that bench's allocation was
compiler scratch. Retained-object measurements are unaffected (Zone memory
is freed after each compile).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 17:33:04 +02:00
Flo
9595b9745d
ci: let workflow_dispatch publish bundle-size history on main (#8620)
The workflow already declares a workflow_dispatch trigger, but no job
accepted that event, so manual runs on main were always skipped. When a
push run is lost (e.g. cancelled waiting for a runner), main's tip gets
no history entry and PR comments silently fall back to an older baseline.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 10:53:58 +02:00
Flo
e7ab1570ec
perf(solid-router): let mergeProps memoize the Link's own props (#8619)
* perf(solid-router): let mergeProps memoize the Link's own props

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(solid-router): pin how Link element props, state props and handlers reach the anchor

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* ci: retrigger benchmarks against refreshed main baselines

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 10:36:08 +02:00
Flo
efc2042c2d
perf(router): skip Link work for routes a navigation leaves (#8602)
* test(benchmarks): add departing and retained Link navigation cases

Add lane-* cases to the React Link performance harness, with per-navigation
sync, onLoad and total timings in the paired runner.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* perf(react-router): share one location subscription per route's Links

Links subscribe to a scope owned by their match context instead of each
subscribing to the location store. A scope skips a location publication
whose navigation leaves its route, so Links that are about to unmount do
no work. Clicks and preloads resolve from the location a Link displays,
and mask builds use the same source location as their destination.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(benchmarks): add Solid departing and retained Link navigation harness

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

* perf(solid-router): hold the location of Links in a departing match

Each Match owns one memo that keeps its Links' source location when the
publishing navigation leaves the route, so those Links do no work.
Clicks and preloads resolve from that source.

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

* perf(react-router): trim the Link scope's bundle cost

Key each router's link scopes by route id instead of carrying them in a
`[routeId, linkScope]` match context tuple. `matchContext` provides the
route id again, so `Match`, `Outlet`, `useMatch` and `useParentMatches` /
`useChildMatches` match main, and the outside-every-match holder becomes
the `undefined` key of the same registry. A scope without links still
releases its location, so keeping one per route id holds none.

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

* test(benchmarks): add Vue departing and retained Link navigation harness

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

* perf(vue-router): hold the location of Links in a departing match

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

* test(benchmarks): add a real-browser Link INP harness

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

* perf(solid-router): gate departing Links in their own location memo

Drop the per-Match memo and the third match-context slot. Each Link reads
its route id once at setup and, while the publishing navigation leaves
that route, keeps its previous location in the memo it already owns.
Links mounting in an already-departing route read the pending location.

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

* test(benchmarks): add Vue to the real-browser Link INP harness

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

* fix(solid-router): build Link navigations from the live location state

The Link location memo deduplicated by href, so a same-href navigation that only changed history state left clicks and preloads building from the previous location's state.
Compare by identity instead; downstream href and active memos still compare by value, so unchanged Links do not touch the DOM.

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

* perf(react-router): drop the Link scope's reentrant publication re-check

A listener that publishes a new location while a route's Links derive is not a
supported use case, so the scope no longer re-reads the store after notifying.

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

* perf(react-router, router-core): follow-up Link improvements (#8607)

* perf(router-core): cache location-independent masked destinations

A mask that reads the current location already marks the result as
source-dependent through the shared usedCurrent flag, and route masks
belong to the route tree and options whose updates replace the cache.

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

* perf(react-router): hydrate hash-sensitive Links through the scope's server snapshot

The Link's location subscription already has a server-snapshot slot.
Reporting an active hash-sensitive Link as inactive there replaces the
per-Link useHydrated subscription with identical hydration output.

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

* fix(react-router): follow href and reloadDocument changes of a mounted Link

The destination memo did not depend on href, so a Link whose href alone
changed kept displaying, preloading and navigating to the old target.
Clicks also navigated with the memo's copy of the options, so a changed
reloadDocument only applied once another destination prop changed.
Navigate with the current options and the displayed source location.

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

* perf(react-router): hold a Link's intent preload timer on its own ref

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

* perf(history): avoid copying navigation arguments when checking blockers

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

* test(benchmarks): opt-in intent preloading for the Link lane cases

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

* chore: changeset

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* perf(solid-router, vue-router): follow-up Link improvements (#8609)

* test(benchmarks): measure Solid and Vue Link lanes with intent preloading

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

* perf(solid-router): reuse a Link-owned destination so fixed Links hit the location cache

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

* perf(solid-router): pass navigation controls through the Link-owned options

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

* test(solid-router): cover Link clicks after a state-only navigation

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

* perf(solid-router): read Link options directly with a single splitProps

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

* perf(solid-router): keep the Link preload timer in a closure

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

* perf(solid-router): let the Link observer read the preload mode directly

The internal useIntersectionObserver no longer returns an unused accessor and
takes the preload mode instead of two predicates (its unit test is updated).

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

* perf(solid-router): create the Link hydration signal only for SSR routers

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

* perf(solid-router): let element insertion track Link children without a memo

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

* fix(solid-router): call a Link's ref once per element

The ref no longer comes from the props memo, so href/active changes do not
re-run the element's ref effect. Drops the mergeRefs import.

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

* perf(solid-router): derive a Link's href and active state in one computation

The destination build, href, external/blocked classification and active state
share one memo whose unchanged result keeps its identity, so a navigation that
leaves a Link as it was notifies nothing downstream. Presentation props only
rerun the props memo. The server derives the same values once, without memos.

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

* test(benchmarks): use the t quantile for the lane comparison's round count

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

* perf(solid-router): split a Link's props once

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

* perf(vue-router): reuse a Link-owned destination so fixed Links hit the location cache

Navigation controls travel on the same object, so clicks no longer re-list them.

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

* perf(vue-router): pick a Link's element props with one shared key set

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

* perf(vue-router): derive a Link's href and active state in one computed

The preload effects read a location-independent mode, so a navigation no
longer queues them for every Link. A Link whose destination updater navigates
while it derives derives again for the newer location.

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

* perf(vue-router): keep the Link preload timer in a closure

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

* perf(vue-router): drop the unused IntersectionObserver ref per Link

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

* perf(vue-router): return plain empty Link props without a router

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

* perf(vue-router): render server Links without reactive wrappers

The server returns shallow refs and reads Link props directly, without the
attrs snapshot, its update hook, the props computed or a template ref.

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

* perf(vue-router): drop the deferred re-derivation for updaters that navigate

A search updater that navigates while a Link derives is not a supported use
case; remove the retry that existed only for it, and its test.

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

* chore: add changeset for the Solid and Vue Link follow-up

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* chore(benchmarks): remove the real-browser Link INP harness

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

* fix(solid-router, vue-router): rebuild masks whose options are stores

Router core now reuses masked locations built from the same options object
when the mask does not read the current location. Solid and Vue Links keep
one destination object while their navigation options keep their identity,
and only a store/reactive option value forced a fresh object per location.
A plain mask object holding a store (e.g. `mask={{ to, params: store }}`)
therefore kept the mask built from the store's first value. The mask's own
values are destination options too, so check them for stores as well.

React has no in-place reactive values: a changed mask prop changes identity
and rebuilds. Add the equivalent React coverage for prop and inherited masks.

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

* chore(benchmarks): remove the ad-hoc Link lane harnesses

The link-churn scenario covers this work in CodSpeed. Removes the Solid and
Vue lane harnesses and restores link-performance to its main content.

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

* style: name tuple indexes in Link code

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

* refactor(react-router): stop treating _fromLocation as a Link prop

`_fromLocation` is an internal router option, not a Link prop: the Link
always builds from its own scope's location. It stays among the stripped
router option keys so code that still passes it does not leak an attribute
to the element.

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

* refactor(solid-router): stop treating _fromLocation as a Link prop

`_fromLocation` is an internal router option, not a Link prop: the Link
always builds from the location its match presents.

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

* refactor(vue-router): stop treating _fromLocation as a Link prop

`_fromLocation` is an internal router option, not a Link prop: the Link
always builds from the location its match presents.

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

* refactor(react-router): drop _fromLocation from the Link's option keys

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-05 21:27:33 +02:00
Flo
c4cb0e4cae
test(router): Link tests that hold on main, ahead of the departing-Link work (#8611)
Tests written for #8602 that already pass on main: rewrites of Link tests
that asserted on a detached anchor after its route unmounted, and Link
destination tests for Solid, Vue and React (in-place store/reactive inputs,
inherited params, masks, frozen options, state-only navigations).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 22:46:37 +02:00
Flo
2741b159af
test(benchmarks): add a client-nav scenario for departing, staying and mounting Links (#8604)
* test(benchmarks): add a client-nav scenario for departing, staying and mounting Links

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

* test(benchmarks): size link-churn to 60 staying and 200 departing Links

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

* test(benchmarks): halve link-churn to 30 staying and 100 departing Links

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 19:25:58 +02:00
Flo
dfe3dea88a
perf(router-core, history): small parsing and bundle-size cleanups (#8605)
* fix(history): keep a leading query or fragment out of parseHref's pathname

parseHref compared the '?' and '#' indexes with '> 0', so an href that
starts with a query or fragment (reachable via hash history '/#?x=1'
or memory entries) kept it in the pathname as well, and the router
location became '?x=1?x=1'.

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

* perf(history): read hash-history locations with indexOf/slice

Replace split('#').slice(1)/join('#') with one indexOf and two slices
when reading the hash-history location. Characterization tests from
#8351 cover nested fragments, encoded '#', and an empty hash.

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

* perf(router-core,history): use slice where substring bounds are ordered

Every converted call has non-negative, ordered bounds (fixed offsets,
indexOf results within the same segment, or guarded by a '<' check).
extractParams' affix-stripping calls and the wildcard-tail suffix in
parseSegments keep substring: their bounds can cross.

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

* perf(router-core,history): drop a duplicated flag and a createHref wrapper

buildLocation's currentMatch now reads the location through current(),
which already marks the build as location-dependent. Browser history
passes its createHref directly; createHistory already wraps it.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 18:52:45 +02:00
Flo
b839f47027
test(e2e): wait for the destination route before asserting shared widget CSS (#8603)
/lazy-css-lazy and /lazy-css-static both render `shared-widget`, and the URL
updates before the departing route unmounts, so assertions after `waitForURL`
could hit the old widget while it was being detached and read `""`. Wait for a
destination-only marker and use retrying `toHaveCSS` assertions instead.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:02:43 +02:00
Flo
2413cc0098
perf(react-router): reduce component nesting per route match (#8594)
* perf(react-router): reduce component nesting per route match

* make it stable between server and client
2026-10-03 22:33:29 +02:00
Sarah Gerrard
1f0f20a320
chore(react-start-rsc): upgrade Rspack to 2.2.7 (#8542)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-01 20:50:06 +02:00
Flo
d35aab425b
fix(router): cancel pending link preload before navigation (#8579) 2026-10-01 13:52:43 +02:00
github-actions[bot]
57e126e99d
ci: Version Packages (#8531)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-30 11:41:29 -06:00
Tanner Linsley
d521abd71c
fix(start): align server function transport behavior (#8573) 2026-09-30 11:29:54 -06:00
Flo
614bc27034
chore(deps): update TanStack Store to 0.11.2 (#8568)
* chore(deps): update TanStack Store to 0.11.2

* chore(deps): regenerate Store 0.11.2 lockfile
2026-09-30 12:42:07 +02:00
bkuzmanoski
41ebd28867
fix(start-plugin-core): use http scheme for sitemap xmlns (#8127)
fix: use http scheme for sitemap xmlns per sitemaps.org spec
2026-09-28 00:48:33 +02:00
Flo
05223c2ada
perf(start): defer sitemap dependencies until generation (#8533)
* perf(start): defer sitemap dependencies until generation

* Delete packages/start-plugin-core/tests/sitemap-import.test.ts

* perf(start): defer sitemap dependencies until generation [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-28 00:07:58 +02:00
Flo
60b8ad1ad0
perf(react-router): omit inactive route wrapper components (#8529)
* perf(react-router): omit inactive route wrapper components

* perf(react-router): omit inactive route wrapper components [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-27 22:02:22 +02:00
Flo
863c8a736b
perf(react-router): reuse link selector results (#8522)
* test(react-router): cover cached link selector reruns

* test(react-router): type configurable trailing slash fixture

* test(react-router): use type import in selector benchmark

* test(react-router): benchmark inactive dynamic destinations

* perf(react-router): reuse link selector results

* perf(react-router): resolve external links once per selector

* perf(react-router): shrink link state classification

* perf(react-router): shrink external link expression

* perf(react-router): shrink link state classification [Self-Healing CI Rerun]

* test(react-router): address link selector review cleanup

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-27 22:01:33 +02:00
Flo
ff66a03df4
perf(react-router): consolidate root match provider (CodSpeed experiment) (#8530)
perf(react-router): consolidate root match context provider
2026-09-27 21:31:39 +02:00
github-actions[bot]
f0e751d325
ci: Version Packages (#8497)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-27 16:03:11 +02:00
Manuel Schiller
3cdd1af04b
fix(router-core): restore native scroll restoration on reload (#8519)
* test: cover scroll restoration lifecycle handoff

* test: remove temporary scroll lifecycle benchmark

* fix(router-core): hand native scroll restoration back on pagehide
2026-09-27 14:31:49 +02:00
Sarah Gerrard
488d046a90
perf(router,start): update Seroval to 1.6.7 (#8297)
* perf(router,start): update Seroval to 1.6.6

* perf(router,start): update Seroval to 1.6.7

* chore: update seroval to 1.6.7

seroval and seroval-plugins were pinned to ^1.6.2 while 1.6.7 is the
current release. The type surface is additive: two new options
(maxBase64Length, compactArrayBufferViews) and an isStream export.

Bundle (gzip): router-only scenarios unchanged; Start client bundles
grow 532-642 bytes from the upstream typed array and base64 handling.
react-start.minimal 98504 -> 99039 (+535).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-26 15:55:05 -07:00
Flo
7471fb8591
chore: update CodSpeed action and Vitest plugin (#8508) 2026-09-26 21:39:51 +02:00
Flo
1e113034bd
test: expand compiler correctness coverage (#8506)
test: port compiler correctness coverage from Yuku migration
2026-09-26 19:31:18 +02:00
Flo
0b377c2e5b
test: stabilize scroll regression page readiness (#8507)
test: wait for rendered pages in scroll race regression
2026-09-26 19:11:42 +02:00
Cyril Strone
763ac8b8ad
test(react-router): regression for #2072 router context invalidation (#8499)
* test(react-router): add invalidate context regression for #2072

* cover auth logout/login via RouterProvider context with router.invalidate();
* assert beforeLoad observes fresh context in the same event handler.

* test(react-router): drive #2072 login redirect via beforeLoad

* assert invalidating the active /login match triggers the guard redirect;
* drop the explicit router.navigate that bypassed invalidation.

* test(react-router): tighten auth invalidation assertions

* test(react-router): clarify login invalidation comment

* test(react-router): assert auth observations without redundant waits

---------

Co-authored-by: Sheraff <me@florianpellet.com>
2026-09-26 13:45:54 +02:00
Flo
bb4423e098
bench(client-nav): add React and Solid hydration scenarios (#8439)
* bench(client-nav): add React hydration scenario

* fix(benchmarks): await React hydration completion under instrumentation

* bench(client-nav): add Solid and Vue hydration scenarios

* ci: apply automated fixes

* bench(client-nav): split Vue hydration into a separate PR

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-25 20:43:16 +02:00
Flo
e81845ff1e
fix(start): parse path params before server route handlers (#8434) 2026-09-25 17:02:09 +02:00
Flo
f5ffd3884b
perf(router): skip unused link preload cleanup across adapters (#8436)
* perf(react-router): skip unused link preload cleanup

* perf(react-router): use timer-only cleanup for intent preloading

* Revert "perf(react-router): use timer-only cleanup for intent preloading"

This reverts commit b5f46eac5f.

* perf(react-router): skip unused link preload cleanup [Self-Healing CI Rerun]

* perf(solid-router,vue-router): skip unused preload cleanup

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-25 16:45:51 +02:00
Sarah Gerrard
76a7c0bfad
perf(start-client-core): avoid unused middleware array (#8353) 2026-09-25 07:34:47 -07:00
Flo
0c1b5e38de
fix(router-core): retire invalidated loader reservations (#8460) 2026-09-25 16:16:41 +02:00
github-actions[bot]
ddad69a4a4
ci: Version Packages (#8486)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-23 15:28:58 +02:00
Flo
73bfc153ee
perf(react-router): avoid redundant link hydration updates (#8435)
* perf(react-router): avoid redundant link hydration updates

* refactor(react-router): hide hydration flag behind internal overload
2026-09-23 14:00:26 +02:00
github-actions[bot]
fe7f1fd0e6
ci: Version Packages (#8477)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-21 22:20:15 +02:00
Caleb Zearing
222300b82f
fix(start-plugin-core): restore per route stylesheets on Windows (#8202)
fix(start-plugin-core): normalize rspack route module paths for the Start manifest

Co-authored-by: Caleb Zearing <calebzearing@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
2026-09-21 22:15:10 +02:00
Flo
ac223be013
fix(benchmarks): limit targeted bundle reports to measured scenarios (#8456) 2026-09-17 11:46:56 +02:00
Flo
2fb7723230
perf(benchmarks): compress bundle-size outputs once (#8453)
* perf(benchmarks): compress bundle-size outputs once

* add link to readme in skill

* ci: apply automated fixes

* fix(benchmarks): persist timing flag in measurement command

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-17 11:19:08 +02:00
Flo
6faf2bf292
ci: skip benchmarks for package test-only PRs (#8463) 2026-09-17 10:26:33 +02:00
Flo
faec323dc5
fix(router-core): missing deepEqual signature changes in replace-equal-deep benchmark (#8462) 2026-09-17 10:05:30 +02:00
github-actions[bot]
84bde660a1
ci: Version Packages (#8457)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 23:34:45 +02:00
Flo
ce10dcd4d9
perf(router-core): reduce replaceEqualDeep allocations (#8411)
* perf(router-core): reuse key buffers in replaceEqualDeep

* perf(router-core): reuse unchanged incoming objects

* perf(router-core): reuse existing search objects
2026-09-16 23:12:37 +02:00
Manuel Schiller
bbd2336b84
perf(router-core): split replaceEqualDeep into an equality scan and a copy phase (#8389)
* perf(router-core): split replaceEqualDeep into an equality scan and a copy phase

`replaceEqualDeep` compared and copied in one loop. Every entry, also on
the common all-equal path, paid for the copy bookkeeping (`copy ??=`,
`if (copy) copy[key] = n`), an `equal` flag and — for objects — a
`hasOwn.call(prev, key)` lookup, while arrays and objects shared the
same keyed accesses through `array ? i : keys[i]`, so every access site
saw both element and named keys.

The function now runs in two phases:

- Scan: walk `next` up to the first difference, sharing equal children
  on the way. Arrays and objects have their own loop, so each keyed
  access only ever sees one kind of key and nothing is allocated while
  entries keep matching. A key at the same position of both key lists
  is proven to be `prev`'s own key; only reordered keys still need
  `hasOwn`. When everything matched and the key counts agree, `prev` is
  returned.
- Copy: equality is ruled out, so the loop only builds the result. The
  scanned prefix is shared from `prev`, the first differing entry keeps
  the value the scan already computed, and the rest is resolved without
  any equality bookkeeping.

Only an object entry of `prev` can share anything, so the recursion is
guarded by a single `typeof` check; `null` and mismatched types return
`next`'s entry through the entry checks. `isPlainArray` is no longer
used here: the array check reuses the `Object.keys` result that the
scan needs anyway. Semantics are unchanged: pass-through for
non-enumerable keys and for symbol keys on `next`, null-prototype
copies, the depth limit and the SSR early return all stay as they were,
and the tests pass against both implementations.

Bundle size (`benchmark:bundle-size`, gzip): react-router.minimal -1 B,
react-router.full -18 B, all 18 scenarios net -110 B (13 down, 5 up,
max +20 B on react-start.full for identical code).

Paired runs against the previous version (hz medians of 3 runs,
1000 calls per iteration; the machine was under load, so single-digit
differences are noise):

  equal flat search                          5.96k -> 6.98k  (+17%)
  equal nested search                        2.47k -> 2.83k  (+14%)
  equal array of objects                       524 ->   579  (+10%)
  equal long primitive array (1024)             49 ->    69  (+39%)
  long primitive array, last item changed       37 ->    41  (+11%)
  wider flat object (64 keys), last changed    218 ->   229   (+5%)
  flat search, one changed leaf              5.31k -> 5.59k   (+5%)
  array of objects, one changed item           483 ->   513   (+6%)
  flat search, all leaves changed            5.29k -> 5.35k   (+1%)
  array of shared objects, one changed       1.61k -> 1.44k  (-10%, ±29%)

Entries that change between an object and a primitive now pay one
recursive call instead of an inline four-way type check; guarding both
sides costs more bundle bytes than this branch is worth.

Adds tests for the scan/copy boundary (equal children and next-only
keys after the first difference, reordered keys, object/primitive
transitions, shorter and longer arrays, a change in the last of 1024
entries, the depth limit) and bench cases for the shapes that told the
candidate implementations apart.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(router-core): keep sparse arrays with extra keys opaque in replaceEqualDeep

The plain-array check compares `Object.keys(array).length` with
`array.length`. A hole and an extra enumerable key cancel out in that
count, so `Object.assign([1, ,], { extra: 'x' })` was admitted: the
index-based copy dropped `extra` and turned the hole into an explicit
`undefined`, and an index-wise equal `prev` was returned for it. The
same blind spot exists in the exported `isPlainArray`, which the
previous implementation used for this check.

Extra string keys always sort after the index keys, so once the count
matches, `next` is a dense index-only array exactly when its last key
is its last index. That is one string comparison per array instead of
a per-key validation, and it stays inline with the existing count
check. `prev` keeps the count check only: a result is either a copy
built from `next`'s entries or `prev` itself, which the caller already
holds.

Symbol keys on arrays stay admitted, as before this stack: checking
them costs an `Object.getOwnPropertySymbols` call per array pair, which
measured ~8% on the equal nested search shape (a record holding a
four-element array), and `react-router.minimal` +3 B on top of the
+13 B gzip of this fix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 23:12:36 +02:00
Manuel Schiller
01035782e5
perf(router-core): skip symbol enumeration for plain replaceEqualDeep inputs (#8364)
Every object pair `replaceEqualDeep` visited paid for three native key
lookups per side: `Object.keys`, `Object.getOwnPropertyNames` (to detect
non-enumerable props) and `Object.getOwnPropertySymbols`. Measured on a
4-key literal the first two cost 7.6 ns and 10 ns, the symbol lookup
34 ns — 31 ns even on `{}` — so two thirds of the enumeration cost went
into a key type that router data never carries. (`Reflect.ownKeys` as a
single replacement call was tried and is 100 ns.)

Symbol keys and non-enumerable keys still have to be handled correctly:
Apollo's `preloadQuery` refs carry symbol keys and broke under
`defaultStructuralSharing` when copies dropped them (#4237). Instead of
comparing and copying such objects key by key, they are now opaque: an
object with non-enumerable own keys on either side, or symbol keys on
`next`, makes `next` pass through untouched. That keeps both guarantees
that matter — no partial copy, no stale `prev` returned for it — and only
gives up structural sharing for those objects.

`prev` is not scanned for symbols on purpose. It is normally an earlier
`next`, so a symbol-carrying `prev` meets a symbol-carrying `next` and the
`next` check fires; a symbol-carrying `prev` with a symbol-free, otherwise
equal `next` returns `prev` (covered by a test). Plain objects are now
compared and copied by `Object.keys` alone, and `getEnumerableOwnKeys`
is gone.

Paired runs against the previous version (hz, 1000 calls per iteration):

  equal empty objects             14.8k -> 18.3k  (+24%)
  equal empty null-proto objects   5.1k ->  6.3k  (+24%)
  equal flat search                7.3k ->  8.2k  (+12%)
  flat, one changed leaf           6.1k ->  6.9k  (+12%)
  equal nested search              3.0k ->  3.1k   (+4%)
  nested, sharing subtrees         2.6k ->  2.7k   (+7%)
  equal array of objects            609 ->   729  (+20%)
  array, one changed item           551 ->   640  (+16%)
  wide (12 keys) changed, null-proto 1.8k -> 2.0k  (+9%)

Tests now document the pass-through contract for symbol-keyed objects,
including the deliberate `prev`-only asymmetry.
2026-09-16 23:12:36 +02:00
Manuel Schiller
cecae5440b
perf(router-core): check plain objects by constructor (#8363)
* perf(router-core): check plain objects by constructor

`isPlainObject` gates every recursion step of `replaceEqualDeep` and
`deepEqual`, so it runs at least twice per object pair, on every nested
level, on every navigation and Link build. The previous implementation
(copied from `is-plain-object`) called `Object.prototype.toString` on the
value and again on its constructor's prototype, plus a `hasOwnProperty`
lookup: up to four `toString` dispatches per compared pair, most of them
spent confirming that `{}` is a plain object.

The check is now a single expression:

  !!o && typeof o === 'object' && (o.constructor ?? Object) === Object

Object literals, `JSON.parse` output and `Object.create(literal)` inherit
`Object` as their constructor; `Object.create(null)` objects (the router's
search and params objects) have none, which `?? Object` accepts. Class
instances, arrays, `Map`, `Date`, functions and primitives fail it, as
before. The only accept-set differences are objects from another realm
(an iframe's `Object` is not `===` ours) and objects with a custom
`Symbol.toStringTag`; neither occurs in router state.

Paired runs against the previous version (hz, 1000 calls per iteration):

  deepEqual equal empty objects         25.6k -> 59.4k  (+132%)
  deepEqual nested, one changed leaf    11.3k -> 22.8k  (+102%)
  deepEqual equal flat (partial)        23.0k -> 39.7k   (+73%)
  replaceEqualDeep equal empty objects  10.6k -> 14.9k   (+40%)
  replaceEqualDeep equal array of objs    489 ->   604   (+24%)
  replaceEqualDeep equal nested          2.4k ->  2.8k   (+19%)
  replaceEqualDeep equal flat search     6.0k ->  7.0k   (+17%)

Adds an accept/reject table for `isPlainObject` and checks that class
instances stay opaque to structural sharing while null-prototype and
literal objects compare as equal.

* fix(router-core): keep records with a constructor key plain

`?constructor=foo` decodes to an own `constructor` data key on the
null-prototype search record, and `(o.constructor ?? Object) === Object`
read that key. Such records (and the `{ ...search }` copies of them) were
classified as non-plain, so `replaceEqualDeep` handed back `next` without
sharing and `deepEqual` reported them unequal.

Keep the constructor comparison as the fast accept: it is an inline-cache
load for literals and null-prototype records and is what the PR's speedup
comes from. When `constructor` is anything else, consult the actual
prototype instead of rejecting: `null` or one whose `constructor` is
`Object` means a record, anything else a class instance. The prototype
lookup is a builtin call (~6ns in megamorphic optimized code), so running
it unconditionally would return most of the gain: median hz over 3
rotated rounds, `replaceEqualDeep` equal empty 10.9k -> 8.6k (-21%),
equal array of objects 470 -> 386 (-18%), `deepEqual` equal empty
58.0k -> 35.9k (-38%). With the fallback only on the mismatch path the
hot cases stay within noise of the shortcut and the constructor-key
cases now do the sharing work at the same cost as other null-prototype
records. `react-router.minimal` gzip is +15 B against the shortcut and
still 44 B below the `toString` implementation.

Benchmarks the predicate directly (literal, null-prototype record, record
with a constructor key, class instance) and sharing of a search record
that carries a constructor key. Tests both record shapes and parser
output, all `constructor` value types, and that a class instance with an
own `constructor` key stays opaque.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 23:12:35 +02:00
Manuel Schiller
84936cc045
perf(router-core): allocate replaceEqualDeep copies lazily (#8362)
`replaceEqualDeep` runs on every navigation and Link build: search,
params, state and loader data all go through it, and in the common case
`next` turns out to be deeply equal to `prev`. Until now the function
still allocated the result object (or array) up front and filled it key
by key while comparing, only to throw it away and return `prev`.

The copy is now created at the first difference. Everything compared
before that point is known to be equal and is taken from `prev` in one
pass (`copyItems`), so unchanged subtrees are shared exactly as before.
When nothing differs, nothing is allocated; when only the key sets
differ, the copy is built after the loop.

Smaller changes in the same function:

- deep equality is a single `equal` flag instead of a matched-key count
  compared against the sizes afterwards; once unequal, the `hasOwn`
  check for keys that only `next` has is skipped
- `nullReplaceEqualDeep` passes a boolean instead of an object factory,
  so the plain variant no longer evaluates a default `() => ({})` per
  call and the copy site has no indirect call
- an overload signature keeps the generic return type without the
  `_next` alias in the emitted code
- `getEnumerableOwnKeys` loops over `getOwnPropertySymbols` directly;
  an empty loop needs no early return

`tests/replace-equal-deep.bench.ts` was added first, with the shapes the
router feeds these helpers. Paired runs against the previous version
(hz, 1000 calls per iteration):

  equal empty objects        10.0k -> 10.6k   (+6%)
  equal flat search           5.3k ->  5.9k  (+12%)
  equal nested search         2.2k ->  2.4k  (+13%)
  equal array of objects       445 ->   485   (+9%)
  flat, one changed leaf      5.4k ->  5.2k   (-3%)
  wide (12 keys) changed      2.4k ->  2.2k  (-11%)

The equal paths win and allocate nothing; the copy paths pay for the
extra call and the per-key `copy` check.
2026-09-16 23:12:34 +02:00
github-actions[bot]
de023a7533
ci: Version Packages (#8429)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 23:07:33 +02:00
Manuel Schiller
cbbfbe37ab
optimize streaming (#8204) 2026-09-16 22:38:25 +02:00
Manuel Schiller
1ca361ba52
refactor(router-core): parse masked locations without mutating shared state (#8421)
* refactor(router-core): parse masked locations without mutating shared state

`parseLocation` built the presented location of a masked entry by parsing
the stored `__tempLocation` and then patching and `delete`-ing keys on the
resulting `state`, which `replaceEqualDeep` may have shared with the
previous location, before spreading the result once more. The inner parser
now takes the state to use, so the masked branch passes the intended state
up front and assigns `maskedLocation` on the fresh object.

The slow parsing path only runs the input rewrite when one is configured,
and `resolvePathWithBase` is inlined into its two callers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit cc6159628cd22faf9c16e6e432cb35093b2826a8)

* refactor(router-core): remove redundant input rewrite guard

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 00:42:50 +02:00
Manuel Schiller
a1c8d1aa75
perf(router-core): pass resolvePath arguments positionally (#8419)
`resolvePath(base, to, trailingSlash?, cache?)` replaces the options object,
so `resolvePathWithBase` — called from `buildLocation` and `matchRoute` —
no longer allocates per path resolution. `resolvePath` is an internal
helper. react-router.minimal shrinks by 17 B gzip (60 raw).


(cherry picked from commit de7bc72a952aaf77bbedfd4453a4d12edadaad53)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 00:42:50 +02:00
Manuel Schiller
a0b2ad99ae
perf(router-core): parse the location once in update and build rewrites without arrays (#8422)
* perf(router-core): parse the location once in update and build rewrites without arrays

- update(): compute the basepath/rewrite before the single updateLatestLocation
  call; the first update always saw basepathWasUnset, so every router
  construction parsed the location twice and re-published to a store created
  from the same location.
- invalidate(): fill the id set in one pass instead of spread/flat/filter/map.
- rewriteBasepath(basepath, caseSensitive?) takes positional arguments (it is
  internal) and the output rewrite uses cleanPath on a template string instead
  of joinPaths' array/filter/join.
- parseLocation(): inline the single-use fullPath local.

react-router.minimal 86019 -> 85989 gzip, react-router.full 89605 -> 89561 gzip.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 64978a1c8a8b5926c53797edcb528159c70ab093)

* perf(router-core): parse the location once in update and build rewrites without arrays [Self-Healing CI Rerun]

* test(router-core): cover basepath rewrite composition and updates

* perf(router-core): specialize internal basepath rewrites

* fix(router-core): key server route caches by case sensitivity

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-15 23:57:16 +02:00
Manuel Schiller
83895f1272
test(router-core): add a Link-like buildLocation benchmark (#8423)
Mirrors what useLinkProps does on every location publication: 32 links, each
with a stable dest object, pointing _fromLocation at a fresh location and
calling router.buildLocation inside their selector. Covers the static-cache
hit, search updaters (with and without middleware), relative destinations,
inherited params and masks. Baseline (Node 24.8, hz, mean of two runs):

  static cache hit         1,928,000   search updater   41,600
  + retainSearchParams        30,850   relative         29,800
  params: true                35,050   masked           20,500


(cherry picked from commit d4787b65e25e0817f747fc3c6dc0209889ffe174)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 22:48:37 +02:00
Manuel Schiller
856cfcd05a
agents (#8258)
* agents

* update

* docs: require upstream fixes for dependency issues
2026-09-15 22:36:13 +02:00
Manuel Schiller
8e164d28f9
refactor(react-router): drop the useLinkProps pass-through wrapper (#8420)
`useLinkPropsFor` existed only to keep the `host` argument off the public
`useLinkProps` signature. Fold it into `useLinkProps` behind an `@internal`
overload; `stripInternal` removes that overload from the published
declarations, so the public signature stays `(options, forwardedRef?)`.
react-router.full shrinks by 24 B gzip.


(cherry picked from commit 918d3050850815abc8ae49518befda61cb29bf7b)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-14 23:30:50 +02:00
Manuel Schiller
e561fa1d71
perf(router-core): pass deepEqual flags positionally (#8418)
`deepEqual(a, b, partial?, explicitUndefined?)` replaces the options
object. The hot callers (Link option stabilization and active-state checks,
matchRoute) no longer allocate `{ partial }` / `{ ignoreUndefined: false }`
per comparison, and the comparator reads two booleans instead of an options
parameter that saw four object shapes. `explicitUndefined` (falsy default)
replaces `ignoreUndefined: false` and reuses the `activeOptions` vocabulary.

deepEqual is an internal helper; two-argument callers are unaffected.

react-router.minimal shrinks by 48 B gzip (129 raw) on top of the previous
commit; the Link stabilization micro-benchmark improves by ~10% and the
paired Link component runner resolves three cases as faster.


(cherry picked from commit d6f2c1ca55a4900b33868cfc115ac7120d68d26b)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-14 20:42:14 +02:00
Manuel Schiller
bc80866f6d
perf(router-core): skip recursion for identical array elements in deepEqual (#8417)
Compare array elements by identity before recursing, count the exact
comparison down with a single counter, and drop the `typeof` early exit,
which `Array.isArray`/`isPlainObject` already imply. Behavior, key
enumeration and getter read order are unchanged (pinned by the new contract
test).

Measured in one mixed-mode process (all option modes share the function's
type feedback, which is how the router uses it): equal numeric arrays ~+65%,
flat records +7-9%, nested records and mismatches +7-8%; every case
improves. Identity guards inside the object loops were rejected: they grow
the recursive function past what V8 keeps inlining and cost -31% on a
single-key mismatch. react-router.minimal shrinks by 4 B gzip.


(cherry picked from commit cb23ed54757255540cb203081c3423524d6483ca)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-14 20:42:13 +02:00
Harry Whorlow
34bb302c09
chore(netlify): bump vite plugin and update trust policy (#8414) 2026-09-14 17:05:02 +02:00
github-actions[bot]
a768f66c2f
ci: Version Packages (#8413)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-14 11:40:25 +02:00
Flo
5facdbfe3d
test: fix Nx sandbox violations in CI tasks (#8400)
* test: declare remaining Nx sandbox inputs and outputs

* test: declare the ESLint Start build configuration input

* test: match generated route fixtures in Nx outputs

* ci: apply automated fixes

* test: keep mutable fixtures out of Nx cache replay

* test: declare inputs found in the latest Nx sandbox audit

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-14 10:54:23 +02:00
Flo
fda8a77405
test(e2e): let Playwright manage application servers (#8357) 2026-09-14 10:54:23 +02:00
Flo
e8b0701420
test(e2e): replace dummy APIs with MSW fixtures (#8402)
* test(e2e): replace dummy APIs with MSW fixtures

* test(e2e): require Node with native type stripping

* Merge branch 'codex/e2e-playwright-cache' into codex/e2e-runtime-fixtures [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-14 10:54:22 +02:00
Flo
702d9efe8b
fix(e2e): serialize Playwright runners per Nx agent (#8356)
fix(e2e): adopt upstream Playwright cache validation
2026-09-14 10:54:22 +02:00
Flo
ab99818225
chore(deps): upgrade Rsbuild to 2.2.5 (#8397)
* chore: upgrade Rsbuild to 2.2.5

* fix(rsbuild): preserve flags in watch exclusions

* Merge branch 'main' into codex/rsbuild-upgrade [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-14 10:54:21 +02:00
github-actions[bot]
6954a370a7
ci: Version Packages (#8355)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-13 15:13:54 +02:00
Manuel Schiller
bc57fa3f12
fix(router-core): review follow-ups for Link stack (#8410)
* chore(benchmarks): remove TSR_LINK_PERF opt-in flag

The router-core Link/path benchmarks and the react-link-performance
project are never part of the CodSpeed matrix or the client-nav/SSR
aggregate projects, so the env-var gate only added friction. Rely on
standard vitest name filtering (-t) to narrow runs instead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(router-core): treat 0 and false as provided _splat values

Splat interpolation used a falsy check, so _splat: 0 was omitted like a
missing param while $id: 0 interpolated to '/0'. Only undefined, null,
and '' now omit a splat segment, matching how other path params are
stringified.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(router-core): use path-derived ids in original-param-names fixtures

The matcher only uses route ids as routesById keys and for the pathless
'_' check, so unrelated ids worked but never occur in a real router.
Align the fixtures with the sibling test file's convention where each
id mirrors its fullPath.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(solid-router): shorten conditional Link class and style spreads

Spread `cond && { value }` instead of `cond ? { value } : undefined`,
matching the neighbouring `active && STATIC_ACTIVE_ATTRIBUTES` spread.
Falsy operands spread to nothing, so the emitted props are unchanged.

Measured with the bundle-size benchmark on solid-router.full:
gzip 39205 -> 39198 (-7), raw -12, brotli -33.

Covered by the existing `six-adults-open` changeset.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(router-core): drop the unused server axis from interpolatePath tests

The `interpolatePath (server: $server)` block never read its `server`
argument since interpolation stopped taking a server flag, so it ran every
case twice under a misleading label. The remaining diff is re-indentation;
review with `git show -w`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(router-core): interpolate paths through the production API in tests

`interpolateTestPath` only survived as a compatibility layer from the
segment-reuse refactor: it emulated the removed
`(path, params, decoder, usedParams, keys, metadata)` signature by parsing
the template, re-implementing the param-name loop and folding
`hasMissingPathParams` into a metadata flag.

Call the real functions instead. Tests now parse templates with
`parseSegments(false, { fullPath }, 0)` exactly like `buildLocation` does
for templates without a processed route, pass the segments to
`interpolatePath`, and read names and availability from `getParamNames`
and `hasMissingPathParams`. The prepared-route tests compare route-owned
segments against that standalone parse directly, and the interpolation
bench derives its reference values the same way.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:08 +02:00
Manuel Schiller
1e6d9c8062
perf(router-core): match the current location lazily in buildLocation (#8406)
`buildLocation` matched the current location up front for every build,
although the result is only read by relative destinations, inherited
params, `search: true` or updater functions and search middlewares. An
absolute destination with its params given, on a branch without search
middlewares, never reads it, yet still paid three store reads and a
WeakMap lookup per call. The match is now computed on first read, and the
destination template is scanned for `$` once instead of twice.

Server `buildLocation` of `/items/$itemId` with params on a middleware-free
tree: 399 -> 382 ns per call (-4%). Builds that read the current match are
unchanged. react-router.minimal gzip +4 (86008 -> 86012, the stack base).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:08 +02:00
Manuel Schiller
92719bd586
perf(react-router): memoize Link and forward refs without an effect (#8405)
* perf(react-router): memoize Link and forward refs without an effect

When a layout re-renders on navigation, for instance because it reads
`useLocation`, every Link below it re-renders too. Profiling 200 mounted
Links showed that re-render dominated by React's per-hook update work, the
element creation and the anchor's prop diff, not by the Link's own logic.
A Link's output depends only on its props, the router context and the
location store, all of which React tracks for memoized components, so
`Link` is now wrapped in `React.memo`. Router options are compared by
value, because destinations are usually inline object literals; element
props are compared by reference, since they may hold arbitrary, even
cyclic, user data. The comparator reuses `ROUTER_OPTION_KEYS`.

The memo adds one fiber per Link. To pay for it, `useForwardedRef` goes:
its `useImperativeHandle` was the only layout effect on a Link and ran for
every Link although most never receive a ref. The link keeps a plain
`useRef`; when a ref is forwarded, one callback fills both. The hook had no
other consumer. `enqueuePreload` no longer doubles as the cleanup path: the
preload effect cancels the intent timer directly.

Measurements (macOS arm64, Node 24.8.0, local, against the previous commit):
- Link client paired runner, 200 Links under a re-rendering layout
  (3 repeats): shared-params CPU -54%, masks -56%, rewrites -60%; links
  whose props can never compare equal (updater functions, inline
  `activeProps` functions) param-updaters +2.5% [-5.2, 10.9],
  location-updaters -1.0%, active -2.0%, all inconclusive.
- retained heap per mounted app 2782 -> 2738 KB; mount unchanged within
  noise (the memo fiber and the removed layout effect cancel out).
- react-router.minimal gzip 85968 -> 86008 (+40); the branch stays 4 bytes
  under the stack base.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(react-router): memoize the Link's merged ref callback

The merged ref that fills a forwarded ref alongside the link's own ref was
an inline closure, so every Link render produced a new callback and React
detached and re-attached it: a consumer's callback ref was called with
`null` and then the element again on each location-driven re-render
(3 calls after one navigation instead of 1), and an object ref was cleared
and refilled inside the commit. `useImperativeHandle(ref, ..., [])` on main
only re-ran when the consumer's ref changed.

The callback is now memoized with `useCallback` on the forwarded ref, which
restores that contract: the consumer is notified on mount, when their ref
changes and on unmount. A cleanup returned by a consumer callback is still
passed through to React. Nothing reads `innerRef.current` after a detach
without a re-attach, so the wrapper that would clear it on cleanup is left
out (+19 gzip for no observable behavior).

`areLinkPropsEqual` keeps the same rule but states it in two steps, since
the nested condition read as if `children` were deep-compared: element
props (`children`, handlers, `style`, ...) only match by reference, and
only router options fall through to `deepEqual`.

Tests pin all three: a stable callback ref stays at one call across a
location change and is released when swapped, a returned cleanup runs on
unmount instead of a `null` call, and a new JSX child or a cyclic element
prop re-renders the Link instead of being compared deeply. The ref test
fails on the previous commit with `expected 1 call, got 3`.

Measurements (local: macOS arm64, Node 24.8.0, production React 19.2.3):

- `react-router.minimal` gzip 86008 -> 86004 (-4). The comparator
  restructure alone is -2; `useCallback` without the cleanup wrapper is
  neutral, the wrapper would have been +19.
- Mount of the 200-Link benchmark app, medians of 60 runs: 4.97 ms with
  `useImperativeHandle` (main's mechanism on top of this branch), 4.71 ms
  with the inline callback, 4.69 ms memoized. Retained heap per mounted app:
  -23 KB against `useImperativeHandle` (its layout effect keeps an effect
  node, a bound function and two deps arrays per fiber pair).
- Paired client runner, 3 repeats, memoized vs `useImperativeHandle`: 12/13
  workloads inconclusive, `rewrites` -4.6% [-9.0, -0.2]. Memoized vs the
  inline callback: +2.5% [1.4, 3.7] on `param-updaters` and +1.4% [0.4, 2.5]
  on `relative`, where every Link re-renders per navigation and pays the
  extra hook; the other 11 workloads are inconclusive.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:07 +02:00
Manuel Schiller
d740d8bf2d
perf(react-router): fewer hooks per Link (#8404)
A Link render ran about 25 hook slots. React allocates a hook object per
slot per render, plus a deps array for every memo, callback and effect, so
the slots set both the re-render cost and the retained fiber memory of a
mounted Link. Five of them did not need to exist:

- The three `useValueStable` refs for `search`, `params` and `activeOptions`
  become one `useStableValues` ref that replaces each entry only when its
  own contents change, so identities behave exactly as before.
- `_options` and its `dest` copy come out of one memo instead of two.
- `doPreload` is a module function, `preloadLink(router, options)`; the
  callback existed only to give the effects a stable identity.
- The IntersectionObserver effect and the render-preload effect merge into
  one preload effect whose cleanup also cancels a pending intent timer, as
  the observer hook's cleanup did. `useIntersectionObserver` had no other
  consumer and is removed.

`hasRenderFetched` stays: without it a link with an updater-function
`search` would preload on every render.

Measurements (macOS arm64, Node 24.8.0, local, 200 mounted Links):
- retained heap per mounted app 2949 -> 2782 KB (-6%, about -0.8 KB per Link)
- mount (router creation + first render) median 2.05 -> 1.90 ms
- Link client paired runner (4 repeats): shared-params CPU -3.0%
  [-5.3, -0.6], active -3.3% [-8.4, 2.1]
- react-router.minimal gzip 85984 -> 85968 (-16)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:07 +02:00
Manuel Schiller
f2ff324b7a
refactor(react-router): one key set and one assembly path for Link props (#8401)
The client and the server each kept their own copy of the 35 option names:
the client as an object-rest destructure, the server as a Set. The two
paths then assembled the result differently, with an eleven-spread external
return and a fourteen-entry literal on the client and a fill-in-place
sequence on the server.

Both now share two helpers. `collectElementProps` copies every option the
router does not consume, using one `ROUTER_OPTION_KEYS` set plus the two
host rules (`Link` hosts never render `type`, an anchor has no `disabled`).
`applyLinkState` finishes a router-controlled link: the selected state
props, then the routing attributes and the merged class and style. It is
the one place that defines precedence and absorbs `resolveStateProps`. The
client adds its composed handlers between the two; the server adds
nothing. External links return the collected props with `ref` and `href`.

Element props therefore pass through as given instead of being stripped
and re-added: external links forward them verbatim, falsy values included,
and `useLinkProps` returns `children` for router-controlled links as it
already did for external ones. Class and style are assigned only when the
link or its state props provide one, so links without them carry no
`undefined` keys and empty strings are still dropped.

Measurements (macOS arm64, Node 24.8.0, local, against the previous commit):
- react-router.minimal gzip 86019 -> 85984 (-35); -28 against the stack
  base, which this branch previously exceeded by 7.
- Link client paired runner (3 repeats): shared-params CPU -13.8%,
  unique-params -11.4%, middleware -8.6%, encoding -13.2%, active -16.9%,
  all "faster". A 35-key object rest costs about 440 ns per call, the key
  set copy about 50 ns.
- Link SSR paired runner (6 repeats): +0.4% to +1.5%, inside the runner's
  +/-4% noise floor measured head-against-head. SSR bundle 189850 -> 189523.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:07 +02:00
Manuel Schiller
b747fb8891
perf(router): keep the location cache client-only and slim Link SSR (#8390)
* perf(router): keep the location cache client-only and slim Link SSR

The per-options location cache from the location-reuse changes only ever
hits on the client: server renders never repeat an options object, yet
every server build still created the WeakMap, looked it up per build, and
Solid/Vue server Links stored an entry per render. All three sites are now
guarded by `!(isServer ?? this.isServer)`. `isServer` is a per-bundle
constant, so server bundles contain no cache at all (the Link SSR bundle
has zero references); client bundles keep it unchanged.

Rendering a React Link on the server copied its props four times: `Link`
split off `_asChild`, `useLinkProps` split the router options off with an
object rest, the result was assembled with spreads, and `Link` copied once
more to drop `type` and `disabled`. Profiling showed the object rest alone
was 85% of the hook's self time: V8 checks every key against the whole
35-entry exclusion list (about 470 ns per call versus 95 ns for a key-set
copy).

`useLinkProps` is now a wrapper over `useLinkPropsFor(options, ref, host)`.
`Link` passes its host (`'a'` or the `createLink` component), so the hook
omits `disabled` for anchors and `type` for both, and `Link` passes the
result straight to `createElement`. The server branch is a separate
`getServerLinkProps` referenced only inside the `isServer` check, so it and
its key set are dropped from client bundles; it reads the few options it
needs, splits element props with the key set, fills the props object in
place with the same precedence and attribute order as before, and no
longer runs `useForwardedRef` (moved after the server return). The client
keeps its rest destructure; the host handling costs a few bytes there,
mostly paid back by the folded router-core guards (numbers below).

`encodePathLikeUrl` tests with one merged character class
(`/[\s\u0080-\uFFFF]/`), which matches exactly the same code units as the
alternation it replaces and is about 10% cheaper.

Measurements (macOS arm64, Node 24.8.0, local):
- Link SSR paired runner (ABBA, 4 fresh processes per case) against the
  previous stack top: all 13 cases faster, CPU -19.5% to -40.3%.
- Link client paired runner: all 13 cases faster, CPU -4.6% to -9.2%.
- Start SSR request loop (benchmarks/ssr, react), interleaved builds:
  3.120 -> 2.890 ms per loop (-7.4%), 320.5 -> 346.1 hz.
- Client bundle react-router.minimal gzip: 86012 -> 86021 (+9; raw +7,
  brotli -22): the router-core guards fold to -12, the Link host handling
  costs +19. The Link SSR bundle shrinks from 197832 to 189989 bytes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* refactor(react-router): one state-prop precedence rule for every Link

Active and inactive state props overrode `ref` and the event handlers on
every link except a blocked one (a destination with a disallowed scheme),
where the forwarded ref and the router's handlers won. The exception dates
from the hardening change, whose test observed the then-general "router
wins" rule on a blocked link; when state props were later allowed to
override element props, blocked links were carved out to keep that test
green rather than by design. It bought no safety: `href`, `disabled` and
`target` are assigned after the state props in both orders, which is what
actually keeps a blocked destination inert. It did make the same
`inactiveProps` attach their `ref` and `onClick` on one inactive link and
silently drop them on another, and it differed from Solid's Link, which
applies one rule.

Blocked links now follow the same precedence as every other link: state
props override element props, `ref` and handlers; the routing attributes
always win. The server branch loses its if/else, the client loses the two
conditional spreads and the `blockedLink` flag. The blocked-link test now
pins the uniform rule together with the routing attributes it already
checked.

Measurements (macOS arm64, Node 24.8.0, local, against the previous commit):
- react-router.minimal gzip 86021 -> 86019 (-2), raw -38, brotli -33.
- Link client paired runner (3 repeats): shared-params CPU -11.6%
  [-15.1, -7.9], encoding -13.2% [-20.2, -5.7].
- Link SSR paired runner: within noise. SSR bundle 189989 -> 189850 bytes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:06 +02:00
Manuel Schiller
9448caa03a
perf(router-core): keep search middleware collection optimized (#8385)
CodSpeed's memory instrument flagged the interrupted-navigations client
benchmark on the location-reuse changes (react +14.6%, vue +29.8%, solid
+10.8% peak memory). Under its worker flags (`--no-opt --predictable`,
single threaded) that benchmark's peak is set by a synchronous Maglev
compile that happens inside the measured run.

`getSearchMiddlewares` is compiled during the preparation calls and then
deoptimized on the first property load off a route's options. Before,
its only caller was the small `applySearchMiddleware`, which Maglev
compiled next and inlined it into, so the callee never tiered up again.
Since `build` calls it directly and does not inline it, it became hot
again during the measured run, and its recompilation (about four 32 KB
zone segments) set the peak.

Iterating `destRoutes` with a counted loop instead of `for...of` keeps the
function optimized once compiled: no deoptimization and no recompilation
in the measured window. Middleware order and live route-option reads are
unchanged. Hoisting the option reads alone did not help.

Local reproduction with a malloc interposer, CodSpeed's worker flags and
seven preparation calls, macOS arm64 / Node 24.8.0 (deterministic peaks):
- react: 248880 (base) -> 287760 (+15.6%) -> 248944 with this change
- vue:   256704 -> 292656 (+14.0%) -> 256640
- solid: 287408 -> 288240 (+0.3%)  -> 287632
These are local native allocations, not a new Linux CodSpeed CI run.
Bundle (react-router.minimal gzip): +8.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:06 +02:00
Manuel Schiller
6cfb1e8b56
perf(router-core): stop structurally sharing search and state in buildLocation (#8382)
`buildLocation` ran `nullReplaceEqualDeep` over the built search and
`replaceEqualDeep` over the built state against the current location on
every build. That work only affected object identity, and nothing reads
that identity from a built location:

- Links select href and isActive from the built location; active state is
  computed by value and ignores history state.
- `commitLocation` already compares state by value (`deepEqual` over
  `_getUserHistoryState`), so pre-shared children were at most a shortcut.
- The identity consumers actually rely on (selecting `location.state.user`
  or a nested search value without rerendering) comes from `parseLocation`,
  which stabilizes the committed location against the previous one. That
  sharing stays untouched, as do the `matchRoutes` sites for search, params
  and loaderDeps.

On the server `replaceEqualDeep` was already a passthrough, so client and
server builds now produce the same shapes.

Behavior changes:

- A literal `search` or `state` is returned as the caller's object. It is
  never written to: `commitLocation` and history both copy before adding
  `__hashScrollIntoViewOptions`, `__TSR_key`, `key` and the index.
- Because `replaceEqualDeep` returned the *current* search when contents
  were equal, `buildLocation` used to re-serialize the current key order.
  At `?a=1&b=2`, `buildLocation({ search: { b: 2, a: 1 } })` produced
  `?a=1&b=2`, so navigating there was a same-location no-op. It now
  produces `?b=2&a=1` and pushes a new history entry.
- A destination without `search` yields the frozen `EMPTY_RECORD`
  instead of a fresh or shared object. Nothing downstream mutates the
  built search; all consumers copy.

The `usedCurrent` tracking is unchanged: only reads through `current()` /
`currentMatch()` mark a build as location-dependent, so literal search and
state keep hitting the per-options cache.

Tests: the build-time sharing assertion (`explicit state structurally
shares unchanged nested values`) is replaced by a describe block that pins
the new contract: built search/state are the caller's objects, equal nested
references are preserved after navigation via parseLocation, `navigate`
does not mutate a plain or frozen caller state, and the key-order case is
covered at both the buildLocation and the navigation level.

Measurements (react-router.minimal, this tree):
gzip 86026 -> 86004 (-22), initial -23, raw -41, brotli +65.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:05 +02:00
Manuel Schiller
465c85a734
fix(react-router): treat Link params and search as immutable inputs (#8380)
`useValueStable` kept a shallow copy of `params` / `search` /
`activeOptions` (dac2bf249f) so that an object mutated in place would
yield a new reference on the next render. That only ever held one level
deep: a nested change such as `search.filters.page = 2` left the shared
nested reference in the copy, `deepEqual` short-circuited on it, `dest`
kept its identity and `buildLocation` served the cached location.

Detecting mutation is not a contract React lets us keep. A mutation on its
own never renders anything; the tests that exercised it needed a manual
re-render button to observe the change, which is the same situation as a
mutated `React.memo` prop or `useMemo` dependency. Rather than snapshot
deeper (measured +63 gzip bytes on react-router.minimal and a 3-5x slower
compare whenever nested references are shared, since nothing can
short-circuit), `useValueStable` stores the caller's reference again, as
on main. The reference is the router's invalidation signal: pass a new
object to change a destination.

The regression test now pins the contract that can actually break: fresh
inline literals with equal nested contents must not trigger another
`buildLocation`, and a nested value that changes through React state must
produce a new href on that render and keep it across navigations. The
accessor and in-place mutation tests are removed along with the promise
in the changeset.

Bundle (react-router.minimal gzip): 86038 -> 86026 (-12).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:05 +02:00
Manuel Schiller
e9396c9289
perf(router): reuse location-independent Link destinations (#8370)
* perf(router-core): reuse location-independent Link destinations

Most mounted Links point at a destination that does not depend on where
the user currently is: an absolute `to`, literal params for every template
key, a literal (or no) search, hash and state. Until now every navigation
rebuilt all of them anyway, because `buildLocation` always started from the
current location.

`buildLocation` now tracks whether a build read the current location at
all. Every such read goes through `current()` / `currentMatch()`, which set
one flag; a build that finishes without it depends only on its options and
the route tree. When the caller passed `_fromLocation` (what Links do) and
no mask is involved, the resulting location is kept in a WeakMap keyed by
the options object, and the next `buildLocation` with that same object
returns it directly. `update()` and `setRoutes()` replace the map, so router
option changes and HMR route-tree rebuilds invalidate everything.

To make that flag meaningful the reads became demand-driven instead of
unconditional: an absolute `to` resolves without a base path, params that
cover the template skip the inherited-params merge, a literal search/hash/
state never touches the current values, and stringifiers fetch inherited
params only when a route defines one. Structural sharing with the current
search/state stays, as it only affects identity.

Contract: the same options object yields the same location until router
options or the route tree change. Callers own invalidation by passing a new
object when their values change (the follow-up react-router commit does
that with deepEqual-stabilized copies of `params`/`search`).

Once whole locations are reused, the per-route SIEVE pathname cache
(`_pathCache`, `InterpolationPlan`, `createPathInterpolator` and its router
plumbing) is redundant and is removed; templates are interpolated directly
from the route's parsed segments.

Tests: path, route-tree-caches, path-decoder and the interpolation bench
assert canonical pathnames through `buildLocation` instead of cache
internals.

Performance (Apple M4, Node 24, fresh production bundles, 3 runs each;
measured on a tree that also carried the replaceEqualDeep changes now
proposed separately in #8362, #8363 and #8364):

- Measured alone, with the React Link still spreading a fresh options
  object per navigation so nothing hits the cache: links/react 341.3 ->
  290 hz (-15%); paired link-perf client vs stack HEAD: encoding +30%,
  splats +24% slower (HEAD's pathname cache targeted exactly those), the
  other cases within noise. This commit is the first half of a two-part
  change and regresses on its own.
- With the follow-up react-router commit (stable options object, so 160 of
  161 builds per navigation become 13 ns cache hits; a full build costs
  680-970 ns): links/react 622 hz (+82% vs stack HEAD, rme +-0.4%).
  Paired link-perf client vs origin/main: shared-params -34%, unique-params
  -36%, splats -41%, encoding -54%, active -44%, middleware -14%,
  relative -9%. SSR vs origin/main: -12..-32% on every measured case
  (encoding -23%, splats -18%); vs stack HEAD only SSR encoding is slower
  (+31%).
- Bundle (react-router.minimal gzip, this tree): 85925 -> 85992 (+67) for
  this commit, 1 byte below origin/main (85993); 86038 with the Link commit.
  With #8362, #8363 and #8364 applied as well the tree measures 85983.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(react-router): keep one options object per Link so locations are reused

`buildLocation` now returns a cached location for an options object whose
previous build never read the current location (06e4504605). The React
Link built a fresh `{ _fromLocation, ..._options }` on every navigation, so
it never hit that cache.

Each Link now owns one `dest` object, memoized on `_options`. The location
selector sets `dest._fromLocation` in place (unless the caller supplied one)
and passes the same object to `router.buildLocation`, so a Link whose
destination does not depend on the current location costs a WeakMap lookup
per navigation instead of a full build. `navigate` and `preloadRoute` still
receive `_options`, so the in-place field never reaches a navigation.

Because object identity is now the router's invalidation signal,
`useValueStable` keeps a shallow copy of `params`/`search`/`activeOptions`
rather than the caller's object. `deepEqual` therefore never short-circuits
on reference equality, and a params object that was mutated in place, or is
backed by accessors, yields a new reference (hence a new `dest`) on the
render that observes the change. A mutation that no render observes is no
longer picked up by a navigation alone; that matches how every other Link
input already behaves.

The server branch had its own inline copy of the active-state, class and
style derivation while the client used `resolveIsActive`. Both now share
`resolveIsActive` and a `resolveStateProps` helper; the results are
identical (`exactPathTest` is the same trailing-slash comparison,
`deepEqual` already treats two key-less search objects as equal, and the
hash check yields `false` on the server because it is never hydrated
there). The two `blockedLink` spreads that position state props before or
after `ref`/handlers are documented in place.

Tests (`link-destination.test.tsx`): the middleware test follows the HMR
sequence (`route.update()` then `router.setRoutes(router.buildRouteTree())`)
instead of expecting a bare `route.update()` to be observed; the test for
an impure `stringifySearch` closing over a mutable variable is dropped
along with that contract; the mutation and accessor tests re-render the
fixture and assert the updated location survives further navigations.

Performance (Apple M4, Node 24, fresh production bundles, 3 runs each;
measured on a tree that also carried the replaceEqualDeep changes now
proposed separately in #8362, #8363 and #8364):

- links/react (200 mounted Links, 8 navigations per lap): 290 -> 622 hz
  against the parent commit, +82% against stack HEAD (341 hz). 160 of the
  161 `buildLocation` calls per navigation become 13 ns cache hits; a full
  build of these Links costs 680-970 ns.
- Paired link-perf client vs the parent commit: shared-params -24%,
  splats -35%, encoding -49%, active -36%, unique-params -25% (wide
  interval), middleware unchanged (never cacheable).
- Combined with the parent, vs origin/main: client shared-params -34%,
  unique-params -36%, splats -41%, encoding -54%, active -44%,
  middleware -14%, relative -9%; SSR -12..-32% on every measured case.
- Bundle (react-router.minimal gzip, this tree): 85992 -> 86038 (+46);
  +113 vs stack HEAD, +45 vs origin/main (85993). With #8362, #8363 and
  #8364 applied as well the tree measures 85983, 10 bytes below origin/main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* refactor: stop exporting isPlainObject and isPlainArray

Nothing in the repository imports these two helpers from a package entry
point; they are only called inside `utils.ts` by `deepEqual` and
`replaceEqualDeep`, and `isPlainArray` is unit-tested via `../src/utils`.
#8363 tightens `isPlainObject` to a constructor check that is meant
for the router's own structural sharing, so the helpers are no longer
exported from `@tanstack/router-core`, `@tanstack/react-router`,
`@tanstack/solid-router` or `@tanstack/vue-router`.

No bundle change in react-router.minimal (unused exports were already
tree-shaken): 85983 before and after.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* chore: add changesets for Link location reuse and the removed helpers

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:05 +02:00
Manuel Schiller
634da9176e
perf(router-core): streamline route initialization (#8327)
* perf(router-core): reuse parsed route segments for interpolation

Capture original template segments during the existing route-tree parse.
Interpolation only substitutes current values and produces fresh metadata;
it never reparses known routes, including first use and trailing-slash
variants. Rebuild the captured data with the tree for HMR. Parse unknown
templates once per bounded entry and reuse their segments across decoder
changes. Update Devtools and internal test consumers.

Remove internal undefined-path/server-flag compatibility and the divergent
SSR scanner. Both runtimes follow the canonical splat grammar. Keep the
128-result route cache after measuring its removal rather than adding an
unproven configuration option.

Measured against 41e42009be with frozen production bundles:
- 26 client/SSR Link cases, 4 paired replicas each: client unique params
  -3.94% CPU [95% CI -6.30,-1.52], optionals -2.58% [-4.34,-0.78].
  Other cases inconclusive; no supported end-to-end slowdown.
- 1000-route client high-cardinality interpolation -18.55..-24.83%;
  matching with fresh metadata -14.69..-19.12% (5 process samples).
- 1000-route client setup costs an extra 0.084..0.192 ms; sparse first use
  costs about 0.23..0.28 us/call. Retained segment data adds about 200..298 B
  per dynamic route in the measured fixtures.
- All 18 bundle cases add 303..392 gzip B; React minimal/full +311/+326 B.
- Cache-off saves 0.8..0.9 MiB per 1000 used routes and 1.2..1.5 MiB after
  growth, but client encoding/splat Links regress 25.31%/12.71% and SSR
  encoding/splats regress 21.76%/25.37%; retain result caching.
- Shared-value sampled allocations rise 2.18% client/5.23% SSR without that
  cache. Native Vue peaks remain effectively unchanged (macOS captures,
  not a new Linux CodSpeed CI run). Benchmark counts/JIT/GC flags unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): avoid temporary route initialization joins

Build route IDs and full paths with direct string assembly and the existing
cleanPath normalizer. Avoid temporary filter/join arrays and the second ID
normalization. Pathless layouts keep the parent's fullPath unchanged.

Add a focused construction benchmark with fresh route objects and separate
processing-only / allocation-plus-processing cases at 100/1000/10000 routes.
Document why client-nav route-tree-scale is not a construction benchmark.

Standalone attribution against 41e42009be, otherwise unchanged Uint16Array
parser, 7 fresh process replicas and 1000 routes per tree:
- Client processRouteTree+route.init CPU improves 11.48-19.57% across
  static, dynamic, nested and mixed trees (all 95% intervals below zero).
- Server CPU improves 9.39-22.29% (all 95% intervals below zero).
- React Router minimal gzip +6 bytes; the composed parse-once implementation
  is measured separately against the required original bundle budget.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): reuse stable path parameter decoders

Compare allowed-character values rather than recompiling the decoder on
every provider-style options update. Equivalent arrays retain warm route
paths; in-place edits and option removal update encoding correctly.
Publish the configuration key only after successful compilation, and
declare optional state without forcing an unused instance field.

Isolated against 3e0b23f46c with the same path-decoder.bench.ts, seven
alternating independent process pairs (200 locations per batch):
- Stable provider updates: 143.3707 -> 122.5572 us, -14.52%
  (95% process interval -15.51% to -13.52%).
- No-update control: 119.1170 -> 118.8155 us, -0.25%
  (interval -1.05% to +0.55%).
- Deliberately changing configuration every batch: 143.8213 -> 147.7340 us,
  +2.72% (interval +1.38% to +4.08%). Reconfiguration remains the cold path.

These are decoder/update mechanism measurements, not a claim about every
React Link render. Standalone React minimal gzip: 86121 -> 86142 bytes
(+21); raw +48 bytes, Brotli +10 bytes.

Add coverage for equivalent options, mutation, removal, direct overrides
and retrying failed compilation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): simplify route-owned path interpolation

Share one canonical scanner between tree processing and unknown templates.
Retain compact dynamic records and derive original parameter names lazily,
instead of reconstructing them during matching. Keep initialization/indexing
and traversal in processRouteTree, including existing nested-mask behavior.

Make pathParamsAllowedCharacters initialization-only, as requested. Compile
the readonly decoder once, remove decoder keys/stamps/update invalidation,
and keep path results on each route. Preserve the shared bounded unmatched
template cache across SSR requests; lightweight matching stays router-local.
Do not add an encoding-specific cache, router-level route map or bulk clear.

Move Devtools-only navigation availability outside the hot formatter.
Preserve legacy standalone fallback match identity and cache behavior,
including inherited params and route-tree replacement. Retain useful encoding
comments and explicit tuple-slot labels.

Final measurements (Node 24.8.0, built production JS, unchanged workloads):
- Original React client-nav Link loop versus 41e42009be, four balanced
  fresh-process pairs: CPU 2.5015016 -> 2.4370936 ms per 8-navigation batch,
  -2.57% (95% process interval -3.72% to -1.42%). Wall -2.58%.
- Fresh 1000-route client processing/init: static -12.39%, dynamic -5.34%,
  nested -6.54%, mixed -2.59%. Server static -9.12%; remaining intervals
  are reported separately and the mixed-server result is inconclusive.
- All 18 gzip fixtures are below 41e by 47-88 bytes. React minimal:
  85801 -> 85731; full: 89392 -> 89318. Raw JS -533..-697 bytes;
  Brotli varies by fixture rather than uniformly shrinking.
- Full 26-case paired client/SSR Link suite: no supported regressions;
  most small changes are inconclusive, not claimed as universal speedups.
- Warm retained path-cache heap saves about 7.8 KiB per 1000 routes in
  default/custom configurations. Native Vue peaks remain near baseline;
  peak, allocation totals and end outstanding are measured separately.

Existing literal grammar/URL/matching expectations are preserved. The
independent oracle covers 49638 segment cases and 338 matching/mask traces
within the old offset range. Initialization-only encoding deliberately
supersedes the previous live-update contract.

Detailed measurements and rejected experiments remain in uncommitted
session reports and LOG.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): initialize routes directly during tree processing

Remove the optional initRoute callback and unconditionally call
route.init({ originalIndex: index }) at the start of the parent-first visit,
before indexing or parsing the route. Require init on this function's input
without imposing it on masks or the shared template-scanning RouteLike type.

Remove the Router and construction-benchmark forwarding wrappers. Adapt
preinitialized matcher fixtures through one test-only helper with a
non-enumerable no-op init; do not normalize their paths/IDs or change their
expected grammar/matching results. Add real-route initialization order,
index and exactly-once coverage.

Performance versus bc71b06207, seven independent process pairs per
shape/mode using the same built-JS entry and fresh route objects:
- Server static 1000-route processing/init: 0.7781686 -> 0.7623686 ms/tree,
  CPU -2.06% (95% interval -3.26% to -0.84%); wall -2.10%.
- Other construction cells are inconclusive, with no supported slowdown.
- All 18 gzip fixtures improve by 10-26 bytes. React minimal:
  85731 -> 85712 bytes (-19). Raw -20 bytes (-59 for Rsbuild);
  Brotli remains fixture-dependent.

Object creation and forced GC are outside processing timers. The common
measurement entry's obsolete third argument is ignored by the new code,
so once-per-tree callback allocation savings are not overstated.

Full measurements and logs remain in the session's
direct-route-init-20260909 artifacts and uncommitted LOG.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): pass route initialization indexes directly

Change the internal initializer to route.init(originalIndex). Update the
Route interface, BaseRoute implementation, processRouteTree contract and
both production call sites, including the standalone legacy fallback.
Remove object-literal arguments without adding compatibility wrappers.

Keep route ordering and stored indexes unchanged. Cover primitive arguments,
index zero and the large legacy fallback index explicitly.

Performance versus f2c2d55f99:
- Seven independent fresh-process construction comparisons per shape/mode
  (100, 1000 and 10000 routes; static/dynamic/nested/mixed) show no
  statistically supported timing difference. Do not claim an unproven
  CPU or heap-byte improvement from the removed object literals.
- All 18 gzip fixtures improve by 7-13 bytes. React minimal:
  85712 -> 85702 (-10); full: 89303 -> 89291 (-12).
- Raw JS decreases by 46 bytes in every fixture. Brotli varies.

The same production-JS phase entry and workloads are used on both sides.
Object creation and forced GC are outside processing timers. Detailed
samples, intervals and logs remain in numeric-route-init-20260909 session
artifacts and uncommitted LOG.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* update route trees

* ci: apply automated fixes

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-13 13:55:04 +02:00
Manuel Schiller
cb8749e9fc
perf(vue-router): remove redundant match fragment (#8326)
Remove the inner Fragment around scroll restoration while retaining the
outer Fragment, script/null condition and fresh shell-slot VNodes. Cover
child state across shell updates/invalidation and SSR script selectors/nonces.

Native malloc profiling on macOS arm64, Node 24.8.0, with the existing
CodSpeed flags, seven preparation calls and three fresh final captures:
- Interrupted peak after middleware split: 733736 -> 295024 bytes (-59.79%).
- Navigation peak after middleware split: 420776 -> 420896 (+120 bytes).
- Composed vs f2530bf453: interrupted -59.79%, navigation -19.32%,
  unique-location churn effectively unchanged (-0.016%).
These are local native measurements, not a Linux CodSpeed CI result.
Navigation end-of-region outstanding malloc increases 12472 bytes versus
the middleware-only control; this endpoint is before teardown, not retained
JS heap. Total allocated native bytes decrease.

Standalone Vue canonical Link CPU: 5.32037 -> 5.30865 ms/batch,
-0.22% [-4.04%, +3.75%], inconclusive across four isolated process pairs.
Incremental gzip: Vue Router minimal/full +1/+1 byte, Vue Start 0/-2.
All four Vue bundles remove 12 raw bytes; other 14 fixtures are identical.
No benchmark flags, workload counts, public APIs or features changed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:04 +02:00
Manuel Schiller
700a714c5f
perf(router-core): reduce navigation allocations (#8325)
* perf(router-core): cache canonical interpolated pathnames

Store the existing canonical decoder's pathname in the route interpolation cache so hits do not decode it again. Keep the standalone interpolation kernel, static/leaveParams paths, non-string fallbacks, cache capacities and decoder/template invalidation unchanged. Cover cold/hit href parity, reserved encodings and coercion fallback.

Against 3905181fd4, four balanced isolated-process pairs reduced encoded-destination client CPU 13.42% (95% CI -14.50% to -12.32%) and wall 13.32% (-14.44% to -12.19%). Shared params CPU improved 1.27% (-2.39% to -0.14%); unique/miss-heavy CPU +0.49% (-0.35% to +1.33%) was inconclusive. Four paired SSR repetitions improved encoded CPU 14.13% (-19.70% to -8.18%) and wall 14.17% (-19.83% to -8.12%).

React Router minimal/full gzip +4/+5 bytes to 85791/89378. Across all 18 fixtures gzip deltas range -7 to +16 bytes. The private microbenchmark now names its normalized-output contract; its changed-scope timings are not used for the speedup claims.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): reuse lightweight raw-param snapshots

getMatchedRoutes already copies cached raw params. Reuse that owned snapshot for lightweight parsing instead of allocating another dictionary. Preserve state-param reuse and matcher cache ownership. Cover mutating/throwing live parsers and add an opt-in cold-source location benchmark.

Against ac2ac45367, the same 256-build cold-location benchmark observed client means 0.3434 to 0.2987 ms for one param, 0.7437 to 0.4638 ms for eight, and 1.8625 to 1.1565 ms for 32. Before/after RMEs were 5.15/5.47%, 8.10/4.14%, and 2.37/2.97%. These are cold-mechanism results, not a 38% application speedup; small server cases were noisy and four paired application relative/numeric cases were inconclusive.

React Router minimal/full gzip decreases 6/9 bytes to 85786/89376; raw -35. All 18 fixture gzip deltas range -11 to +1 bytes. No public API, parser behavior or cache capacity changed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): reduce middleware compilation memory

Separate search middleware collection from recursive execution so Maglev
does not build one large compiler graph for both. Preserve live route-option
reads, ordering, validation, legacy filters and the empty-search fast path.
Cover middleware replacement/removal across a previously used route branch.

Native malloc profiling on macOS arm64, Node 24.8.0, using the existing
CodSpeed flags and seven preparation calls (three fresh processes):
- Vue navigation peak: mean 521664 -> 420776 bytes (-19.34%).
- Vue interrupted-navigation peak: 733736 -> 733736 bytes (unchanged).
These are local native allocations, not a new Linux CodSpeed CI run.

Four paired React Link replicas: relative client CPU -2.79%
[-4.37%, -1.18%]; shared/updater/middleware cases are inconclusive.
Isolated SSR CPU means range -1.63% to +1.28%, all inconclusive.
React Router minimal/full gzip: +15/+16 bytes; all 18 gzip deltas -6..+20.
Keep all benchmark JIT/GC flags and operation counts unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:04 +02:00
Manuel Schiller
6387d581ea
perf(react-router): reduce Link runtime allocations (#8324)
* perf(react-router): filter native Link props once

Omit type and disabled in one rest copy for native anchors instead of copying the hook result twice. Custom components still receive disabled, and useLinkProps still returns supported type/disabled values. Add client/SSR coverage for those distinctions, refs and render-function children.

Against 6e4584e0d8, four balanced fresh-process pairs with one implementation per process reduced client parameter-updater CPU from 15.61515 to 15.14615 ms per eight-navigation batch (-3.00%, 95% CI -4.19% to -1.80%); wall -3.04% (-4.29% to -1.78%). SSR shared-param CPU fell from 1.45208 to 1.41006 ms per four-request batch (-2.89%, CI -3.80% to -1.98%); wall -2.85% (-3.84% to -1.84%). Earlier co-loaded comparisons were inconclusive.

React Router minimal gzip -5 bytes to 85773; full +1 to 89358. Other React fixtures vary -3 to +4 bytes, raw +14; Solid/Vue remain byte-identical. No public API or prop functionality removed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(react-router): stabilize hydration snapshot getters

Reuse the existing true/false snapshot functions instead of allocating them on every useHydrated render. This lets React skip unnecessary store-instance passive bookkeeping without changing hydration values or adding hooks. Cover stable identities and an actual server-render/hydrateRoot transition.

Against b6971a434a, four balanced fresh-process pairs per case (200 warmup and 500 measured eight-navigation batches) reduced parameter-updater CPU from 15.16880 to 14.99436 ms (-1.15%, 95% CI -1.84% to -0.46%); wall -1.05% (-1.62% to -0.47%). Middleware CPU fell from 15.23708 to 14.81729 ms (-2.75%, CI -4.46% to -1.01%); wall -2.79% (-4.53% to -1.01%).

React Router minimal/full gzip increases 14/15 bytes for this isolated fix, remaining below the initial branch baseline. All Solid/Vue bundle output is unchanged. Public APIs, server snapshots and client hydration transitions are preserved.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:03 +02:00
Manuel Schiller
9a356d7505
test(benchmarks): profile unmodified React Link bundles (#8323)
Keep comparison snapshots in SWC's existing node_modules exclusion so emitted JavaScript is not retranspiled and source-map positions remain valid. Preserve asynchronous ESM loading and add a failing-before source-integrity regression.

Four-replica identical-bundle calibration: client shared-params CPU +0.92% [-4.14%, +6.24%], wall +1.03% [-4.55%, +6.93%]; SSR CPU +0.17% [-6.32%, +7.11%], wall +0.15% [-6.44%, +7.21%]. Intervals include zero; no speedup is claimed. Production code is unchanged; baseline React Router gzip is 85797/89379 bytes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:03 +02:00
Manuel Schiller
d76a33284b
perf(router-core): consolidate interpolation caches (#8321)
* refactor(router-core): consolidate path interpolation

Remove the object-returning internal wrapper and keep one interpolatePath returning a pathname with optional metadata outputs. Migrate router, devtools, tests, and benchmarks while leaving parsing and cache limits unchanged.

Devtools requests only missing-param status. Tests use direct expected paths and explicit metadata; cache benchmarks no longer carry obsolete factory compatibility dispatch.

React Router minimal/full gzip are 85829/89413 bytes (+5/+4 from 8a9f57e638, still 14/4 below measured main). Full units/types/exports and 76 browser cases pass; eight paired client/SSR workloads show no supported timing change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): keep derived caches on routes

Store branches and interpolation plans directly on route objects. Use the already-resolved destination route, remove the fixed outer limit for registered templates, and retain128 results per route. Keep a bounded32-template fallback for arbitrary templates and masks.

Build/install route-tree indexes and string caches as one bundle for existing SSR reuse. Reinitialization clears ancestor branches; interpolation plans validate their exact template and decoder without unconditional resets. Loaded match data remains request-local.

Against29509b9b98, paired core buildLocation batches over64/256 templates use40-43% less CPU; four fresh server routers generating200 hrefs each use8-9% less. Reversed import order corroborates these scoped results. Four real client/SSR Link cases remain statistically inconclusive.

All18 bundle fixtures shrink19-37 gzip bytes versus the consolidation baseline. React Router minimal/full are85797/89379 bytes,46/38 below measured main. Tests cover SSR request cleanup, route reuse, decoder/trailing variants, reparenting, result bounds and fallback capacity.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(router-core): add opt-in matching interpolation benchmarks

Cover client/server matching with cold and Link-primed route plans, nested params, high-cardinality misses, optional params, and splats. Gate all additional cases behind TSR_LINK_PERF=1.

Evaluate six matching-cache prototypes without retaining production changes. Eager variants regress repeated misses by24-64%. Read-through reuse improves warm matching microcases but adds65 gzip bytes; all26 application Link/SSR comparisons show no supported speedup, with one relative-Link slowdown. Real HTTP SSR ABBA means differ by only -0.41%, within observed variation.

Restore production and all18 bundle metrics exactly to ec05cc6bec. Preserve detailed measurements and rejected prototypes in session artifacts and uncommitted LOG.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:03 +02:00
Manuel Schiller
f151ab018e
perf(router-core): compact navigation parameter resolution (#8328)
Declare the native null-prototype target once for non-inheriting parameter modes. Preserve updater isolation, native copy counts, and literal-parameter merge behavior. Group parameter resolution with search middleware without changing Link or path interpolation logic.

Official current-branch bundles shrink in all 18 scenarios by 2-30 gzip bytes versus 9c7cab48c1. React Router minimal: 85778 -> 85748 (-30); full: 89386 -> 89384 (-2).

A matched-main preview against cf166d160e measures React Router minimal at 85805 versus main 85821 (-16), and full at 89385 versus main 89398 (-13). Eight of nine matched-main React fixtures meet main; Start+Query remains +25 bytes. Small Solid overages are retained as agreed.

Eight paired client/SSR cases with four independent replicas each detected no supported timing regression or improvement. Add coverage for fresh updater copies, null prototypes, inheritance, and clearing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:02 +02:00
Manuel Schiller
873c830ccb
refactor(router-core): clarify segment interpolation (#8319)
Organize the generic interpolation loop into static, wildcard, and named-parameter behavior blocks. Keep one shared key lookup, one encoding step, and one prefix/value/suffix assembly. Name affix boundaries and keep optional/missing wildcard behavior local to its segment type.

Replace the self-clearing onMissing callback with an optional metadata result object. The public interpolatePath wrapper reuses its existing result object; pathname-only callers still allocate no metadata. Preserve one parameter read, the reusable parser buffer, absent optional cache keys, canonical and legacy splat metadata, and public return values. Fast-path empty splat strings before the URL-safe regex so sharing the encoding step does not penalize omitted values.

Final official gzip measurements versus 5017a72614:
- React minimal: 85771 -> 85769 (-2 bytes).
- React full: 89384 -> 89382 (-2 bytes).
- All 18 fixtures range from -4 to +8 bytes; no unrelated source changes compensate for interpolation cost.

Added mixed-type/affix metadata coverage and direct pathname-kernel benchmarks. Paired fixed-seed CPU measurements of the real parent/current modules show effectively flat required client pathname interpolation (+0.04%) and 0.37-4.14% lower time in the other sampled required/optional/splat/mixed/missing client/server combinations. These are focused kernel diagnostics, not a broad application speedup claim.

Preserve the experiments, rejected larger variants, full fixture metrics, and raw benchmark output in uncommitted LOG.md and session artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:02 +02:00
Manuel Schiller
9b2adaf8c3
perf(router): optimize Link state props across frameworks (#8318)
* perf(router): compact Solid and Vue Link state props

Port the React Link bundle-size reductions to Solid and Vue: share exact/fuzzy pathname normalization, resolve only the selected active/inactive props, concatenate classes without temporary arrays, and avoid style allocation when neither source supplies styles. Vue forwards and visits one selected props object in both client and SSR paths.

Keep framework-specific behavior: Solid retains its default-styling fast path and base href/handler precedence; Vue retains state-prop overrides and zero-argument callbacks. Both keep style snapshots so mutable Solid stores and Vue proxies remain reactive, including additions to empty style objects. No public API or unrelated production code changes.

Official gzip measurements versus d4cc307869:
- Solid minimal: 34017 -> 33973 (-44 bytes).
- Solid full: 38973 -> 38930 (-43 bytes).
- Vue minimal: 50731 -> 50646 (-85 bytes).
- Vue full: 56484 -> 56395 (-89 bytes).
All nine Solid/Vue Router/Start fixtures shrink by 26-104 gzip bytes; all nine React fixtures remain byte-identical.

Independent hunk attribution: active pathname checks save 36/41 Solid and 37/34 Vue bytes. State-prop changes alone save 0/2 Solid and 46/53 Vue bytes. Combined gzip deltas are not additive.

Existing 200-Link/eight-navigation workloads were compared with frozen parent, props-only, and final bundles. Standalone wall-time runs were too variable for a speed claim. Interleaved fixed-seed checks, repeated with reversed module order, showed effectively flat rendering cost: Solid mean CPU -1.49% / +0.33%, Vue -0.23% / -0.29%; corresponding wall changes -1.81% / +0.50% and -0.12% / -0.33%. No incremental rendering speedup is claimed. Raw results and experiments remain in uncommitted LOG.md and session artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(router): honor Link state props and Vue class bindings

Apply selected active/inactive props after ordinary base props in Solid and React, including React server output. Preserve the dedicated class concatenation and style merge handling. Add client/server regressions for supported refs and event handlers; do not widen the state-prop API to router navigation options.

Keep Vue object and nested-array class values intact instead of interpolating them into strings. Compose base/state values with Vue-compatible arrays, retain omitted-class behavior, and clone props at VNode creation because Vue normalizes class values in place. This preserves cached bindings and later reactive class changes. Vue ordinary state-attribute precedence was already correct and is left unchanged.

The regressions were run on the pre-fix implementations and failed for the reported behaviors, then passed after the fixes. Full framework unit/type/lint/package and Chromium coverage passes. Bundle impact remains small: React/Solid raw bytes unchanged; Vue Router minimal/full are 14/10 gzip bytes smaller. Detailed red/green evidence and measurements are kept in uncommitted LOG.md and session artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(solid-router): preserve computed Link routing props

Restore the computed href, target, and disabled values after active/inactive state props. Keep state-prop ref/event overrides, class/style composition, and the default styling fast path unchanged for client and SSR rendering.

Reproduce the history/rewrite href failures and extend existing state-prop regressions to cover conflicting routing fields. Full validation passes 922 client tests (one skipped), 33 server tests, type/lint/export checks, and 24 Chromium cases.

The full bundle matrix adds 16/13 gzip bytes to Solid Router minimal/full and 13-17 bytes to Solid Start fixtures. React and Vue bundles are unchanged; no extra allocations or href recomputation are introduced.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:01 +02:00
Manuel Schiller
94f6c14f6b
test(router): add stable Link performance benchmarks (#8317)
* test(router): add opt-in React Link performance cases

Add 13 shared typed workloads measured through production client navigation and real SSR rendering: shared/unique params, updater functions, inheritance, relative targets, middleware chains, numeric parse/stringify, optional/splat segments, encoding, masks, rewrites, and active props with structured search and style merging.

Keep all 26 benchmarks outside the existing client-nav/SSR aggregate projects and CodSpeed build graph. The dedicated @benchmarks/react-link-performance targets require TSR_LINK_PERF=1 for discovery; disabled suites import no app. Gate tests cover explicit enablement and production environment selection.

Client batches perform eight navigations with 200 persistent measured Links. SSR batches create/load/render/dispose four fresh routers. Independent href, active-state, style, and history-state updater assertions run outside the measured loops. No production packages or dependencies change.

Compared identical sources on origin/main 28a5e4504e and captured HEAD bbaa7b3f29, with two fresh processes per ref/mode in counterbalanced order, 50 warm-up iterations, and 3-second windows. Full-suite results show lower HEAD client times for most cases (10.6% shared params, 13.2% search/hash/state updaters, 17.1% masks); SSR updater and optional cases show 14.8% and 12.4% reductions. These are whole-ref comparisons, not improvements from this benchmark-only commit.

Run-to-run noise is significant for small differences. Initial middleware and unique-param SSR slowdowns reversed in focused reruns, so they are not established regressions. Preserve both full-suite and focused data in the uncommitted experiment log and session artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(router): stabilize opt-in Link performance comparisons

Bound control navigation history with replace and assert that the measured anchors remain mounted. Share the exact setup, batch, and post-measurement assertions between normal Vitest benches and the paired comparison runner. Increase normal warm-up and measurement windows.

Add an opt-in stable runner with a fresh process per case/replica, separate router/app modules, one shared production React runtime, deterministic V8 random/hash seeds, alternating initialization order, and ABBA/BAAB fixed-work blocks. Record main-thread CPU, wall time, whole-process CPU, bundle hashes, and all raw blocks. Derive per-case 95% intervals from independent process replicas rather than correlated individual batches; require CPU and wall results to corroborate a direction.

Same-code controls exposed substantial noise in earlier methods. The selected control was centered near zero (client CPU -0.95%, SSR CPU -0.56%), with intervals still several percentage points wide. Keep unresolved measurements explicitly inconclusive instead of labeling them regressions.

Compared fixed runtime refs origin/main 28a5e4504e and bbaa7b3f29 across all 26 cases with four fresh-process replicas each: 16 cases support speedups, 10 remain inconclusive, and none support a slowdown in both metrics. Client middleware CPU: -5.95% [-13.89%, +2.73%]; SSR middleware: -16.06% [-31.65%, +3.09%]; SSR unique params: -5.08% [-14.97%, +5.96%]. These do not establish middleware or unique-param regressions.

No production package code or default CodSpeed workflow changes. Keep the complete raw matrix, calibration trials, snapshots, and detailed conclusions in uncommitted session artifacts and LOG.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:01 +02:00
Manuel Schiller
7e349c3071
perf(router): share Link pathname interpolation (#8252)
* perf(router-core): share pathname interpolation across Links

Reuse the existing segment parser to prepare parameter-name lists. Share pure interpolated path strings through bounded router-scoped SIEVE caches (32 templates, 128 paths per template). Avoid compound-key allocation for single-parameter templates and reuse the current template plan.

Parameter callbacks still run before interpolation. Search, hash, state, masks, rewrites, and active-state handling remain independent. Decoder changes clear the caches. No per-Link result cache, descriptor checks, new route matcher, or public API change.

React Link rendering benchmark, measured separately for this commit
and its parent using exact production builds:
- Workload: benchmarks/client-nav/scenarios/links/react/speed.bench.ts
  (200 persistent Links, eight navigations per measured batch).
- Apple M4, Node 24.20.0, Vitest 4.1.4, NODE_ENV=production.
- 8 fresh parent processes and 4 fresh processes for this commit,
  each with warmupIterations=50 and time=10000 ms;
  counterbalanced run order.
- Parent mean times (ms): 3.8767, 3.8900, 4.5507, 4.0116, 3.8297, 3.8582, 3.8879, 4.0157.
- This commit mean times (ms): 2.8824, 2.8625, 2.9597, 2.9673.
- Median run means: 3.8889 -> 2.9211 ms.
- Incremental effect: 24.89% less time; throughput change +33.13%.
- Largest within-run RME for this revision: 1.15%.

Incremental minimal/full React gzip impact: +251/+265 bytes.
Benchmark sources and commit implementation trees are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(router-core): cover shared interpolation cache workloads

Cover missing optional parameters that become present, canonical splat keys, and the public usedParams shape. Add focused hit, eviction, and mixed-input benchmarks before simplifying cache metadata collection.

Current cache baseline on Node 24.20.0: repeated single-param batches average 0.0050 ms, repeated multi-param batches 0.0305 ms, result eviction 0.1568 ms, template eviction 0.0809 ms, and mixed inputs 0.0370 ms. Miss-heavy runs show outliers and require narrower comparisons. Production cache remains unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): reuse interpolation pass for cache keys

Collect cache parameter names during the existing interpolation pass instead of parsing each new template twice. Reuse the first interpolated result, compact template plans, and share required/optional/splat path assembly. Preserve public interpolation metadata, missing-param behavior, decoder invalidation, and bounded router-local caches.

Fresh existing React Link benchmark against parent cd4010d9cb, Apple M4 / Node 24.20.0 / Vitest 4.1.4 / production:
- 200 persistent Links and eight navigations per batch. Four separate processes per version, counterbalanced order, warmupIterations=50, time=10000 ms.
- Parent means: 3.0527, 2.8610, 2.8329, 2.8729 ms.
- This commit means: 3.1291, 2.8745, 2.8849, 2.8552 ms.
- Median run means: 2.8670 -> 2.8797 ms (+0.44% time, effectively flat; no incremental Link speedup claimed). Within-run RME below 1%.
- Fresh original-baseline comparisons: 4.2143 -> 2.9825 ms (-29.23%) and 4.0561 -> 2.9909 ms (-26.26%). The complete series still exceeds the original 20% target.

Focused interpolation benchmarks, same files/inputs before and after:
- Client uncached single-param batches: 90.51 -> 79.91 us (-11.7%).
- Client cached template eviction: 72.33 -> 49.74 us (-31.2%; 4-6% RME, p75 also improves).
- Client uncached mixed batches: 71.10 -> 52.41 us (-26.3%).
- Server uncached mixed batches: 61.42 -> 38.11 us (-38.0%).

Bundle size: React minimal/full -414 raw bytes each and -55/-68 gzip bytes. All 18 Router/Start fixtures shrink by 48-75 gzip bytes. Independent hunk attribution confirmed reductions for every retained group.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router): meet the original Link bundle budgets

Move the bounded pathname cache onto RouterCore and reuse one interpolation traversal for pathname generation, cache keys, and optional public metadata. Remove the factory and per-parameter metadata callbacks, preserve decoder invalidation and development server/client overrides, and simplify React Link active-state and state-prop assembly. Public APIs and routing features remain unchanged.

Official gzip measurements against parent 37bd31e4e2:
- React minimal: 86000 -> 85772 bytes (-228), equal to origin/main.
- React full: 89601 -> 89356 bytes (-245), 6 below origin/main.
- All 18 Router/Start fixtures shrink by 130-245 gzip bytes. Link remains included; fixtures and the existing Link workload are unchanged.
- Independent Link-only changes save 78/86 bytes; core-only changes save 174/169. Combined gzip effects are not additive.

Fresh existing production Link benchmark, Apple M4 / Node 24.20.0 / Vitest 4.1.4: 200 persistent Links, eight navigations per batch, 50 warm-up iterations and 10-second measurements, with separate processes in counterbalanced order.
- Parent means: 2.903316, 2.908833, 2.945163, 2.955386 ms.
- This commit means: 2.941129, 2.941699, 2.920172, 2.970072 ms.
- Median run means: 2.926998 -> 2.941414 ms (+0.49% time, near process-to-process noise; no incremental Link speedup claimed). Maximum within-run RME: 0.84%.
- Fresh original-baseline comparison: 4.283454 -> 3.016571 ms (-29.58% time). This is the whole-series improvement, not the incremental effect of this commit.

Identical focused before/after benchmarks show public helper regressions eliminated, server public families 4.68-12.85% faster, and cached mixed/missing cases 6.50-10.43% faster. Removing the redundant last-template shortcut makes isolated single-template cache hits slower (5.93 -> 7.21 us client per 200 calls; 5.99 -> 6.83 us server). The real Link workload remains effectively flat for this size-reduction step.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* perf(router-core): cache omitted optional path params

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:01 +02:00
Sarah Gerrard
ae68535929
perf(history): avoid generating unused location keys (#8349) 2026-09-12 13:19:37 -07:00
Flo
8fff7fa1f2
fix(history): normalize memory history hrefs (#8359) 2026-09-12 21:57:33 +02:00
Tanner Linsley
05422da535
docs(start): correct authentication server function examples (#8368)
* docs(start): correct authentication server function examples

* docs(start): prevent caching session-specific auth pages

* docs(start): guard login forms until hydration

* test(start): assert authentication behavior in SSR and SPA modes
2026-09-11 17:22:55 -06:00
Tanner Linsley
3487cf0451
docs(start): redirect obsolete Solid tutorial path (#8379) 2026-09-11 17:14:55 -06:00
Tanner Linsley
0b152a7b5e
docs(start): add production release checklist (#8373)
* docs(start): add production release checklist

* docs(start): clarify authenticated CSRF and cache checks
2026-09-11 17:14:04 -06:00
Tanner Linsley
e047e3f7ca
docs(start): add tested TanStack Query integration guide (#8372)
* docs(start): add tested TanStack Query integration guide

* fix(examples): protect Query server functions from cross-site calls
2026-09-11 17:13:58 -06:00
Tanner Linsley
c6c282b786
docs(start): distinguish authentication page titles (#8378) 2026-09-11 17:12:52 -06:00
Tanner Linsley
dbf0bd9582
docs(start): add a tested Next.js migration reference (#8371)
* docs(start): add a tested Next.js migration reference

* fix(examples): serialize migration save and sign-out actions

* fix(examples): verify authenticated cross-site mutation rejection
2026-09-11 17:12:47 -06:00
Tanner Linsley
83b2199b4c
docs(start): substantiate framework comparison claims (#8369) 2026-09-11 15:06:24 -06:00
Tanner Linsley
d48ae42b85
docs(start): describe key search entry pages (#8367) 2026-09-11 14:47:42 -06:00
Tanner Linsley
931fae487e
docs(start): fix tutorial and ISR guide links (#8366)
* docs(start): fix broken createServerFn doc links in reading-writing-file tutorials

The 'server-functions' page moved from /framework/{react,solid}/server-functions
to /framework/{react,solid}/guide/server-functions in a recent docs refactor.
The old URL returns 307 redirects that hang (tanstack.com server is
timing out on these paths) — effectively a 404 from the user perspective.

Verified manually: the new /guide/server-functions path returns 200 for
both react and solid variants. The link text in the tutorial points to
'createServerFn', which is documented on the new page.

* docs(start): fix ISR data loading link

---------

Co-authored-by: sanjibani <18418553+sanjibani@users.noreply.github.com>
2026-09-11 14:36:09 -06:00
EduardF1
d91b383b8f
docs(start): fix broken routing-side guide link in authentication primitives (#7701) (#7705)
docs(start): fix broken routing-side guide link in authentication primitives

The "routing-side guide" links in the Authentication Server Primitives guide
used a relative path (`../../../../router/guide/authenticated-routes.md`).
While that resolves as a file path, it renders to an invalid site URL
(`/start/latest/router/guide/authenticated-routes`) and 404s.

Use the absolute cross-project doc path that the rest of the docs already use
for Router links, e.g. `/router/latest/docs/framework/react/guide/authenticated-routes`.

Closes #7701

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-11 14:34:50 -06:00
Sarah Gerrard
f021f6d1c6
perf(history): avoid temporary arrays in memory history (#8352) 2026-09-11 07:51:30 -07:00
Flo
9872d2ac39
perf(history): use lightweight history for server rendering (#8354) 2026-09-11 11:45:21 +02:00
github-actions[bot]
6494e75362
ci: Version Packages (#8330)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-10 20:11:56 +02:00
Corbin Crutchley
8c43c71252
fix: upgrade TanStack Store to latest (#7824)
* fix: upgrade TanStack Store to 0.11.x

* fix: add isServer edgecase to Vue Router

* Revert "fix: add isServer edgecase to Vue Router"

This reverts commit 18b52ab215.

* chore: remove useSelector in favor of upstream

* fix: handle CatchNotFound memory leaks

* fix(vue): migrate to use defineComponent properly

* fix: accept SFCs for routes
2026-09-10 19:41:24 +02:00
Flo
0ba4e9f03b
fix(nx): cache benchmark checks and build measurements (#8343)
* chore: update nx to 23.2.0

* fix(nx): remove deprecated self dependencies from Playwright plugin

* fix(nx): cache benchmark checks and build measurements
2026-09-10 18:55:36 +02:00
Flo
0a89977174
fix(nx): remove deprecated self dependencies from Playwright plugin (#8342)
* chore: update nx to 23.2.0

* fix(nx): remove deprecated self dependencies from Playwright plugin
2026-09-10 18:55:17 +02:00
Flo
1eb8b03595
chore: update nx to 23.2.0 (#8341) 2026-09-10 18:28:24 +02:00
Flo
d914b085bb
fix(start-server-core): correctly iterate response headers (#8340)
* test(start-server-core): cover response header replacement

Carry forward the five tests from #5537 and extend cookie and header-name coverage.

Co-authored-by: Carlos González <carlos.rgn@gmail.com>

* fix(start-server-core): correctly iterate response headers

* fix(start-server-core): preserve live response headers

---------

Co-authored-by: Carlos González <carlos.rgn@gmail.com>
2026-09-10 17:27:44 +02:00
Flo
130992b32f
test(start): cover transformed script URL escaping in SSR (#8336) 2026-09-10 15:46:59 +02:00
Kevin Van Cott
3b27db6c38
docs: remove duplicate Router and Start page headings (#8339) 2026-09-10 12:32:59 +02:00
Flo
69c07c4bbf
test(router-core): cover search-derived context boundaries (#8334)
* test(react-router): cover search-derived context boundaries

* test(router-core): move search context boundary coverage to core
2026-09-10 11:05:54 +02:00
Flo
b1c9219439
perf(solid-router): skip client setup for all server links (#8316)
* perf(solid-router): skip client setup for all server links

* test(solid-router): preserve caller props for internal SSR links

* Merge branch 'main' into codex/solid-link-server-all [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-09-10 07:55:02 +02:00
Sarah Gerrard
76239a34b7
fix(solid): avoid repeated hydration scans and script execution (#8270)
* fix(solid): avoid repeated hydration scans and script execution

* test: assert hydration boundary behavior

* test(solid): cover script counts and local hydration lookups
2026-09-09 19:02:21 -07:00
github-actions[bot]
edeb19979e
ci: Version Packages (#8281)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-09 23:43:22 +02:00
Flo
9c1871ccc8
fix: harden URL handling across Router and Start (#8308)
* fix: harden URL handling across Router and Start

* fix: preserve unload blockers after document navigation

* perf: reduce document navigation guard size
2026-09-09 23:03:49 +02:00
Manuel Schiller
f9836f16f0
perf(router-core): avoid empty query serializer allocations (#8313)
Construct URLSearchParams only when the first non-undefined input is serialized. Preserve inherited enumeration, getter/callback order, falsy values, empty custom output and native set collision semantics. Add failing-before empty-allocation cases and focused empty-query benchmark cases.

Against d40fb30307, four balanced isolated-process pairs reduced client shared-param CPU 7.89% (95% CI -12.61% to -2.92%) and wall 7.36% (-12.77% to -1.61%). SSR shared-param CPU fell 15.65% (-18.07% to -13.15%) and wall 15.63% (-18.72% to -12.41%). Populated middleware search remained inconclusive: CPU -0.20% (-2.69% to +2.36%), wall +0.02% (-3.36% to +3.51%).

React Router minimal/full gzip +1/+7 bytes; deltas across all 18 fixtures range -3 to +7 bytes. Custom stringifySearch and middleware are still executed; no API or functionality removed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 22:51:44 +02:00
Manuel Schiller
9aec5a7012
perf(react-router): avoid redundant Link state prop allocations (#8311)
Links resolve one state-prop bag instead of separate active and inactive bags. Class names do not need temporary arrays. Unchanged styles retain their original references. Callback behavior and prop precedence remain unchanged.

React Link rendering benchmark, measured separately for this commit
and its parent using exact production builds:
- Workload: benchmarks/client-nav/scenarios/links/react/speed.bench.ts
  (200 persistent Links, eight navigations per measured batch).
- Apple M4, Node 24.20.0, Vitest 4.1.4, NODE_ENV=production.
- 8 fresh parent processes and 8 fresh processes for this commit,
  each with warmupIterations=50 and time=10000 ms;
  counterbalanced run order.
- Parent mean times (ms): 3.9412, 3.8998, 3.8950, 4.2674, 4.0423, 3.8793, 3.9043, 4.1120.
- This commit mean times (ms): 3.8767, 3.8900, 4.5507, 4.0116, 3.8297, 3.8582, 3.8879, 4.0157.
- Median run means: 3.9228 -> 3.8889 ms.
- Incremental effect: 0.86% less time; throughput change +0.87%.
- Largest within-run RME for this revision: 3.08%.
- The small difference is not a reliable speedup claim; it is close to
  process-to-process variation.

Incremental minimal/full React gzip impact: -12/-7 bytes.
Benchmark sources and commit implementation trees are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 22:22:12 +02:00
Flo
539e5985cf
test(router-core): cover SSR URL encoding regressions (#8307) 2026-09-09 16:26:19 +02:00
Sarah Gerrard
49bcd4db74
chore: refresh Router and Start dependencies (#8300)
* chore: refresh Router and Start dependencies

* chore: centralize shared dependencies

* chore: keep examples self-contained

* chore: sync catalog versions into examples

* test(start-plugin-core): refresh hydration snapshots and portable fixtures
2026-09-09 06:27:59 +02:00
Sarah Gerrard
9871c06258
perf(router-core): index cache membership checks per commit (#8288) 2026-09-07 16:59:23 -07:00
Flo
0654c0a1a4
fix(router-core): reload documents for cross-origin rewrites (#8287)
* fix(router-core): reload documents for cross-origin rewrites

* test(router): expand document navigation coverage

* fix(router): respect registered document navigation blockers
2026-09-08 01:23:05 +02:00
Sarah Gerrard
919c397149
perf(start-plugin-core): skip unused manifest build data (#8261)
* perf(start-plugin-core): skip unused manifest build data

* fix(start-plugin-core): skip Rsbuild CSS capture during development

* update tests per review
2026-09-08 00:21:49 +02:00
Flo
0f40695fbe
test: cover existing navigation and redirect behavior (#8286) 2026-09-07 21:35:15 +02:00
Flo
aee42c6b64
perf(react-router): avoid unnecessary composed handlers (#8279)
* perf(react-router): avoid unnecessary composed handlers

* perf(react-router): shorten composed handler fast path

* test(react-router): remove handler benchmark
2026-09-07 13:25:36 +02:00
github-actions[bot]
a58e01c604
ci: Version Packages (#8182)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-06 23:22:45 +02:00
Flo
216c0c4803
perf(router-core): reduce navigation promise chains (#8259)
* test(router-core): cover navigation promise overhead

* test(router-core): cover blocking readiness and queued SSR cancellation

* perf(router-core): reduce navigation promise chains

* test(router-core): focus awaitable coverage on standard promises

* perf(router-core): bypass cancellable waits for synchronous beforeLoad

* chore: remove navigation investigation artifacts

* refactor(router-core): return chunk failures directly
2026-09-06 18:55:52 +02:00
Flo
9035abc411
fix(history): handle blockers consistently across history traversal (#8264)
* fix(history): preserve unload blockers during back and forward navigation

* fix(history): respect ignoreBlocker in go navigation

* fix(history): reverse blocked traversal by its delta
2026-09-06 16:19:47 +02:00
Flo
e16faec455
test: reduce memory benchmark variance and simplify the harness (#8260)
* ci: allow memory-only benchmark experiments

* test: apply Node compiler and GC corrections to memory workers

* test: replace adaptive memory GC polling with fixed work

* test: control the memory worker old-generation GC budget

* test: measure natural churn and single-request memory footprints

* test: isolate memory error-path workers

* test: remove code generation from memory measurements

* test: make aborted memory requests follow cancellation

* test: simplify memory cancellation helpers

* test: remove incremental marking from memory measurements

* test: track shared memory runtime in type-check cache

* test: separate memory warmups with an event-loop turn

* test: reset client memory apps between benchmark invocations

* chore: remove stale memory benchmark guidance

* test: control the memory benchmark coordinator runtime

* revert: keep the better-tested memory benchmark runtime

* test: restore JIT in memory benchmark workers

* docs: record memory worker flag removal evidence

* test: remove added memory unit tests and restore workflow
2026-09-06 13:11:27 +02:00
Flo
08eff50c44
fix(router-core): fix dangling references in published declarations (#8207)
* fix(router-core): strip internal SSR globals from declarations

* fix(router-core): avoid stripped SSR type reference

* Revert "fix(router-core): avoid stripped SSR type reference"

This reverts commit 2bc6b55255.

* fix(router-core): strip internal dehydrated context type

* test(router-core): cover published declarations for internal context fix

* test(router-core): isolate published declaration fixtures

* test(router-core): remove declaration consumer fixtures
2026-09-06 11:00:24 +02:00
Manuel Schiller
cf166d160e
fix(react-router): avoid rewriting unchanged head assets (#8257)
Fixes #8250

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-06 00:21:02 +02:00
Flo
07b3bc971d
test(react-router): cover pending and not-found context (#8243)
test(react-router): cover context during pending and not-found loads
2026-09-06 00:00:46 +02:00
Flo
2f20c00224
fix(router-core): skip lifecycle callbacks below fallback boundaries (#8165)
* fix(router-core): track lifecycle membership through fallback boundaries

* test(router-core): benchmark fallback lifecycle dispatch

* test(router-core): preserve explicitly targeted not-found lifecycle

* perf(router-core): avoid lifecycle prefix allocations

* test(router-core): cover lifecycle dispatch at typical route depths

* perf(router-core): reduce fallback lifecycle bundle overhead

* perf(router-core): omit unused initial lifecycle boundary

* fix(router-core): keep lifecycle metadata declaration compatible with Playwright
2026-09-06 00:00:46 +02:00
Flo
0497caeef3
perf(router): use URL.canParse for absolute URL checks (#8251)
* perf(router): use URL.canParse for absolute URL checks

* refactor(router): simplify absolute URL conditions

* perf(router): remove redundant absolute URL prechecks
2026-09-05 22:05:13 +02:00
Flo
09da932575
test: stabilize CPU simulation with isolated SSR workers and explicit V8 settings (#8248)
* test: disable Maglev in CPU simulation benchmarks

* test: track shared CPU simulation flags in benchmark checks

* test: disable scheduled minor GC in CPU simulation

* test: keep incremental marking allocation-driven in CPU simulation

* test: release streamed benchmark data on counted task turns

* test: fix the initial heap budget for CPU simulation

* test: use eager baseline compilation in CPU simulation

* test: isolate each SSR workload in a fresh benchmark worker

* test: remove unnecessary marking override after runtime comparisons

* test: simplify benchmark setup after review
2026-09-05 20:54:53 +02:00
Manuel Schiller
af2f9d1c44
chore: simplify bundle optimization commands (#8253)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-05 20:46:34 +02:00
Flo
28a5e4504e
fix(router): handle unknown error boundary values (#8209)
* fix(router): handle unknown error boundary values

* fix(router): complete unknown boundary error migration

* docs(router): keep boundary examples within skill limits

* fix(router): restore minimal boundary error display

* fix(solid-router): unify boundary errors across SSR and client
2026-09-05 14:48:44 +02:00
Flo
c18e690814
perf(router-core): avoid redundant promises for ready routes (#8244)
* test(router-core): add ready-route performance controls

* test(router-core): type throwing thenable getter explicitly

* perf(router-core): avoid redundant promises for ready routes

* test(router-core): restrict preload coverage to supported behavior

* docs(router-core): record immediate preload scheduling experiment

* perf(router-core): keep the simpler immediate chunk wrapper

* chore: remove ready-route benchmark artifacts
2026-09-05 11:24:18 +02:00
Flo
f0b5eda544
fix(router-core): retain not-found boundary during navigation (#8161)
* fix(router-core): retain not-found boundary during navigation

* chore: add changeset for not-found boundary fix

* test(react-router): cover overlapping not-found retention boundaries
2026-09-05 09:51:56 +02:00
Flo
2f9150309b
perf(router-core): avoid quadratic cache resource handoff (#8240)
* test(router-core): cover cache commit ownership and scaling

* perf(router-core): avoid quadratic cache resource handoff
2026-09-04 22:55:02 +02:00
Flo
50eafcaebb
perf(router-core): gate JSON.parse attempts behind jsonStart guard in parseSearchWith (#8142)
* perf(router-core): gate JSON.parse attempts behind jsonStart guard in parseSearchWith

* test(router-core): strengthen search parsing regression coverage

* chore(router-core): add search parsing changeset and refresh measurements

* docs: use a shell-safe parsing benchmark output path

* chore: keep search parsing measurements out of the PR
2026-09-04 22:43:10 +02:00
Flo
ee283480df
perf(router-core): replace the LRU cache with a trimmed SIEVE cache (#8230)
* perf(router-core): replace the LRU cache with a trimmed SIEVE cache

The hand-rolled doubly-linked LRU relinked the hit entry to the newest
position on every `get`. Every cache in the router (resolvePathCache,
the route tree's matchCache/singleCache/flatCache, the SSR manifest
cache) is hit-dominated: a page of links re-resolves the same handful
of paths on every navigation, so the relink was pure overhead.

SIEVE (https://cachemon.github.io/SIEVE-website/) keeps a FIFO list and
a visited bit per entry; a hit only sets the bit, and eviction sweeps a
hand from the oldest entry, clearing bits and dropping the first
unvisited one. Same API as before (`get`/`set`/`clear`, fixed `max`),
no dependency, and the old implementation's stale-`oldest` eviction
edge case is gone.

Microbenchmark (ns/op, Node 25): get-hit 17.0 -> 13.9, set-insert
64.9 -> 50.8, set-evict 79.9 -> 79.9, scan-then-return 41.0 -> 34.8,
get-miss 16.2 -> 19.3. Hit ratios on the links and route-tree-scale
client-nav traces are identical (working sets of 3-9 keys never evict).

Bundle gzip: react-router.minimal -8 B, react-router.full -15 B.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C1tX2n8xegVBsZqoJPu7iv

* perf(router-core): trim SIEVE cache nodes

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 20:56:39 +02:00
Magnus
650acb4a89
fix(docs): Ensure we use normal install for query integration package (#8228) 2026-09-03 20:01:54 +02:00
Flo
edf0e16ebf
perf(router-core): share settle chain between superseded navigation waiters (#8222)
perf(router-core): make superseded navigation waiters share one settle chain

`awaitCurrent` looped `await current.done` and re-read `router._tx` after
each completion. Under back-to-back navigations (anything that starts the
next navigation in the same tick as `onRendered`, including the client-nav
benchmarks) every superseded waiter woke on every successor, so a burst of
N navigations cost N²/2 microtask iterations and kept every superseded
transaction alive until the router went idle.

Each transaction's `done` promise now follows its current successor, so
every waiter on a transaction shares the same chain instead of polling
successors independently. A waiter still resolves once the router has
settled on a transaction other than its owner.

Measured in benchmarks/client-nav (react, navigations per 10s, jsdom):
baseline 15.4K -> 43K, route-tree-scale 17.9K -> 98K,
search-params 16.5K -> 55K. The instrumented baseline run showed
125.8M loop iterations for 15,867 navigations before the change.
Bundle: react-router.minimal -1 B gzip vs main.


Claude-Session: https://claude.ai/code/session_01C1tX2n8xegVBsZqoJPu7iv

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 15:10:53 +02:00
Cong-Cong Pan
37877da166
perf(start): optimize Rsbuild import protection reporting (#8164)
* perf(start): avoid parsing original source in Rsbuild import protection

* perf(start): avoid filesystem reads in Rsbuild import protection reporting

* perf(start): remove redundant module survival checks

* perf(start): ignore inactive Rspack import connections

* perf(start): lazily build Rsbuild import protection diagnostics

* chore: remove test case

* add changeset

* fix(start): persist Rsbuild import protection markers in buildInfo

* fix: normalize file path in getModuleResource

* fix(start): restore Rsbuild diagnostics for inactive imports

* fix(start): improve Rsbuild import protection diagnostics

* refactor(start): clarify Rsbuild violation scanner state

* update readme

* fix(start-plugin-core): avoid dependency locations in Rsbuild diagnostics

* fix(start): respect importer scope for Rsbuild markers

* refactor(start): move Rsbuild import protection transform to loader

* test(start): type Rsbuild import protection mocks

* fix(start): close Rsbuild import protection reporting gaps

* fix(start): skip errored Rsbuild import protection modules
2026-08-31 18:48:41 +02:00
Manuel Schiller
65d565c946
fix route trees (#8197) 2026-08-31 01:34:33 +02:00
Nicolas Stepien
3c6c959e56
Tweak a few NODE_ENV placements (#8196) 2026-08-31 01:34:24 +02:00
Kenji Mizuguchi
0caf6b9a2b
fix: preserve shouldThrow in route-scoped hooks (#8169)
* fix(react-router): forward shouldThrow in Route.useMatch

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

* fix(react-router,solid-router,vue-router): preserve shouldThrow in route-scoped hooks

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: simplify route-scoped shouldThrow coverage

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sheraff <me@florianpellet.com>
2026-08-27 23:54:34 +02:00
github-actions[bot]
0dbb77f726
ci: Version Packages (#8177)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 01:33:18 +02:00
Manuel Schiller
79e35335b4
optimize query integration (#8175)
* optimize query integration

* fix
2026-08-27 01:28:24 +02:00
Manuel Schiller
ebf13ed517
add react-start-query-integration bundlesize benchmark scenario (#8153)
* add react-start-query-integration bundlesize benchmark scenario

* bump query
2026-08-25 19:43:21 +02:00
Kevin Van Cott
3dee5b2e94
docs: clarify contribution guidelines (#8163)
* docs: clarify contribution guidelines

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-25 05:14:16 +02:00
Flo
9f8990b515
test(router-core): assert sequential asset projection (#8152) 2026-08-23 11:43:22 +02:00
github-actions[bot]
a5a5bacc8f
ci: Version Packages (#8133)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 00:53:08 +02:00
Flo
0eb45738c0
fix(router-core): reject overlapping parameter affixes (#8154)
* fix(router-core): reject overlapping parameter affixes

* perf(router-core): reduce affix overlap check size

* test(router-core): assert affix match parameters

* ci: apply automated fixes

* perf(router-core): normalize route affixes

* ci: apply automated fixes

* add test case

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 21:47:42 +02:00
Flo
eb9ddac3e2
test(router-core): document U+0130 affix limitation (#8149)
* fix(router-core): match Unicode wildcard suffixes

* ci: apply automated fixes

* refactor(router-core): clarify wildcard suffix boundaries

* fix(router-core): handle Unicode parameter affixes

* test(router-core): document U+0130 affix limitation

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 18:16:43 +02:00
Flo
81e4a79da2
perf(router-core): reduce client loader bundle size (#8150)
* perf(router-core): reduce client loader bundle size

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 17:42:10 +02:00
Jiahan Chen
aab01dec75
chore(start): remove redundant splitChunks config from React plugin (#8136) 2026-08-22 09:48:38 +02:00
Jiahan Chen
a0041bb36e
fix(start): migrate to Rsbuild splitChunks config (#8135) 2026-08-22 09:48:30 +02:00
Flo
d83a8964c2
ci: improve bundle size PR table (#8148) 2026-08-22 05:45:16 +02:00
Flo
cb281d70c1
fix(router-core): preserve context during reloads (#8130)
* fix(router-core): preserve context during reloads

* ci: apply automated fixes

* test(router): consolidate issue 8115 coverage

* fix(vue-router): react to provider context changes

* fix(router-core): refine context reconstruction

* bytes

* type fixes

* context + immediate UI on load

* coderabbit is happy

* no context in pending/error/notFound components

* changesets

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-20 23:34:06 +02:00
Manuel Schiller
fa65287281
perf(router): remove prebuilt preload locations (#8132) 2026-08-20 23:17:16 +02:00
Flo
e9f63a6c69
ci: add timeout-minutes to codspeed step in benchmarks (#8122)
* ci: add timeout-minutes to codspeed step in benchmarks

* add concurrency w/ queue:single
2026-08-19 19:16:25 +02:00
Flo
7557415669
test(router-core): assert state structural sharing (#8121) 2026-08-19 13:48:51 +02:00
github-actions[bot]
4fcbcde90d
ci: Version Packages (#8119)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-19 13:22:14 +02:00
Flo
3e016ac84f
perf(router-core): buildLocation optimizations (#8117) 2026-08-19 11:28:52 +02:00
Flo
92749aba6e
perf(router-core): cache route mask misses (#8111)
* perf(router-core): cache route mask misses

* test(router-core): restore route mask cache spy
2026-08-19 11:24:35 +02:00
Flo
128757113e
perf(router-core): skip impossible state sharing (#8110)
* perf(router-core): skip impossible state sharing

* fix(router-core): preserve custom state handling

* perf(router-core): simplify state sharing guard

* perf(router-core): inline state property reads
2026-08-19 11:24:26 +02:00
Flo
a1c3674d3b
perf(router-core): skip disabled search validation (#8112)
* perf(router-core): skip disabled search validation

* test(router-core): cover validation middleware ordering

* test(router-core): assert search validation execution
2026-08-19 11:24:18 +02:00
Flo
6be202cde4
perf(router-core): optimize buildLocation path resolution (#8108)
* perf(router-core): optimize buildLocation path resolution

* perf(router-core): remove unreachable absolute path handling

* fix(router-core): normalize relative path bases

* perf(router-core): skip redundant relative path cleanup
2026-08-19 11:24:08 +02:00
github-actions[bot]
a78f2af5b4
ci: Version Packages (#8079)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-18 17:12:28 +02:00
Flo
63d2cc9155
fix(router-core): remove navigation rollback (#8092)
* fix(router-core): remove navigation rollback

* test(react-start): update failed HMR refresh expectation
2026-08-18 14:09:37 +02:00
Flo
5d3785dcc3
fix(router-core): preserve pending UI across retained routes (#8084)
* fix(router-core): preserve pending UI across retained routes

* fix(router-core): harden pending session ownership

* fix(router): align pending presentation across Solid and Vue (#8097)

fix(router): align pending presentation across frameworks

* changesets

* test: align hydration fake timers
2026-08-18 14:09:36 +02:00
Flo
f97188fdb4
chore: localize package dependencies (#8078) 2026-08-15 13:42:24 +02:00
Flo
f75cada017
perf(react-router): direct export of CatchBoundary class component, remove function wrapper (#8068)
bundle(react-router): direct export of CatchBoundary class component, remove function wrapper
2026-08-15 08:52:06 +02:00
github-actions[bot]
11dfc93669
ci: Version Packages (#8075)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-15 00:08:52 +02:00
Flo
bdaf73a406
perf(router-core): inline buildWithMatches inside buildLocation (#8070)
* perf(router-core): inline buildWithMatches inside buildLocation

* better cleanup
2026-08-14 22:47:45 +02:00
Flo
cf6ab178b3
perf(router-core): inline isFunction utility (#8069) 2026-08-14 21:03:47 +02:00
Flo
4c89b15dd2
perf(router-core): inline getOpenAndCloseBraces in parseSegment (#8071) 2026-08-14 21:03:20 +02:00
Flo
0fdf9ff16f
perf: inline isCtrlKey utility inside all Link components (#8073) 2026-08-14 21:02:47 +02:00
github-actions[bot]
53b63cf6fb
ci: Version Packages (#8052)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-14 14:05:28 +02:00
Flo
0c25a7b43b
fix(react-router): avoid Suspense above root documents (#8055)
* fix(react-router): avoid suspense above root documents

* test(react-start): cover root document hydration

* test(react-router): remove indirect hydration assertion

* perf(react-router): reduce suspense wrapper bundle size

* test(react-start): isolate root hydration regression

* fix(react-router): preserve root suspense in CSR

* refactor(react-router): simplify root suspense checks

* fix(react-router): preserve functional ssr classification
2026-08-14 13:34:08 +02:00
Flo
31882c7fa8
fix(router): reuse resolved lazy route components (#8054)
* fix(router): reuse resolved lazy route components

* fix vue inconsistency

* fix(router): clear resolved lazy component preload
2026-08-14 13:30:20 +02:00
Flo
0ad38a710c
fix(router): reject superseded Solid and Vue render acknowledgements (#8065)
* fix(router): reject superseded render acknowledgements

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-14 09:38:09 +02:00
3237 changed files with 158137 additions and 48886 deletions

1
.gitignore vendored

Some files were not shown because too many files have changed in this diff Show more