Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/free-knives-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Remove Stripe from non-RHC build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Appearance as StripeAppearance, Stripe } from '@stripe/stripe-js';
import { loadStripe } from '@stripe/stripe-js';
import { useEffect, useRef, useState } from 'react';

import { clerkUnsupportedEnvironmentWarning } from '../../../core/errors';
import { useEnvironment, usePaymentSourcesContext } from '../../contexts';
import { descriptors, Flex, localizationKeys, Spinner, useAppearance } from '../../customizables';
import { Alert, Form, FormButtons, FormContainer, withCardStateProvider } from '../../elements';
Expand Down Expand Up @@ -74,12 +75,16 @@ export const AddPaymentSource = (props: AddPaymentSourceProps) => {

useEffect(() => {
if (!stripePromiseRef.current && externalGatewayId && __experimental_commerceSettings.stripePublishableKey) {
stripePromiseRef.current = loadStripe(__experimental_commerceSettings.stripePublishableKey, {
stripeAccount: externalGatewayId,
});
void stripePromiseRef.current.then(stripeInstance => {
setStripe(stripeInstance);
});
if (!__BUILD_DISABLE_RHC__) {
stripePromiseRef.current = loadStripe(__experimental_commerceSettings.stripePublishableKey, {
stripeAccount: externalGatewayId,
});
void stripePromiseRef.current.then(stripeInstance => {
setStripe(stripeInstance);
});
} else {
clerkUnsupportedEnvironmentWarning('Stripe');
}
}
}, [externalGatewayId, __experimental_commerceSettings]);

Expand Down
1 change: 1 addition & 0 deletions scripts/search-for-rhc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ await Promise.allSettled([
asyncSearchRHC('Turnstile', 'cloudflare.com/turnstile/v0/api.js'),
asyncSearchRHC('clerk-js Hotloading', '/npm/@clerk/clerk-js'),
asyncSearchRHC('Google One Tap', 'accounts.google.com/gsi/client'),
asyncSearchRHC('Stripe', 'loadStripe('),
]).then(results => {
const errors = results.filter(result => result.status === 'rejected').map(result => result.reason.message);

Expand Down