Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Feb 2, 2026

Summary

  • Fix URL resolution for packages with 0.x.x versions
  • When @clerk/ui is at version 0.0.1, getMajorVersion was returning "0", creating invalid CDN URLs like @clerk/ui@0/dist/ui.browser.js
  • Now returns "canary" for 0.x.x versions, so URLs resolve to @clerk/ui@canary/dist/ui.browser.js

Test plan

  • Added unit tests for 0.x.x version handling
  • Verified prerelease tags still work for 0.x.x versions (e.g., 0.0.1-next.0next)
  • Existing tests pass
  • Build passes

Summary by CodeRabbit

  • Bug Fixes
    • Version selector now resolves 0.x.x releases to "canary" and correctly maps 0.x prerelease versions to their prerelease tags.
  • Tests
    • Added tests covering 0.x.x resolution (including prefixed/whitespace variants) and varied prerelease tag formats.

When a package has a 0.x.x version, getMajorVersion was returning '0',
which creates invalid CDN URLs like @clerk/ui@0 that don't resolve.

This fix returns 'canary' instead for 0.x.x versions, ensuring the URL
resolves to @clerk/ui@canary which works correctly.
@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2026

🦋 Changeset detected

Latest commit: a1dd33c

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

This PR includes changesets to release 20 packages
Name Type
@clerk/shared Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify 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

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

@vercel
Copy link

vercel bot commented Feb 2, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 2, 2026 8:56pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Updated version selection logic and tests: getMajorVersion now maps major version 0 to the string canary instead of returning "0". New tests were added to packages/shared/src/__tests__/versionSelector.spec.ts verifying 0.x.x versions resolve to canary and that 0.x.x prerelease versions resolve to their prerelease tags (e.g., next, alpha, beta, or remain as the full prerelease version when appropriate). A changelog entry .changeset/fix-version-selector-zero.md was added.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: mapping 0.x.x package versions to the canary tag for proper CDN URL resolution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 2, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7735

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7735

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: a1dd33c

@dstaley
Copy link
Member

dstaley commented Feb 3, 2026

I think it's more appropriate for this logic to live in our worker instead.

@jacekradko jacekradko marked this pull request as draft February 3, 2026 17:00
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.

3 participants