feat: typed definePage params.path#2716
Conversation
Make `definePage` generic on the SFC's file path so `params.path` keys are narrowed to the actual route path-params. The Volar plugin injects the file path on bare `definePage(...)` calls, mirroring `useRoute()`. - Codegen emits `pathParamNames` per file in `_RouteFileInfoMap` - `_RouteFileInfoMap` wired through `TypesConfig` to survive d.ts bundling - Volar plugin escapes apostrophes/backslashes in injected file paths
✅ Deploy Preview for vue-router canceled.
|
commit: |
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThe PR extends the Vue Router type system to enable ChangesTyped definePage path parameters
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
Make
definePagegeneric on the SFC's file path soparams.pathkeys arenarrowed to the actual route path-params. The Volar plugin injects the
file path on bare
definePage(...)calls, mirroringuseRoute().pathParamNamesper file in_RouteFileInfoMap_RouteFileInfoMapwired throughTypesConfigto survive d.ts bundlingSummary by CodeRabbit
Release Notes
New Features
Improvements