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

4,564 commits

Author SHA1 Message Date
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
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
Nicolas Beaussart
da2adec76d
ci: upgrade Nx and migrate worker configuration (#8807) 2026-10-25 01:21:10 +02: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
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
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
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
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
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
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