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

4,532 commits

Author SHA1 Message Date
github-actions[bot]
79e938f2b2
ci: Version Packages (rc) (#8239)
ci: changeset release (rc)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-04 19:24:12 +02:00
Ryan Carniato
cc25e82278
fix(solid-router): remove router-owned Loading boundaries, ack startTransition at settlement (#8236) 2026-09-04 18:54:53 +02:00
github-actions[bot]
8ca0beac8a
ci: Version Packages (rc) (#8219)
ci: changeset release (rc)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-03 22:08:49 +02:00
Ryan Carniato
b445b89281
feat(solid-router): native SSR match transfer, hydration-claiming boot, provider-owned dispatch (#8213)
* refactor(solid): retire solid-router-ssr-query — Solid's native channels carry the Router + Query pairing

solid-query v6's QueryClientProvider serializes the request's cache into
Solid's hydration registry during SSR and primes the client cache from
it, so running the ssr-query transport alongside it ships every query
payload twice. The package's two runtime conveniences are each a few
lines of userland composition on public APIs: the provider wrap via the
router's Wrap option, and cache-driven redirect() errors handed to
router.navigate from the caches' config.onError.

Converts the three Solid Start e2e apps to the composition (all suites
green, including the redirect-from-query tests) and marks the package
deprecated for the v2 line.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: changeset for the solid-router-ssr-query deprecation notice

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-start): named single-flight source for router flight data

Solid's single-flight channel is becoming multi-source (solidjs/solid
653dd41e): mutation responses carry a keyed envelope of per-cache
slices, each routed to the consumer subscribed under its source id.
Today Start claims the single unnamed slot on both halves, which means
any other cache wanting mutation-response data (e.g. solid-query, whose
provider subscribes under "sq" in TanStack/query#11326) displaces the
router's — whichever registers last wins, silently.

The router's flight data now rides its own source id ("tsr"): the
server collector registers additively with registerFlightDataSource and
the client subscribes its consumer under the same id, so router
loader/match state and other caches' slices coexist on one round trip.
A user-supplied collectFlightData hook keeps the unnamed slot to itself,
adding data alongside the router's instead of displacing it.

Both halves feature-detect the protocol on the installed @solidjs/web
(it ships in the release after 2.0.0-rc.4) and fall back to the exact
previous unnamed-slot behavior on older versions; since client and
server resolve the same install, the halves cannot disagree.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-router): loadFlightTarget, the cache-agnostic single-flight trigger

The router's half of flight collection as a public primitive: derive the
flight request for the mutation's target, run the matched routes' data
functions, hand the loaded router to the caller's collect() — any cache
(the router's own state, a query client) composes its extraction on top.
Start's collector now consumes it; errors are contained per Solid
Router's collector convention (flight data is an optimization, never a
mutation error).

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-start): require named flight sources, drop the pre-rc.5 fallback

@solidjs/web 2.0.0-rc.5 ships the multi-source single-flight protocol, so
the feature detection and cast shims bridging unreleased types come out:
the client subscribes directly under SOLID_START_FLIGHT_SOURCE, the server
registers its collector via registerFlightDataSource unconditionally (the
unnamed collectFlightData slot now always belongs to the user), and the
@solidjs/web peer floor moves to rc.5.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(e2e): expect the named single-flight source header

With the pre-rc.5 fallback stripped, the client advertises its named
source and the server echoes what it folded: X-Single-Flight is "tsr" on
both sides, not the legacy "true".

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(solid): bump solid-js, @solidjs/web, @solidjs/signals to 2.0.0-rc.6

Repo-wide (packages, examples, e2e apps, benchmarks) — a scoped bump
leaves the workspace mixed, and examples/benchmarks then build workspace
solid-start dists (which import registerFlightDataSource, rc.5+) against
their own @solidjs/web rc.4 resolution. rc.6 ships the named flight-data
source API this branch requires plus the settle-walk fix that unblocks
the Solid Query pairing. @tanstack/solid-start's peer floor moves to
rc.6.

The SSR bench helpers move onto rc.6's wire shape: scripted callers use
the data address (`<endpoint>/data/<id>`) — the bare address now answers
document traffic with the no-JS convention.

Co-authored-by: Cursor <cursoragent@cursor.com>

* spike(solid-router): Phase 1 — registry match transfer + hydration-claiming boot

Proves the RFC's Phase 1 claims on the external-SSR harness, against
published core (web 2.0.0-rc.5):

- Server render serializes each match's loaderData/status into Solid's
  hydration registry, content-addressed (`tsr:<matchId>`), the identical
  mechanism solid-query v6 ships queries through — no `__TSR_SSR__`
  script channel.
- The client boot matches synchronously, primes match state from the
  registry (populated at document parse), and commits — no
  `router.load()` before hydrate, loaders do not re-run (0 client runs),
  hydration claims the server DOM identically, and post-hydration
  navigation with an unresolved chunk still shows pending UI and settles
  under its boundary.

Spike-level notes: the commit must happen before hydrate() (store writes
inside the hydration render are owned-scope writes), the transfer covers
settled matches (promise-valued entries for pending loaders are the same
serialize call, next step), and the serialization-context guard keys on
`ctx.serialize` presence (`ctx.async` is not set under this web
version's renderToString).

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-router): native SSR match transfer + hydration-claiming boot (Phase 1)

Grows the spike into the adapter. RouterProvider serializes each settled
match's state (loaderData, status, error, notFound, beforeLoadContext,
ssr) into Solid's hydration registry during server render —
content-addressed (`tsr:<matchId>`), the same channel solid-query v6
ships queries through, no `__TSR_SSR__` script injection. The Router
constructor owns the client half: when the registry holds entries for the
synchronously matched routes, it primes and commits match state at
creation — always outside a render, after the document (and therefore the
entries) parsed, before hydrate(). No load pass before hydration, no
loader re-runs; route chunks resolve at the read point under the
boundaries the server rendered.

Both halves are inert outside the bare pairing: the server skips when
`router.serverSsr` marks the Start contract, and the boot falls through
on the first missing entry (SPA pages, Start's own channel).

Placement is load-bearing: committing inside the hydration render — even
with writes moved off the owner — leaves the claiming walk's registry
bookkeeping desynced (nodes reuse correctly but audit as unclaimed).
Router creation is the client's natural pre-render moment, and the
harness A/B proved it clean.

Validated: external-SSR harness green end to end (registry primed, zero
client loader runs, identical DOM claimed, pending UI on post-hydration
nav), solid-router unit suite 865 tests green, and all 37 Solid Start e2e
tests green against the rc.6-candidate core (workspace tarballs) with the
named-source strips in place. The harness now contains zero transfer
code. Pending matches are skipped, not deferred — promise-valued entries
(streaming SSR) are the next increment.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(rfc): record Phase 1 landed state — transfer + boot in the adapter, boundary bullet corrected

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-router): provider-owned server dispatch + streamed loaderData

