bab [Wed, 22 Apr 2026 15:29:03 +0000 (00:29 +0900)]
fix(resolve): omit empty optional params from resolved params (#2434)
Optional params that don't match a segment are no longer set to `''` in
the resolved `params` object; the key is now absent. This matches how
the same route resolves by name and fixes #2419.
Code that checks `params.p === ''` to detect a missing optional param
should use `!params.p` instead as it works with both old and new behavior.
Co-authored-by: Eduardo San Martin Morote <posva13@gmail.com>
chore(release): show last tag and relative date in package prompt
Display the previous tag and how long ago it was released (e.g. "42 days
ago") next to each package in the release multiselect, and in the
"changed files since ..." log line. Makes it easier to gauge at a glance
whether a release is overdue or expected.
fix(experimental): resolve TS errors in resolver/router type hierarchy
Widen parent/aliasOf in ResolverRecord_Base from the narrow union type
to the base interface, allowing router types to narrow them via standard
interface extension instead of incompatible overrides.
Curt Grimes [Mon, 9 Feb 2026 16:42:36 +0000 (10:42 -0600)]
chore(playground): upgrade to script setup syntax and TypeScript (#2490)
Upgrade the playground package to use the `<script setup>` syntax and
TypeScript. This change makes the playground more consistent with recent
Vue.js practices and improves type safety.
Keep the purpose of each example identical to the original examples as
much as possible. Therefore, components using `beforeRouteEnter()`,
[which does not have a `<script setup>`
equivalent](https://github.com/vuejs/router/issues/1517), are not
converted to `<script setup>` syntax but are only converted to use
TypeScript for improved type safety (Home.vue and
ComponentWithData.vue). Converting these to use the [recommended data
loaders or
`defineMacro()`](https://github.com/vuejs/router/issues/1517#issuecomment-2263346429)
could be an option in the future.
Update `RouteNamedMap` in main.ts to improve type safety and better
demonstrate the newer typed routes feature (introduced in
vue-router@4.4.0) in LongView.vue, Nested.vue, and RepeatedParams.vue.
Fix type issue in AppLink.vue where `RouterLinkProps` replaces
`RouterLink.props`.
Remove the `name` option from the `defineComponent` calls that used it,
because this option is [only useful when the component recursively calls
itself](https://v2.vuejs.org/v2/api/#name),
but there are not components in this playground project that do so.
BREAKING CHANGE: Remove the selectNavigationResult option and NAVIGATION_RESULTS_KEY since reroute() now throws immediately, making the collection and selection of navigation results unnecessary.
feat(experimental)!: add reroute() and deprecate NavigationResult
Introduce reroute() as the new API for changing navigation from within
data loaders. It throws a NavigationResult internally, which simplifies
the control flow and removes the need for stagedNavigationResult.
NavigationResult is deprecated in favor of reroute().
refactor(experimental)!: make miss() throw internally and return never
BREAKING CHANGE: `miss()` now throws the `MatchMiss` error internally
instead of returning it. If you were using `throw miss()`, replace it
with just `miss()`. This change prevents silently swallowing misses
when forgetting to `throw` and hides the fact that this is implemented
through a class, making it an implementation detail. **Most users won't be
affected as this only impacts custom matchers using the experimental
route resolver API. Also renames `MatchMiss` export to `_MatchMiss`
(internal).**
fix: correct route ordering for group nodes with inflated scores
Replace min/avg comparator with element-by-element score comparison
ported from pathParserRanker.ts. Add path depth tiebreaker so routes
like /:username/settings sort before /:username when group node
inflation makes their scores element-by-element equal.
fix: stable route ordering for group folders with same path
Group folders like (user) and (user-home) both resolve to an empty path
segment, making TreeNode.compare return 0 and fall back to non-deterministic
insertion order. Use rawSegment as tiebreaker for stable sorting.