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

2,272 commits

Author SHA1 Message Date
github-actions[bot]
84bde660a1
ci: Version Packages (#8457)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 23:34:45 +02:00
github-actions[bot]
de023a7533
ci: Version Packages (#8429)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 23:07:33 +02:00
Manuel Schiller
cbbfbe37ab
optimize streaming (#8204) 2026-09-16 22:38:25 +02:00
Manuel Schiller
8e164d28f9
refactor(react-router): drop the useLinkProps pass-through wrapper (#8420)
`useLinkPropsFor` existed only to keep the `host` argument off the public
`useLinkProps` signature. Fold it into `useLinkProps` behind an `@internal`
overload; `stripInternal` removes that overload from the published
declarations, so the public signature stays `(options, forwardedRef?)`.
react-router.full shrinks by 24 B gzip.


(cherry picked from commit 918d3050850815abc8ae49518befda61cb29bf7b)

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

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

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


(cherry picked from commit d6f2c1ca55a4900b33868cfc115ac7120d68d26b)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-14 20:42:14 +02:00
github-actions[bot]
6954a370a7
ci: Version Packages (#8355)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-13 15:13:54 +02:00
Manuel Schiller
92719bd586
perf(react-router): memoize Link and forward refs without an effect (#8405)
* perf(react-router): memoize Link and forward refs without an effect

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* refactor: stop exporting isPlainObject and isPlainArray

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* update route trees

* ci: apply automated fixes

---------

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:01 +02:00
github-actions[bot]
6494e75362
ci: Version Packages (#8330)
ci: changeset release

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

* fix: add isServer edgecase to Vue Router

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

This reverts commit 18b52ab215.

* chore: remove useSelector in favor of upstream

* fix: handle CatchNotFound memory leaks

* fix(vue): migrate to use defineComponent properly

* fix: accept SFCs for routes
2026-09-10 19:41:24 +02:00
github-actions[bot]
edeb19979e
ci: Version Packages (#8281)
ci: changeset release

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

* fix: preserve unload blockers after document navigation

* perf: reduce document navigation guard size
2026-09-09 23:03:49 +02:00
Manuel Schiller
9aec5a7012
perf(react-router): avoid redundant Link state prop allocations (#8311)
Links resolve one state-prop bag instead of separate active and inactive bags. Class names do not need temporary arrays. Unchanged styles retain their original references. Callback behavior and prop precedence remain unchanged.

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

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 22:22:12 +02:00
Sarah Gerrard
49bcd4db74
chore: refresh Router and Start dependencies (#8300)
* chore: refresh Router and Start dependencies

* chore: centralize shared dependencies

* chore: keep examples self-contained

* chore: sync catalog versions into examples

* test(start-plugin-core): refresh hydration snapshots and portable fixtures
2026-09-09 06:27:59 +02:00
Flo
0f40695fbe
test: cover existing navigation and redirect behavior (#8286) 2026-09-07 21:35:15 +02:00
Flo
aee42c6b64
perf(react-router): avoid unnecessary composed handlers (#8279)
* perf(react-router): avoid unnecessary composed handlers

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

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-06 23:22:45 +02:00
Flo
08eff50c44
fix(router-core): fix dangling references in published declarations (#8207)
* fix(router-core): strip internal SSR globals from declarations

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

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

This reverts commit 2bc6b55255.

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

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

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

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

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

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

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

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

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

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

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

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

* refactor(router): simplify absolute URL conditions

* perf(router): remove redundant absolute URL prechecks
2026-09-05 22:05:13 +02:00
Flo
28a5e4504e
fix(router): handle unknown error boundary values (#8209)
* fix(router): handle unknown error boundary values

* fix(router): complete unknown boundary error migration

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

* fix(router): restore minimal boundary error display

* fix(solid-router): unify boundary errors across SSR and client
2026-09-05 14:48:44 +02:00
Flo
f0b5eda544
fix(router-core): retain not-found boundary during navigation (#8161)
* fix(router-core): retain not-found boundary during navigation

* chore: add changeset for not-found boundary fix

* test(react-router): cover overlapping not-found retention boundaries
2026-09-05 09:51:56 +02:00
Kenji Mizuguchi
0caf6b9a2b
fix: preserve shouldThrow in route-scoped hooks (#8169)
* fix(react-router): forward shouldThrow in Route.useMatch

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

* ci: apply automated fixes

* fix(react-router,solid-router,vue-router): preserve shouldThrow in route-scoped hooks

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

* test: simplify route-scoped shouldThrow coverage

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sheraff <me@florianpellet.com>
2026-08-27 23:54:34 +02:00
github-actions[bot]
a5a5bacc8f
ci: Version Packages (#8133)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 00:53:08 +02:00
Flo
cb281d70c1
fix(router-core): preserve context during reloads (#8130)
* fix(router-core): preserve context during reloads

* ci: apply automated fixes

* test(router): consolidate issue 8115 coverage

* fix(vue-router): react to provider context changes

* fix(router-core): refine context reconstruction

* bytes

* type fixes

* context + immediate UI on load

* coderabbit is happy

* no context in pending/error/notFound components

* changesets

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-20 23:34:06 +02:00
github-actions[bot]
4fcbcde90d
ci: Version Packages (#8119)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-19 13:22:14 +02:00
github-actions[bot]
a78f2af5b4
ci: Version Packages (#8079)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-18 17:12:28 +02:00
Flo
63d2cc9155
fix(router-core): remove navigation rollback (#8092)
* fix(router-core): remove navigation rollback

* test(react-start): update failed HMR refresh expectation
2026-08-18 14:09:37 +02:00
Flo
5d3785dcc3
fix(router-core): preserve pending UI across retained routes (#8084)
* fix(router-core): preserve pending UI across retained routes

* fix(router-core): harden pending session ownership

* fix(router): align pending presentation across Solid and Vue (#8097)

fix(router): align pending presentation across frameworks

* changesets

* test: align hydration fake timers
2026-08-18 14:09:36 +02:00
Flo
f97188fdb4
chore: localize package dependencies (#8078) 2026-08-15 13:42:24 +02:00
Flo
f75cada017
perf(react-router): direct export of CatchBoundary class component, remove function wrapper (#8068)
bundle(react-router): direct export of CatchBoundary class component, remove function wrapper
2026-08-15 08:52:06 +02:00
github-actions[bot]
11dfc93669
ci: Version Packages (#8075)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-15 00:08:52 +02:00
Flo
0fdf9ff16f
perf: inline isCtrlKey utility inside all Link components (#8073) 2026-08-14 21:02:47 +02:00
github-actions[bot]
53b63cf6fb
ci: Version Packages (#8052)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-14 14:05:28 +02:00
Flo
0c25a7b43b
fix(react-router): avoid Suspense above root documents (#8055)
* fix(react-router): avoid suspense above root documents

* test(react-start): cover root document hydration

* test(react-router): remove indirect hydration assertion

* perf(react-router): reduce suspense wrapper bundle size

* test(react-start): isolate root hydration regression

* fix(react-router): preserve root suspense in CSR

* refactor(react-router): simplify root suspense checks

* fix(react-router): preserve functional ssr classification
2026-08-14 13:34:08 +02:00
Flo
31882c7fa8
fix(router): reuse resolved lazy route components (#8054)
* fix(router): reuse resolved lazy route components

* fix vue inconsistency

* fix(router): clear resolved lazy component preload
2026-08-14 13:30:20 +02:00
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