refactor(shared): rename billing hook and update semantics#7687
refactor(shared): rename billing hook and update semantics#7687jacekradko merged 7 commits intomainfrom
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: bc50c7c The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 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.
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: |
|
!allow-major |
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.