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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clerk-js): Show custom pages errors when sdks are in dev mode #2802

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

panteliselef
Copy link
Member

@panteliselef panteliselef commented Feb 15, 2024

Description

Details

All of our SDKs consume the production version of clerk-js, with this change we acquire more information about the environment each sdk runs on.

For this case we want to log warning or errors that we wouldn't want to log if the app was used in it's final production version.

Video example

Screen.Recording.2024-02-15.at.3.17.10.PM.mov

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 馃悰 Bug fix
  • 馃専 New feature
  • 馃敤 Breaking change
  • 馃摉 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Feb 15, 2024

馃 Changeset detected

Latest commit: 2d5436c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
gatsby-plugin-clerk Minor
@clerk/clerk-js Minor
@clerk/clerk-sdk-node Minor
@clerk/fastify Minor
@clerk/nextjs Minor
@clerk/clerk-react Minor
@clerk/types Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/remix Patch
@clerk/backend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@panteliselef
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @panteliselef - the snapshot version command generated the following package versions:

Package Version
@clerk/backend 1.0.1-snapshot.v33c285b
@clerk/chrome-extension 1.0.1-snapshot.v33c285b
@clerk/clerk-js 5.0.1-snapshot.v33c285b
@clerk/clerk-expo 1.0.1-snapshot.v33c285b
@clerk/fastify 1.0.1-snapshot.v33c285b
gatsby-plugin-clerk 5.0.1-snapshot.v33c285b
@clerk/localizations 2.0.1-snapshot.v33c285b
@clerk/nextjs 5.0.1-snapshot.v33c285b
@clerk/clerk-react 5.0.1-snapshot.v33c285b
@clerk/remix 4.0.1-snapshot.v33c285b
@clerk/clerk-sdk-node 5.0.1-snapshot.v33c285b
@clerk/shared 2.0.1-snapshot.v33c285b
@clerk/themes 2.0.1-snapshot.v33c285b
@clerk/types 4.0.1-snapshot.v33c285b

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/backend

npm i @clerk/backend@1.0.1-snapshot.v33c285b --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.0.1-snapshot.v33c285b --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.0.1-snapshot.v33c285b --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@1.0.1-snapshot.v33c285b --save-exact

@clerk/fastify

npm i @clerk/fastify@1.0.1-snapshot.v33c285b --save-exact

gatsby-plugin-clerk

npm i gatsby-plugin-clerk@5.0.1-snapshot.v33c285b --save-exact

@clerk/localizations

npm i @clerk/localizations@2.0.1-snapshot.v33c285b --save-exact

@clerk/nextjs

npm i @clerk/nextjs@5.0.1-snapshot.v33c285b --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.0.1-snapshot.v33c285b --save-exact

@clerk/remix

npm i @clerk/remix@4.0.1-snapshot.v33c285b --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.1-snapshot.v33c285b --save-exact

@clerk/shared

npm i @clerk/shared@2.0.1-snapshot.v33c285b --save-exact

@clerk/themes

npm i @clerk/themes@2.0.1-snapshot.v33c285b --save-exact

@clerk/types

npm i @clerk/types@4.0.1-snapshot.v33c285b --save-exact

@panteliselef panteliselef self-assigned this Feb 15, 2024
@panteliselef panteliselef changed the title fix(clerk-js): Show custom pages errors when sdks are in dev mode @panteliselef fix(clerk-js): Show custom pages errors when sdks are in dev mode Feb 15, 2024
@@ -123,6 +123,7 @@ export function getResponseClerkState(requestState: RequestState, context: AppLo
__clerkJSVersion: getEnvVariable('CLERK_JS_VERSION', context),
__telemetryDisabled: isTruthy(getEnvVariable('CLERK_TELEMETRY_DISABLED', context)),
__telemetryDebug: isTruthy(getEnvVariable('CLERK_TELEMETRY_DEBUG', context)),
__environment: getEnvVariable('NODE_ENV', context) || getEnvVariable('ENVIRONMENT', context),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Remix we should recommend users to add the ENVIRONMENT env var in their configs.

@panteliselef panteliselef marked this pull request as ready for review February 15, 2024 13:30
Copy link
Member

@anagstef anagstef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挴 This is awesome! 馃殌

@clerk-cookie clerk-cookie removed the remix label Mar 1, 2024
There is no default way to grab the env in remix, so we are skipping it for now.
@panteliselef panteliselef added this pull request to the merge queue Mar 1, 2024
Merged via the queue into main with commit 18c0d01 Mar 1, 2024
8 checks passed
@panteliselef panteliselef deleted the elef/SDK-885 branch March 1, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants