Optimize route tree sibling sorting - #7969
Conversation
|
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)
📝 WalkthroughWalkthroughRoute parsing now records sortable dynamic, optional, and wildcard sibling arrays. Route trees and route masks sort those arrays after parsing. Tests cover specificity when routes and masks are declared in least-specific order. ChangesRoute sorting
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
|
View your CI Pipeline Execution ↗ for commit f07a855
☁️ Nx Cloud last updated this comment at |
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. |
🚀 Changeset Version Preview5 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
Merging this PR will regress 5 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server error-paths unmatched (react) |
317.5 KB | 741.7 KB | -57.2% |
| ❌ | Memory | mem client unique-location-churn (solid) |
341.2 KB | 524.8 KB | -34.97% |
| ❌ | Memory | mem server peak-large-page (react) |
1.7 MB | 2.5 MB | -32.15% |
| ❌ | Memory | mem server error-paths redirect (vue) |
338.6 KB | 487.5 KB | -30.53% |
| ❌ | Simulation | ssr control-flow route headers (react) |
63.8 ms | 66.1 ms | -3.48% |
| ⚡ | Memory | mem server server-fn-churn (vue) |
4,147.3 KB | 264.6 KB | ×16 |
| ⚡ | Memory | mem server error-paths unmatched (vue) |
2,142.1 KB | 484.9 KB | ×4.4 |
| ⚡ | Memory | mem server error-paths redirect (solid) |
388 KB | 283.8 KB | +36.75% |
| ⚡ | Memory | mem client navigation-churn (vue) |
1.3 MB | 1.2 MB | +4.12% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/optimize-route-tree-sorting (f07a855) with main (697ebb6)
What
Why
Most nodes do not contain competing dynamic siblings. Tracking the few arrays that need ordering avoids traversing the entire parsed tree a second time while preserving the existing comparator and post-parse ordering.
Bundle impact
Prior isolated prototype measurements from the same
maincommit used as this PR's base:react-router.minimal: -214 B raw, -18 B gzip, -75 B Brotlisolid-router.minimal: -213 B raw, -31 B gzip, -27 B BrotliValidation
Summary by CodeRabbit
Bug Fixes
Tests