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

19 commits

Author SHA1 Message Date
Manuel Schiller
cbbfbe37ab
optimize streaming (#8204) 2026-09-16 22:38:25 +02:00
Manuel Schiller
bc57fa3f12
fix(router-core): review follow-ups for Link stack (#8410)
* chore(benchmarks): remove TSR_LINK_PERF opt-in flag

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-13 13:55:01 +02:00
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
09da932575
test: stabilize CPU simulation with isolated SSR workers and explicit V8 settings (#8248)
* test: disable Maglev in CPU simulation benchmarks

* test: track shared CPU simulation flags in benchmark checks

* test: disable scheduled minor GC in CPU simulation

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

* test: release streamed benchmark data on counted task turns

* test: fix the initial heap budget for CPU simulation

* test: use eager baseline compilation in CPU simulation

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

* test: remove unnecessary marking override after runtime comparisons

* test: simplify benchmark setup after review
2026-09-05 20:54:53 +02:00
Flo
f97188fdb4
chore: localize package dependencies (#8078) 2026-08-15 13:42:24 +02:00
Flo
abf9b81b1f
test: stabilize codspeed CPU benchmarks (#7987) 2026-08-06 16:46:19 +02:00
Flo
b2908c642a
chore: update seroval to 1.6.2 (#7962) 2026-08-05 15:21:12 +02:00
Manuel Schiller
88f366ab8e
chore: migrate to typescript 7 (#7887) 2026-07-23 23:10:51 +02:00
Manuel Schiller
218eab2c3b
chore: regenerate route trees (#7853) 2026-07-19 09:20:56 +02:00
Flo
36ed57409a
bench: calibrate new ssr benchmarks iteration to reduce variability (#7625)
* bench: calibrate new ssr benchmarks iteration to reduce variability

* better response stream draining

* last remaining fast ssr scenarios
2026-06-13 15:21:57 +02:00
Flo
0c110a934a
ssr benchmarks (#7606) 2026-06-12 22:04:10 +02:00
Flo
b80781ede4
fix(benchmarks): run SSR setup imports natively (#7579)
* fix(benchmarks): run SSR setup imports natively

* fix(benchmarks): update codspeed vitest plugin

* fix(benchmarks): avoid SSR CodSpeed setup hooks

* ci: apply automated fixes

* fix(benchmarks): preload SSR handlers before bench

* ci: apply automated fixes

* ensure benchmarks build are NODE_ENV=production

* fail codspeed on error, to avoid future skips like this one

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-07 18:46:47 +02:00
Manuel Schiller
90adda91aa
fix: bundled dev support for vite (#7482) 2026-05-24 22:08:23 +02:00
Flo
b57e898e67
chore(deps): vitest 4.1.4 (#7212) 2026-04-17 21:19:38 +02:00
Birk Skyum
b1c0f4602d
chore: upgrade tooling to typescript 6 (#7024) 2026-03-23 22:59:52 +01:00
Flo
7f38aac99b
chore: migrate benchmarks to Vite 8 (#6986) 2026-03-19 20:03:32 +01:00
Flo
b46b2eef67
test: faster benchmark ci (#6834) 2026-03-06 18:10:09 +01:00
Flo
33188782e1
test: add cross-framework SSR request-loop benchmarks (#6803) 2026-03-03 10:45:15 +01:00