-
-
Notifications
You must be signed in to change notification settings - Fork 103
fix: remove componentless routes from routes
in _RouteFileInfoMap
#686
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
base: main
Are you sure you want to change the base?
fix: remove componentless routes from routes
in _RouteFileInfoMap
#686
Conversation
WalkthroughVariable names in the route file info map generator were updated for clarity. Filtering logic for route names was tightened to exclude unnamed nodes and nodes without components. Type annotations for route names were added. No changes were made to function signatures or exported entities. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #686 +/- ##
==========================================
+ Coverage 60.90% 61.00% +0.10%
==========================================
Files 36 36
Lines 3379 3388 +9
Branches 618 620 +2
==========================================
+ Hits 2058 2067 +9
Misses 1314 1314
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
72882a3
to
a53ecf9
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.
Can you add a test?
@@ -108,4 +108,65 @@ describe('generateRouteFileInfoMap', () => { | |||
}" | |||
`) | |||
}) | |||
|
|||
it('does not contain routes without components', () => { |
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.
@posva This test already passed before my change in generateRouteFileInfoMap.ts
`) | ||
}) | ||
|
||
it('does not contain nested routes without components', () => { |
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.
@posva But this one only passes after the change in generateRouteFileInfoMap.ts
. I don't understand why in this case specifically, the output was wrong. Maybe you can double check if the problem lies elsewhere.
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.
Ah I think I get it! In generateRouteFileInfoLines()
, when running node.getChildrenDeepSorted()
for the parent route, that also returns the following routes during this particular test:
'/parent/optional'
'/parent/optional-repeatable'
'/parent/repeatable'
Only after the change I made, those componentless routes are not included in the parent route's routes
union in _RouteFileInfoMap
.
Fixes #685
We only checked if deep child routes had a name before adding them to
routes
in_RouteFileInfoMap
. We should have checked whether the deep child route had any corresponding Vue components too.Summary by CodeRabbit
Summary by CodeRabbit
No changes to visible features or user-facing functionality.