RouterProvider now owns router.load() on the server, parking the render
on it through an async memo — no more explicit await router.load() in
entries; blocking semantics ride Solid's async SSR. The bare-pairing
harness moves to renderToStream and proves deferred loaderData promises
stream natively (fallback in the shell chunk, value in a later chunk,
settled through hydration without <Await>).

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: changeset for Phase 1 native SSR transfer

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

* fix(solid): unbreak CI after the solid-js rc.6 bump

Two things were failing the Test job:

- @tanstack/solid-router test:eslint: the repro-external-ssr harness
  is not part of the package tsconfig, so the typed parser rejected
  its .tsx files. Ignore the harness in the package eslint config; it
  is a standalone vite script, not shipped code.

- Four example builds (basic-solid-query, basic-solid-query-file-based,
  kitchen-sink-file-based, kitchen-sink-solid-query) run tsc, and the
  rc.6 types no longer accept the one-argument createEffect form.
  Convert the eleven call sites to the two-argument
  createEffect(source, effect) form already used by the sibling
  examples and e2e apps.

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 18:50:29 -05:00
Ryan Carniato
96f50d94a6
feat(solid): named single-flight source + loadFlightTarget, the cache-agnostic trigger (#8192)
* refactor(solid): retire solid-router-ssr-query — Solid's native channels carry the Router + Query pairing

solid-query v6's QueryClientProvider serializes the request's cache into
Solid's hydration registry during SSR and primes the client cache from
it, so running the ssr-query transport alongside it ships every query
payload twice. The package's two runtime conveniences are each a few
lines of userland composition on public APIs: the provider wrap via the
router's Wrap option, and cache-driven redirect() errors handed to
router.navigate from the caches' config.onError.

Converts the three Solid Start e2e apps to the composition (all suites
green, including the redirect-from-query tests) and marks the package
deprecated for the v2 line.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: changeset for the solid-router-ssr-query deprecation notice

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-start): named single-flight source for router flight data

Solid's single-flight channel is becoming multi-source (solidjs/solid
653dd41e): mutation responses carry a keyed envelope of per-cache
slices, each routed to the consumer subscribed under its source id.
Today Start claims the single unnamed slot on both halves, which means
any other cache wanting mutation-response data (e.g. solid-query, whose
provider subscribes under "sq" in TanStack/query#11326) displaces the
router's — whichever registers last wins, silently.

The router's flight data now rides its own source id ("tsr"): the
server collector registers additively with registerFlightDataSource and
the client subscribes its consumer under the same id, so router
loader/match state and other caches' slices coexist on one round trip.
A user-supplied collectFlightData hook keeps the unnamed slot to itself,
adding data alongside the router's instead of displacing it.

Both halves feature-detect the protocol on the installed @solidjs/web
(it ships in the release after 2.0.0-rc.4) and fall back to the exact
previous unnamed-slot behavior on older versions; since client and
server resolve the same install, the halves cannot disagree.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(solid-router): loadFlightTarget, the cache-agnostic single-flight trigger

The router's half of flight collection as a public primitive: derive the
flight request for the mutation's target, run the matched routes' data
functions, hand the loaded router to the caller's collect() — any cache
(the router's own state, a query client) composes its extraction on top.
Start's collector now consumes it; errors are contained per Solid
Router's collector convention (flight data is an optimization, never a
mutation error).

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-start): require named flight sources, drop the pre-rc.5 fallback

@solidjs/web 2.0.0-rc.5 ships the multi-source single-flight protocol, so
the feature detection and cast shims bridging unreleased types come out:
the client subscribes directly under SOLID_START_FLIGHT_SOURCE, the server
registers its collector via registerFlightDataSource unconditionally (the
unnamed collectFlightData slot now always belongs to the user), and the
@solidjs/web peer floor moves to rc.5.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(e2e): expect the named single-flight source header

With the pre-rc.5 fallback stripped, the client advertises its named
source and the server echoes what it folded: X-Single-Flight is "tsr" on
both sides, not the legacy "true".

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(solid): bump solid-js, @solidjs/web, @solidjs/signals to 2.0.0-rc.6

Repo-wide (packages, examples, e2e apps, benchmarks) — a scoped bump
leaves the workspace mixed, and examples/benchmarks then build workspace
solid-start dists (which import registerFlightDataSource, rc.5+) against
their own @solidjs/web rc.4 resolution. rc.6 ships the named flight-data
source API this branch requires plus the settle-walk fix that unblocks
the Solid Query pairing. @tanstack/solid-start's peer floor moves to
rc.6.

