fix(react): gate remote Clerk UI loader behind __BUILD_DISABLE_RHC__#8773
fix(react): gate remote Clerk UI loader behind __BUILD_DISABLE_RHC__#8773jacekradko wants to merge 1 commit into
Conversation
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
🦋 Changeset detectedLatest commit: c8ff729 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR gates the Clerk UI remote script loader behind the ChangesRemote Code Gate for Clerk UI
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
Break Check: no API changes detected across the tracked packages. Last ran on |
@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