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

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

Conversation

desiprisg
Copy link
Member

@desiprisg desiprisg commented Mar 12, 2024

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:

Copy link

changeset-bot bot commented Mar 12, 2024

🦋 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

packages/clerk-js/src/core/clerk.ts Outdated Show resolved Hide resolved
@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
Copy link
Member

@panteliselef panteliselef left a comment

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

packages/clerk-js/src/core/clerk.ts Outdated Show resolved Hide resolved
packages/clerk-js/src/core/clerk.ts Outdated Show resolved Hide resolved
packages/clerk-js/src/core/clerk.ts Outdated Show resolved Hide resolved
@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
9 checks passed
@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.

None yet

3 participants