Skip to content

feat(clerk-js): Throw errors for invalid mounts/modal opens in development - #2976

Merged
desiprisg merged 1 commit into
mainfrom
george/sdk-1445-throw-a-clear-error-when-org-components-are-used-but
Mar 20, 2024
Merged

feat(clerk-js): Throw errors for invalid mounts/modal opens in development#2976
desiprisg merged 1 commit into
mainfrom
george/sdk-1445-throw-a-clear-error-when-org-components-are-used-but

Conversation

@desiprisg

@desiprisg desiprisg commented Mar 12, 2024

Copy link
Copy Markdown
Contributor

Description

  • Throw an error instead of console.info in cases where the mounting of a component or opening of a modal is not supposed to happen (in development). Render nothing in production without an error or warning.
  • Cleaned up some cases where we would only return early if in development. That made no sense. We should only show the error in dev and return in either case.
  • Removed the withOrganizationsEnabledGuard HOC as it did not have any effect since the clerk method protections were introduced.

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

changeset-bot Bot commented Mar 12, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 61c4a96

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo 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

Comment thread packages/clerk-js/src/core/clerk.ts Outdated
@desiprisg
desiprisg force-pushed the george/sdk-1445-throw-a-clear-error-when-org-components-are-used-but branch 2 times, most recently from 3bb537a to 5112bde Compare March 13, 2024 10:08

@panteliselef panteliselef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added some suggestions for the code names

Comment thread packages/clerk-js/src/core/clerk.ts Outdated
Comment thread packages/clerk-js/src/core/clerk.ts Outdated
Comment thread packages/clerk-js/src/core/clerk.ts Outdated
@desiprisg
desiprisg force-pushed the george/sdk-1445-throw-a-clear-error-when-org-components-are-used-but branch from 5112bde to f29dd68 Compare March 20, 2024 09:20
@desiprisg
desiprisg enabled auto-merge (squash) March 20, 2024 09:22
@desiprisg
desiprisg force-pushed the george/sdk-1445-throw-a-clear-error-when-org-components-are-used-but branch from f29dd68 to 61c4a96 Compare March 20, 2024 11:40
@desiprisg
desiprisg merged commit ff803ff into main Mar 20, 2024
@desiprisg
desiprisg deleted the george/sdk-1445-throw-a-clear-error-when-org-components-are-used-but branch March 20, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants