fix: resolve MatchRoute return types for pathless (layout) routes - #7571
fix: resolve MatchRoute return types for pathless (layout) routes#7571EduardF1 wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe PR broadens ChangesMatchRouteFn Type Signature Update
Estimated code review effort: 2 (Simple) | ~8 minutes Merge Risk: ⚪ Minimal · up to This change corrects TypeScript return-type resolution for matches beneath pathless layout routes without changing runtime matching behavior. No concrete merge-blocking risk is currently identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Friendly ping — this PR is still mergeable and all checks are green. Anything I can do to help it land? Happy to rebase onto the latest base or adjust the scope if the approach has changed since it was opened. |
Description
Fixes #6011
Currently,
router.matchRoutereturns a type offalsewhen matching against paths contained within pathless (layout) routes (e.g._pathless/nested/$id). The runtime behavior is correct, but the genericTResolvedresolution fails to extract the underlying string type when passing throughNoInfervia the Layout masking.This patch adds a string union extraction step on
TResolved, ensuring the generic constraint successfully unwraps the pathless definition and provides proper TS intellisense (ResolveParams) without evaluating toneverorfalse.Testing
Verified TS compiler locally.
Summary by CodeRabbit