Skip to content

Conversation

panteliselef
Copy link
Member

@panteliselef panteliselef commented Sep 29, 2025

Description

Internally clerk-js and our hooks already use the payer specific flags (e.g. user.enabled). The react hooks from @clerk/shared never got to used this old properties, thus compatibility with old versions is assured. We should remove this before the Clerk Billing goes to GA, to ensure that we are not making breaking changes later on.

Environment is already considered unstable, thus such a change should be permitted.

Checklist

  • pnpm test runs as expected.
  • pnpm 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:

@panteliselef panteliselef requested review from aeliox and a team September 29, 2025 11:02
@panteliselef panteliselef self-assigned this Sep 29, 2025
Copy link

changeset-bot bot commented Sep 29, 2025

🦋 Changeset detected

Latest commit: 370480a

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

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Minor
@clerk/types Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/shared Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/vue 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

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Sep 29, 2025 11:03am

Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

Removed top-level billing flags (enabled, hasPaidUserPlans, hasPaidOrgPlans) from types, core CommerceSettings, and test fixtures. Updated JSON load/serialize logic accordingly. Added changeset documenting the Billing Beta behavior change and minor bumps for @clerk/clerk-js and @clerk/types.

Changes

Cohort / File(s) Summary
Core resource: CommerceSettings billing shape
packages/clerk-js/src/core/resources/CommerceSettings.ts
Dropped billing.enabled, hasPaidUserPlans, hasPaidOrgPlans; updated defaults, fromJSON, and snapshot serialization to exclude these fields.
Public types: CommerceSettings
packages/types/src/commerceSettings.ts
Removed billing.enabled, billing.has_paid_user_plans, billing.has_paid_org_plans from CommerceSettingsJSON and CommerceSettingsResource interfaces.
Test fixtures and helpers
packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts, packages/clerk-js/src/ui/utils/test/fixtures.ts
Removed initialization and helper mutations for top-level billing flags; retained user/organization nested flags and stripe key.
Changeset metadata
.changeset/seven-trees-double.md
Recorded minor version bumps for @clerk/clerk-js and @clerk/types; documented Billing Beta shift to payer-specific flags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny taps keys with a billing-flag grin,
Hop—pluck three booleans, tidy within.
Payers now speak where globals once stood,
Types trim their whiskers—sleek, understood.
Version bumps bloom; carrots for code—
Thump-thump, the release is ready to go! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title uses the conventional “chore” prefix and correctly scopes the change to clerk-js and types while clearly stating the primary update of dropping top-level billing flags from the environment, which directly reflects the removal of billing boolean fields documented in the changeset. It is concise, uses an imperative verb, and gives any reviewer a clear understanding of the main intent of the PR at a glance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch elef/bill-1290-drop-top-level-billing-enabled-flags-from-clerk-js

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

pkg-pr-new bot commented Sep 29, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6882

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6882

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6882

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6882

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6882

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6882

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6882

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6882

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6882

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6882

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6882

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6882

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6882

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6882

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6882

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6882

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6882

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6882

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6882

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6882

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6882

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6882

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6882

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6882

commit: 370480a

@panteliselef panteliselef merged commit 37028ca into main Sep 29, 2025
48 checks passed
@panteliselef panteliselef deleted the elef/bill-1290-drop-top-level-billing-enabled-flags-from-clerk-js branch September 29, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants