-
Notifications
You must be signed in to change notification settings - Fork 353
chore(clerk-js): Remove Clerk.commerce #5846
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
Conversation
🦋 Changeset detectedLatest commit: 05afd9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should also update https://github.com/clerk/javascript/blob/main/.changeset/witty-doors-hear.md because otherwise the changelog is quite confusing. Then the new changeset you can keep minimal as the old one will show the correct one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left some comments about invariant
@@ -29,9 +35,22 @@ export const useCheckoutContext = () => { | |||
|
|||
const { componentName, ...ctx } = context; | |||
|
|||
const subscriber = () => { | |||
if (ctx.subscriberType === 'org' && clerk.organization) { | |||
invariant(clerk.organization, 'Clerk: subscriberType is "org" but no active organization was found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we handle this inside the mount/open singleton methods instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly to make types happy without casting, agreed it shouldn't really be necessary in practice
return clerk.organization; | ||
} | ||
|
||
invariant(clerk.user, 'Clerk: no active user found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this ? openCheckout
will not mount any component if user is signed out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be necessary I agree, it's mostly done to satisfy types in this usage.
Description
Removes the
Clerk.commerce
namespace in favor of justClerk.billing
. The payment source methods that lived underClerk.commerce
have been moved toClerk.user
andClerk.organization
.Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change