Skip to content

Commit 00148b8

Browse files
authored
chore(clerk-js): Remove new UI renderer (#4950)
1 parent c4cad79 commit 00148b8

File tree

10 files changed

+23
-272
lines changed

10 files changed

+23
-272
lines changed

.changeset/little-rivers-push.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Remove unused, experimental code for a new UI component rendering path.

packages/clerk-js/jest.setup.ts

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ if (typeof window !== 'undefined') {
3535

3636
global.__PKG_NAME__ = '';
3737
global.__PKG_VERSION__ = '';
38-
global.BUILD_ENABLE_NEW_COMPONENTS = '';
3938

4039
//@ts-expect-error
4140
global.IntersectionObserver = class IntersectionObserver {

packages/clerk-js/rspack.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const common = ({ mode, disableRHC = false }) => {
5050
*/
5151
__BUILD_FLAG_KEYLESS_UI__: isDevelopment(mode),
5252
__BUILD_DISABLE_RHC__: JSON.stringify(disableRHC),
53-
BUILD_ENABLE_NEW_COMPONENTS: JSON.stringify(process.env.BUILD_ENABLE_NEW_COMPONENTS),
5453
}),
5554
new rspack.EnvironmentPlugin({
5655
CLERK_ENV: mode,

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

+18-43
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import type {
3434
InstanceType,
3535
JoinWaitlistParams,
3636
ListenerCallback,
37-
LoadedClerk,
3837
NavigateOptions,
3938
OrganizationListProps,
4039
OrganizationProfileProps,
@@ -68,7 +67,6 @@ import type {
6867
} from '@clerk/types';
6968

7069
import type { MountComponentRenderer } from '../ui/Components';
71-
import { UI } from '../ui/new';
7270
import {
7371
ALLOWED_PROTOCOLS,
7472
buildURL,
@@ -155,12 +153,7 @@ const defaultOptions: ClerkOptions = {
155153
signUpForceRedirectUrl: undefined,
156154
};
157155

158-
function clerkIsLoaded(clerk: ClerkInterface): clerk is LoadedClerk {
159-
return !!clerk.client;
160-
}
161-
162156
export class Clerk implements ClerkInterface {
163-
public __experimental_ui?: UI;
164157
public static mountComponentRenderer?: MountComponentRenderer;
165158

166159
public static version: string = __PKG_VERSION__;
@@ -353,16 +346,6 @@ export class Clerk implements ClerkInterface {
353346
} else {
354347
this.#loaded = await this.#loadInNonStandardBrowser();
355348
}
356-
357-
if (BUILD_ENABLE_NEW_COMPONENTS) {
358-
if (clerkIsLoaded(this)) {
359-
this.__experimental_ui = new UI({
360-
router: this.#options.__experimental_router,
361-
clerk: this,
362-
options: this.#options,
363-
});
364-
}
365-
}
366349
};
367350

368351
#isCombinedSignInOrUpFlow(): boolean {
@@ -578,19 +561,15 @@ export class Clerk implements ClerkInterface {
578561
};
579562

580563
public mountSignIn = (node: HTMLDivElement, props?: SignInProps): void => {
581-
if (props?.__experimental?.newComponents && this.__experimental_ui) {
582-
this.__experimental_ui.mount('SignIn', node, props);
583-
} else {
584-
this.assertComponentsReady(this.#componentControls);
585-
void this.#componentControls.ensureMounted({ preloadHint: 'SignIn' }).then(controls =>
586-
controls.mountComponent({
587-
name: 'SignIn',
588-
appearanceKey: 'signIn',
589-
node,
590-
props,
591-
}),
592-
);
593-
}
564+
this.assertComponentsReady(this.#componentControls);
565+
void this.#componentControls.ensureMounted({ preloadHint: 'SignIn' }).then(controls =>
566+
controls.mountComponent({
567+
name: 'SignIn',
568+
appearanceKey: 'signIn',
569+
node,
570+
props,
571+
}),
572+
);
594573
this.telemetry?.record(
595574
eventPrebuiltComponentMounted('SignIn', {
596575
...props,
@@ -609,19 +588,15 @@ export class Clerk implements ClerkInterface {
609588
};
610589

611590
public mountSignUp = (node: HTMLDivElement, props?: SignUpProps): void => {
612-
if (props?.__experimental?.newComponents && this.__experimental_ui) {
613-
this.__experimental_ui.mount('SignUp', node, props);
614-
} else {
615-
this.assertComponentsReady(this.#componentControls);
616-
void this.#componentControls.ensureMounted({ preloadHint: 'SignUp' }).then(controls =>
617-
controls.mountComponent({
618-
name: 'SignUp',
619-
appearanceKey: 'signUp',
620-
node,
621-
props,
622-
}),
623-
);
624-
}
591+
this.assertComponentsReady(this.#componentControls);
592+
void this.#componentControls.ensureMounted({ preloadHint: 'SignUp' }).then(controls =>
593+
controls.mountComponent({
594+
name: 'SignUp',
595+
appearanceKey: 'signUp',
596+
node,
597+
props,
598+
}),
599+
);
625600
this.telemetry?.record(eventPrebuiltComponentMounted('SignUp', props));
626601
};
627602

packages/clerk-js/src/global.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ declare module '*.svg' {
88
export default value;
99
}
1010

11-
declare const BUILD_ENABLE_NEW_COMPONENTS: string;
1211
declare const __PKG_NAME__: string;
1312
declare const __PKG_VERSION__: string;
1413
declare const __DEV__: boolean;

packages/clerk-js/src/ui/new/index.tsx

-100
This file was deleted.

packages/clerk-js/src/ui/new/renderer.tsx

-107
This file was deleted.

packages/clerk-js/src/ui/new/types.ts

-12
This file was deleted.

packages/clerk-js/turbo.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": ["//"],
33
"tasks": {
44
"build": {
5-
"env": ["BUILD_ENABLE_NEW_COMPONENTS"],
65
"inputs": [
76
"*.d.ts",
87
"headless/**",

packages/types/src/clerk.ts

-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import type {
3131
SignUpFallbackRedirectUrl,
3232
SignUpForceRedirectUrl,
3333
} from './redirects';
34-
import type { ClerkHostRouter } from './router';
3534
import type { ActiveSessionResource } from './session';
3635
import type { SessionVerificationLevel } from './sessionVerification';
3736
import type { SignInResource } from './signIn';
@@ -776,11 +775,6 @@ export type ClerkOptions = ClerkOptionsNavigation &
776775
* After a developer has claimed their instance created by Keyless mode, they can use this URL to find their instance's keys
777776
*/
778777
__internal_copyInstanceKeysUrl?: string;
779-
780-
/**
781-
* [EXPERIMENTAL] Provide the underlying host router, required for the new experimental UI components.
782-
*/
783-
__experimental_router?: ClerkHostRouter;
784778
};
785779

786780
export interface NavigateOptions {

0 commit comments

Comments
 (0)