-
Notifications
You must be signed in to change notification settings - Fork 449
chore(clerk-js,ui): Make OAuthConsent component public #8381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
69dac72
2c33684
c7c79fa
39afe25
5adabce
0f340a8
b660e28
3b8d7bf
24a419f
bf70ca2
7dd33d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| "@clerk/nuxt": minor | ||
| "@clerk/vue": minor | ||
| --- | ||
|
|
||
| Expose `OAuthConsent` as a public component export for Vue and Nuxt. | ||
|
|
||
| Example: | ||
|
|
||
| ```vue | ||
| <script setup lang="ts"> | ||
| import { OAuthConsent } from '@clerk/vue'; | ||
| </script> | ||
| <template> | ||
| <OAuthConsent /> | ||
| </template> | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| "@clerk/astro": minor | ||
| --- | ||
|
|
||
| Expose `OAuthConsent` as a public component export for Astro. | ||
|
|
||
| Example: | ||
|
|
||
| ```astro | ||
| --- | ||
| import { OAuthConsent } from '@clerk/astro/components'; | ||
| --- | ||
| <OAuthConsent /> | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| "@clerk/clerk-js": minor | ||
| "@clerk/nextjs": minor | ||
| "@clerk/react": minor | ||
| "@clerk/react-router": minor | ||
| "@clerk/shared": minor | ||
| "@clerk/tanstack-react-start": minor | ||
| "@clerk/ui": minor | ||
| --- | ||
|
|
||
| Expose `OAuthConsent` as a public component export across React-based SDKs. | ||
|
|
||
| Also expose `useOAuthConsent()` as a public hook where supported. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| import type { OAuthConsentProps } from '@clerk/shared/types'; | ||
| type Props = OAuthConsentProps; | ||
| import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro'; | ||
| --- | ||
|
|
||
| <InternalUIComponentRenderer | ||
| {...Astro.props} | ||
| component='oauth-consent' | ||
| /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,13 @@ | ||
| export { useOAuthConsent, OAuthConsent } from '@clerk/react/internal'; | ||
| import { OAuthConsent as OAuthConsentOriginal, useOAuthConsent as useOAuthConsentOriginal } from '@clerk/react'; | ||
|
|
||
| /** | ||
| * @deprecated Import `OAuthConsent` from `@clerk/react-router` instead. | ||
| */ | ||
| const OAuthConsent = OAuthConsentOriginal; | ||
| export { OAuthConsent }; | ||
|
|
||
| /** | ||
| * @deprecated Import `useOAuthConsent` from `@clerk/react-router` instead. | ||
| */ | ||
| const useOAuthConsent = useOAuthConsentOriginal; | ||
| export { useOAuthConsent }; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,7 @@ import type { | |||||||||||||||||||||||||||||
| __internal_CheckoutProps, | ||||||||||||||||||||||||||||||
| __internal_EnableOrganizationsPromptProps, | ||||||||||||||||||||||||||||||
| __internal_OAuthConsentProps, | ||||||||||||||||||||||||||||||
| OAuthConsentProps, | ||||||||||||||||||||||||||||||
| __internal_PlanDetailsProps, | ||||||||||||||||||||||||||||||
| __internal_SubscriptionDetailsProps, | ||||||||||||||||||||||||||||||
| __internal_UserVerificationModalProps, | ||||||||||||||||||||||||||||||
|
|
@@ -1298,6 +1299,14 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk { | |||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps) => { | ||||||||||||||||||||||||||||||
| this.__internal_mountOAuthConsent(node, props); | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| unmountOAuthConsent = (node: HTMLDivElement) => { | ||||||||||||||||||||||||||||||
| this.__internal_unmountOAuthConsent(node); | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
Comment on lines
+1302
to
+1308
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="packages/react/src/isomorphicClerk.ts"
# Verify newly added methods currently omit explicit return types
rg -n "mountOAuthConsent\\s*=\\s*\\(node: HTMLDivElement, props\\?: OAuthConsentProps\\)\\s*=>" "$FILE"
rg -n "unmountOAuthConsent\\s*=\\s*\\(node: HTMLDivElement\\)\\s*=>" "$FILE"
# Compare with existing explicit-void public mount/unmount methods in same file
rg -n "mountAPIKeys\\s*=\\s*\\(node: HTMLDivElement, props\\?: APIKeysProps\\): void" "$FILE"
rg -n "unmountAPIKeys\\s*=\\s*\\(node: HTMLDivElement\\): void" "$FILE"Repository: clerk/javascript Length of output: 403 Add explicit return type annotations to the new public OAuth consent methods. Lines 1302 and 1306 introduce public API methods without explicit return type annotations. Declare Proposed fix- mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps) => {
+ mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps): void => {
this.__internal_mountOAuthConsent(node, props);
};
- unmountOAuthConsent = (node: HTMLDivElement) => {
+ unmountOAuthConsent = (node: HTMLDivElement): void => {
this.__internal_unmountOAuthConsent(node);
};📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| mountTaskChooseOrganization = (node: HTMLDivElement, props?: TaskChooseOrganizationProps): void => { | ||||||||||||||||||||||||||||||
| if (this.clerkjs && this.loaded) { | ||||||||||||||||||||||||||||||
| this.clerkjs.mountTaskChooseOrganization(node, props); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto https://github.com/clerk/javascript/pull/8381/changes#r3164755377