-
Notifications
You must be signed in to change notification settings - Fork 431
refactor(shared): rename billing hook and update semantics #7687
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
base: main
Are you sure you want to change the base?
Conversation
Update semantics so calling without 'for' param returns true if either user or organization billing is enabled, rather than defaulting to user.
🦋 Changeset detectedLatest commit: 9d21054 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 GitHub.
|
📝 WalkthroughWalkthroughThe pull request renames the billing hook from 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/shared/src/react/hooks/useStatementQuery.tsx (1)
12-30: Align billing gate with defaultforTypeto avoid incorrect enablement.Line 13 defaults
forTypeto'user', but Line 28 passes rawparamsintouseBillingIsEnabled. With the new hook semantics, omittingformeans “user OR org,” which can enable user-scoped statement queries when only org billing is enabled. This is a functional gating bug.✅ Proposed fix
- const billingEnabled = useBillingIsEnabled(params); + const billingEnabled = useBillingIsEnabled({ ...params, for: forType });
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Summary
useBillingHookEnabledtouseBillingIsEnabledforparam now returnstrueif either user or organization billing is enabled (previously defaulted to user billing only)New API
Test plan
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.