The SSR bench helpers move onto rc.6's wire shape: scripted callers use
the data address (`<endpoint>/data/<id>`) — the bare address now answers
document traffic with the no-JS convention.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-02 18:10:56 -05:00
Ryan Carniato
5a6935f2d5
refactor(solid): retire solid-router-ssr-query — native channels carry the Router + Query pairing (#8193)
* refactor(solid): retire solid-router-ssr-query — Solid's native channels carry the Router + Query pairing

solid-query v6's QueryClientProvider serializes the request's cache into
Solid's hydration registry during SSR and primes the client cache from
it, so running the ssr-query transport alongside it ships every query
payload twice. The package's two runtime conveniences are each a few
lines of userland composition on public APIs: the provider wrap via the
router's Wrap option, and cache-driven redirect() errors handed to
router.navigate from the caches' config.onError.

Converts the three Solid Start e2e apps to the composition (all suites
green, including the redirect-from-query tests) and marks the package
deprecated for the v2 line.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: changeset for the solid-router-ssr-query deprecation notice

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 16:34:33 -05:00
github-actions[bot]
5010e89a0c
ci: Version Packages (rc) (#8190)
ci: changeset release (rc)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-28 19:32:16 -05:00
Brenley Dueck
22fd367d81
chore(solid): bump to solid-js 2.0.0-rc.4 and @solidjs/vite-plugin 3.0.0-next.35 (#8189)
* chore(solid): bump to solid-js 2.0.0-rc.4 and @solidjs/vite-plugin 3.0.0-next.35

Also:
- Migrate the webpack example and docs off the deleted babel-preset-solid
  onto @solidjs/babel-plugin (compiler packages were renamed in rc.3).
- Bump @rsbuild/plugin-solid to ^2.0.0-beta.2 so the rsbuild path compiles
  with the rc-line preset.
- Adapt the server function transport to rc.4: function ids resolve from
  the request url pathname (X-Server-Function header removed), and the
  client reference derives its url from the configured endpoint.
- Wire per-call AbortSignals through Solid's new invoke() channel and
  re-enable the previously skipped abort e2e tests.

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

* fix(solid-start): rc.4 CI fallout — rsbuild native loader ssr mode, benchmark wire protocol

- @rsbuild/plugin-solid >= 2.0.0-beta.1 compiles through its own solid
  loader (native compiler) instead of registering babel-preset-solid, so
  the babel preset patch never fired and node-target rsbuild bundles were
  compiled in dom mode, throwing "Client-only API called on the server
  side" at import. Patch the loader's solid options (generate ssr on
  node targets, hydratable) alongside the legacy preset patch.
- The benchmark server-function request builders still spoke the pre-rc.4
  wire protocol (id in the removed X-Server-Function-Id header, bare
  endpoint url). Ids now ride the url pathname.

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

* chore(solid): bump @tanstack/solid-query to 6.0.0-rc.1

The rc.1 adapter is rewritten onto Solid 2.0's native async model
(TanStack/query#11308) and peer-requires solid-js >=2.0.0-rc.4, so it
rides this branch's rc.4 bump. Catalog entry plus the non-catalogued
solid-query-devtools pins move in lockstep.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 19:05:50 -05:00
github-actions[bot]
5f657835cf
ci: Version Packages (rc) (#8173)
ci: changeset release (rc)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 18:12:28 +02:00
Birk Skyum
a09f492463
fix(solid-start): single-flight (#8170) 2026-08-26 16:08:48 +02:00
github-actions[bot]
f3fa7c55a0
ci: Version Packages (rc) (#8167)
ci: changeset release (rc)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-25 13:06:37 -05:00
Brenley Dueck
eaa2e8d5ce
chore(solid): bump to solid-js 2.0.0-rc.2 and @solidjs/vite-plugin 3.0.0-next.32 (#8166)
Monorepo-wide range bump: solid-js, @solidjs/web, and babel-preset-solid
^2.0.0-rc.1 -> ^2.0.0-rc.2, @solidjs/vite-plugin ^3.0.0-next.30 ->
^3.0.0-next.32. No code changes needed; the new vite-plugin still peers
on solid-js ^2.0.0-rc.0.

Verified: solid packages build; unit suites green; solid-start basic
e2e 80 passed, start-manifest 12 passed.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 14:51:49 +02:00
github-actions[bot]
b6984af74d
ci: Version Packages (rc) (#8124)
ci: changeset release (rc)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-19 23:59:30 +02:00
Brenley Dueck
252caa8534
feat(solid-router): delegate lazyRouteComponent to Solid 2's lazy() (#8081)
* feat(solid-router): register head tags through Solid's useHead registry

HeadContent now feeds the route-derived tags (useTags output, semantics
unchanged) to Solid's head registry as one reactive group instead of
rendering <Asset> elements in-tree. The registry owns head emission on
both runtimes: SSR splices/streams resolved winners into <head>, the
client patches document.head reactively — replacing the manual
relocate-into-head, imperative script injection, and document.title
syncing that Asset.tsx carried for head tags.

The dev-only dev-styles handling (filter DEV_STYLES_ATTR links post
hydration) is a no-op in production, so it folds into the single
HeadContent — retiring HeadContent.dev.tsx, index.dev.tsx, and the
package's development export conditions.

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

* test(solid-start): pin SSR'd lazy() modulepreload hints and hydration asset map

The client-assets manifest wiring (99756c0710) gives SSR'd lazy()
components three observable outputs in the served HTML: modulepreload
hints for the lazy chunk and its static imports in the initial <head>,
the chunk's stylesheet link, and the serialized boundary→chunk asset map
that gates client hydration on those imports. The start-manifest e2e
only asserted the stylesheet side, so a silent regression to the
route-keyed manifest fallback would keep the suite green while losing
hints and hydration gating.

Two request-level tests against the built app pin the rest: direct SSR
entry to /lazy-css-lazy emits exactly one head modulepreload for the
lazy chunk and one for its statically imported widget chunk (and none of
them on routes that never render the component), and the hydration
payload's _assets map points at the same chunk URL the head hinted.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-router): lean on the head registry for tag lifecycle

Drop the pieces of the head pipeline that existed only for the old
in-tree render path: the reference-reuse memo and replaceEqualTags (DOM
node stability for a <For> that no longer exists) and the dev-styles
post-hydration filtering (HeadContent is now a pure useHead
registration). Add the changeset for the useHead adoption.

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

* ci: apply automated fixes

* feat(solid-router): delegate lazyRouteComponent to Solid's lazy()

Route components now render through solid-js lazy(): the importer wrapper
selects the configured export and forwards the module's $$moduleUrl (the
bundler's SSR transform appends it), so SSR'd route chunks get client
asset resolution — stylesheet links, modulepreload hints, and hydration
gating — through the same client-assets manifest seam as any other
lazy() component, with positional hydration as the fallback.

Carries an interim pnpm patch for solid-js 2.0.0-rc.0 (to be upstreamed,
same play as the vite-plugin-solid isEntry patch): lazy() no longer
caches a rejected module promise, so a failed chunk download is retried
by the next preload or render instead of being sealed in for the page's
lifetime — this is what lets TanStack's download-retry contract ride on
lazy() directly instead of wrapping it in a retry state machine. The
patch also fixes an unhandled-rejection leak (lazy's internal .then had
no rejection handler) and, on the server, stops a transient import
failure from poisoning every later SSR request.

Retry semantics improve: a failed hover-preload is retried at render
(previously the recorded error was thrown without re-attempting the
import); the error boundary + route-reload retry flow is unchanged when
the render-time attempt also fails. preload() keeps its contract — a
memoized Promise<void> that never rejects, cleared on failure so a later
preload retries, one import per server. The module-not-found reload-once
dance is unchanged.

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

* fix(solid-router): stable head-registry identities for inline tags + CI repairs

Inline scripts and styles get a stable content-derived key in toHeadTags:
the registry otherwise assigns per-runtime unique identities that can
never match between server and client, so hydration appended a client
copy next to the server-rendered tag (caught by the solid-start basic
script-duplication e2e).

The ssr head benchmark's sanity assertion now counts name="…" attribute
occurrences instead of raw substring hits — the registry writes the
identity into data-dh on the same element, which doubled the old count.

remountDeps tests migrate onMount to Solid 2's onSettled (pre-existing
branch failure; the API was removed in the rc line).

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

* fix(solid-router): make route-boundary resets converge (issue 7986 + background recovery)

Two compounding defects kept a captured route error from retrying
cleanly on Solid 2:

- CatchBoundary's reset effect re-ran on every recompute of the reset
  key, not only on value changes, so any store write recreated the
  retried subtree while it settled. The effect is now gated on the key
  value. The reset handle deliberately stays un-consumed: a reset
  applied at the wrong moment can no-op (the boundary stays errored and
  the fallback never re-runs), and only a repeated attempt on a later
  key change recovers it — consuming the handle at apply time or at
  children re-render both proved to lose exactly that retry (verified
  against the background-recovery test).

- Match keyed its boundary on the whole matches store, so every
  unrelated transition fired a premature reset that re-threw the
  still-stale error and flapped the error UI. The key is now scoped to
  the guarded match and its descendants (whose errors bubble here when
  they have no errorComponent), mirroring react-router's per-match
  keying, as a value string because the store emits fresh objects for
  content-equal writes.

The issue-7986 pending assertion queries fresh under waitFor: the
retried subtree renders the pending fallback from two nested slots in
quick succession (Show fallback, then the Loading boundary once the
child suspends), so a cached element handle can go stale across the
swap.

First fully green unit run on this branch: 59 files, 864 tests.

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

* fix(solid-router): hydrate lazy route components correctly; scope route assets to TanStack's manifest

Extends the interim solid-js patch with two hydration-critical fixes
(both upstream candidates, same play as the retry fix it already
carries):

- lazy()'s preloaded-module hydration shortcut (_$HY.modules) now only
  applies when the callsite has a bundler-injected moduleUrl. The
  shortcut assumes the registered chunk's default export is the
  component; for wrappers selecting a named export it silently rendered
  undefined, never claimed the SSR'd DOM, and navigation later couldn't
  dispose it — 20 basic-suite e2e failures (orphaned route content
  stacking up across navigations).

- $$moduleUrl: null on a lazy()-resolved module is an explicit opt-out
  of per-module asset registration, without the server warning that
  undefined draws.

lazyRouteComponent uses that opt-out: route chunks bundle many routes,
so registering the chunk emitted the union of their CSS on every route
and broke per-route stylesheet isolation (4 start-manifest e2e
failures). Route assets stay on TanStack's route-keyed manifest, which
is per-route precise; hydration is synchronous because preload() warms
lazy()'s component cache before the router renders. User-level lazy()
components inside routes remain fully registered — the opt-out is
scoped to the route-component wrapper.

Verified: solid-start basic e2e 80 passed (was 60/20); start-manifest
10 passed (including the previously failing lazy-to-static shared-CSS
navigation); unit suites green apart from the four pre-existing
failures fixed on the useHead branch.

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

* feat(solid-router): route chunks opt in to Solid's client-assets manifest

With the head registry (useHead branch) underneath, lazyRouteComponent
forwards the module's real $$moduleUrl: split route modules have
per-module client-manifest entries (the query is part of the module
identity), so server-side lazy() registers exactly the route's own CSS
and modulepreload hints, and the registry's URL-keyed resource dedupe
absorbs the overlap with TanStack's route-keyed manifest links — the
duplicate-stylesheet failures that forced the earlier $$moduleUrl null
opt-out were double emission between Solid's channel and TanStack's
in-tree links, which the registry now reconciles.

The now-unused null opt-out hunk is dropped from the solid-js patch,
leaving exactly the two upstream-tracked fixes (rejection retry:
solidjs/solid#2999, fixed on next in 3c68ab21; hydration-shortcut
moduleUrl gate: solidjs/solid#3011).

Verified on the stack: unit 59 files / 865 tests all green (first fully
green combination), solid-start basic e2e 80 passed, start-manifest 12
passed including the ported modulepreload-hint and hydration asset-map
tests.

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

* feat(solid-router): adopt lazy()'s { export } option via upstream backport

Upstream resolved solidjs/solid#3011 with first-class named-export
support instead of the fallback gate this patch carried: lazy(fn,
{ export }, moduleUrl?) names which export of the resolved module is
the component, as a call-site literal available on both runtimes —
so hydration claims the component synchronously from the preloaded
module namespace, and runtime wrappers that pick an export inside the
import thunk fail loudly in dev instead of silently orphaning SSR'd
DOM.

The solid-js patch is now a faithful backport of solidjs/solid@56ca6470
(which also carries the #2999 rejection-retry fix in its final
load-inside-memo shape) onto the rc.0 dists, plus one deliberate
deviation: lazy() still accepts the legacy string second argument
(moduleUrl) that rc.0's bundler transform injects, normalizing it to
the third position, until the updated transform (dom-expressions
0856717a) ships. Type declarations carry the new overloads.

lazyRouteComponent takes its final upstream-aligned shape: the module
namespace passes through untouched ($$moduleUrl included, so route
chunks keep registering their real client assets), { export } selects
the component, and only the module-not-found reload dance and the
memoized never-rejecting preload contract remain as wrapper logic.
When an rc ships with both upstream commits, the migration is deleting
the patch.

Verified: unit 59 files / 865 tests green; solid-start basic e2e 80
passed; start-manifest 12 passed.

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

* chore(solid): bump to solid-js 2.0.0-rc.1 and drop the solid-js patch

rc.1 ships everything the interim patch carried: the lazy() rejection
retry fix (solidjs/solid#2999, 3c68ab21) and the { export } option with
its loud-in-dev hydration guard (solidjs/solid#3011, 56ca6470 +
dom-expressions 0856717a — the updated transform arrives through
babel-preset-solid 2.0.0-rc.1 via @solidjs/vite-plugin 3.0.0-next.30).
patches/ and the patchedDependencies entry are deleted;
lazyRouteComponent is unchanged, already in its final shape against the
real API.

Monorepo-wide range bump: solid-js and @solidjs/web ^2.0.0-rc.0 →
^2.0.0-rc.1, @solidjs/vite-plugin ^3.0.0-next.28 → ^3.0.0-next.30.

Verified on vanilla rc.1: unit 59 files / 865 tests green; solid-start
basic e2e 80 passed; start-manifest 12 passed.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Ryan Carniato <ryansolid@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-19 19:09:35 +02:00
Brenley Dueck
b60b741a88
feat(solid-router): adopt Solid 2's useHead registry for head management (#8080)
* feat(solid-router): register head tags through Solid's useHead registry

HeadContent now feeds the route-derived tags (useTags output, semantics
unchanged) to Solid's head registry as one reactive group instead of
rendering <Asset> elements in-tree. The registry owns head emission on
both runtimes: SSR splices/streams resolved winners into <head>, the
client patches document.head reactively — replacing the manual
relocate-into-head, imperative script injection, and document.title
syncing that Asset.tsx carried for head tags.

The dev-only dev-styles handling (filter DEV_STYLES_ATTR links post
hydration) is a no-op in production, so it folds into the single
HeadContent — retiring HeadContent.dev.tsx, index.dev.tsx, and the
package's development export conditions.

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

* test(solid-start): pin SSR'd lazy() modulepreload hints and hydration asset map

The client-assets manifest wiring (99756c0710) gives SSR'd lazy()
components three observable outputs in the served HTML: modulepreload
hints for the lazy chunk and its static imports in the initial <head>,
the chunk's stylesheet link, and the serialized boundary→chunk asset map
that gates client hydration on those imports. The start-manifest e2e
only asserted the stylesheet side, so a silent regression to the
route-keyed manifest fallback would keep the suite green while losing
hints and hydration gating.

Two request-level tests against the built app pin the rest: direct SSR
entry to /lazy-css-lazy emits exactly one head modulepreload for the
lazy chunk and one for its statically imported widget chunk (and none of
them on routes that never render the component), and the hydration
payload's _assets map points at the same chunk URL the head hinted.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(solid-router): lean on the head registry for tag lifecycle

Drop the pieces of the head pipeline that existed only for the old
in-tree render path: the reference-reuse memo and replaceEqualTags (DOM
node stability for a <For> that no longer exists) and the dev-styles
post-hydration filtering (HeadContent is now a pure useHead
registration). Add the changeset for the useHead adoption.

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

* ci: apply automated fixes

* fix(solid-router): stable head-registry identities for inline tags + CI repairs

Inline scripts and styles get a stable content-derived key in toHeadTags:
the registry otherwise assigns per-runtime unique identities that can
never match between server and client, so hydration appended a client
copy next to the server-rendered tag (caught by the solid-start basic
script-duplication e2e).

The ssr head benchmark's sanity assertion now counts name="…" attribute
occurrences instead of raw substring hits — the registry writes the
identity into data-dh on the same element, which doubled the old count.

remountDeps tests migrate onMount to Solid 2's onSettled (pre-existing
branch failure; the API was removed in the rc line).

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

* fix(solid-router): make route-boundary resets converge (issue 7986 + background recovery)

Two compounding defects kept a captured route error from retrying
cleanly on Solid 2:

- CatchBoundary's reset effect re-ran on every recompute of the reset
  key, not only on value changes, so any store write recreated the
  retried subtree while it settled. The effect is now gated on the key
  value. The reset handle deliberately stays un-consumed: a reset
  applied at the wrong moment can no-op (the boundary stays errored and
  the fallback never re-runs), and only a repeated attempt on a later
  key change recovers it — consuming the handle at apply time or at
  children re-render both proved to lose exactly that retry (verified
  against the background-recovery test).

- Match keyed its boundary on the whole matches store, so every
  unrelated transition fired a premature reset that re-threw the
  still-stale error and flapped the error UI. The key is now scoped to
  the guarded match and its descendants (whose errors bubble here when
  they have no errorComponent), mirroring react-router's per-match
  keying, as a value string because the store emits fresh objects for
  content-equal writes.

The issue-7986 pending assertion queries fresh under waitFor: the
retried subtree renders the pending fallback from two nested slots in
quick succession (Show fallback, then the Loading boundary once the
child suspends), so a cached element handle can go stale across the
swap.

First fully green unit run on this branch: 59 files, 864 tests.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Ryan Carniato <ryansolid@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-19 17:58:15 +02:00
autofix-ci[bot]
6512ced192
ci: apply automated fixes 2026-08-13 04:12:26 +00:00
Brenley Dueck
1022de9f32 Merge branch 'main' into upgrade-solidjs-rc-0-main-merge
# Conflicts:
#	benchmarks/client-nav/package.json
#	benchmarks/client-nav/scenarios/async-pipeline/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/control-flow/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/head/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/history/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/links/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/loaders/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/mount/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/nested-params/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/preload/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/rewrites/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/route-tree-scale/solid/src/main.tsx
#	benchmarks/client-nav/scenarios/search-params/solid/src/main.tsx
#	examples/react/basic-default-search-params/package.json
#	examples/react/large-file-based/package.json
#	examples/react/location-masking/package.json
#	examples/react/navigation-blocking/package.json
#	examples/react/router-monorepo-react-query/packages/router/package.json
#	examples/react/search-validator-adapters/package.json
#	examples/react/start-large/package.json
#	examples/solid/authenticated-routes-firebase/package.json
#	examples/solid/authenticated-routes/package.json
#	examples/solid/basic-default-search-params/package.json
#	examples/solid/basic-devtools-panel/package.json
#	examples/solid/basic-file-based/package.json
#	examples/solid/basic-non-nested-devtools/package.json
#	examples/solid/basic-solid-query-file-based/package.json
#	examples/solid/basic-solid-query/package.json
#	examples/solid/basic-ssr-file-based/package.json
#	examples/solid/basic-ssr-streaming-file-based/package.json
#	examples/solid/basic-virtual-file-based/package.json
#	examples/solid/basic-virtual-inside-file-based/package.json
#	examples/solid/basic/package.json
#	examples/solid/deferred-data/package.json
#	examples/solid/i18n-paraglide/package.json
#	examples/solid/kitchen-sink-file-based/package.json
#	examples/solid/kitchen-sink-solid-query-file-based/package.json
#	examples/solid/kitchen-sink-solid-query/package.json
#	examples/solid/kitchen-sink/package.json
#	examples/solid/large-file-based/package.json
#	examples/solid/location-masking/package.json
#	examples/solid/navigation-blocking/package.json
#	examples/solid/quickstart-esbuild-file-based/package.json
#	examples/solid/quickstart-file-based/package.json
#	examples/solid/quickstart-rspack-file-based/package.json
#	examples/solid/quickstart-webpack-file-based/package.json
#	examples/solid/quickstart/package.json
#	examples/solid/router-monorepo-simple-lazy/package.json
#	examples/solid/router-monorepo-simple-lazy/packages/router/package.json
#	examples/solid/router-monorepo-simple/package.json
#	examples/solid/router-monorepo-simple/packages/router/package.json
#	examples/solid/router-monorepo-solid-query/package.json
#	examples/solid/router-monorepo-solid-query/packages/router/package.json
#	examples/solid/scroll-restoration/package.json
#	examples/solid/search-validator-adapters/package.json
#	examples/solid/start-basic-auth/package.json
#	examples/solid/start-basic-authjs/package.json
#	examples/solid/start-basic-cloudflare/package.json
#	examples/solid/start-basic-netlify/package.json
#	examples/solid/start-basic-nitro/package.json
#	examples/solid/start-basic-solid-query/package.json
#	examples/solid/start-basic-static/package.json
#	examples/solid/start-basic/package.json
#	examples/solid/start-bun/package.json
#	examples/solid/start-convex-better-auth/package.json
#	examples/solid/start-counter/package.json
#	examples/solid/start-i18n-paraglide/package.json
#	examples/solid/start-large/package.json
#	examples/solid/start-streaming-data-from-server-functions/package.json
#	examples/solid/start-supabase-basic/package.json
#	examples/solid/start-tailwind-v4/package.json
#	examples/solid/view-transitions/package.json
#	examples/solid/with-framer-motion/package.json
#	examples/solid/with-trpc/package.json
#	packages/solid-router/CHANGELOG.md
#	packages/solid-router/package.json
#	packages/solid-router/src/CatchBoundary.tsx
#	packages/solid-router/src/Match.tsx
#	packages/solid-router/src/link.tsx
#	packages/solid-router/src/useBlocker.tsx
#	packages/solid-router/src/useRouterState.tsx
#	packages/solid-router/src/utils.ts
#	packages/solid-start-client/CHANGELOG.md
#	packages/solid-start-client/package.json
#	packages/solid-start-client/src/GenericHydrate.tsx
#	packages/solid-start-server/CHANGELOG.md
#	packages/solid-start-server/package.json
#	packages/solid-start/CHANGELOG.md
#	packages/solid-start/package.json
#	pnpm-lock.yaml
2026-08-12 23:09:21 -05:00
Brenley Dueck
9b773206ed Version Packages: solid family to 2.0.0-rc.0
Manually applied `changeset version` and normalized the prerelease counters
to 0. Changesets continues each package's counter across a pre-tag switch
(beta.30 would have become rc.31), and the counter is derived from the
current versions, so a literal rc.0 is only reachable by hand.

All six @tanstack/solid-* packages move to 2.0.0-rc.0; the pending solid
changesets are recorded as consumed in .changeset/pre.json, so CI's next
version run has nothing further to apply.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 20:32:52 -05:00
Brenley Dueck
56cc90ea2c Upgrade solidjs rc 0 and rename vite-plugin-solid to @solidjs/vite-plugin
`vite-plugin-solid` has been renamed to `@solidjs/vite-plugin`. Its final
release under the old name (`3.0.0-next.27`) is a re-export shim over the new
package, and `next.28`+ ships only under the new name.

The rename and the `rc` bump are forced together: `@solidjs/vite-plugin@3.0.0-next.28`
peer-requires `solid-js`/`@solidjs/web` `^2.0.0-rc.0`.

- solid-js, @solidjs/web, babel-preset-solid: 2.0.0-beta.32 -> ^2.0.0-rc.0
- vite-plugin-solid ^3.0.0-next.23 -> @solidjs/vite-plugin ^3.0.0-next.28
- @tanstack/solid-query + solid-query-devtools -> ^6.0.0-rc.0
  (solid-query rc.0 peer-requires solid-js >=2.0.0-rc.0)
- @tanstack/query-core converged on 5.101.4: solid-query depends on query-core
  5.101.0, which previously resolved to a stale 5.99.0 and produced two
  structurally incompatible `QueryClient` types, failing
  @tanstack/solid-router-ssr-query's build

`packages/router-devtools-core` intentionally stays on `vite-plugin-solid@^2.11.10`
— it builds against Solid 1.9.12 and `@solidjs/vite-plugin` has no 2.x line.

`@tanstack/router-plugin` is intentionally untouched: it detects the Solid JSX
plugin by its Vite plugin name (`solid`), which the renamed package still
registers, and its `vite-plugin-solid` peer is optional — so it keeps working
for both Solid 1 and Solid 2 consumers without a change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 20:21:16 -05:00
Flo
38485038c5
Fix default route component remounting (#8002)
* Fix default route component remounting

* Optimize reactive Vue Link props

* fix(vue-router): address reactive Link review feedback
2026-08-12 14:53:17 +02:00
github-actions[bot]
dc5a404eb9
ci: Version Packages (#8048)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-12 11:15:35 +02:00
Flo
31355ae92c
fix(react-router): useMatchRoute w/ React Compiler (#8015)
* fix(react-router): useMatchRoute w/ React Compiler

* test(react-router): add React Compiler E2E

Co-authored-by: Kamal Bennani <kamal.bennani@aircall.io>

* disable eslint react-hooks/exhaustive-deps for known static condition w/ DCE

* test(react-router): cover useMatchRoute callback identity

Co-authored-by: Sarah Gerrard <98355961+LadyBluenotes@users.noreply.github.com>

* test(react-router): rely on useMatchRoute subscription

* test(react-router): exercise compiler-generated memoization

* no useCallback during SSR

* update docs

---------

Co-authored-by: Kamal Bennani <kamal.bennani@aircall.io>
Co-authored-by: Sarah Gerrard <98355961+LadyBluenotes@users.noreply.github.com>
2026-08-12 10:35:50 +02:00
github-actions[bot]
e15bda5c4d
ci: Version Packages (#8040)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-12 10:33:33 +02:00
Flo
f5007607d6
fix(router): warn when Outlet is rendered in fallback components (#8045) 2026-08-12 09:53:15 +02:00
Flo
aa10b6589e
fix(router): apply preload delay to viewport links (#8044)
* fix(router): apply preload delay to viewport links

* fix(router): cancel delayed viewport preloads on exit

* fix(router): process queued viewport transitions in order

* fix(router): use latest queued viewport state

* refactor(router): inline viewport observer options

* fix(router): stabilize viewport preload timers

* cleaner timeout map key
2026-08-12 09:52:36 +02:00
Flo
1aafca9b45
refactor: remove Link transition state (#8043) 2026-08-12 09:52:10 +02:00
Flo
7e93431ae9
fix(router-core): load-client can cache settled abandoned loader work without preload authority (#8039)
* fix(router-core): load-client can cache settles abandonned loader work without preload authority

* changeset

* update INTERNALS.md
2026-08-11 12:17:44 +02:00
github-actions[bot]
03fd7365a7
ci: Version Packages (beta) (#8034)
ci: changeset release (beta)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-10 15:24:58 -05:00
Brenley Dueck
980ed5794a
Upgrade solidjs beta 32 (#8014)
* Upgrade solid-js to 2.0.0-beta.32 and vite-plugin-solid to 3.0.0-next.23

- solid-js / @solidjs/web / babel-preset-solid: 2.0.0-beta.29 -> 2.0.0-beta.32
- vite-plugin-solid: ^3.0.0-next.21 -> ^3.0.0-next.23 (ships @dom-expressions/compiler 0.50.0-next.40)
- Migrate server tests off removed renderToStringAsync: awaiting renderToStream()
  now resolves with the fully-settled HTML string

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

* ci: apply automated fixes

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-10 15:05:00 -05:00
Ryan Carniato
41cffa00f3
fix(solid-router): make the global loading boundary opt-in and server/client-symmetric (#8027)
* fix(solid-router): make the global loading boundary opt-in and server/client-symmetric

`Matches` wrapped the match tree in a client-only `Solid.Loading`
boundary unless `disableGlobalCatchBoundary`, `isServer`, or
`router.ssr` was set, while the server side always rendered
`SafeFragment`. Apps that server-render without the `$_TSR` stream
protocol (own server entry: memory history, awaited `router.load()`,
`renderToStream`) never set `router.ssr`, so the client hydrated a
boundary the server never rendered. That desyncs Solid's positional
node claiming and surfaces as an opaque `reconcileArrays` crash
(`NotFoundError: insertBefore`).

The wrapper is now opt-in and the decision is evaluated identically on
the server and the client. It renders only when all of these hold:

- the app configured root pending UI (root `pendingComponent` or
  `defaultPendingComponent`) — new;
- `router.ssr` is not set (the `$_TSR` protocol short-circuit,
  unchanged and pinned by tests);
- `disableGlobalCatchBoundary` is not set (unchanged).

There is no `isServer` arm, no hydration probe, and no match-state
inspection — the decision reads only router configuration, so the
server tree and the hydrating client tree cannot disagree.

With nothing configured there is no wrapper at all: pending propagates
as ordinary Solid 2 async. The previous behavior there was an invisible
`Solid.Loading` with a `null` fallback, which also converted errors to
pending. With pending UI configured, the boundary now renders on both
sides, so external SSR hydrates cleanly (server nodes claimed and
reused, no pending flash) and the pending UI keeps working for
post-hydration navigations — a client-only wrapper, even a settled one,
shifts hydration-key derivation and leaves the server nodes unclaimed.

Tests: matches-hydration-boundary.test.tsx pins the opt-in decision,
the protocol short-circuit, `disableGlobalCatchBoundary`, and that the
decision is identical whether or not a hydration pass is in flight (a
hydration-keyed decision would freeze `SafeFragment` into hydrated apps
permanently); server-mode matchesLoadingBoundary.test.tsx pins the
symmetric server output. Verified additionally against a real
`renderToString` -> `hydrate` round trip: zero hydration errors, zero
unclaimed nodes, server DOM reused by identity.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-10 15:03:44 -05:00
Flo
af8dcb859a
test(router-core): add missing test cleanup in 3920 (#8023) 2026-08-09 23:43:17 +02:00
github-actions[bot]
91a848e979
ci: Version Packages (#8021)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-09 20:43:56 +02:00
Flo
5500fd3510
fix(router-core): handle excessive parent relative links (#8018) 2026-08-09 19:40:25 +02:00
github-actions[bot]
6f8f534bf3
ci: Version Packages (#8011)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-09 11:01:57 +02:00
Flo
44a8c3e1d2
perf(router-core): skip impossible JSON parse attempts (#8006)
* perf(router-core): skip impossible JSON parses

* perf(router-core): refine JSON parse fast path

* changeset
2026-08-08 19:43:09 +02:00
Flo
c59788ca20
perf(start-client-core): O(1) buffer drain in client frame decoder (#8009)
The frame decoder dropped consumed chunks from its buffer with
bufferList.shift(), which is O(n). When a single large frame (e.g. a big
RawStream payload) is assembled from many small network reads, the
extract loop calls shift() once per chunk, making reassembly O(n^2).

Track the first un-consumed chunk with a head pointer and advance it in
O(1) instead of shifting. Consumed slots are released for GC, and the
buffer is compacted when fully drained (O(1) reset) or once the consumed
prefix grows past a small threshold (amortized O(1) per chunk).

A micro-benchmark draining 1000 small chunks is ~11x faster.

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
2026-08-08 19:20:41 +02:00
Flo
5253e70db2
perf(router-core): faster enumerable-key collection in structural sharing (#8010)
* perf(router-core): faster enumerable-key collection in structural sharing

getEnumerableOwnKeys (used by replaceEqualDeep) called
Object.getOwnPropertyNames and then invoked propertyIsEnumerable once per
key to verify every own string prop is enumerable. Replace that O(n) loop
of JS method calls with Object.keys (native, enumerable-only) plus a
single length comparison against getOwnPropertyNames to detect
non-enumerable string props. Symbol handling is unchanged.

Behavior is identical (verified against the existing suite + fuzzing): the
function still returns the enumerable own keys in the same order and still
bails (returns false) for objects with any non-enumerable own string or
symbol property.

replaceEqualDeep runs on every selector result on every state update when
defaultStructuralSharing is enabled, so this is a hot client path for
selector-heavy apps. Measured ~1.3-1.5x faster on typical router state.

* style(router-core): address enumerable key review

---------

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
2026-08-08 19:20:08 +02:00
Manuel Schiller
c568caf3f3
inline isServer for proper DCE (#7996) 2026-08-08 09:54:57 +02:00
github-actions[bot]
2265129b40
ci: Version Packages (#7994)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-07 19:58:00 +02:00
Mat Clayton
95dec51018
perf(react-router): bail out of Link re-renders when href and active state are unchanged (#7952)
* perf(react-router): bail out of Link re-renders when href and active state are unchanged

useLinkProps subscribes to the location store with an identity selector and an
href comparator, then derives href and isActive from the published location in
downstream memos. The comparator can only ask "is this a different URL?", never
"does this link care?", so every Link on the page re-renders on every navigation.

Move the location-derived values into the selector and compare them, so a link
whose resolved href and active state are unaffected by a navigation bails out.
buildLocation still runs once per link per location change; what goes away is the
React render and the host reconciliation under it.

doPreload no longer pre-supplies _builtLocation, because the built location is no
longer kept in render state. preloadRoute already falls back to building it, which
is what handleClick has always relied on for router.navigate.

The isActive and externalLink bodies move to module-level helpers unchanged so the
selector stays readable; activeOptions is spread into its four primitive fields in
the dependency list because callers routinely pass an inline object literal.

* refactor: trim redundant comments and brace single-line bodies

The comments explained the bail-out rationale twice — once on the LinkState type
and again above the selector — and two helper docblocks restated their function
names. The rationale now appears once, where a reader meets the selector; the
detail belongs in the PR description rather than the source.

Also braces the three single-line if bodies, per the AGENTS.md rule that if/else
bodies always use curly braces.

* refactor: publish link state as a tuple

The type is erased either way, but the object literal's property names survive
minification and a tuple's positions don't — so this drops three property names
from the selector's return plus the three property reads in compareLinkState.

Measured on the unminified build: -54 bytes in dist/esm/link.js and the same in
dist/cjs/link.cjs.

* test: assert the published link state, and drop a redundant cast

The render-count assertions proved the bail-out but not that the selector still
publishes correct values, so a selector returning a constant could have passed.
The test now also asserts that the link gaining active state carries
`data-status="active"` afterwards (and does not beforehand), and that the
unaffected link keeps its href and stays inactive.

Checked by sabotaging the selector: returning a constant tuple with a wrong href
but a correct active state now fails, where previously it passed.

Also drops `as any` from `new URL(to)` in resolveExternalLink — the guard above
already narrows `to` to string.

* refactor: pass activeOptions through instead of destructuring

Depends on the four fields rather than the object, with an exhaustive-deps
disable: callers routinely pass an inline literal, which would otherwise rebuild
the selector every render. resolveIsActive reads only those four fields, so the
disable is not hiding a live dependency.

-269 bytes on each of dist/esm/link.js and dist/cjs/link.cjs (unminified).

* perf: memoize the href derivation on the built href

The `useMemo` chain this replaced keyed `getHrefOption` and the external-link
resolution on the href string, so a navigation that left a link's href alone
skipped both. Deriving everything in the selector ran them on every location
notification instead, which showed up as a ~10% regression on the client-nav
rewrites benchmark, where rewrite handling makes `getHrefOption` expensive.

Cache both on the built href inside the selector closure. Measured on a
five-link root layout, per navigation: getHrefOption drops from 5 calls back to
0, matching the pre-change profile, with buildLocation and the active-state
derivation unchanged at 5.

* perf: keep _options referentially stable while its contents are equal

Links commonly pass inline `params` / `search` object literals. Those change
identity on every parent render, which rebuilt `_options`, which changed the
store selector's identity, which discarded useSyncExternalStoreWithSelector's
memoized selection. buildLocation then ran twice per navigation: once in the
notification check and once in the render-phase selection.

Measured on a replica of the client-nav rewrites scenario (six links, root
subscribed to the pathname via useLocation), buildLocation per navigation:
base 7, before this commit 12, after 7.

* revert: drop the href memoization, it measured no benefit

Reverts 409371b. It did cut getHrefOption from 5 calls per navigation to 0,
matching the pre-change profile, but that is not where the time went: on the
rewrites scenario it moved the number by 0.05% (medians 245.33 vs 245.21 hz over
four interleaved rounds). Not worth ~15 lines of mutable closure state.

The rewrites regression is fixed by the _options stabilisation instead.

* docs: explain why useValueStable exists

Replaces a leftover scratch note.

* perf: cut the bundle cost of the link state selector

Stabilise `activeOptions` with the same helper used for `search` / `params`,
so the selector depends on one value instead of four destructured fields. That
also makes the dependency array honest, so the exhaustive-deps disable goes.

Drop the reference-equality guard in useValueStable: deepEqual already
short-circuits on `a === b`, so the guard only saved a function call that
returns immediately.

Measured with benchmarks/bundle-size against this branch's base, gzip delta
across the eight React scenarios moves from +27/-7 to +11/-24, and raw bytes go
uniformly negative (-37 to -45 on every scenario).

* perf: pass _options to preloadRoute without the shallow clone

The spread existed to add _builtLocation, which is gone, and nothing on the
preload path mutates the options object: preloadRoute only reads
opts._builtLocation, build() only reads dest fields, and the search middleware
chain only reads dest.search. Search middlewares themselves receive
{ search, next }, never dest.

Saves an object allocation per hover. Bytes are unchanged on gzip, -5 raw.

* fix: do not collapse explicit-undefined params when stabilising link options

useValueStable compared with deepEqual's default ignoreUndefined: true, which
skips undefined-valued keys on both sides, so `{}` and `{ category: undefined }`
compared equal. Those build different locations: an explicit undefined clears an
inherited optional param while an empty object inherits it. A Link whose params
changed from one to the other kept publishing the stale href, and click and
preload used the stale options too.

Compare with ignoreUndefined: false. Adds a regression test covering the
/posts/tech -> /posts transition, which fails before this commit and passes
after, and passes on the pre-PR baseline.

* chore: empty commit to re-trigger CI

* chore: add changeset

---------

Co-authored-by: Flo <me@florianpellet.com>
2026-08-07 17:37:30 +02:00
Flo
6bede65d70
perf(start): compact deferred hydration private state (#7980)
* perf(solid-start): shorten private prefetch state

* perf(start): use locals for hydration wait state

* perf(start): compact visible observer registry entries

* test(start): cover hydration private-state lifecycles

* docs: record solid hydration bundle result

* Delete RESULT-optimization-solid-hydration-private-state.md

* changeset

* ci: Version Packages (#7993) [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-08-07 17:30:30 +02:00
Flo
2fbc99f2c2
perf(start-client-core): compact private frame decoder result keys (#7978)
* perf(start-client-core): compact frame decoder result keys

* docs: record compact frame result evidence

* docs: record frame result attribution and e2e

* Delete RESULT-optimization-frame-decoder-compact-result.md

* changeset
2026-08-07 15:18:37 +02:00
github-actions[bot]
995bd97a9f
ci: Version Packages (#7993)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-07 13:04:38 +02:00
Flo
ea3a665d81
fix(router): retain mounted UI during revalidation (#7992)
* fix(router): retain mounted UI during revalidation

* fix(router): preserve initial pending presentation

* changeset

* test(router): make retained pending tests deterministic

* complete solid/vue suite
2026-08-07 11:57:59 +02:00
github-actions[bot]
ac1d0abea9
ci: Version Packages (#7968)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-06 15:38:36 +02:00
Flo
94685306a9
perf: compact private bundle boundaries (#7975)
* perf(history): compact queued action kind

* perf(history): compact queued navigation state

* perf(history): derive queued action state

* perf(router-core): tuple lightweight route matches

* perf(solid-router): compact nearest match context

* perf(vue-router): reuse the computed scripts tuple

* perf(vue-router): flatten private href input

* perf(vue-router): flatten private active-state input

* perf(vue-router): flatten private style input

* perf(start): return fetch bodies without an internal wrapper

* test(history): cover browser action batching

* docs: record compact private boundary results

* Delete RESULT-optimization-compact-private-boundaries.md
2026-08-06 13:40:09 +02:00
Flo
2435885fa8
Create file routes directly (#7970)
* test createFileRoute factory behavior

* create file routes directly

* preserve createFileRoute parameter name

* cleanup

* changeset
2026-08-06 13:38:43 +02:00
Flo
86bf510c29
Pass intersection observer disabled state directly (#7971)
* test disabled viewport links in Vue

* test reactive intersection observer disabling

* pass intersection observer disabled state directly

* changeset
2026-08-06 13:38:04 +02:00
Flo
84db4a8423
perf(router-core): optimize route tree processing (#7984) 2026-08-06 13:37:55 +02:00
Flo
697ebb6ddb
fix(react-router): prevent blank frame before initial pending UI (#7961)
* fix(react-router): prevent blank initial pending frame

* test(react-router): remove obsolete issue 4759 unit test

* alternative fix

* ci: apply automated fixes

* simplify code comment

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-06 00:09:29 +02:00