* 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>
* docs(start): correct authentication server function examples
* docs(start): prevent caching session-specific auth pages
* docs(start): guard login forms until hydration
* test(start): assert authentication behavior in SSR and SPA modes
* docs(start): fix broken createServerFn doc links in reading-writing-file tutorials
The 'server-functions' page moved from /framework/{react,solid}/server-functions
to /framework/{react,solid}/guide/server-functions in a recent docs refactor.
The old URL returns 307 redirects that hang (tanstack.com server is
timing out on these paths) — effectively a 404 from the user perspective.
Verified manually: the new /guide/server-functions path returns 200 for
both react and solid variants. The link text in the tutorial points to
'createServerFn', which is documented on the new page.
* docs(start): fix ISR data loading link
---------
Co-authored-by: sanjibani <18418553+sanjibani@users.noreply.github.com>
docs(start): fix broken routing-side guide link in authentication primitives
The "routing-side guide" links in the Authentication Server Primitives guide
used a relative path (`../../../../router/guide/authenticated-routes.md`).
While that resolves as a file path, it renders to an invalid site URL
(`/start/latest/router/guide/authenticated-routes`) and 404s.
Use the absolute cross-project doc path that the rest of the docs already use
for Router links, e.g. `/router/latest/docs/framework/react/guide/authenticated-routes`.
Closes#7701
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* 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>
* 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>
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>
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>
* perf(start-plugin-core): skip unused manifest build data
* fix(start-plugin-core): skip Rsbuild CSS capture during development
* update tests per review
* 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
* 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
* 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