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

[SDK-805] Use the errorThrower shared util when throwing errors #1999

Conversation

anagstef
Copy link
Member

@anagstef anagstef commented Nov 1, 2023

Description

This PR includes the following:

  • Adds a new function to the shared errorThrower utility with the simple name throw that accepts a string with the message to be thrown.
  • Fix the React package name passed to the errorThrower.
  • Use the errorThrower to throw all errors in the @clerk/clerk-react package.

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:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

Copy link

changeset-bot bot commented Nov 1, 2023

🦋 Changeset detected

Latest commit: a493ffc

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

This PR includes changesets to release 11 packages
Name Type
@clerk/shared Patch
@clerk/clerk-react Patch
@clerk/backend Patch
@clerk/clerk-js Patch
@clerk/clerk-expo Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch
@clerk/chrome-extension Patch
gatsby-plugin-clerk 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

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.

🧹🧹

packages/react/src/utils/errorThrower.ts Show resolved Hide resolved
packages/react/src/utils/useMaxAllowedInstancesGuard.tsx Outdated Show resolved Hide resolved
Copy link
Member

@dimkl dimkl left a comment

Choose a reason for hiding this comment

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

🚀

@anagstef anagstef requested a review from a team as a code owner November 6, 2023 15:12
@nikosdouvlis
Copy link
Member

!snapshot

5 similar comments
@nikosdouvlis
Copy link
Member

!snapshot

@nikosdouvlis
Copy link
Member

!snapshot

@nikosdouvlis
Copy link
Member

!snapshot

@nikosdouvlis
Copy link
Member

!snapshot

@nikosdouvlis
Copy link
Member

!snapshot

@clerk-cookie
Copy link
Collaborator

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

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

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

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/clerk-expo

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

@clerk/fastify

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

gatsby-plugin-clerk

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

@clerk/localizations

npm i @clerk/localizations@1.26.9-snapshot.v11d57a5 --save-exact

@clerk/nextjs

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

@clerk/clerk-react

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

@clerk/remix

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

@clerk/clerk-sdk-node

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

@clerk/shared

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

@clerk/themes

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

@clerk/types

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

@nikosdouvlis
Copy link
Member

!snapshot

@clerk-cookie
Copy link
Collaborator

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

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

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

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/clerk-expo

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

@clerk/fastify

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

gatsby-plugin-clerk

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

@clerk/localizations

npm i @clerk/localizations@1.26.9-snapshot.v11d57a5 --save-exact

@clerk/nextjs

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

@clerk/clerk-react

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

@clerk/remix

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

@clerk/clerk-sdk-node

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

@clerk/shared

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

@clerk/themes

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

@clerk/types

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

@anagstef anagstef force-pushed the stefanos/sdk-805-refactor-the-react-errors-to-use-the-shared-errorthrower branch from d923448 to a493ffc Compare November 9, 2023 09:55
@anagstef anagstef added this pull request to the merge queue Nov 9, 2023
Merged via the queue into main with commit e0e79b4 Nov 9, 2023
6 checks passed
@anagstef anagstef deleted the stefanos/sdk-805-refactor-the-react-errors-to-use-the-shared-errorthrower branch November 9, 2023 10:08
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

5 participants