Skip to content

fix(react): make __internal_* URL props take precedence over bundled constructors#7919

Merged
jacekradko merged 2 commits intomainfrom
jacek/internal-url-precedence
Feb 24, 2026
Merged

fix(react): make __internal_* URL props take precedence over bundled constructors#7919
jacekradko merged 2 commits intomainfrom
jacek/internal-url-precedence

Conversation

@jacekradko
Copy link
Copy Markdown
Member

@jacekradko jacekradko commented Feb 24, 2026

Summary

  • __internal_clerkJSUrl now takes precedence over the bundled Clerk constructor prop in IsomorphicClerk.getClerkJsEntryChunk
  • __internal_clerkUIUrl now takes precedence over the bundled ui.ClerkUI constructor prop in IsomorphicClerk.getClerkUIEntryChunk
  • Previously, bundled constructors silently won, causing internal URL overrides (used for staging/canary testing) to be ignored

Test plan

  • Added 4 new tests covering precedence behavior in both directions
  • All 378 existing tests pass
  • pnpm build passes for @clerk/react

Summary by CodeRabbit

  • Tests

    • Expanded test coverage for internal URL configuration precedence and fallback behavior.
  • Bug Fixes

    • Fixed loading precedence so externally specified script/UI URLs take priority over bundled constructors, preventing unintended overrides and skipping bundled prefetch/loading when external URLs are present.

…constructors

When both a bundled Clerk/ClerkUI constructor and an __internal_*Url prop
are provided, the URL prop now takes precedence. This ensures testing
overrides (e.g. staging/canary builds) are not silently ignored.
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 24, 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 24, 2026 7:16pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: 3dd794a

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

This PR includes changesets to release 6 packages
Name Type
@clerk/react Patch
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/nextjs Patch
@clerk/react-router Patch
@clerk/tanstack-react-start 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

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

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c1e32ca and 3dd794a.

📒 Files selected for processing (1)
  • .changeset/internal-url-precedence.md

📝 Walkthrough

Walkthrough

The changes make internal URL flags take precedence for resource loading: when `__internal_clerkJSUrl` or `__internal_clerkUIUrl` are set, the implementation loads Clerk JS/UI from those URLs and avoids using or assigning bundled constructors. Tests were expanded and setup/teardown adjusted to verify URL precedence and fallback to bundled resources when the internal flags are absent.

🚥 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 clearly describes the main change: making internal URL props take precedence over bundled constructors in the Clerk React package.
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
Copy Markdown

pkg-pr-new Bot commented Feb 24, 2026

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 3dd794a

@jacekradko jacekradko merged commit ab9efa2 into main Feb 24, 2026
41 checks passed
@jacekradko jacekradko deleted the jacek/internal-url-precedence branch February 24, 2026 19:27
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