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

4,435 commits

Author SHA1 Message Date
github-actions[bot]
6494e75362
ci: Version Packages (#8330)
ci: changeset release

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

* fix: add isServer edgecase to Vue Router

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

This reverts commit 18b52ab215.

* chore: remove useSelector in favor of upstream

* fix: handle CatchNotFound memory leaks

* fix(vue): migrate to use defineComponent properly

* fix: accept SFCs for routes
2026-09-10 19:41:24 +02:00
Flo
d914b085bb
fix(start-server-core): correctly iterate response headers (#8340)
* test(start-server-core): cover response header replacement

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

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

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

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

---------

Co-authored-by: Carlos González <carlos.rgn@gmail.com>
2026-09-10 17:27:44 +02:00
Flo
69c07c4bbf
test(router-core): cover search-derived context boundaries (#8334)
* test(react-router): cover search-derived context boundaries

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

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

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

---------

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

* test: assert hydration boundary behavior

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

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

* fix: preserve unload blockers after document navigation

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

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

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

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

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

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

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

* chore: centralize shared dependencies

* chore: keep examples self-contained

* chore: sync catalog versions into examples

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

* test(router): expand document navigation coverage

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

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

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

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

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

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

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

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

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

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

* chore: remove navigation investigation artifacts

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

* fix(history): respect ignoreBlocker in go navigation

* fix(history): reverse blocked traversal by its delta
2026-09-06 16:19:47 +02:00
Flo
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
c18e690814
perf(router-core): avoid redundant promises for ready routes (#8244)
* test(router-core): add ready-route performance controls

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

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

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

* docs(router-core): record immediate preload scheduling experiment

* perf(router-core): keep the simpler immediate chunk wrapper

* chore: remove ready-route benchmark artifacts
2026-09-05 11:24:18 +02:00
Flo
f0b5eda544
fix(router-core): retain not-found boundary during navigation (#8161)
* fix(router-core): retain not-found boundary during navigation

* chore: add changeset for not-found boundary fix

* test(react-router): cover overlapping not-found retention boundaries
2026-09-05 09:51:56 +02:00
Flo
2f9150309b
perf(router-core): avoid quadratic cache resource handoff (#8240)
* test(router-core): cover cache commit ownership and scaling

* perf(router-core): avoid quadratic cache resource handoff
2026-09-04 22:55:02 +02:00
Flo
50eafcaebb
perf(router-core): gate JSON.parse attempts behind jsonStart guard in parseSearchWith (#8142)
* perf(router-core): gate JSON.parse attempts behind jsonStart guard in parseSearchWith

* test(router-core): strengthen search parsing regression coverage

* chore(router-core): add search parsing changeset and refresh measurements

* docs: use a shell-safe parsing benchmark output path

* chore: keep search parsing measurements out of the PR
2026-09-04 22:43:10 +02:00
Flo
ee283480df
perf(router-core): replace the LRU cache with a trimmed SIEVE cache (#8230)
* perf(router-core): replace the LRU cache with a trimmed SIEVE cache

The hand-rolled doubly-linked LRU relinked the hit entry to the newest
position on every `get`. Every cache in the router (resolvePathCache,
the route tree's matchCache/singleCache/flatCache, the SSR manifest
cache) is hit-dominated: a page of links re-resolves the same handful
of paths on every navigation, so the relink was pure overhead.

SIEVE (https://cachemon.github.io/SIEVE-website/) keeps a FIFO list and
a visited bit per entry; a hit only sets the bit, and eviction sweeps a
hand from the oldest entry, clearing bits and dropping the first
unvisited one. Same API as before (`get`/`set`/`clear`, fixed `max`),
no dependency, and the old implementation's stale-`oldest` eviction
edge case is gone.

Microbenchmark (ns/op, Node 25): get-hit 17.0 -> 13.9, set-insert
64.9 -> 50.8, set-evict 79.9 -> 79.9, scan-then-return 41.0 -> 34.8,
get-miss 16.2 -> 19.3. Hit ratios on the links and route-tree-scale
client-nav traces are identical (working sets of 3-9 keys never evict).

Bundle gzip: react-router.minimal -8 B, react-router.full -15 B.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C1tX2n8xegVBsZqoJPu7iv

* perf(router-core): trim SIEVE cache nodes

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 20:56:39 +02:00
Flo
edf0e16ebf
perf(router-core): share settle chain between superseded navigation waiters (#8222)
perf(router-core): make superseded navigation waiters share one settle chain

`awaitCurrent` looped `await current.done` and re-read `router._tx` after
each completion. Under back-to-back navigations (anything that starts the
next navigation in the same tick as `onRendered`, including the client-nav
benchmarks) every superseded waiter woke on every successor, so a burst of
N navigations cost N²/2 microtask iterations and kept every superseded
transaction alive until the router went idle.

Each transaction's `done` promise now follows its current successor, so
every waiter on a transaction shares the same chain instead of polling
successors independently. A waiter still resolves once the router has
settled on a transaction other than its owner.

Measured in benchmarks/client-nav (react, navigations per 10s, jsdom):
baseline 15.4K -> 43K, route-tree-scale 17.9K -> 98K,
search-params 16.5K -> 55K. The instrumented baseline run showed
125.8M loop iterations for 15,867 navigations before the change.
Bundle: react-router.minimal -1 B gzip vs main.


Claude-Session: https://claude.ai/code/session_01C1tX2n8xegVBsZqoJPu7iv

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 15:10:53 +02:00
Cong-Cong Pan
37877da166
perf(start): optimize Rsbuild import protection reporting (#8164)
* perf(start): avoid parsing original source in Rsbuild import protection

* perf(start): avoid filesystem reads in Rsbuild import protection reporting

* perf(start): remove redundant module survival checks

* perf(start): ignore inactive Rspack import connections

* perf(start): lazily build Rsbuild import protection diagnostics

* chore: remove test case

* add changeset

* fix(start): persist Rsbuild import protection markers in buildInfo

* fix: normalize file path in getModuleResource

* fix(start): restore Rsbuild diagnostics for inactive imports

* fix(start): improve Rsbuild import protection diagnostics

* refactor(start): clarify Rsbuild violation scanner state

* update readme

* fix(start-plugin-core): avoid dependency locations in Rsbuild diagnostics

* fix(start): respect importer scope for Rsbuild markers

* refactor(start): move Rsbuild import protection transform to loader

* test(start): type Rsbuild import protection mocks

* fix(start): close Rsbuild import protection reporting gaps

* fix(start): skip errored Rsbuild import protection modules
2026-08-31 18:48:41 +02:00
Nicolas Stepien
3c6c959e56
Tweak a few NODE_ENV placements (#8196) 2026-08-31 01:34:24 +02:00
Kenji Mizuguchi
0caf6b9a2b
fix: preserve shouldThrow in route-scoped hooks (#8169)
* fix(react-router): forward shouldThrow in Route.useMatch

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

* ci: apply automated fixes

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

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

* test: simplify route-scoped shouldThrow coverage

---------

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 01:33:18 +02:00
Manuel Schiller
79e35335b4
optimize query integration (#8175)
* optimize query integration

* fix
2026-08-27 01:28:24 +02:00
Manuel Schiller
ebf13ed517
add react-start-query-integration bundlesize benchmark scenario (#8153)
* add react-start-query-integration bundlesize benchmark scenario

* bump query
2026-08-25 19:43:21 +02:00
Flo
9f8990b515
test(router-core): assert sequential asset projection (#8152) 2026-08-23 11:43:22 +02:00
github-actions[bot]
a5a5bacc8f
ci: Version Packages (#8133)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 00:53:08 +02:00
Flo
0eb45738c0
fix(router-core): reject overlapping parameter affixes (#8154)
* fix(router-core): reject overlapping parameter affixes

* perf(router-core): reduce affix overlap check size

* test(router-core): assert affix match parameters

* ci: apply automated fixes

* perf(router-core): normalize route affixes

* ci: apply automated fixes

* add test case

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 21:47:42 +02:00
Flo
eb9ddac3e2
test(router-core): document U+0130 affix limitation (#8149)
* fix(router-core): match Unicode wildcard suffixes

* ci: apply automated fixes

* refactor(router-core): clarify wildcard suffix boundaries

* fix(router-core): handle Unicode parameter affixes

* test(router-core): document U+0130 affix limitation

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 18:16:43 +02:00
Flo
81e4a79da2
perf(router-core): reduce client loader bundle size (#8150)
* perf(router-core): reduce client loader bundle size

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 17:42:10 +02:00
Jiahan Chen
a0041bb36e
fix(start): migrate to Rsbuild splitChunks config (#8135) 2026-08-22 09:48:30 +02:00
Flo
cb281d70c1
fix(router-core): preserve context during reloads (#8130)
* fix(router-core): preserve context during reloads

* ci: apply automated fixes

* test(router): consolidate issue 8115 coverage

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

* fix(router-core): refine context reconstruction

* bytes

* type fixes

* context + immediate UI on load

* coderabbit is happy

* no context in pending/error/notFound components

* changesets

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-20 23:34:06 +02:00
Manuel Schiller
fa65287281
perf(router): remove prebuilt preload locations (#8132) 2026-08-20 23:17:16 +02:00
Flo
7557415669
test(router-core): assert state structural sharing (#8121) 2026-08-19 13:48:51 +02:00
github-actions[bot]
4fcbcde90d
ci: Version Packages (#8119)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-19 13:22:14 +02:00
Flo
92749aba6e
perf(router-core): cache route mask misses (#8111)
* perf(router-core): cache route mask misses

* test(router-core): restore route mask cache spy
2026-08-19 11:24:35 +02:00
Flo
128757113e
perf(router-core): skip impossible state sharing (#8110)
* perf(router-core): skip impossible state sharing

* fix(router-core): preserve custom state handling

* perf(router-core): simplify state sharing guard

* perf(router-core): inline state property reads
2026-08-19 11:24:26 +02:00