feat(shared): make clerkJSUrl, clerkJSVersion, clerkUIUrl internal#7879
feat(shared): make clerkJSUrl, clerkJSVersion, clerkUIUrl internal#7879jacekradko wants to merge 10 commits intomainfrom
Conversation
…xt): remove clerkUIVersion and deprecate clerkJSVersion Remove the `clerkUIVersion` prop from all SDKs and deprecate the `clerkJSVersion` prop with @deprecated JSDoc annotations.
…xt): rename clerkJSUrl, clerkJSVersion, clerkUIUrl to __internal_ prefix
🦋 Changeset detectedLatest commit: f0b02fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@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: |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis pull request renames four UI configuration properties from public to internal-only across the SDKs: 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/astro/src/integration/create-integration.ts (1)
22-66:⚠️ Potential issue | 🟠 MajorMissing env mapping for
__internal_clerkUIUrlparameterThe
__internal_clerkUIUrlparameter is defined inAstroClerkIntegrationParamsand used inbuild-clerk-hotload-script, but it's never extracted from params or mapped to thePUBLIC_CLERK_UI_URLenv variable increate-integration.ts. This inconsistency with how__internal_clerkJSUrland__internal_clerkJSVersionare handled breaks UI URL overrides passed through integration params—the server-side code won't have access to the custom UI URL.Add the missing extraction and env mapping:
const clerkJSUrl = (params as any)?.__internal_clerkJSUrl as string | undefined; const clerkJSVersion = (params as any)?.__internal_clerkJSVersion as string | undefined; + const clerkUIUrl = (params as any)?.__internal_clerkUIUrl as string | undefined; const prefetchUI = (params as any)?.prefetchUI as boolean | undefined;...buildEnvVarFromOption(clerkJSUrl, 'PUBLIC_CLERK_JS_URL'), ...buildEnvVarFromOption(clerkJSVersion, 'PUBLIC_CLERK_JS_VERSION'), + ...buildEnvVarFromOption(clerkUIUrl, 'PUBLIC_CLERK_UI_URL'),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/astro/src/integration/create-integration.ts` around lines 22 - 66, The integration never extracts the __internal_clerkUIUrl param nor maps it to an env var, so the server cannot see UI URL overrides; add a const like clerkUIUrl = (params as any)?.__internal_clerkUIUrl as string | undefined alongside clerkJSUrl/clerkJSVersion, then include ...buildEnvVarFromOption(clerkUIUrl, 'PUBLIC_CLERK_UI_URL') in the define block inside the 'astro:config:setup' hook (near the other buildEnvVarFromOption calls) so the value is available server-side for code that reads PUBLIC_CLERK_UI_URL (e.g., build-clerk-hotload-script).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/astro/src/integration/create-integration.ts`:
- Around line 22-66: The integration never extracts the __internal_clerkUIUrl
param nor maps it to an env var, so the server cannot see UI URL overrides; add
a const like clerkUIUrl = (params as any)?.__internal_clerkUIUrl as string |
undefined alongside clerkJSUrl/clerkJSVersion, then include
...buildEnvVarFromOption(clerkUIUrl, 'PUBLIC_CLERK_UI_URL') in the define block
inside the 'astro:config:setup' hook (near the other buildEnvVarFromOption
calls) so the value is available server-side for code that reads
PUBLIC_CLERK_UI_URL (e.g., build-clerk-hotload-script).
…rop names Update all ClerkProvider usages in integration test templates and playground to use the renamed __internal_clerkJSUrl, __internal_clerkUIUrl, and __internal_clerkJSVersion props. Also deduplicate pnpm-lock.yaml.
Remove @deprecated annotations from internal props and add a jscodeshift codemod to rename clerkJSUrl, clerkJSVersion, clerkUIUrl, clerkUIVersion to their __internal_ prefixed equivalents. Update changesets to reflect full removal rather than deprecation.
Omit __internal_clerkJSUrl, __internal_clerkJSVersion, __internal_clerkUIUrl, and __internal_clerkUIVersion from consumer-facing ClerkProviderProps and framework SDK types. These props are now only accessible via InternalClerkProvider exported from @clerk/react/internal. - Add InternalClerkScriptProps type to @clerk/shared - Narrow ClerkProviderProps in @clerk/react via Omit - Export InternalClerkProvider from @clerk/react/internal with wider type - Switch all framework SDKs to use InternalClerkProvider - Clean up Vue PluginOptions, Astro, and Nuxt types
…n next.js ClerkScripts
Summary
clerkJSUrl,clerkJSVersion,clerkUIUrl, andclerkUIVersionto__internal_clerkJSUrl,__internal_clerkJSVersion,__internal_clerkUIUrl, and__internal_clerkUIVersiononIsomorphicClerkOptionsClerkProviderProps, VuePluginOptions, AstroAstroClerkIntegrationParams) usingOmit<..., keyof InternalClerkScriptProps>— these props no longer appear in autocompleteInternalClerkProviderfrom@clerk/react/internalwith wider type that accepts the internal script props@clerk/nextjs,@clerk/react-router,@clerk/tanstack-react-start,@clerk/expo,@clerk/chrome-extension) to useInternalClerkProvider@clerk/astro,@clerk/nuxt, and@clerk/vuetypes to hide internal props from consumers while preserving internal usage@clerk/upgradefor the prop renameChecklist
pnpm buildpasses (21/21 packages)@clerk/sharedtests pass (976 tests)@clerk/reacttests pass (370 tests)@clerk/nextjstests pass (389 tests)@clerk/react-routertests pass (23 tests)@clerk/astrotests pass (2 tests)@clerk/tanstack-react-starttests pass (16 tests)git diff main --stat)