Skip to content

Commit

Permalink
chore(clerk-js): Use a custom build ff name
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Nov 25, 2024
1 parent 1fcf863 commit 90db729
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/clerk-js/src/core/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ export class Clerk implements ClerkInterface {
void this.#captchaHeartbeat.start();
this.#clearClerkQueryParams();
this.#handleImpersonationFab();
if (__DEV__) {
if (__BUILD_FLAG_ACCOUNTLESS_UI__) {
this.#handleAccountlessPrompt();
}
return true;
Expand Down Expand Up @@ -2009,7 +2009,7 @@ export class Clerk implements ClerkInterface {
};

#handleAccountlessPrompt = () => {
if (__DEV__) {
if (__BUILD_FLAG_ACCOUNTLESS_UI__) {
void this.#componentControls?.ensureMounted().then(controls => {
if (this.#options.__internal_claimAccountlessKeysUrl) {
controls.updateProps({
Expand Down
1 change: 1 addition & 0 deletions packages/clerk-js/src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare global {
const __DEV__: boolean;
const __BUILD_FLAG_ACCOUNTLESS_UI__: boolean;
const __PKG_NAME__: string;
const __PKG_VERSION__: string;
const __BUILD_DISABLE_RHC__: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const Components = (props: ComponentsProps) => {
</LazyImpersonationFabProvider>
)}

{__DEV__
{__BUILD_FLAG_ACCOUNTLESS_UI__
? state.options?.__internal_claimAccountlessKeysUrl && (
<LazyImpersonationFabProvider globalAppearance={state.appearance}>
<AccountlessPrompt url={state.options.__internal_claimAccountlessKeysUrl} />
Expand Down
6 changes: 3 additions & 3 deletions packages/clerk-js/src/ui/lazyModules/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const componentImportPaths = {
BlankCaptchaModal: () => import(/* webpackChunkName: "blankcaptcha" */ './../components/BlankCaptchaModal'),
UserVerification: () => import(/* webpackChunkName: "userverification" */ './../components/UserVerification'),
Waitlist: () => import(/* webpackChunkName: "waitlist" */ './../components/Waitlist'),
AccountlessPrompt: __DEV__
AccountlessPrompt: __BUILD_FLAG_ACCOUNTLESS_UI__
? () => import(/* webpackChunkName: "accountlessPrompt" */ './../components/AccountlessPrompt')
: () => null,
} as const;
Expand Down Expand Up @@ -86,8 +86,8 @@ export const BlankCaptchaModal = lazy(() =>
export const ImpersonationFab = lazy(() =>
componentImportPaths.ImpersonationFab().then(module => ({ default: module.ImpersonationFab })),
);
export const AccountlessPrompt = __DEV__
? // @ts-expect-error Types are broken due to __DEV__
export const AccountlessPrompt = __BUILD_FLAG_ACCOUNTLESS_UI__
? // @ts-expect-error Types are broken due to __BUILD_FLAG_ACCOUNTLESS_UI__
lazy(() => componentImportPaths.AccountlessPrompt().then(module => ({ default: module.AccountlessPrompt })))
: () => null;

Expand Down

0 comments on commit 90db729

Please sign in to comment.