You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@clerk/chrome-extension was getting rejected from the Chrome Web Store under MV3 because the bundle ships a remote script loader for @clerk/ui's ui.browser.js. The extension already bundles the UI via @clerk/ui/no-rhc so the loader never runs, but getClerkUIEntryChunk wasn't gating it behind __BUILD_DISABLE_RHC__ the way getClerkJsEntryChunk already does for clerk-js. Gating it lets the loader (and the createElement('script') it uses) tree-shake out of the extension build.
The search-for-rhc.mjs postbuild check should have caught this since it already greps for /npm/@clerk/ui, but its directory mode was missing -r, so grep never looked inside dist and always came back clean. That's fixed here too, which is why it goes in the same PR as the gate rather than on its own. I rebuilt react and the extension to confirm the RHC strings are gone and the check passes, then pointed the fixed checker at a planted URL to make sure it still fails when there's something to find.
getClerkUIEntryChunk did not gate loadClerkUIScript behind
__BUILD_DISABLE_RHC__, so no-remote-code builds (e.g. @clerk/chrome-extension)
shipped the @clerk/ui ui.browser.js CDN loader as unreachable code. The Chrome
Web Store rejects this under Manifest V3 even though it never runs. Gate it like
getClerkJsEntryChunk so it dead-code-eliminates out of the bundle.
Also fix scripts/search-for-rhc.mjs directory mode, which was missing -r and so
never descended into dist, silently passing. This made the chrome-extension
postbuild and ui check:no-rhc guards no-ops.
Closes#8770
Reviewing files that changed from the base of the PR and between c8ff729 and fb6ad51.
📒 Files selected for processing (1)
packages/react/src/isomorphicClerk.ts
🚧 Files skipped from review as they are similar to previous changes (1)
packages/react/src/isomorphicClerk.ts
📝 Walkthrough
Walkthrough
This PR gates the Clerk UI remote script loader behind the __BUILD_DISABLE_RHC__ build flag in the React package, documents the resulting Chrome extension cleanup, and updates the RHC search utility to traverse directories recursively.
Changes
Remote Code Gate for Clerk UI
Layer / File(s)
Summary
Build-time gate for Clerk UI remote loader packages/react/src/isomorphicClerk.ts, .changeset/react-gate-ui-loader-norhc.md
getClerkUIEntryChunk is wrapped with a !__BUILD_DISABLE_RHC__ guard so it returns undefined when the flag is enabled, preventing the remote UI CDN loader from being bundled; unchanged behavior when the flag is not set.
Chrome extension cleanup documentation and RHC search improvement .changeset/chrome-extension-strip-ui-rhc-loader.md, scripts/search-for-rhc.mjs
Adds a changeset documenting removal of the remote @clerk/ui loader from the Chrome extension bundle and updates asyncSearchRHC to use grep -r for directory searches so nested files are checked.
🎯 2 (Simple) | ⏱️ ~10 minutes
A gate to block the script so tight, No remote code will bundle in flight! Chrome's manifest won't fuss and fight, Extensions pass inspection just right. 🐰✨
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title clearly and concisely describes the main change: gating the remote Clerk UI loader behind a build-time flag to enable tree-shaking in builds that disable remote-hosted code.
Linked Issues check
✅ Passed
The PR fully addresses issue #8770 by implementing a build-time gate for the remote UI script loader, enabling tree-shaking for no-RHC builds and fixing the postbuild verification script.
Out of Scope Changes check
✅ Passed
All changes are directly related to the stated objective: gating the remote UI loader and fixing the recursive directory search in the verification script.
Docstring Coverage
✅ Passed
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
Comment @coderabbitai help to get the list of available commands and usage tips.
Generated by Break Check on 2026-06-09T03:25:44.791Z
Summary
Metric
Count
Packages analyzed
19
Packages with changes
0
🔴 Breaking changes
0
🟡 Non-breaking changes
0
🟢 Additions
0
Note
Break Check could not snapshot 3 subpaths; the diff below excludes them.
@clerk/astro ./env: Internal Error: Unable to determine module for: /home/runner/_work/javascript/javascript/packages/astro/env.d.ts You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
@clerk/shared ./cookie: Internal Error: Unable to follow symbol for "Cookies" You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
@clerk/testing ./cypress: Symbol not found for identifier: Cypress
No API Changes Detected
All packages have stable APIs with no detected changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@clerk/chrome-extensionwas getting rejected from the Chrome Web Store under MV3 because the bundle ships a remote script loader for@clerk/ui'sui.browser.js. The extension already bundles the UI via@clerk/ui/no-rhcso the loader never runs, butgetClerkUIEntryChunkwasn't gating it behind__BUILD_DISABLE_RHC__the waygetClerkJsEntryChunkalready does for clerk-js. Gating it lets the loader (and thecreateElement('script')it uses) tree-shake out of the extension build.The
search-for-rhc.mjspostbuild check should have caught this since it already greps for/npm/@clerk/ui, but its directory mode was missing-r, so grep never looked insidedistand always came back clean. That's fixed here too, which is why it goes in the same PR as the gate rather than on its own. I rebuilt react and the extension to confirm the RHC strings are gone and the check passes, then pointed the fixed checker at a planted URL to make sure it still fails when there's something to find.Closes#8770
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores