Skip to content

feat(clerk-js,localizations,shared,ui): Annual-only plans#8012

Merged
dstaley merged 7 commits into
mainfrom
ds.feat/annual-only
Mar 10, 2026
Merged

feat(clerk-js,localizations,shared,ui): Annual-only plans#8012
dstaley merged 7 commits into
mainfrom
ds.feat/annual-only

Conversation

@dstaley

@dstaley dstaley commented Mar 9, 2026

Copy link
Copy Markdown
Member

Description

This PR adds support for annual-only billing plans. An annual-only billing plan is a plan where the fee is null. This is a new concept, so the UI needed to be updated to remove all assumptions of fee being always available. This is mostly small logic changes, but the most significant change is in the PricingTable and PlanDetails components where we now render Only billed monthly when a plan only supports being billed annually.

Testing Instructions

  • Checkout locally, run pnpm i && turbo build, then pnpm dev:sandbox to start the sandbox and go to it at http://localhost:4000
  • Open the development tools console
  • run scenario.setScenario(AVAILABLE_SCENARIOS.AnnualOnlyPlans)
  • after refresh run components.pricingTable.setProps({ for: 'user' })
  • navigate to the pricing table page
  • confirm that three plans are rendered: one monthly-only, one that supports monthly and annual, and one annual only
  • confirm changing the toggle on the middle plan does not impact rendering on the first or third plans

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:

Summary by CodeRabbit

  • New Features

    • Support for annual-only billing plans and plans that can omit a base monthly fee
    • Period toggle to switch monthly/annual where applicable
    • Checkout automatically selects an appropriate billing period
  • UI

    • Updated plan details and pricing table to use consolidated fee formatting and unified period handling
  • Localization

    • Added label: "Only billed annually"
  • Sandbox

    • New annual-only plans scenario and updated demo billing flags

@vercel

vercel Bot commented Mar 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Mar 9, 2026 8:53pm

Request Review

@changeset-bot

changeset-bot Bot commented Mar 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1968bf5

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

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

@dstaley dstaley changed the title Ds.feat/annual only feat(clerk-js,localizations,shared,ui): Annual-only plans Mar 9, 2026
@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 41d6eb84-c8e6-45e6-91bb-d9950b8e8628

📥 Commits

Reviewing files that changed from the base of the PR and between 7648ea3 and 1968bf5.

📒 Files selected for processing (1)
  • packages/ui/src/components/PricingTable/PricingTableDefault.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui/src/components/PricingTable/PricingTableDefault.tsx

📝 Walkthrough

Walkthrough

Introduces a changeset and makes BillingPlan.fee nullable across backend, shared types, clerk-js resources, and JSON shapes. Adds a sandbox scenario AnnualOnlyPlans and a localization key billing.billedAnnuallyOnly. UI components (Plans/PlanDetails, PricingTable) were refactored to handle nullable fees and to use a new PeriodToggle component. Adds determinePlanPeriod helper used in the checkout flow. Updates MSW single-session environment to enable billing flags.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding support for annual-only billing plans across multiple packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@pkg-pr-new

pkg-pr-new Bot commented Mar 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8012

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8012

@clerk/upgrade

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

@clerk/vue

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

commit: 1968bf5

@dstaley dstaley requested a review from a team March 9, 2026 22:12
Comment on lines -35 to +41
enabled: false,
has_paid_plans: false,
enabled: true,
has_paid_plans: true,
},
stripe_publishable_key: '',
user: {
enabled: false,
has_paid_plans: false,
enabled: true,
has_paid_plans: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(not blocking just curious) what is this change for?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is for the mock scenario system. this sets all mock scenarios to default to having billing enabled.

@dstaley dstaley merged commit 3e63793 into main Mar 10, 2026
68 of 70 checks passed
@dstaley dstaley deleted the ds.feat/annual-only branch March 10, 2026 00:33
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.

3 participants