Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(remix): Avoid always showing frontendApi deprecation #2086

Merged
merged 1 commit into from
Nov 8, 2023
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/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
Loading