fix(shared): suggest :path* subtree form in createRouteMatcher path types#9057
fix(shared): suggest :path* subtree form in createRouteMatcher path types#9057jacekradko wants to merge 1 commit into
Conversation
…ypes WithPathPatternWildcard now suggests `/dashboard/:path*` instead of `/dashboard(.*)`. The `:path*` form matches on path-segment boundaries, so it covers `/dashboard` and its subtree without also matching sibling routes like `/dashboardxyz`. Root is special-cased to `/:path*` to avoid a malformed `//:path*`. Backward compatible: the param is Autocomplete-wrapped, so existing `(.*)` patterns still type-check, and there is no runtime change.
🦋 Changeset detectedLatest commit: 42cecb9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR modifies the ChangesPath Wildcard Suggestion Update
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
🔴 Breaking changes index (1)Every breaking change, up front. Full diffs are in the package sections below.
@clerk/sharedCurrent version: 4.23.0 Subpath
|
createRouteMatcher's route-type suggestions now offer/dashboard/:path*instead of/dashboard(.*).(.*)also matches sibling routes like/dashboardxyz;:path*matches only/dashboardand its path-segment subtree. It's a type-level suggestion only (the param isAutocomplete-wrapped), so existing(.*)patterns keep type-checking and there's no runtime change.Worth a look: the root special-case.
WithPathPatternWildcard<'/'>resolves to/:path*, not the naive//:path*(which the vendored path-to-regexp 6.x matches as only/, not everything). I verified/dashboard/:path*,/:path*, and legacy(.*)against the vendored matcher, and@clerk/nextjstypechecks clean against it.Scoped to the type on purpose: the
['/foo', '/bar(.*)']JSDoc examples in nextjs/astro/nuxt are left as-is here and can be aligned in a follow-up. The docs are moving to recommend:path*too.Summary by CodeRabbit
:path*wildcard format for nested paths, making suggested routes more consistent and easier to read.(.*)route patterns continue to work as before.