chore(clerk-js,ui): Make OAuthConsent component public#8381
chore(clerk-js,ui): Make OAuthConsent component public#8381wobsoriano merged 19 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: fe96c4a 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 |
- Rename __internal_OAuthConsentProps to OAuthConsentProps in @clerk/shared - Rename __internal_mountOAuthConsent / __internal_unmountOAuthConsent to mountOAuthConsent / unmountOAuthConsent on the Clerk interface and clerk-js - Add OAuthConsent and useOAuthConsent to the public exports of @clerk/react, @clerk/nextjs, @clerk/vue, @clerk/nuxt, and @clerk/astro - Add @deprecated JSDoc to the existing /internal re-exports in @clerk/react and @clerk/nextjs pointing consumers to the public paths - Update @clerk/ui type references to the renamed public types
b7eb222 to
2c33684
Compare
694e79b to
39afe25
Compare
|
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:
📝 WalkthroughWalkthroughAdds a new OAuthConsent UI component and useOAuthConsent hook as public APIs across multiple SDKs (Astro, React, Next.js, Nuxt, Vue, React Router, TanStack React Start). Introduces framework-specific wrapper components, updates export barrels and re-exports, expands InternalUIComponentId/type unions to include 'oauth-consent', and promotes internal mount/unmount methods to public mountOAuthConsent/unmountOAuthConsent while retaining deprecated internal wrappers. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@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: |
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/clerk-js/src/core/clerk.ts (1)
1352-1392:⚠️ Potential issue | 🟠 MajorAdd explicit return type annotations for the new OAuthConsent public API methods.
Lines 1352, 1376, 1383, and 1390 define public methods without explicit return types. Public APIs in this repository must include explicit return type annotations (
: voidin this case).Suggested fix
- public mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps) => { + public mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps): void => { @@ - public unmountOAuthConsent = (node: HTMLDivElement) => { + public unmountOAuthConsent = (node: HTMLDivElement): void => { @@ - public __internal_mountOAuthConsent = (node: HTMLDivElement, props?: __internal_OAuthConsentProps) => { + public __internal_mountOAuthConsent = ( + node: HTMLDivElement, + props?: __internal_OAuthConsentProps, + ): void => { @@ - public __internal_unmountOAuthConsent = (node: HTMLDivElement) => { + public __internal_unmountOAuthConsent = (node: HTMLDivElement): void => {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/clerk-js/src/core/clerk.ts` around lines 1352 - 1392, The four public methods mountOAuthConsent, unmountOAuthConsent, __internal_mountOAuthConsent, and __internal_unmountOAuthConsent lack explicit return type annotations; update their function signatures to include an explicit ": void" return type (e.g., change "public mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps)" to "public mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps): void"), and do the same for unmountOAuthConsent, __internal_mountOAuthConsent, and __internal_unmountOAuthConsent so the public API has explicit void return types.
🤖 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/clerk-js/src/core/clerk.ts`:
- Around line 1352-1392: The four public methods mountOAuthConsent,
unmountOAuthConsent, __internal_mountOAuthConsent, and
__internal_unmountOAuthConsent lack explicit return type annotations; update
their function signatures to include an explicit ": void" return type (e.g.,
change "public mountOAuthConsent = (node: HTMLDivElement, props?:
OAuthConsentProps)" to "public mountOAuthConsent = (node: HTMLDivElement,
props?: OAuthConsentProps): void"), and do the same for unmountOAuthConsent,
__internal_mountOAuthConsent, and __internal_unmountOAuthConsent so the public
API has explicit void return types.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 7fec644c-ae08-448a-a0e5-df62849dd863
📒 Files selected for processing (6)
packages/astro/src/astro-components/interactive/OAuthConsent.astropackages/astro/src/internal/mount-clerk-astro-js-components.tspackages/astro/src/react/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/shared/src/types/clerk.tspackages/vue/src/components/ui-components/OAuthConsent.vue
✅ Files skipped from review due to trivial changes (2)
- packages/astro/src/astro-components/interactive/OAuthConsent.astro
- packages/vue/src/components/ui-components/OAuthConsent.vue
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/astro/src/internal/mount-clerk-astro-js-components.ts
- packages/astro/src/react/uiComponents.tsx
- packages/shared/src/types/clerk.ts
There was a problem hiding this comment.
maybe it's safe just to remove this /internal export that was added just for OAuthConsent. Never used in any of our repos
There was a problem hiding this comment.
| :mount="clerk?.__internal_mountOAuthConsent" | ||
| :unmount="clerk?.__internal_unmountOAuthConsent" |
There was a problem hiding this comment.
Any of these new components should likely be using the mountOAuthConsent or unmountOAuthConsent vs deprecated __internal methods right?
Description
This PR makes
OAuthConsentpublicly available across SDKs and keeps the legacy__internal_*OAuthConsentruntime methods in place for compatibility.Older published SDKs still call:
clerk.__internal_mountOAuthConsentclerk.__internal_unmountOAuthConsentWhen
clerk-jsis loaded from the CDN, users can end up with:clerk-jsruntime assetsIf we remove the legacy runtime methods now, those mixed-version deployments break at runtime with
... is not a function.To avoid that, this PR:
mountOAuthConsent/unmountOAuthConsentas the canonical API__internal_mountOAuthConsent/__internal_unmountOAuthConsentas deprecated aliasesFollow-up plan
mountOAuthConsent/unmountOAuthConsent__internal_*OAuthConsentcan be removed in a later major once we intentionally drop compatibility with older published wrappersChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change