Always execute beforeLoad for client lanes - #7922
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 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 79c00bc
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview4 package(s) bumped directly, 19 bumped as dependents. 🟩 Patch bumps
|
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 12.74%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server error-paths unmatched (react) |
261.3 KB | 596.3 KB | -56.18% |
| ❌ | Memory | mem server error-paths redirect (vue) |
306 KB | 630.6 KB | -51.47% |
| ❌ | Memory | mem client unique-location-churn (react) |
665.1 KB | 872.7 KB | -23.79% |
| ❌ | Memory | mem server error-paths not-found (solid) |
751.3 KB | 818.3 KB | -8.18% |
| ❌ | Memory | mem server streaming-peak chunked (vue) |
11.1 MB | 11.6 MB | -4.85% |
| ❌ | Simulation | ssr control-flow route headers (react) |
60.3 ms | 62.7 ms | -3.8% |
| ❌ | Simulation | ssr selective (solid) |
70.3 ms | 72.9 ms | -3.62% |
| ❌ | Simulation | client-rewrites navigation loop (solid) |
81.8 ms | 84.5 ms | -3.19% |
| ⚡ | Memory | mem client navigation-churn (solid) |
544.9 KB | 498.5 KB | +9.31% |
| ⚡ | Memory | mem server error-paths redirect (react) |
201.8 KB | 185.2 KB | +8.97% |
| ⚡ | Simulation | ssr server-fn multipart (solid) |
64.2 ms | 61.2 ms | +4.86% |
| ⚡ | Simulation | client-preload interaction loop (react) |
55.4 ms | 53.4 ms | +3.63% |
| ⚡ | Simulation | ssr server-fn raw-stream (solid) |
111.7 ms | 108.1 ms | +3.36% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/always-run-beforeload (d49f47f) with fix-router-core-lane-match-loader (2d639e1)
What changed
beforeLoadindependently for every client navigation and preload lane, including identical and same-location requestsbeforeLoadplanningclearCachepreserve correct loader ownershipurgentmode fromStartTransitionFnWhy
beforeLoadcarries lane-specific guard and context semantics, so adopting it from cache or another in-flight lane can expose stale context and control flow. Loader data is the intended reusable boundary. Separating these rules simplifies the match-loading architecture while retaining loader deduplication.The previous broad reservation and lane-adoption mechanisms also made it possible to leak zero-owner loader flights, replay stale work after invalidation, or make retained shared work undiscoverable during filtered cache clearing.
Impact
Every client lane now evaluates its own
beforeLoad. Loader work can still be reused from cache or an in-flight generation, even when lane arguments such aspreloador context differ. The resulting orchestration has fewer semantic authorities and removes per-preload full-flight-registry sweeps.Validation
react-router.minimaldecreased by 166 bytes