Skip to content

Commit f6fb8b5

Browse files
authored
chore(nextjs,clerk-react,clerk-js): Drop the mounted variant of UserVerification (#4266)
1 parent 3a24de7 commit f6fb8b5

9 files changed

Lines changed: 13 additions & 96 deletions

File tree

.changeset/breezy-crabs-crash.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@clerk/clerk-js": minor
3+
"@clerk/nextjs": minor
4+
"@clerk/clerk-react": minor
5+
"@clerk/types": minor
6+
---
7+
8+
Drop the experimental mounted variant of `UserVerification`.
9+
10+
Removes:
11+
- `<__experimental_UserVerification/>`
12+
- `__experimental_mountUserVerification()`
13+
- `__experimental_unmountUserVerification()`

packages/chrome-extension/src/__tests__/__snapshots__/exports.test.ts.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ exports[`public exports should not include a breaking change 1`] = `
2727
"SignedOut",
2828
"UserButton",
2929
"UserProfile",
30-
"__experimental_UserVerification",
3130
"useAuth",
3231
"useClerk",
3332
"useEmailLink",

packages/clerk-js/src/core/clerk.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { logger } from '@clerk/shared/logger';
1818
import { eventPrebuiltComponentMounted, TelemetryCollector } from '@clerk/shared/telemetry';
1919
import type {
2020
__experimental_UserVerificationModalProps,
21-
__experimental_UserVerificationProps,
2221
ActiveSessionResource,
2322
AuthenticateWithCoinbaseWalletParams,
2423
AuthenticateWithGoogleOneTapParams,
@@ -517,38 +516,6 @@ export class Clerk implements ClerkInterface {
517516
);
518517
};
519518

520-
public __experimental_mountUserVerification = (
521-
node: HTMLDivElement,
522-
props?: __experimental_UserVerificationProps,
523-
): void => {
524-
this.assertComponentsReady(this.#componentControls);
525-
if (noUserExists(this)) {
526-
if (this.#instanceType === 'development') {
527-
throw new ClerkRuntimeError(warnings.cannotOpenUserProfile, {
528-
code: 'cannot_render_user_missing',
529-
});
530-
}
531-
return;
532-
}
533-
void this.#componentControls.ensureMounted({ preloadHint: 'UserVerification' }).then(controls =>
534-
controls.mountComponent({
535-
name: 'UserVerification',
536-
appearanceKey: 'userVerification',
537-
node,
538-
props,
539-
}),
540-
);
541-
};
542-
543-
public __experimental_unmountUserVerification = (node: HTMLDivElement): void => {
544-
this.assertComponentsReady(this.#componentControls);
545-
void this.#componentControls.ensureMounted().then(controls =>
546-
controls.unmountComponent({
547-
node,
548-
}),
549-
);
550-
};
551-
552519
public mountSignUp = (node: HTMLDivElement, props?: SignUpProps): void => {
553520
this.assertComponentsReady(this.#componentControls);
554521
void this.#componentControls.ensureMounted({ preloadHint: 'SignUp' }).then(controls =>

packages/nextjs/src/client-boundary/uiComponents.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export {
2626
SignOutButton,
2727
SignUpButton,
2828
UserButton,
29-
__experimental_UserVerification,
3029
GoogleOneTap,
3130
} from '@clerk/clerk-react';
3231

packages/nextjs/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export {
3030
SignUpButton,
3131
UserButton,
3232
UserProfile,
33-
__experimental_UserVerification,
3433
GoogleOneTap,
3534
} from './client-boundary/uiComponents';
3635

packages/react/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export {
33
SignIn,
44
UserProfile,
55
UserButton,
6-
__experimental_UserVerification,
76
OrganizationSwitcher,
87
OrganizationProfile,
98
CreateOrganization,

packages/react/src/components/uiComponents.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { logErrorInDevMode, without } from '@clerk/shared';
22
import { isDeeplyEqual } from '@clerk/shared/react';
33
import type {
4-
__experimental_UserVerificationProps,
54
CreateOrganizationProps,
65
GoogleOneTapProps,
76
OrganizationListProps,
@@ -260,20 +259,6 @@ export const UserButton: UserButtonExportType = Object.assign(_UserButton, {
260259
Link: MenuLink,
261260
});
262261

263-
export const __experimental_UserVerification = withClerk(
264-
({ clerk, ...props }: WithClerkProp<PropsWithChildren<__experimental_UserVerificationProps>>) => {
265-
return (
266-
<Portal
267-
mount={clerk.__experimental_mountUserVerification}
268-
unmount={clerk.__experimental_unmountUserVerification}
269-
updateProps={(clerk as any).__unstable__updateProps}
270-
props={props}
271-
/>
272-
);
273-
},
274-
'__experimental_UserVerification',
275-
);
276-
277262
export function OrganizationProfilePage({ children }: PropsWithChildren<OrganizationProfilePageProps>) {
278263
logErrorInDevMode(organizationProfilePageRenderedError);
279264
return <>{children}</>;

packages/react/src/isomorphicClerk.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ type IsomorphicLoadedClerk = Without<
108108
| 'mountSignUp'
109109
| 'mountSignIn'
110110
| 'mountUserProfile'
111-
| '__experimental_mountUserVerification'
112111
| 'client'
113112
> & {
114113
// TODO: Align return type and parms
@@ -154,7 +153,6 @@ type IsomorphicLoadedClerk = Without<
154153
mountSignUp: (node: HTMLDivElement, props: SignUpProps) => void;
155154
mountSignIn: (node: HTMLDivElement, props: SignInProps) => void;
156155
mountUserProfile: (node: HTMLDivElement, props: UserProfileProps) => void;
157-
__experimental_mountUserVerification: (node: HTMLDivElement, props: __experimental_UserVerificationProps) => void;
158156
client: ClientResource | undefined;
159157
};
160158

@@ -178,7 +176,6 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
178176
private premountCreateOrganizationNodes = new Map<HTMLDivElement, CreateOrganizationProps>();
179177
private premountOrganizationSwitcherNodes = new Map<HTMLDivElement, OrganizationSwitcherProps>();
180178
private premountOrganizationListNodes = new Map<HTMLDivElement, OrganizationListProps>();
181-
private premountUserVerificationNodes = new Map<HTMLDivElement, __experimental_UserVerificationProps>();
182179
private premountMethodCalls = new Map<MethodName<BrowserClerk>, MethodCallback>();
183180
// A separate Map of `addListener` method calls to handle multiple listeners.
184181
private premountAddListenerCalls = new Map<
@@ -541,10 +538,6 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
541538
clerkjs.mountUserProfile(node, props);
542539
});
543540

544-
this.premountUserVerificationNodes.forEach((props: __experimental_UserVerificationProps, node: HTMLDivElement) => {
545-
clerkjs.__experimental_mountUserVerification(node, props);
546-
});
547-
548541
this.premountUserButtonNodes.forEach((props: UserButtonProps, node: HTMLDivElement) => {
549542
clerkjs.mountUserButton(node, props);
550543
});
@@ -768,22 +761,6 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
768761
}
769762
};
770763

771-
__experimental_mountUserVerification = (node: HTMLDivElement, props: __experimental_UserVerificationProps): void => {
772-
if (this.clerkjs && this.#loaded) {
773-
this.clerkjs.__experimental_mountUserVerification(node, props);
774-
} else {
775-
this.premountUserVerificationNodes.set(node, props);
776-
}
777-
};
778-
779-
__experimental_unmountUserVerification = (node: HTMLDivElement): void => {
780-
if (this.clerkjs && this.#loaded) {
781-
this.clerkjs.__experimental_unmountUserVerification(node);
782-
} else {
783-
this.premountUserVerificationNodes.delete(node);
784-
}
785-
};
786-
787764
mountSignUp = (node: HTMLDivElement, props: SignUpProps): void => {
788765
if (this.clerkjs && this.#loaded) {
789766
this.clerkjs.mountSignUp(node, props);

packages/types/src/clerk.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -242,27 +242,6 @@ export interface Clerk {
242242
*/
243243
unmountSignIn: (targetNode: HTMLDivElement) => void;
244244

245-
/**
246-
* Mounts a user reverification flow component at the target element.
247-
*
248-
* @experimantal This API is still under active development and may change at any moment.
249-
* @param targetNode Target node to mount the UserVerification component from.
250-
* @param props user verification configuration parameters.
251-
*/
252-
__experimental_mountUserVerification: (
253-
targetNode: HTMLDivElement,
254-
props?: __experimental_UserVerificationProps,
255-
) => void;
256-
257-
/**
258-
* Unmount a user reverification flow component from the target element.
259-
* If there is no component mounted at the target node, results in a noop.
260-
*
261-
* @experimantal This API is still under active development and may change at any moment.
262-
* @param targetNode Target node to unmount the UserVerification component from.
263-
*/
264-
__experimental_unmountUserVerification: (targetNode: HTMLDivElement) => void;
265-
266245
/**
267246
* Mounts a sign up flow component at the target element.
268247
*

0 commit comments

Comments
 (0)