-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: revert "refactor: don't reparse upon navigation (#6398)" #6468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 6cbd96e.
📝 WalkthroughWalkthroughThis PR removes snapshot-based route-matching optimizations and simplifies the navigation API across TanStack Router. Changes include eliminating Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
View your CI Pipeline Execution ↗ for commit aa6f711
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/router-core/src/router.ts (1)
700-706: GuardparsedParamswhenskipRouteOnParseErroris enabled.
parsedParamsis now optional, butkey in parsedParams!will throw if it’sundefined. This can surface as a runtime error during matching whenskipRouteOnParseErroris used. Please guard with a fallback object (or default it ingetMatchedRoutes).🐛 Proposed fix
- const { foundRoute, routeParams, parsedParams } = matchedRoutesResult + const { foundRoute, routeParams, parsedParams } = matchedRoutesResult + const safeParsedParams = parsedParams ?? {} ... - for (const key in usedParams) { - if (key in parsedParams!) { - strictParams[key] = parsedParams![key] - } - } + for (const key in usedParams) { + if (key in safeParsedParams) { + strictParams[key] = (safeParsedParams as any)[key] + } + }Also applies to: 1266-1558, 2781-2787
♻️ Duplicate comments (2)
packages/react-router/tests/useNavigate.test.tsx (2)
1450-1465: Same sync-assumption as earlier segment.
No additional notes beyond the verification about immediate router state assertions above.
1763-1778: Same sync-assumption as earlier segment.
No additional notes beyond the verification about immediate router state assertions above.
This reverts commit 6cbd96e.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Breaking Changes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.