-
-
Notifications
You must be signed in to change notification settings - Fork 103
feat: add children route names generic to generated RouteNamedMap
and adjust docs and tests
#602
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
feat: add children route names generic to generated RouteNamedMap
and adjust docs and tests
#602
Conversation
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
+ Coverage 62.36% 62.60% +0.23%
==========================================
Files 32 32
Lines 3141 3161 +20
Branches 586 592 +6
==========================================
+ Hits 1959 1979 +20
Misses 1177 1177
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Just some extra info 😄
WalkthroughThe updates introduce a fifth generic parameter to Changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3696626
to
13706a2
Compare
…nd adjust docs and tests
13706a2
to
d56f127
Compare
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.
It took me a while but we are getting there!
> | ||
'custom-dynamic-child-name': RouteRecordInfo< | ||
'custom-dynamic-child-name', | ||
'/added-during-runtime/[...path]/child', |
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.
I think we should improve this example:
- keep the original
[...path]
route - Add a new one that makes more sense in a nested fashion like
/users/[id]/edit
- Omit
/users
/users/[id]
should have edit as a child
- Omit
Description
Note
This PR is intended to be paired with the following
vue-router
PR: vuejs/router#2475.This PR itself contains a temporary
pnpm
patch file that applies the changes in above-mentioned PR to work on this feature and make sure you can run tests and generate docs properly. Before merging, this patch needs to be removed andvue-router
should be updated if thevue-router
PR is merged.This extends generated

RouteRecordInfo
objects inRouteNamedMap
to make sure every route defines the route names of their children routes. NowuseRoute('/parent')
can return the typings of both the parent route and its children routes, as can be seen in the example in the adjusted docs:Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests