refactor(router-core): use one path interpolation implementation - #8007
refactor(router-core): use one path interpolation implementation#8007Sheraff wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 7a25c7c
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
Merging this PR will degrade performance by 7.49%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | ssr dehydrate rich types (solid) |
87.3 ms | 95.7 ms | -8.77% |
| ❌ | Simulation | ssr dehydrate plain control (solid) |
119.6 ms | 129.2 ms | -7.49% |
| ⚡ | Memory | mem server error-paths redirect (solid) |
588.2 KB | 281.8 KB | ×2.1 |
| ⚡ | Memory | mem client preload-churn (vue) |
776.2 KB | 741.4 KB | +4.7% |
| ⚡ | Simulation | ssr control-flow unmatched 404 (react) |
67.2 ms | 64.3 ms | +4.55% |
| ⚡ | Memory | mem client navigation-churn (solid) |
570.2 KB | 553 KB | +3.11% |
| 👁 | Memory | mem server server-fn-churn (vue) |
263.1 KB | 273.4 KB | -3.78% |
| 👁 | Memory | mem server error-paths not-found (solid) |
416.3 KB | 733.4 KB | -43.23% |
| 👁 | Memory | mem server streaming-peak chunked (solid) |
30.3 MB | 32.2 MB | -5.91% |
| 👁 | Memory | mem server error-paths not-found (react) |
256.3 KB | 291.3 KB | -12.01% |
| 👁 | Memory | mem server error-paths redirect (react) |
204.1 KB | 227.1 KB | -10.13% |
| 👁 | Memory | mem server error-paths unmatched (react) |
263.6 KB | 542.4 KB | -51.4% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing agent/interpolate-path-remove-server-fast-path (7a25c7c) with main (c568caf)
What changed
interpolatePathserverinterpolation option and router call-site plumbingWhy
Path interpolation had two implementations of the route grammar: a server-gated plain-template fast path and the canonical parser. The internal
options.servervalue was also runtime plumbing rather than a compile-time server boundary, so it was not an appropriate dead-code-elimination mechanism. A single path keeps grammar behavior and maintenance centralized.This PR intentionally does not include the separate
parseSegmentbranch reorder. It is correct and mergeable on its own; the parser optimization is complementary rather than required.Impact
react-router.minimaldecreases from 85,919 to 85,907 bytes gzip (-12 bytes; raw -47 bytes)Validation
@tanstack/router-core:test:unit: 105 files / 1,495 tests passed, plus 3 expected failures@tanstack/router-core:test:types: TypeScript 5.6 through 7.0 passed@tanstack/router-core:test:eslint: zero errors (existing warnings remain)tests/path.bench.tsrunreact-router.minimalbundle-size scenario onmainand this branchserveroption or router call-site prop remainsgit diff --check