From 59c90409a753bfa0cde9bfcf1242147217378d26 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 2 Jul 2025 18:47:47 -0700 Subject: [PATCH 01/13] fix(clerk-js,types,localizations): Adjust invalid plan change alert wording --- .changeset/orange-doors-notice.md | 5 +++++ packages/clerk-js/src/ui/components/Checkout/parts.tsx | 6 +++++- packages/localizations/src/en-US.ts | 1 + packages/types/src/localization.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/orange-doors-notice.md diff --git a/.changeset/orange-doors-notice.md b/.changeset/orange-doors-notice.md new file mode 100644 index 00000000000..42e9c352702 --- /dev/null +++ b/.changeset/orange-doors-notice.md @@ -0,0 +1,5 @@ +--- +'@clerk/localizations': patch +'@clerk/clerk-js': patch +'@clerk/types': patch +--- diff --git a/packages/clerk-js/src/ui/components/Checkout/parts.tsx b/packages/clerk-js/src/ui/components/Checkout/parts.tsx index 235200f0469..bc5935d1e82 100644 --- a/packages/clerk-js/src/ui/components/Checkout/parts.tsx +++ b/packages/clerk-js/src/ui/components/Checkout/parts.tsx @@ -82,7 +82,11 @@ export const InvalidPlanScreen = () => { diff --git a/packages/localizations/src/en-US.ts b/packages/localizations/src/en-US.ts index 9e04afbb058..ff04326a1d9 100644 --- a/packages/localizations/src/en-US.ts +++ b/packages/localizations/src/en-US.ts @@ -67,6 +67,7 @@ export const enUS: LocalizationResource = { cancelSubscriptionTitle: 'Cancel {{plan}} Subscription?', cannotSubscribeMonthly: 'You cannot subscribe to this plan by paying monthly. To subscribe to this plan, you need to choose to pay annually.', + cannotSubscribeMonthlyNoAnnual: 'You cannot subscribe to this plan with an existing annual subscription.', checkout: { description__paymentSuccessful: 'Your payment was successful.', description__subscriptionSuccessful: 'Your new subscription is all set.', diff --git a/packages/types/src/localization.ts b/packages/types/src/localization.ts index 16a1002f4b6..887afe4cf2d 100644 --- a/packages/types/src/localization.ts +++ b/packages/types/src/localization.ts @@ -199,6 +199,7 @@ export type __internal_LocalizationResource = { monthly: LocalizationValue; annually: LocalizationValue; cannotSubscribeMonthly: LocalizationValue; + cannotSubscribeMonthlyNoAnnual: LocalizationValue; pricingTable: { billingCycle: LocalizationValue; included: LocalizationValue; From c402d8f6f8a1968dce14f455f426b4eca1f12cf9 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Thu, 3 Jul 2025 15:22:03 -0700 Subject: [PATCH 02/13] update wording --- packages/localizations/src/en-US.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/localizations/src/en-US.ts b/packages/localizations/src/en-US.ts index ff04326a1d9..752bf352783 100644 --- a/packages/localizations/src/en-US.ts +++ b/packages/localizations/src/en-US.ts @@ -67,7 +67,8 @@ export const enUS: LocalizationResource = { cancelSubscriptionTitle: 'Cancel {{plan}} Subscription?', cannotSubscribeMonthly: 'You cannot subscribe to this plan by paying monthly. To subscribe to this plan, you need to choose to pay annually.', - cannotSubscribeMonthlyNoAnnual: 'You cannot subscribe to this plan with an existing annual subscription.', + cannotSubscribeMonthlyNoAnnual: + "You cannot subscribe to this plan. Your existing annual subscription is more expensive than this plan's monthly amount.", checkout: { description__paymentSuccessful: 'Your payment was successful.', description__subscriptionSuccessful: 'Your new subscription is all set.', From 0f9e0520a14b8eedeb4eb066a538d6ff6fcdc900 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Tue, 8 Jul 2025 10:51:35 -0700 Subject: [PATCH 03/13] use new isRecoverable flag --- packages/clerk-js/src/ui/components/Checkout/parts.tsx | 4 ++-- packages/localizations/src/en-US.ts | 4 ++-- packages/types/src/api.ts | 1 + packages/types/src/json.ts | 1 + packages/types/src/localization.ts | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/clerk-js/src/ui/components/Checkout/parts.tsx b/packages/clerk-js/src/ui/components/Checkout/parts.tsx index bc5935d1e82..5fdab47afe0 100644 --- a/packages/clerk-js/src/ui/components/Checkout/parts.tsx +++ b/packages/clerk-js/src/ui/components/Checkout/parts.tsx @@ -83,9 +83,9 @@ export const InvalidPlanScreen = () => { variant='info' colorScheme='info' title={ - planFromError.annual_monthly_amount_formatted !== '0' + planFromError.is_recoverable ? localizationKeys('commerce.cannotSubscribeMonthly') - : localizationKeys('commerce.cannotSubscribeMonthlyNoAnnual') + : localizationKeys('commerce.cannotSubscribeUnrecoverable') } /> diff --git a/packages/localizations/src/en-US.ts b/packages/localizations/src/en-US.ts index 752bf352783..1a750b90d80 100644 --- a/packages/localizations/src/en-US.ts +++ b/packages/localizations/src/en-US.ts @@ -67,8 +67,8 @@ export const enUS: LocalizationResource = { cancelSubscriptionTitle: 'Cancel {{plan}} Subscription?', cannotSubscribeMonthly: 'You cannot subscribe to this plan by paying monthly. To subscribe to this plan, you need to choose to pay annually.', - cannotSubscribeMonthlyNoAnnual: - "You cannot subscribe to this plan. Your existing annual subscription is more expensive than this plan's monthly amount.", + cannotSubscribeUnrecoverable: + 'You cannot subscribe to this plan. Your existing subscription is more expensive than this plan.', checkout: { description__paymentSuccessful: 'Your payment was successful.', description__subscriptionSuccessful: 'Your new subscription is all set.', diff --git a/packages/types/src/api.ts b/packages/types/src/api.ts index 80a96be7a51..4e8eb4a3c62 100644 --- a/packages/types/src/api.ts +++ b/packages/types/src/api.ts @@ -35,6 +35,7 @@ export interface ClerkAPIError { currency_symbol: string; id: string; name: string; + is_recoverable: boolean; }; }; } diff --git a/packages/types/src/json.ts b/packages/types/src/json.ts index 89917b5d2a9..c2b49151f53 100644 --- a/packages/types/src/json.ts +++ b/packages/types/src/json.ts @@ -357,6 +357,7 @@ export interface ClerkAPIErrorJSON { currency_symbol: string; id: string; name: string; + is_recoverable: boolean; }; }; } diff --git a/packages/types/src/localization.ts b/packages/types/src/localization.ts index 887afe4cf2d..eb304778f06 100644 --- a/packages/types/src/localization.ts +++ b/packages/types/src/localization.ts @@ -199,7 +199,7 @@ export type __internal_LocalizationResource = { monthly: LocalizationValue; annually: LocalizationValue; cannotSubscribeMonthly: LocalizationValue; - cannotSubscribeMonthlyNoAnnual: LocalizationValue; + cannotSubscribeUnrecoverable: LocalizationValue; pricingTable: { billingCycle: LocalizationValue; included: LocalizationValue; From 520ea029bf8855112032d9999479c379910928c2 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 9 Jul 2025 08:39:50 -0700 Subject: [PATCH 04/13] update name to `IsPlanUpgradePossible` --- packages/clerk-js/bundlewatch.config.json | 2 +- .../src/ui/components/Checkout/parts.tsx | 7 ++- packages/shared/src/error.ts | 57 ++++++++++++++++++- packages/types/src/api.ts | 2 +- packages/types/src/json.ts | 2 +- 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/packages/clerk-js/bundlewatch.config.json b/packages/clerk-js/bundlewatch.config.json index 3edd92caf01..20de3425174 100644 --- a/packages/clerk-js/bundlewatch.config.json +++ b/packages/clerk-js/bundlewatch.config.json @@ -23,7 +23,7 @@ { "path": "./dist/waitlist*.js", "maxSize": "1.5KB" }, { "path": "./dist/keylessPrompt*.js", "maxSize": "6.5KB" }, { "path": "./dist/pricingTable*.js", "maxSize": "4.02KB" }, - { "path": "./dist/checkout*.js", "maxSize": "8.4KB" }, + { "path": "./dist/checkout*.js", "maxSize": "8.45KB" }, { "path": "./dist/up-billing-page*.js", "maxSize": "3.0KB" }, { "path": "./dist/op-billing-page*.js", "maxSize": "3.0KB" }, { "path": "./dist/up-plans-page*.js", "maxSize": "1.0KB" }, diff --git a/packages/clerk-js/src/ui/components/Checkout/parts.tsx b/packages/clerk-js/src/ui/components/Checkout/parts.tsx index 5fdab47afe0..816ee36a1de 100644 --- a/packages/clerk-js/src/ui/components/Checkout/parts.tsx +++ b/packages/clerk-js/src/ui/components/Checkout/parts.tsx @@ -43,6 +43,11 @@ export const InvalidPlanScreen = () => { return error?.meta?.plan; }, [errors]); + const isPlanUpgradePossible = useMemo(() => { + const error = errors?.find(e => e.code === 'invalid_plan_change'); + return error?.meta?.isPlanUpgradePossible || false; + }, [errors]); + const { planPeriod } = useCheckoutContext(); if (!planFromError) { @@ -83,7 +88,7 @@ export const InvalidPlanScreen = () => { variant='info' colorScheme='info' title={ - planFromError.is_recoverable + isPlanUpgradePossible ? localizationKeys('commerce.cannotSubscribeMonthly') : localizationKeys('commerce.cannotSubscribeUnrecoverable') } diff --git a/packages/shared/src/error.ts b/packages/shared/src/error.ts index 77f2479e516..4198acbe26d 100644 --- a/packages/shared/src/error.ts +++ b/packages/shared/src/error.ts @@ -1,20 +1,32 @@ import type { ClerkAPIError, ClerkAPIErrorJSON } from '@clerk/types'; +/** + * + */ export function isUnauthorizedError(e: any): boolean { const status = e?.status; const code = e?.errors?.[0]?.code; return code === 'authentication_invalid' && status === 401; } +/** + * + */ export function isCaptchaError(e: ClerkAPIResponseError): boolean { return ['captcha_invalid', 'captcha_not_enabled', 'captcha_missing_token'].includes(e.errors[0].code); } +/** + * + */ export function is4xxError(e: any): boolean { const status = e?.status; return !!status && status >= 400 && status < 500; } +/** + * + */ export function isNetworkError(e: any): boolean { // TODO: revise during error handling epic const message = (`${e.message}${e.name}` || '').toLowerCase().replace(/\s+/g, ''); @@ -36,10 +48,16 @@ export interface MetamaskError extends Error { data?: unknown; } +/** + * + */ export function isKnownError(error: any): error is ClerkAPIResponseError | ClerkRuntimeError | MetamaskError { return isClerkAPIResponseError(error) || isMetamaskError(error) || isClerkRuntimeError(error); } +/** + * + */ export function isClerkAPIResponseError(err: any): err is ClerkAPIResponseError { return 'clerkError' in err; } @@ -47,8 +65,8 @@ export function isClerkAPIResponseError(err: any): err is ClerkAPIResponseError /** * Checks if the provided error object is an instance of ClerkRuntimeError. * - * @param {any} err - The error object to check. - * @returns {boolean} True if the error is a ClerkRuntimeError, false otherwise. + * @param err - The error object to check. + * @returns True if the error is a ClerkRuntimeError, false otherwise. * * @example * const error = new ClerkRuntimeError('An error occurred'); @@ -64,26 +82,44 @@ export function isClerkRuntimeError(err: any): err is ClerkRuntimeError { return 'clerkRuntimeError' in err; } +/** + * + */ export function isReverificationCancelledError(err: any) { return isClerkRuntimeError(err) && err.code === 'reverification_cancelled'; } +/** + * + */ export function isMetamaskError(err: any): err is MetamaskError { return 'code' in err && [4001, 32602, 32603].includes(err.code) && 'message' in err; } +/** + * + */ export function isUserLockedError(err: any) { return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'user_locked'; } +/** + * + */ export function isPasswordPwnedError(err: any) { return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'form_password_pwned'; } +/** + * + */ export function parseErrors(data: ClerkAPIErrorJSON[] = []): ClerkAPIError[] { return data.length > 0 ? data.map(parseError) : []; } +/** + * + */ export function parseError(error: ClerkAPIErrorJSON): ClerkAPIError { return { code: error.code, @@ -96,10 +132,14 @@ export function parseError(error: ClerkAPIErrorJSON): ClerkAPIError { identifiers: error?.meta?.identifiers, zxcvbn: error?.meta?.zxcvbn, plan: error?.meta?.plan, + isPlanUpgradePossible: error?.meta?.is_plan_upgrade_possible, }, }; } +/** + * + */ export function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON { return { code: error?.code || '', @@ -112,6 +152,7 @@ export function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON { identifiers: error?.meta?.identifiers, zxcvbn: error?.meta?.zxcvbn, plan: error?.meta?.plan, + is_plan_upgrade_possible: error?.meta?.isPlanUpgradePossible, }, }; } @@ -156,6 +197,7 @@ export class ClerkAPIResponseError extends Error { * Custom error class for representing Clerk runtime errors. * * @class ClerkRuntimeError + * * @example * throw new ClerkRuntimeError('An error occurred', { code: 'password_invalid' }); */ @@ -194,7 +236,7 @@ export class ClerkRuntimeError extends Error { /** * Returns a string representation of the error. * - * @returns {string} A formatted string with the error name and message. + * @returns A formatted string with the error name and message. */ public toString = () => { return `[${this.name}]\nMessage:${this.message}`; @@ -212,6 +254,9 @@ export class EmailLinkError extends Error { } } +/** + * + */ export function isEmailLinkError(err: Error): err is EmailLinkError { return err.name === 'EmailLinkError'; } @@ -270,6 +315,9 @@ export interface ErrorThrower { throw(message: string): never; } +/** + * + */ export function buildErrorThrower({ packageName, customMessages }: ErrorThrowerOptions): ErrorThrower { let pkg = packageName; @@ -278,6 +326,9 @@ export function buildErrorThrower({ packageName, customMessages }: ErrorThrowerO ...customMessages, }; + /** + * + */ function buildMessage(rawMessage: string, replacements?: Record) { if (!replacements) { return `${pkg}: ${rawMessage}`; diff --git a/packages/types/src/api.ts b/packages/types/src/api.ts index 4e8eb4a3c62..b3234c65642 100644 --- a/packages/types/src/api.ts +++ b/packages/types/src/api.ts @@ -35,8 +35,8 @@ export interface ClerkAPIError { currency_symbol: string; id: string; name: string; - is_recoverable: boolean; }; + isPlanUpgradePossible?: boolean; }; } diff --git a/packages/types/src/json.ts b/packages/types/src/json.ts index c2b49151f53..428df82c372 100644 --- a/packages/types/src/json.ts +++ b/packages/types/src/json.ts @@ -357,8 +357,8 @@ export interface ClerkAPIErrorJSON { currency_symbol: string; id: string; name: string; - is_recoverable: boolean; }; + is_plan_upgrade_possible?: boolean; }; } From f2af923d8dabd46c4f7dafe6cd7d3760fea47413 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 9 Jul 2025 09:41:05 -0700 Subject: [PATCH 05/13] update test --- integration/tests/pricing-table.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/integration/tests/pricing-table.test.ts b/integration/tests/pricing-table.test.ts index e204957339b..0045bfef8ec 100644 --- a/integration/tests/pricing-table.test.ts +++ b/integration/tests/pricing-table.test.ts @@ -344,9 +344,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('pricing tabl await expect( page .locator('.cl-checkout-root') - .getByText( - 'You cannot subscribe to this plan by paying monthly. To subscribe to this plan, you need to choose to pay annually', - ), + .getByText('You cannot subscribe to this plan. Your existing subscription is more expensive than this plan.'), ).toBeVisible(); await fakeUser.deleteIfExists(); From 598017fe0b950929ae7b32ce3bc18e1414ef4f4c Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 9 Jul 2025 10:50:53 -0700 Subject: [PATCH 06/13] update typedoc snapshot --- .../__snapshots__/file-structure.test.ts.snap | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap b/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap index f683de4a0d3..9242c9e366a 100644 --- a/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap +++ b/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap @@ -76,6 +76,7 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = ` "types/without.mdx", "shared/api-url-from-publishable-key.mdx", "shared/build-clerk-js-script-attributes.mdx", + "shared/build-error-thrower.mdx", "shared/build-publishable-key.mdx", "shared/camel-to-snake.mdx", "shared/clerk-js-script-url.mdx", @@ -86,6 +87,7 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = ` "shared/deep-snake-to-camel.mdx", "shared/deprecated-object-property.mdx", "shared/derive-state.mdx", + "shared/error-to-json.mdx", "shared/extract-dev-browser-jwt-from-url.mdx", "shared/fast-deep-merge-and-replace.mdx", "shared/get-clerk-js-major-version-or-tag.mdx", @@ -97,22 +99,35 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = ` "shared/icon-image-url.mdx", "shared/in-browser.mdx", "shared/is-browser-online.mdx", + "shared/is-captcha-error.mdx", + "shared/is-clerk-api-response-error.mdx", "shared/is-clerk-runtime-error.mdx", "shared/is-development-from-publishable-key.mdx", "shared/is-development-from-secret-key.mdx", + "shared/is-email-link-error.mdx", "shared/is-ipv4-address.mdx", + "shared/is-known-error.mdx", + "shared/is-metamask-error.mdx", + "shared/is-network-error.mdx", + "shared/is-password-pwned-error.mdx", "shared/is-production-from-publishable-key.mdx", "shared/is-production-from-secret-key.mdx", "shared/is-publishable-key.mdx", + "shared/is-reverification-cancelled-error.mdx", "shared/is-staging.mdx", "shared/is-truthy.mdx", + "shared/is-unauthorized-error.mdx", + "shared/is-user-locked-error.mdx", "shared/is-valid-browser-online.mdx", "shared/is-valid-browser.mdx", + "shared/is4xx-error.mdx", "shared/isomorphic-atob.mdx", "shared/load-clerk-js-script.mdx", "shared/pages-or-infinite-options.mdx", "shared/paginated-hook-config.mdx", "shared/paginated-resources.mdx", + "shared/parse-error.mdx", + "shared/parse-errors.mdx", "shared/parse-publishable-key.mdx", "shared/read-json-file.mdx", "shared/set-clerk-js-loading-error-package-name.mdx", From 08a64a630a97d5d432ffeab814bcf14443b59d40 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Mon, 14 Jul 2025 10:43:51 -0700 Subject: [PATCH 07/13] fix --- .changeset/orange-doors-notice.md | 3 --- .../clerk-js/src/ui/components/Checkout/parts.tsx | 12 ++++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.changeset/orange-doors-notice.md b/.changeset/orange-doors-notice.md index 42e9c352702..a845151cc84 100644 --- a/.changeset/orange-doors-notice.md +++ b/.changeset/orange-doors-notice.md @@ -1,5 +1,2 @@ --- -'@clerk/localizations': patch -'@clerk/clerk-js': patch -'@clerk/types': patch --- diff --git a/packages/clerk-js/src/ui/components/Checkout/parts.tsx b/packages/clerk-js/src/ui/components/Checkout/parts.tsx index 8a0bcee42a1..13684d84804 100644 --- a/packages/clerk-js/src/ui/components/Checkout/parts.tsx +++ b/packages/clerk-js/src/ui/components/Checkout/parts.tsx @@ -44,14 +44,14 @@ export const InvalidPlanScreen = () => { const error = checkout.error; const planFromError = useMemo(() => { - const error = errors?.find(e => e.code === 'invalid_plan_change'); - return error?.meta?.plan; - }, [errors]); + const _error = error?.errors.find(e => e.code === 'invalid_plan_change'); + return _error?.meta?.plan; + }, [error]); const isPlanUpgradePossible = useMemo(() => { - const error = errors?.find(e => e.code === 'invalid_plan_change'); - return error?.meta?.isPlanUpgradePossible || false; - }, [errors]); + const _error = error?.errors.find(e => e.code === 'invalid_plan_change'); + return _error?.meta?.isPlanUpgradePossible || false; + }, [error]); if (!planFromError) { return null; From cea4603d77a6de8c42193c984437f7d05b9a2cc3 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Mon, 14 Jul 2025 10:59:50 -0700 Subject: [PATCH 08/13] update test --- integration/tests/pricing-table.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/integration/tests/pricing-table.test.ts b/integration/tests/pricing-table.test.ts index 0045bfef8ec..1cb6cf01f33 100644 --- a/integration/tests/pricing-table.test.ts +++ b/integration/tests/pricing-table.test.ts @@ -341,11 +341,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('pricing tabl await u.po.checkout.confirmAndContinue(); await u.po.pricingTable.startCheckout({ planSlug: 'pro', shouldSwitch: true, period: 'monthly' }); await u.po.checkout.waitForMounted(); - await expect( - page - .locator('.cl-checkout-root') - .getByText('You cannot subscribe to this plan. Your existing subscription is more expensive than this plan.'), - ).toBeVisible(); + await expect(page.locator('.cl-checkout-root').getByText('You cannot subscribe to this plan.')).toBeVisible(); await fakeUser.deleteIfExists(); }); From 6502520f4add96c2528e07cc97ed70156f05867d Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Mon, 14 Jul 2025 14:10:08 -0700 Subject: [PATCH 09/13] reset test --- integration/tests/pricing-table.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integration/tests/pricing-table.test.ts b/integration/tests/pricing-table.test.ts index 1cb6cf01f33..5d739030a22 100644 --- a/integration/tests/pricing-table.test.ts +++ b/integration/tests/pricing-table.test.ts @@ -341,7 +341,13 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('pricing tabl await u.po.checkout.confirmAndContinue(); await u.po.pricingTable.startCheckout({ planSlug: 'pro', shouldSwitch: true, period: 'monthly' }); await u.po.checkout.waitForMounted(); - await expect(page.locator('.cl-checkout-root').getByText('You cannot subscribe to this plan.')).toBeVisible(); + await expect( + page + .locator('.cl-checkout-root') + .getByText( + 'You cannot subscribe to this plan by paying monthly. To subscribe to this plan, you need to choose to pay annually.', + ), + ).toBeVisible(); await fakeUser.deleteIfExists(); }); From 00e44e3220b19b2d2d4a2de72188292dff3f9041 Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Tue, 15 Jul 2025 08:56:34 -0700 Subject: [PATCH 10/13] Update .changeset/orange-doors-notice.md Co-authored-by: panteliselef --- .changeset/orange-doors-notice.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.changeset/orange-doors-notice.md b/.changeset/orange-doors-notice.md index a845151cc84..729f4fc37a6 100644 --- a/.changeset/orange-doors-notice.md +++ b/.changeset/orange-doors-notice.md @@ -1,2 +1,7 @@ --- +'@clerk/localizations': minor +'@clerk/clerk-js': patch +'@clerk/types': minor --- + +Improve invalid plan change callout for monthly-only plans From ecc054912d5e1edc3a835588c8a4c67555ea359b Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 16 Jul 2025 09:42:15 -0700 Subject: [PATCH 11/13] bundle --- packages/clerk-js/bundlewatch.config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/clerk-js/bundlewatch.config.json b/packages/clerk-js/bundlewatch.config.json index 9a7c5fafaef..ed74dc0b797 100644 --- a/packages/clerk-js/bundlewatch.config.json +++ b/packages/clerk-js/bundlewatch.config.json @@ -1,11 +1,11 @@ { "files": [ - { "path": "./dist/clerk.js", "maxSize": "616.27KB" }, + { "path": "./dist/clerk.js", "maxSize": "616.35KB" }, { "path": "./dist/clerk.browser.js", "maxSize": "72.2KB" }, { "path": "./dist/clerk.legacy.browser.js", "maxSize": "115.08KB" }, { "path": "./dist/clerk.headless*.js", "maxSize": "55KB" }, - { "path": "./dist/ui-common*.js", "maxSize": "111.52KB" }, - { "path": "./dist/ui-common*.legacy.*.js", "maxSize": "115.33KB" }, + { "path": "./dist/ui-common*.js", "maxSize": "111.55KB" }, + { "path": "./dist/ui-common*.legacy.*.js", "maxSize": "115.37KB" }, { "path": "./dist/vendors*.js", "maxSize": "40.2KB" }, { "path": "./dist/coinbase*.js", "maxSize": "38KB" }, { "path": "./dist/stripe-vendors*.js", "maxSize": "1KB" }, From b62dd3b26543b34565053a934a3ebac41b6cd6ce Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 16 Jul 2025 09:42:52 -0700 Subject: [PATCH 12/13] revert snapshot --- .../__snapshots__/file-structure.test.ts.snap | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap b/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap index 013325a40d6..f4f73cf811c 100644 --- a/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap +++ b/.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap @@ -127,7 +127,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = ` "types/without.mdx", "shared/api-url-from-publishable-key.mdx", "shared/build-clerk-js-script-attributes.mdx", - "shared/build-error-thrower.mdx", "shared/build-publishable-key.mdx", "shared/camel-to-snake.mdx", "shared/clerk-js-script-url.mdx", @@ -138,7 +137,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = ` "shared/deep-snake-to-camel.mdx", "shared/deprecated-object-property.mdx", "shared/derive-state.mdx", - "shared/error-to-json.mdx", "shared/extract-dev-browser-jwt-from-url.mdx", "shared/fast-deep-merge-and-replace.mdx", "shared/get-clerk-js-major-version-or-tag.mdx", @@ -150,35 +148,22 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = ` "shared/icon-image-url.mdx", "shared/in-browser.mdx", "shared/is-browser-online.mdx", - "shared/is-captcha-error.mdx", - "shared/is-clerk-api-response-error.mdx", "shared/is-clerk-runtime-error.mdx", "shared/is-development-from-publishable-key.mdx", "shared/is-development-from-secret-key.mdx", - "shared/is-email-link-error.mdx", "shared/is-ipv4-address.mdx", - "shared/is-known-error.mdx", - "shared/is-metamask-error.mdx", - "shared/is-network-error.mdx", - "shared/is-password-pwned-error.mdx", "shared/is-production-from-publishable-key.mdx", "shared/is-production-from-secret-key.mdx", "shared/is-publishable-key.mdx", - "shared/is-reverification-cancelled-error.mdx", "shared/is-staging.mdx", "shared/is-truthy.mdx", - "shared/is-unauthorized-error.mdx", - "shared/is-user-locked-error.mdx", "shared/is-valid-browser-online.mdx", "shared/is-valid-browser.mdx", - "shared/is4xx-error.mdx", "shared/isomorphic-atob.mdx", "shared/load-clerk-js-script.mdx", "shared/pages-or-infinite-options.mdx", "shared/paginated-hook-config.mdx", "shared/paginated-resources.mdx", - "shared/parse-error.mdx", - "shared/parse-errors.mdx", "shared/parse-publishable-key.mdx", "shared/read-json-file.mdx", "shared/set-clerk-js-loading-error-package-name.mdx", From 1bc646e0e24e8622f49de3df215d5527d2be531f Mon Sep 17 00:00:00 2001 From: Keiran Flanigan Date: Wed, 16 Jul 2025 14:56:39 -0700 Subject: [PATCH 13/13] bundle bump --- packages/clerk-js/bundlewatch.config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/clerk-js/bundlewatch.config.json b/packages/clerk-js/bundlewatch.config.json index c560bf97a08..2596f22db33 100644 --- a/packages/clerk-js/bundlewatch.config.json +++ b/packages/clerk-js/bundlewatch.config.json @@ -1,11 +1,11 @@ { "files": [ - { "path": "./dist/clerk.js", "maxSize": "616.35KB" }, + { "path": "./dist/clerk.js", "maxSize": "616.4KB" }, { "path": "./dist/clerk.browser.js", "maxSize": "72.2KB" }, { "path": "./dist/clerk.legacy.browser.js", "maxSize": "115.08KB" }, { "path": "./dist/clerk.headless*.js", "maxSize": "55KB" }, - { "path": "./dist/ui-common*.js", "maxSize": "111.57KB" }, - { "path": "./dist/ui-common*.legacy.*.js", "maxSize": "115.38KB" }, + { "path": "./dist/ui-common*.js", "maxSize": "111.62KB" }, + { "path": "./dist/ui-common*.legacy.*.js", "maxSize": "115.45KB" }, { "path": "./dist/vendors*.js", "maxSize": "40.2KB" }, { "path": "./dist/coinbase*.js", "maxSize": "38KB" }, { "path": "./dist/stripe-vendors*.js", "maxSize": "1KB" },