Skip to content

Commit

Permalink
fix(remix): Avoid always showing frontendApi deprecation (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl authored Nov 8, 2023
1 parent 906da4f commit 4473db8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-bottles-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/remix': patch
---

Avoid always showing deprecation warnings for `frontendApi` in `@clerk/remix`
8 changes: 6 additions & 2 deletions packages/remix/src/ssr/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export const interstitialJsonResponse = (
__loader: opts.loader,
__clerk_ssr_interstitial_html: loadInterstitialFromLocal({
debugData: debugRequestState(requestState),
frontendApi: requestState.frontendApi,
// Use frontendApi only when legacy frontendApi is used to avoid showing deprecation warning
// since the requestState always contains the frontendApi constructed by publishableKey.
frontendApi: requestState.publishableKey ? '' : requestState.frontendApi,
publishableKey: requestState.publishableKey,
// TODO: This needs to be the version of clerk/remix not clerk/react
// pkgVersion: LIB_VERSION,
Expand Down Expand Up @@ -155,7 +157,9 @@ export function getResponseClerkState(requestState: RequestState, context: AppLo
const { reason, message, isSignedIn, isInterstitial, ...rest } = requestState;
const clerkState = wrapWithClerkState({
__clerk_ssr_state: rest.toAuth(),
__frontendApi: requestState.frontendApi,
// Use frontendApi only when legacy frontendApi is used to avoid showing deprecation warning
// since the requestState always contains the frontendApi constructed by publishableKey.
__frontendApi: requestState.publishableKey ? '' : requestState.frontendApi,
__publishableKey: requestState.publishableKey,
__proxyUrl: requestState.proxyUrl,
__domain: requestState.domain,
Expand Down

0 comments on commit 4473db8

Please sign in to comment.