From 9676e4113b6c91f39759f308519d46b3037f7b5c Mon Sep 17 00:00:00 2001 From: Bryce Kalow Date: Thu, 19 Oct 2023 21:50:26 -0500 Subject: [PATCH] fix(clerk-react): Use specific clerk/shared entries --- packages/react/src/contexts/ClerkProvider.tsx | 2 +- packages/react/src/isomorphicClerk.ts | 4 +++- packages/react/src/utils/isDevOrStageUrl.tsx | 2 +- packages/react/src/utils/loadClerkJsScript.ts | 7 +++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/react/src/contexts/ClerkProvider.tsx b/packages/react/src/contexts/ClerkProvider.tsx index d8f2a4bcebd..8495ed4c774 100644 --- a/packages/react/src/contexts/ClerkProvider.tsx +++ b/packages/react/src/contexts/ClerkProvider.tsx @@ -1,4 +1,4 @@ -import { isLegacyFrontendApiKey, isPublishableKey } from '@clerk/shared'; +import { isLegacyFrontendApiKey, isPublishableKey } from '@clerk/shared/keys'; import type { InitialState } from '@clerk/types'; import React from 'react'; diff --git a/packages/react/src/isomorphicClerk.ts b/packages/react/src/isomorphicClerk.ts index 6e157a937f9..9a30c028fe3 100644 --- a/packages/react/src/isomorphicClerk.ts +++ b/packages/react/src/isomorphicClerk.ts @@ -1,4 +1,6 @@ -import { deprecated, handleValueOrFn, inBrowser } from '@clerk/shared'; +import { inBrowser } from '@clerk/shared/browser'; +import { deprecated } from '@clerk/shared/deprecated'; +import { handleValueOrFn } from '@clerk/shared/handleValueOrFn'; import type { ActiveSessionResource, AuthenticateWithMetamaskParams, diff --git a/packages/react/src/utils/isDevOrStageUrl.tsx b/packages/react/src/utils/isDevOrStageUrl.tsx index d30d9d52669..835eceeb711 100644 --- a/packages/react/src/utils/isDevOrStageUrl.tsx +++ b/packages/react/src/utils/isDevOrStageUrl.tsx @@ -1,3 +1,3 @@ -import { createDevOrStagingUrlCache } from '@clerk/shared'; +import { createDevOrStagingUrlCache } from '@clerk/shared/keys'; const { isDevOrStagingUrl } = createDevOrStagingUrlCache(); export { isDevOrStagingUrl }; diff --git a/packages/react/src/utils/loadClerkJsScript.ts b/packages/react/src/utils/loadClerkJsScript.ts index 1ce63f52eb4..ff75bd09d80 100644 --- a/packages/react/src/utils/loadClerkJsScript.ts +++ b/packages/react/src/utils/loadClerkJsScript.ts @@ -1,4 +1,7 @@ -import { addClerkPrefix, isValidProxyUrl, loadScript, parsePublishableKey, proxyUrlToAbsoluteURL } from '@clerk/shared'; +import { parsePublishableKey } from '@clerk/shared/keys'; +import { loadScript } from '@clerk/shared/loadScript'; +import { isValidProxyUrl, proxyUrlToAbsoluteURL } from '@clerk/shared/proxy'; +import { addClerkPrefix } from '@clerk/shared/url'; import type { IsomorphicClerkOptions } from '../types'; import { errorThrower } from './errorThrower'; @@ -12,7 +15,7 @@ type LoadClerkJsScriptOptions = Omit { +export const loadClerkJsScript = (opts: LoadClerkJsScriptOptions) => { const { frontendApi, publishableKey } = opts; if (!publishableKey && !frontendApi) {