Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Anoesj
Copy link
Contributor

@Anoesj Anoesj commented Mar 13, 2025

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 and vue-router should be updated if the vue-router PR is merged.

This extends generated RouteRecordInfo objects in RouteNamedMap to make sure every route defines the route names of their children routes. Now useRoute('/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:
image

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] Transitive: environment, filesystem, shell +23 1.07 MB okonet
npm/[email protected] None 0 0 B
npm/[email protected] environment, network 0 57.6 kB posva
npm/[email protected] None +1 779 kB pi0
npm/[email protected] environment, filesystem, shell +16 498 kB remy
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +247 66.9 MB antfu, atinux, danielroe, ...1 more
npm/[email protected] None 0 4.61 kB sindresorhus

🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

pkg-pr-new bot commented Mar 13, 2025

Open in Stackblitz

npm i https://pkg.pr.new/unplugin-vue-router@602

commit: c32ca68

Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.80%. Comparing base (70e454d) to head (c32ca68).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #602      +/-   ##
==========================================
+ Coverage   61.72%   61.80%   +0.08%     
==========================================
  Files          32       32              
  Lines        3135     3142       +7     
  Branches      580      583       +3     
==========================================
+ Hits         1935     1942       +7     
  Misses       1194     1194              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor Author

@Anoesj Anoesj left a 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 😄

@@ -198,5 +199,17 @@
"vuefire": "^3.2.1",
"webpack": "^5.97.1",
"yorkie": "^2.0.0"
},
"pnpm": {
"onlyBuiltDependencies": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this should be in this PR. With pnpm v10, builds have to be approved. After you do, pnpm adds "approved builds" to package.json.

"vue-demi",
"yorkie"
],
"patchedDependencies": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This temporary patch needs to be removed before merging.

@@ -0,0 +1,73 @@
diff --git a/dist/vue-router.d.ts b/dist/vue-router.d.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This temporary patch needs to be removed before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant