perf(router-core): reuse idle match batch logic for fewer bytes - #8022
perf(router-core): reuse idle match batch logic for fewer bytes#8022Sheraff wants to merge 2 commits into
Conversation
|
View your CI Pipeline Execution ↗ for commit b37cab6
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 22 bumped as dependents. 🟩 Patch bumps
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesIdle match publication
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
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 regress 2 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server error-paths redirect (solid) |
288.7 KB | 403.5 KB | -28.47% |
| ❌ | Memory | mem server error-paths redirect (vue) |
294.9 KB | 372.5 KB | -20.83% |
| ⚡ | Memory | mem server error-paths not-found (solid) |
658 KB | 411.6 KB | +59.88% |
| ⚡ | Memory | mem client navigation-churn (solid) |
665.6 KB | 616 KB | +8.05% |
| ⚡ | Simulation | client-history navigation loop (react) |
40 ms | 37.1 ms | +7.75% |
| ⚡ | Memory | mem client unique-location-churn (vue) |
1.3 MB | 1.2 MB | +4.99% |
| ⚡ | Memory | mem server server-fn-churn (solid) |
275 KB | 264.6 KB | +3.96% |
| ⚡ | Memory | mem server error-paths unmatched (react) |
272.1 KB | 263.5 KB | +3.27% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing perf-router-core-reuse-idle-match-batch (bb7f463) with main (91a848e)
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We updated the setIdleMatches function signature in load-client.ts to use Array<AnyRouteMatch> instead of AnyRouteMatch[], which fixes the @typescript-eslint/array-type ESLint error introduced by this PR. Our change aligns with the project's enforced generic array syntax rule while preserving the full intent of the refactor. No logic was altered — only the type annotation syntax was corrected.
Tip
✅ We verified this fix by re-running @tanstack/router-core:test:eslint.
diff --git a/packages/router-core/src/load-client.ts b/packages/router-core/src/load-client.ts
index a56c5570..131ac76e 100644
--- a/packages/router-core/src/load-client.ts
+++ b/packages/router-core/src/load-client.ts
@@ -2630,7 +2630,7 @@ export async function hydrate(router: AnyRouter): Promise<void> {
function setIdleMatches(
router: AnyRouter,
- matches: AnyRouteMatch[],
+ matches: Array<AnyRouteMatch>,
skipClientLoad?: boolean,
) {
router.batch(() => {
Or Apply changes locally with:
npx nx-cloud apply-locally xOEV-bEpW
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Summary by CodeRabbit
Performance
Bug Fixes