Skip to content

feat(clerk-js): Add dev mode warning to components (#3511)#3870

Merged
octoper merged 15 commits intomainfrom
george/sdk-1805-update-aio-component-ui-to-be-more-obviously-in-dev-mode
Aug 2, 2024
Merged

feat(clerk-js): Add dev mode warning to components (#3511)#3870
octoper merged 15 commits intomainfrom
george/sdk-1805-update-aio-component-ui-to-be-more-obviously-in-dev-mode

Conversation

@octoper
Copy link
Member

@octoper octoper commented Aug 1, 2024

Description

Adding a development mode warning to our components to avoid going to productions with development keys by accident.

To be able to disable the development mode warning in order to preview how the components will look like in production the appearance.layout.unsafe_disableDevelopmentModeWarnings key has been added.

Example usage:

Globally using the <ClerkProvider />:

<ClerkProvider appearance={{
 layout: {
   unsafe_disableDevelopmentModeWarnings: true,
  }
}}>
...
</ClerkProvider>

On each component:

<UserProfile appearance={{
 layout: {
   unsafe_disableDevelopmentModeWarnings: true,
  }
}} />

Original PR: #3511

Screenshots

CleanShot 2024-07-25 at 15 30 12@2x

CleanShot 2024-07-12 at 03 22 47@2x

CleanShot 2024-07-25 at 15 31 12@2x

CleanShot 2024-07-31 at 13 08 00@2x

CleanShot 2024-07-31 at 13 08 33@2x

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:

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2024

🦋 Changeset detected

Latest commit: 109b698

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

This PR includes changesets to release 18 packages
Name Type
@clerk/clerk-js Minor
@clerk/types Minor
@clerk/astro Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch
@clerk/shared Patch
@clerk/tanstack-start Patch
@clerk/testing Patch
@clerk/themes 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

@octoper
Copy link
Member Author

octoper commented Aug 1, 2024

!preview

@octoper octoper changed the title feat(clerk-js): Add dev mode notice to components feat(clerk-js): Add dev mode notice to components (#3511) Aug 1, 2024
@clerk-cookie
Copy link
Collaborator

clerk-cookie commented Aug 1, 2024

Hey @octoper, your preview is available.

Status Preview Updated (UTC)
🍪 Deployed Visit preview Aug 01, 2024 08:20 PM

this.afterLeaveOrganizationUrl = data.after_leave_organization_url;
this.afterCreateOrganizationUrl = data.after_create_organization_url;
this.googleOneTapClientId = data.google_one_tap_client_id;
this.showDevModeWarning = data.show_devmode_warning;
Copy link
Member

Choose a reason for hiding this comment

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

👍

…pearance.layout.unsafe_disableDevelopmentModeWarnings option
@octoper
Copy link
Member Author

octoper commented Aug 1, 2024

!preview

@octoper octoper changed the title feat(clerk-js): Add dev mode notice to components (#3511) feat(clerk-js): Add dev mode warning to components (#3511) Aug 1, 2024
@octoper octoper requested a review from anagstef August 1, 2024 20:24
@octoper
Copy link
Member Author

octoper commented Aug 2, 2024

!snapshot

@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/astro 1.0.5-snapshot.v741fdbd
@clerk/backend 1.5.0-snapshot.v741fdbd
@clerk/chrome-extension 1.1.8-snapshot.v741fdbd
@clerk/clerk-js 5.11.0-snapshot.v741fdbd
@clerk/elements 0.11.0-snapshot.v741fdbd
@clerk/clerk-expo 2.0.1-snapshot.v741fdbd
@clerk/express 0.0.22-snapshot.v741fdbd
@clerk/fastify 1.0.24-snapshot.v741fdbd
gatsby-plugin-clerk 5.0.0-beta.45
@clerk/localizations 2.5.3-snapshot.v741fdbd
@clerk/nextjs 5.2.9-snapshot.v741fdbd
@clerk/clerk-react 5.3.0-snapshot.v741fdbd
@clerk/remix 4.2.8-snapshot.v741fdbd
@clerk/clerk-sdk-node 5.0.21-snapshot.v741fdbd
@clerk/shared 2.4.2-snapshot.v741fdbd
@clerk/tanstack-start 0.1.12-snapshot.v741fdbd
@clerk/testing 1.2.4-snapshot.v741fdbd
@clerk/themes 2.1.15-snapshot.v741fdbd
@clerk/types 4.10.0-snapshot.v741fdbd

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

npm i @clerk/astro@1.0.5-snapshot.v741fdbd --save-exact

@clerk/backend

npm i @clerk/backend@1.5.0-snapshot.v741fdbd --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.1.8-snapshot.v741fdbd --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.11.0-snapshot.v741fdbd --save-exact

@clerk/elements

npm i @clerk/elements@0.11.0-snapshot.v741fdbd --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.0.1-snapshot.v741fdbd --save-exact

@clerk/express

npm i @clerk/express@0.0.22-snapshot.v741fdbd --save-exact

@clerk/fastify

npm i @clerk/fastify@1.0.24-snapshot.v741fdbd --save-exact

gatsby-plugin-clerk

npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact

@clerk/localizations

npm i @clerk/localizations@2.5.3-snapshot.v741fdbd --save-exact

@clerk/nextjs

npm i @clerk/nextjs@5.2.9-snapshot.v741fdbd --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.3.0-snapshot.v741fdbd --save-exact

@clerk/remix

npm i @clerk/remix@4.2.8-snapshot.v741fdbd --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.21-snapshot.v741fdbd --save-exact

@clerk/shared

npm i @clerk/shared@2.4.2-snapshot.v741fdbd --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.1.12-snapshot.v741fdbd --save-exact

@clerk/testing

npm i @clerk/testing@1.2.4-snapshot.v741fdbd --save-exact

@clerk/themes

npm i @clerk/themes@2.1.15-snapshot.v741fdbd --save-exact

@clerk/types

npm i @clerk/types@4.10.0-snapshot.v741fdbd --save-exact

@octoper octoper marked this pull request as ready for review August 2, 2024 12:56
@octoper octoper requested a review from alexcarpenter August 2, 2024 12:57
@octoper octoper requested review from brkalow and panteliselef August 2, 2024 12:57
@octoper octoper merged commit 568186c into main Aug 2, 2024
@octoper octoper deleted the george/sdk-1805-update-aio-component-ui-to-be-more-obviously-in-dev-mode branch August 2, 2024 15:07
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.

6 participants