refactor(router-core): parse masked locations without mutating shared state - #8421
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe router now tracks rewrite and case-sensitivity changes together, validates cached route trees with case-sensitivity data, parses masked locations with merged state, and uses direct ChangesRouter location flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The router-core refactor preserves existing location and rewrite behavior and is ready to merge subject to normal checks. 🚥 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 |
|
View your CI Pipeline Execution ↗ for commit bb56d2a
☁️ 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. |
… state `parseLocation` built the presented location of a masked entry by parsing the stored `__tempLocation` and then patching and `delete`-ing keys on the resulting `state`, which `replaceEqualDeep` may have shared with the previous location, before spreading the result once more. The inner parser now takes the state to use, so the masked branch passes the intended state up front and assigns `maskedLocation` on the fresh object. The slow parsing path only runs the input rewrite when one is configured, and `resolvePathWithBase` is inlined into its two callers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit cc6159628cd22faf9c16e6e432cb35093b2826a8)
bb56d2a to
20d9a05
Compare
🎯 Changes
parseLocationbuilt the presented location of a masked entry by parsingthe stored
__tempLocationand then patching anddelete-ing keys on theresulting
state, whichreplaceEqualDeepmay have shared with theprevious location, before spreading the result once more. The inner parser
now takes the state to use, so the masked branch passes the intended state
up front and assigns
maskedLocationon the fresh object.The slow parsing path only runs the input rewrite when one is configured,
and
resolvePathWithBaseis inlined into its two callers.Verification on
maintest:unit(3252 passed),test:types,test:eslintRelationship to other PRs
Stacked on #8419 (positional
resolvePath): the inlinedresolvePathWithBasecallers use the positional signature. Merge #8419 first and GitHub retargets this one tomain.✅ Checklist
🚀 Release Impact
Summary by CodeRabbit