Skip to content

chore(shared): Deprecate createPathMatcher#9094

Open
jacekradko wants to merge 1 commit into
mainfrom
jacek/shared-deprecate-path-matcher
Open

chore(shared): Deprecate createPathMatcher#9094
jacekradko wants to merge 1 commit into
mainfrom
jacek/shared-deprecate-path-matcher

Conversation

@jacekradko

@jacekradko jacekradko commented Jul 6, 2026

Copy link
Copy Markdown
Member

With createRouteMatcher now deprecated in Next.js (#8994), Astro (#8981), and Nuxt (#9092), this marks the underlying createPathMatcher() and its pattern types in @clerk/shared as @deprecated so they can be removed in the next major.

JSDoc only, no runtime warning on purpose: @clerk/shared resolves via ^ ranges under framework SDK versions already published, and those call createPathMatcher inside their own createRouteMatcher. A runtime warning would show up in apps that never import it directly, and double-warn users who already get the wrapper's warning. The malformed-URL helpers in the same module (isMalformedURLError and friends) stay as-is since the live clerkMiddleware implementations depend on them.

Summary by CodeRabbit

  • Chores
    • Deprecated path-pattern matching helpers and related pattern types.
    • Added clearer guidance that these APIs will be removed in the next major release.
    • Recommended using the framework’s built-in routing primitives for access and protection decisions.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 6, 2026 8:20pm
swingset Ready Ready Preview, Comment Jul 6, 2026 8:20pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b5f6aed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@clerk/shared Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/electron Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/headless Patch
@clerk/hono Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/react Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/ui Patch
@clerk/vue Patch
@clerk/swingset Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9094

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9094

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9094

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9094

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9094

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9094

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9094

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9094

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9094

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9094

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9094

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9094

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9094

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9094

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9094

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9094

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9094

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9094

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9094

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9094

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9094

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9094

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9094

commit: b5f6aed

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a changeset and JSDoc updates marking createPathMatcher() and its associated types (PathMatcherParam, PathPattern, WithPathSegmentWildcard) in @clerk/shared as deprecated, to be removed in the next major version in favor of native routing primitives.

Changes

Deprecation Notice

Layer / File(s) Summary
Changeset and JSDoc deprecation
.changeset/shared-deprecate-path-matcher.md, packages/shared/src/pathMatcher.ts
Adds a patch changeset and @deprecated JSDoc annotations for createPathMatcher(), WithPathSegmentWildcard, and PathPattern, noting removal in the next major version and recommending framework-native routing primitives.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • clerk/javascript#9057: Both PRs touch packages/shared/src/pathMatcher.ts's exported path-matching types, with this PR deprecating pattern matching while the related PR updates type semantics toward the :path* subtree form.

Suggested reviewers: alexcarpenter

Poem

A rabbit hops through docs so neat,
Marking paths that soon retreat,
"@deprecated" tags now bloom,
Making way for routing's room,
Hop along, new patterns greet! 🐇📝

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: deprecating createPathMatcher in @clerk/shared.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-06T20:22:29.152Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on b5f6aed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/shared/src/pathMatcher.ts (1)

19-31: 📐 Maintainability & Code Quality | 🔵 Trivial

Loop in Docs for the generated reference text.

These exported JSDoc updates will surface in Clerk Docs, so the deprecation wording should get a quick docs pass to make sure the generated reference pages still read correctly.

Also applies to: 81-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shared/src/pathMatcher.ts` around lines 19 - 31, The exported
deprecation JSDoc on the path matcher types will be published into Clerk Docs,
so review and adjust the wording in pathMatcher’s type declarations and related
generated reference text to keep the docs readable and accurate. Update the
comments around WithPathSegmentWildcard, PathPattern, and the other deprecated
exports so the generated reference pages render cleanly with consistent
deprecation messaging, then verify the docs output for those symbols.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/shared/src/pathMatcher.ts`:
- Around line 19-31: The exported deprecation JSDoc on the path matcher types
will be published into Clerk Docs, so review and adjust the wording in
pathMatcher’s type declarations and related generated reference text to keep the
docs readable and accurate. Update the comments around WithPathSegmentWildcard,
PathPattern, and the other deprecated exports so the generated reference pages
render cleanly with consistent deprecation messaging, then verify the docs
output for those symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a734fd1-7979-4df3-ba4a-5afca642ab21

📥 Commits

Reviewing files that changed from the base of the PR and between f9afa48 and b5f6aed.

📒 Files selected for processing (2)
  • .changeset/shared-deprecate-path-matcher.md
  • packages/shared/src/pathMatcher.ts

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