Skip to content

Deprecate createRouteMatcher in Nuxt docs in favor of built-in route protection - #3406

Closed
jacekradko wants to merge 2 commits into
jacek/deprecate-createroutematcher-nextjsfrom
jacek/deprecate-createroutematcher-nuxt
Closed

Deprecate createRouteMatcher in Nuxt docs in favor of built-in route protection#3406
jacekradko wants to merge 2 commits into
jacek/deprecate-createroutematcher-nextjsfrom
jacek/deprecate-createroutematcher-nuxt

Conversation

@jacekradko

Copy link
Copy Markdown
Contributor

Stacked on #3405. Moves the Nuxt docs off createRouteMatcher to Nuxt's built-in route protection.

protect-pages.nuxt now uses named route middleware (definePageMeta with file-system inheritance) and route groups (route.meta.groups, Nuxt 4.3+) instead of matching paths by hand, and the API-route examples in the middleware reference use event.path prefix checks. While rewriting the authorization example I also destructured has() from event.context.auth(), which was previously referenced but never defined.

@jacekradko
jacekradko requested a review from a team as a code owner May 29, 2026 21:26
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-docs Ready Ready Preview Jun 5, 2026 3:36am

Request Review

…protection

Rewrites the Nuxt protect-pages guide to use Nuxt's named route middleware (definePageMeta inheritance) and route groups (route.meta.groups, Nuxt 4.3+) instead of createRouteMatcher, updates the overview accordingly, and switches the clerkMiddleware API-route examples to event.path prefix checks (also destructuring has() correctly).
Clarify that the reference covers server (API) routes, which have no
file-system page tree to inherit from, so matching event.path is the right
tool here, and point page protection at Nuxt's built-in route middleware. This
resolves the apparent contradiction with protect-pages.nuxt.mdx ('no separate
list'). Soften the createRouteMatcher NOTE to 'no longer recommended' to match
the shared partial.
@jacekradko
jacekradko force-pushed the jacek/deprecate-createroutematcher-nuxt branch from eb40e02 to 1150e41 Compare June 5, 2026 03:35
@alexisintech alexisintech self-assigned this Jun 5, 2026
@jacekradko

Copy link
Copy Markdown
Contributor Author

Heads up: this PR is part of the createRouteMatcher deprecation stack, which is being re-stacked on top of #3426.

#3426 carries a reframed, positive-recommendation version of the shared middleware-auth-deprecation partial plus the reworked Next.js protect-pages guidance, and is intended to merge to main first. Once it lands, this stack will be rebased onto it and pared down to the deltas it doesn't already cover.

Keeping do not merge until the rebase, no action needed here yet.

@jacekradko

Copy link
Copy Markdown
Contributor Author

Superseded by #3426. The Nuxt deprecation (createRouteMatcher to native event.path matching in the middleware reference, built-in route middleware for pages) is folded into #3426 (head 468fc4df4). Thanks for the approval, @wobsoriano. Closing in favor of #3426.

@jacekradko jacekradko closed this Jun 30, 2026
@jacekradko
jacekradko deleted the jacek/deprecate-createroutematcher-nuxt branch June 30, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants