Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Dec 5, 2025

Description

Renaming the Protect component to Show. Also adjusting how props are passed to it, with a singular when prop that accepts a variety of conditions.

Removed SignedIn and SignedOut components and replaced them with usages of <Show when="signed-in"> etc.

Added codemods for these changes

Fixes: USER-3389

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

    • Introduces a unified Show component with a flexible when prop plus ClerkLoaded and ClerkLoading utilities for safer loading/hydration.
  • Breaking Changes

    • Removes Protect, SignedIn, and SignedOut from public exports; adds ShowProps and ShowWhenCondition (ProtectProps aliased for compatibility).
  • Migration Tools

    • Adds a codemod and changeset to automate migrating Protect/SignedIn/SignedOut → Show.
  • Docs & Tests

    • Updated examples, templates, docs, error messages, and tests to reference and validate Show.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

🦋 Changeset detected

Latest commit: 4c4f7bd

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

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

@vercel
Copy link

vercel bot commented Dec 5, 2025

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

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 5, 2026 8:39pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

📝 Walkthrough

Walkthrough

Replaces the Protect, SignedIn, and SignedOut control components with a unified Show component across packages (react, nextjs, astro, vue, expo, chrome-extension, nuxt, etc.). Introduces Show-related types (ShowProps, ShowWhenCondition, ShowProtectParams, ProtectParams) in shared types, adds ClerkLoaded and ClerkLoading utilities and hydration-safe loading hooks, implements server/CSR/SSR Astro Show components, updates exports and imports, adds unit tests, and provides a codemod (transform-protect-to-show) plus documentation and changesets for migration.

Pre-merge checks

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Changes include some test infrastructure removals (V4 clerk presets, outdated test files) and new template additions (next-app-router-quickstart-v6) that extend beyond the core Protect→Show migration scope. Isolate test infrastructure changes and new template additions into separate PRs to keep the migration focused on component API changes and codemod tooling.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(repo): Migrate Protect to Show' accurately summarizes the main change: renaming the Protect component to Show and updating related components and their usages.
Linked Issues check ✅ Passed The PR fully addresses USER-3389 by renaming Protect to Show, removing SignedIn/SignedOut, and updating all related implementations and documentation to reflect the breaking change.

📜 Recent review details

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

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 56bae99 and 4c4f7bd.

📒 Files selected for processing (1)
  • packages/react/src/components/SubscriptionDetailsButton.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/components/SubscriptionDetailsButton.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (27)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 8, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 4c4f7bd

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
integration/templates/react-vite/src/App.tsx (1)

14-14: Critical: Fix React Router Link prop (already flagged in previous review).

Line 14 uses href on a React Router Link, which is incorrect. React Router's Link component uses the to prop, not href. This is a TypeScript error that will break navigation.

🔎 Proposed fix
-      <Link href='/protected'>Protected</Link>
+      <Link to='/protected'>Protected</Link>
packages/astro/src/astro-components/control/ShowCSR.astro (1)

89-89: Guard customElements.define to prevent runtime crashes.

Calling customElements.define('clerk-show', ClerkShow) without checking if the element is already registered will throw a DOMException if the Show component is used on multiple pages or during HMR in development.

🔎 Proposed fix
-  customElements.define('clerk-show', ClerkShow);
+  if (!customElements.get('clerk-show')) {
+    customElements.define('clerk-show', ClerkShow);
+  }
📜 Review details

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

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f519941 and 6c63d2b.

⛔ Files ignored due to path filters (6)
  • integration/templates/next-app-router-quickstart-v6/public/next.svg is excluded by !**/*.svg
  • integration/templates/next-app-router-quickstart-v6/public/vercel.svg is excluded by !**/*.svg
  • integration/templates/next-app-router-quickstart-v6/src/app/favicon.ico is excluded by !**/*.ico
  • packages/chrome-extension/src/__tests__/__snapshots__/exports.test.ts.snap is excluded by !**/*.snap
  • packages/react-router/src/__tests__/__snapshots__/exports.test.ts.snap is excluded by !**/*.snap
  • packages/tanstack-react-start/src/__tests__/__snapshots__/exports.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (115)
  • .changeset/migrate-to-show.md (1 hunks)
  • .changeset/show-the-guards.md (1 hunks)
  • integration/presets/envs.ts (0 hunks)
  • integration/presets/next.ts (2 hunks)
  • integration/scripts/logger.ts (1 hunks)
  • integration/templates/astro-hybrid/src/pages/index.astro (1 hunks)
  • integration/templates/astro-hybrid/src/pages/only-admins.astro (1 hunks)
  • integration/templates/astro-hybrid/src/pages/only-members.astro (1 hunks)
  • integration/templates/astro-hybrid/src/pages/ssr.astro (1 hunks)
  • integration/templates/astro-node/src/layouts/Layout.astro (3 hunks)
  • integration/templates/astro-node/src/layouts/react/Layout.astro (3 hunks)
  • integration/templates/astro-node/src/pages/billing/checkout-btn.astro (1 hunks)
  • integration/templates/astro-node/src/pages/index.astro (4 hunks)
  • integration/templates/astro-node/src/pages/only-admins.astro (2 hunks)
  • integration/templates/astro-node/src/pages/only-members.astro (2 hunks)
  • integration/templates/astro-node/src/pages/pricing-table.astro (1 hunks)
  • integration/templates/astro-node/src/pages/react/index.astro (5 hunks)
  • integration/templates/astro-node/src/pages/react/only-admins.astro (1 hunks)
  • integration/templates/astro-node/src/pages/react/only-members.astro (2 hunks)
  • integration/templates/astro-node/src/pages/server-islands.astro (2 hunks)
  • integration/templates/astro-node/src/pages/transitions/index.astro (1 hunks)
  • integration/templates/expo-web/app/index.tsx (2 hunks)
  • integration/templates/index.ts (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/.gitignore (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/README.md (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/next.config.js (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/package.json (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/src/app/globals.css (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/src/app/page.module.css (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts (1 hunks)
  • integration/templates/next-app-router-quickstart-v6/tsconfig.json (1 hunks)
  • integration/templates/next-app-router-quickstart/src/app/page.tsx (1 hunks)
  • integration/templates/next-app-router-quickstart/tsconfig.json (1 hunks)
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx (1 hunks)
  • integration/templates/next-app-router/src/app/page.tsx (2 hunks)
  • integration/templates/next-app-router/src/app/pricing-table/page.tsx (2 hunks)
  • integration/templates/next-app-router/src/app/settings/rcc-protect/page.tsx (1 hunks)
  • integration/templates/next-app-router/src/app/settings/rsc-protect/page.tsx (1 hunks)
  • integration/templates/nuxt-node/app/pages/index.vue (2 hunks)
  • integration/templates/nuxt-node/app/pages/only-admin.vue (1 hunks)
  • integration/templates/react-cra/src/App.tsx (1 hunks)
  • integration/templates/react-router-library/src/App.tsx (1 hunks)
  • integration/templates/react-router-node/app/routes/home.tsx (2 hunks)
  • integration/templates/react-vite/src/App.tsx (2 hunks)
  • integration/templates/react-vite/src/protected/index.tsx (1 hunks)
  • integration/templates/tanstack-react-start/src/routes/index.tsx (3 hunks)
  • integration/templates/vue-vite/src/App.vue (2 hunks)
  • integration/templates/vue-vite/src/views/Admin.vue (1 hunks)
  • integration/templates/vue-vite/src/views/Home.vue (1 hunks)
  • integration/templates/vue-vite/src/views/billing/CheckoutBtn.vue (1 hunks)
  • integration/tests/astro/components.test.ts (3 hunks)
  • integration/tests/astro/hybrid.test.ts (1 hunks)
  • integration/tests/next-account-portal/clerk-v4-ap-core-1.test.ts (0 hunks)
  • integration/tests/next-account-portal/clerk-v4-ap-core-3.test.ts (0 hunks)
  • integration/tests/next-account-portal/clerk-v6-ap-core-1.test.ts (0 hunks)
  • integration/tests/nuxt/basic.test.ts (1 hunks)
  • integration/tests/vue/components.test.ts (1 hunks)
  • packages/astro/src/astro-components/control/Protect.astro (0 hunks)
  • packages/astro/src/astro-components/control/ProtectCSR.astro (0 hunks)
  • packages/astro/src/astro-components/control/ProtectSSR.astro (0 hunks)
  • packages/astro/src/astro-components/control/Show.astro (1 hunks)
  • packages/astro/src/astro-components/control/ShowCSR.astro (1 hunks)
  • packages/astro/src/astro-components/control/ShowSSR.astro (1 hunks)
  • packages/astro/src/astro-components/control/SignedIn.astro (0 hunks)
  • packages/astro/src/astro-components/control/SignedInCSR.astro (0 hunks)
  • packages/astro/src/astro-components/control/SignedInSSR.astro (0 hunks)
  • packages/astro/src/astro-components/control/SignedOut.astro (0 hunks)
  • packages/astro/src/astro-components/control/SignedOutCSR.astro (0 hunks)
  • packages/astro/src/astro-components/control/SignedOutSSR.astro (0 hunks)
  • packages/astro/src/astro-components/index.ts (1 hunks)
  • packages/astro/src/react/controlComponents.tsx (2 hunks)
  • packages/astro/src/types.ts (2 hunks)
  • packages/chrome-extension/docs/clerk-provider.md (3 hunks)
  • packages/chrome-extension/src/react/re-exports.ts (1 hunks)
  • packages/expo/src/components/controlComponents.tsx (1 hunks)
  • packages/nextjs/src/app-router/server/__tests__/controlComponents.test-d.ts (1 hunks)
  • packages/nextjs/src/app-router/server/__tests__/controlComponents.test.tsx (1 hunks)
  • packages/nextjs/src/app-router/server/controlComponents.tsx (1 hunks)
  • packages/nextjs/src/client-boundary/controlComponents.ts (1 hunks)
  • packages/nextjs/src/components.client.ts (1 hunks)
  • packages/nextjs/src/components.server.ts (1 hunks)
  • packages/nextjs/src/index.ts (1 hunks)
  • packages/nuxt/src/module.ts (1 hunks)
  • packages/nuxt/src/runtime/components/index.ts (1 hunks)
  • packages/react/src/components/CheckoutButton.tsx (3 hunks)
  • packages/react/src/components/PlanDetailsButton.tsx (1 hunks)
  • packages/react/src/components/SubscriptionDetailsButton.tsx (2 hunks)
  • packages/react/src/components/__tests__/CheckoutButton.test.tsx (1 hunks)
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx (1 hunks)
  • packages/react/src/components/controlComponents.tsx (2 hunks)
  • packages/react/src/components/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useCheckout.ts (1 hunks)
  • packages/shared/src/types/authorization.ts (1 hunks)
  • packages/shared/src/types/index.ts (1 hunks)
  • packages/shared/src/types/protect.ts (0 hunks)
  • packages/upgrade/src/codemods/__tests__/__fixtures__/transform-protect-to-show.fixtures.js (1 hunks)
  • packages/upgrade/src/codemods/__tests__/transform-protect-to-show.test.js (1 hunks)
  • packages/upgrade/src/codemods/transform-protect-to-show.cjs (1 hunks)
  • packages/upgrade/src/versions/core-3/changes/protect-signedin-signedout-replaced-by-show.md (1 hunks)
  • packages/upgrade/src/versions/core-3/index.js (1 hunks)
  • packages/vue/src/components/CheckoutButton.vue (1 hunks)
  • packages/vue/src/components/SubscriptionDetailsButton.vue (1 hunks)
  • packages/vue/src/components/controlComponents.ts (3 hunks)
  • packages/vue/src/components/index.ts (1 hunks)
  • playground/app-router/src/app/protected/page.tsx (2 hunks)
  • playground/app-router/src/pages/user/[[...index]].tsx (2 hunks)
  • playground/browser-extension/src/components/nav-bar.tsx (3 hunks)
  • playground/expo/App.tsx (2 hunks)
  • playground/nextjs/app/app-dir/client/page.tsx (1 hunks)
  • playground/nextjs/app/app-dir/page.tsx (3 hunks)
  • playground/nextjs/pages/_app.tsx (2 hunks)
  • playground/react-router/app/root.tsx (2 hunks)
  • playground/vite-react-ts/src/App.tsx (2 hunks)
💤 Files with no reviewable changes (14)
  • integration/tests/next-account-portal/clerk-v4-ap-core-1.test.ts
  • packages/astro/src/astro-components/control/SignedOutSSR.astro
  • integration/presets/envs.ts
  • packages/astro/src/astro-components/control/SignedOut.astro
  • packages/astro/src/astro-components/control/SignedIn.astro
  • packages/astro/src/astro-components/control/ProtectSSR.astro
  • packages/astro/src/astro-components/control/SignedInSSR.astro
  • integration/tests/next-account-portal/clerk-v6-ap-core-1.test.ts
  • packages/astro/src/astro-components/control/ProtectCSR.astro
  • packages/astro/src/astro-components/control/SignedInCSR.astro
  • integration/tests/next-account-portal/clerk-v4-ap-core-3.test.ts
  • packages/astro/src/astro-components/control/SignedOutCSR.astro
  • packages/astro/src/astro-components/control/Protect.astro
  • packages/shared/src/types/protect.ts
✅ Files skipped from review due to trivial changes (2)
  • integration/templates/next-app-router-quickstart-v6/.gitignore
  • integration/templates/next-app-router-quickstart-v6/README.md
🚧 Files skipped from review as they are similar to previous changes (57)
  • integration/tests/vue/components.test.ts
  • integration/templates/astro-node/src/layouts/Layout.astro
  • integration/templates/next-app-router-quickstart-v6/package.json
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • .changeset/migrate-to-show.md
  • integration/templates/vue-vite/src/views/billing/CheckoutBtn.vue
  • integration/templates/nuxt-node/app/pages/only-admin.vue
  • integration/tests/astro/hybrid.test.ts
  • integration/templates/nuxt-node/app/pages/index.vue
  • packages/nextjs/src/app-router/server/tests/controlComponents.test.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.module.css
  • integration/templates/react-router-node/app/routes/home.tsx
  • packages/vue/src/components/CheckoutButton.vue
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • packages/react/src/components/tests/CheckoutButton.test.tsx
  • integration/templates/astro-node/src/pages/server-islands.astro
  • integration/templates/astro-node/src/layouts/react/Layout.astro
  • packages/nextjs/src/components.server.ts
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • packages/vue/src/components/index.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart-v6/next.config.js
  • playground/app-router/src/pages/user/[[...index]].tsx
  • playground/nextjs/app/app-dir/page.tsx
  • playground/nextjs/app/app-dir/client/page.tsx
  • packages/upgrade/src/versions/core-3/changes/protect-signedin-signedout-replaced-by-show.md
  • integration/templates/astro-hybrid/src/pages/index.astro
  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts
  • packages/react/src/components/CheckoutButton.tsx
  • packages/shared/src/types/authorization.ts
  • packages/expo/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/index.ts
  • packages/chrome-extension/docs/clerk-provider.md
  • playground/nextjs/pages/_app.tsx
  • integration/templates/astro-node/src/pages/index.astro
  • integration/templates/astro-node/src/pages/transitions/index.astro
  • packages/astro/src/astro-components/control/ShowSSR.astro
  • packages/upgrade/src/codemods/tests/transform-protect-to-show.test.js
  • integration/templates/next-app-router-quickstart-v6/tsconfig.json
  • packages/nextjs/src/app-router/server/tests/controlComponents.test-d.ts
  • packages/astro/src/astro-components/control/Show.astro
  • integration/templates/react-cra/src/App.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
  • integration/templates/next-app-router/src/app/settings/rsc-protect/page.tsx
  • integration/templates/next-app-router/src/app/settings/rcc-protect/page.tsx
  • integration/templates/astro-hybrid/src/pages/only-members.astro
  • packages/nextjs/src/client-boundary/controlComponents.ts
  • packages/vue/src/components/SubscriptionDetailsButton.vue
  • packages/nuxt/src/runtime/components/index.ts
  • packages/upgrade/src/codemods/tests/fixtures/transform-protect-to-show.fixtures.js
  • integration/templates/next-app-router/src/app/pricing-table/page.tsx
  • integration/templates/astro-node/src/pages/react/index.astro
  • packages/react/src/components/PlanDetailsButton.tsx
  • integration/templates/expo-web/app/index.tsx
  • packages/nuxt/src/module.ts
  • integration/tests/astro/components.test.ts
🧰 Additional context used
📓 Path-based instructions (19)
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • integration/templates/vue-vite/src/views/Admin.vue
  • integration/scripts/logger.ts
  • integration/templates/astro-node/src/pages/react/only-admins.astro
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • integration/templates/astro-node/src/pages/only-members.astro
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/next-app-router-quickstart/tsconfig.json
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • integration/templates/astro-node/src/pages/pricing-table.astro
  • integration/templates/astro-node/src/pages/react/only-members.astro
  • packages/shared/src/types/index.ts
  • integration/templates/astro-node/src/pages/billing/checkout-btn.astro
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/astro/src/astro-components/control/ShowCSR.astro
  • packages/nextjs/src/components.client.ts
  • integration/templates/astro-hybrid/src/pages/ssr.astro
  • packages/astro/src/react/controlComponents.tsx
  • integration/templates/astro-node/src/pages/only-admins.astro
  • integration/templates/vue-vite/src/App.vue
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/globals.css
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • integration/templates/astro-hybrid/src/pages/only-admins.astro
  • playground/browser-extension/src/components/nav-bar.tsx
  • integration/templates/vue-vite/src/views/Home.vue
  • packages/upgrade/src/codemods/transform-protect-to-show.cjs
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/next-app-router-quickstart/tsconfig.json
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • integration/scripts/logger.ts
  • packages/chrome-extension/src/react/re-exports.ts
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • packages/astro/src/astro-components/index.ts
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/next-app-router-quickstart/tsconfig.json
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/shared/src/types/index.ts
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/presets/next.ts
  • integration/tests/nuxt/basic.test.ts
  • packages/vue/src/components/controlComponents.ts
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • integration/templates/index.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/chrome-extension/src/react/re-exports.ts
  • packages/astro/src/astro-components/index.ts
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • packages/shared/src/types/index.ts
  • packages/vue/src/components/controlComponents.ts
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • packages/react/src/components/controlComponents.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/chrome-extension/src/react/re-exports.ts
  • packages/astro/src/astro-components/index.ts
  • packages/nextjs/src/index.ts
  • packages/astro/src/types.ts
  • packages/shared/src/types/index.ts
  • packages/vue/src/components/controlComponents.ts
  • packages/nextjs/src/components.client.ts
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • packages/react/src/components/controlComponents.tsx
  • packages/upgrade/src/versions/core-3/index.js
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • packages/react/src/components/controlComponents.tsx
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • packages/react/src/components/controlComponents.tsx
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • playground/expo/App.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • packages/astro/src/react/controlComponents.tsx
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
  • packages/react/src/components/controlComponents.tsx
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

Avoid barrel files (index.ts re-exports) as they can cause circular dependencies

Files:

  • packages/astro/src/astro-components/index.ts
  • packages/nextjs/src/index.ts
  • packages/shared/src/types/index.ts
  • integration/templates/index.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{test,spec}.{ts,tsx,js,jsx}: Unit tests are required for all new functionality
Verify proper error handling and edge cases
Include tests for all new features

Files:

  • integration/tests/nuxt/basic.test.ts
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
**/*.{test,spec,e2e}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use real Clerk instances for integration tests

Files:

  • integration/tests/nuxt/basic.test.ts
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use React Testing Library for component testing

Files:

  • integration/tests/nuxt/basic.test.ts
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
**/*.test.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use React Testing Library for component testing

Files:

  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
**/*.{test,spec}.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{test,spec}.{jsx,tsx}: Use React Testing Library for unit testing React components
Test component behavior, not implementation details
Use proper test queries in React Testing Library tests
Implement proper test isolation in React component tests
Use proper test coverage in React component tests
Test component interactions in integration tests
Use proper test data in React component tests
Implement proper test setup in React component tests
Use proper test cleanup in React component tests
Implement proper test assertions in React component tests
Use proper test structure for React component tests

Files:

  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx
🧬 Code graph analysis (11)
integration/templates/react-vite/src/App.tsx (2)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
playground/vite-react-ts/src/App.tsx (1)
packages/react/src/components/controlComponents.tsx (2)
  • Show (85-115)
  • RedirectToSignIn (127-141)
packages/nextjs/src/index.ts (3)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
packages/react/src/components/index.ts (1)
  • Show (31-31)
packages/nextjs/src/components.server.ts (1)
  • ServerComponentsServerModuleTypes (6-9)
playground/app-router/src/app/protected/page.tsx (1)
packages/react/src/components/controlComponents.tsx (2)
  • Show (85-115)
  • ClerkLoaded (12-20)
integration/presets/next.ts (1)
integration/templates/index.ts (1)
  • templates (3-23)
packages/vue/src/components/controlComponents.ts (4)
packages/astro/src/react/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (59-90)
packages/react/src/components/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (85-115)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/shared/src/types/authorization.ts (1)
  • ShowWhenCondition (52-56)
integration/templates/react-vite/src/protected/index.tsx (4)
packages/chrome-extension/src/react/re-exports.ts (1)
  • Show (18-18)
packages/expo/src/components/controlComponents.tsx (1)
  • Show (1-1)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/nextjs/src/client-boundary/controlComponents.ts (1)
  • Show (15-15)
packages/astro/src/react/controlComponents.tsx (5)
packages/astro/src/types.ts (1)
  • ShowProps (71-71)
packages/react/src/components/controlComponents.tsx (3)
  • ShowProps (52-57)
  • Show (85-115)
  • AuthenticateWithRedirectCallback (198-207)
packages/shared/src/types/authorization.ts (1)
  • ShowWhenCondition (52-56)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/astro/src/react/utils.tsx (1)
  • withClerk (16-43)
packages/react/src/components/controlComponents.tsx (6)
packages/astro/src/react/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (59-90)
packages/shared/src/types/authorization.ts (1)
  • ShowWhenCondition (52-56)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/nextjs/src/index.ts (2)
  • Show (76-76)
  • useAuth (50-50)
packages/react/src/hooks/useAuth.ts (1)
  • useAuth (95-124)
packages/upgrade/src/codemods/transform-protect-to-show.cjs (1)
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
  • source (241-241)
packages/nextjs/src/app-router/server/controlComponents.tsx (3)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/shared/src/types/authorization.ts (1)
  • ShowWhenCondition (52-56)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Unit Tests (shared, clerk-js, RQ)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (6)
integration/templates/astro-node/src/pages/react/only-admins.astro (1)

1-27: Looks good.

The migration from Protect to Show is implemented correctly. The admin/not-admin gating logic using both the object shorthand and callback forms of the when prop is sound.

integration/scripts/logger.ts (1)

37-41: LGTM!

The warn method implementation is correct and type-safe. The error handling properly guards against non-Error types, and the message composition logic appropriately handles empty/missing error messages.

packages/nextjs/src/app-router/server/controlComponents.tsx (1)

42-66: LGTM!

The server-side Show implementation correctly handles all when condition types (string shorthands, function predicates, and object descriptors). The logic flow is consistent with the client-side React implementation and properly handles the async nature of server components.

packages/vue/src/components/controlComponents.ts (1)

124-163: LGTM!

The Vue Show implementation correctly addresses the previous review concerns:

  • Null handling for has.value is now consistent (lines 152-156 check hasValue before use)
  • JSDoc documentation has been added
  • The dual fallback support (slot and prop) is Vue-idiomatic

Logic flow matches the React implementation while adapting to Vue's reactive refs and slot system.

packages/react/src/components/controlComponents.tsx (1)

85-125: LGTM!

The React Show implementation is clean and well-structured:

  • The checkAuthorization helper nicely encapsulates the function/object condition evaluation
  • The type narrowing with Exclude<ShowWhenCondition, 'signedIn' | 'signedOut'> is precise
  • Logic flow correctly handles all when condition types in the right order
packages/upgrade/src/codemods/transform-protect-to-show.cjs (1)

1-350: Well-implemented codemod with comprehensive transformation logic.

The codemod correctly handles:

  • ESM and CJS import transformations with alias preservation
  • JSX element renaming with proper attribute extraction and when prop construction
  • Type reference updates (ProtectPropsShowProps)
  • Deduplication of import specifiers
  • Boolean shorthand attributes (line 306-307)
  • Deterministic output via property sorting (lines 316-320)

The edge cases from past reviews have been addressed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
packages/upgrade/src/codemods/transform-protect-to-show.cjs (1)

237-253: JSXMemberExpression type check uses wrong AST node type.

Line 239 uses j.Identifier.check() for both member.object and member.property, but JSXMemberExpression nodes contain JSXIdentifier nodes, not Identifier nodes. This causes the codemod to silently skip namespace components like <Clerk.Protect>, <Clerk.SignedIn>, or <Clerk.SignedOut>.

🔎 Proposed fix
     } else if (j.JSXMemberExpression.check(openingElement.name)) {
       const member = openingElement.name;
-      if (j.Identifier.check(member.object) && j.Identifier.check(member.property)) {
+      if (j.JSXIdentifier.check(member.object) && j.JSXIdentifier.check(member.property)) {
         const objectName = member.object.name;
         const propertyName = member.property.name;
📜 Review details

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

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6c63d2b and d8eb117.

📒 Files selected for processing (51)
  • integration/templates/astro-hybrid/src/pages/index.astro (1 hunks)
  • integration/templates/astro-hybrid/src/pages/ssr.astro (1 hunks)
  • integration/templates/astro-node/src/layouts/Layout.astro (3 hunks)
  • integration/templates/astro-node/src/layouts/react/Layout.astro (3 hunks)
  • integration/templates/astro-node/src/pages/billing/checkout-btn.astro (1 hunks)
  • integration/templates/astro-node/src/pages/index.astro (4 hunks)
  • integration/templates/astro-node/src/pages/react/index.astro (5 hunks)
  • integration/templates/astro-node/src/pages/transitions/index.astro (1 hunks)
  • integration/templates/expo-web/app/index.tsx (2 hunks)
  • integration/templates/next-app-router-quickstart/src/app/page.tsx (1 hunks)
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx (1 hunks)
  • integration/templates/next-app-router/src/app/page.tsx (2 hunks)
  • integration/templates/nuxt-node/app/pages/index.vue (2 hunks)
  • integration/templates/react-cra/src/App.tsx (1 hunks)
  • integration/templates/react-router-library/src/App.tsx (1 hunks)
  • integration/templates/react-router-node/app/routes/home.tsx (2 hunks)
  • integration/templates/react-vite/src/App.tsx (2 hunks)
  • integration/templates/react-vite/src/protected/index.tsx (1 hunks)
  • integration/templates/tanstack-react-start/src/routes/index.tsx (3 hunks)
  • integration/templates/vue-vite/src/App.vue (2 hunks)
  • integration/templates/vue-vite/src/views/Home.vue (1 hunks)
  • integration/templates/vue-vite/src/views/billing/CheckoutBtn.vue (1 hunks)
  • packages/astro/src/astro-components/control/ShowCSR.astro (1 hunks)
  • packages/astro/src/astro-components/control/ShowSSR.astro (1 hunks)
  • packages/astro/src/react/controlComponents.tsx (2 hunks)
  • packages/chrome-extension/docs/clerk-provider.md (3 hunks)
  • packages/nextjs/src/app-router/server/__tests__/controlComponents.test.tsx (1 hunks)
  • packages/nextjs/src/app-router/server/controlComponents.tsx (1 hunks)
  • packages/react/src/components/CheckoutButton.tsx (3 hunks)
  • packages/react/src/components/PlanDetailsButton.tsx (1 hunks)
  • packages/react/src/components/SubscriptionDetailsButton.tsx (2 hunks)
  • packages/react/src/components/__tests__/CheckoutButton.test.tsx (1 hunks)
  • packages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsx (1 hunks)
  • packages/react/src/components/controlComponents.tsx (2 hunks)
  • packages/shared/src/react/hooks/useCheckout.ts (1 hunks)
  • packages/shared/src/types/authorization.ts (1 hunks)
  • packages/upgrade/src/codemods/__tests__/__fixtures__/transform-protect-to-show.fixtures.js (1 hunks)
  • packages/upgrade/src/codemods/transform-protect-to-show.cjs (1 hunks)
  • packages/upgrade/src/versions/core-3/changes/protect-signedin-signedout-replaced-by-show.md (1 hunks)
  • packages/vue/src/components/CheckoutButton.vue (1 hunks)
  • packages/vue/src/components/SubscriptionDetailsButton.vue (1 hunks)
  • packages/vue/src/components/controlComponents.ts (3 hunks)
  • playground/app-router/src/app/protected/page.tsx (2 hunks)
  • playground/app-router/src/pages/user/[[...index]].tsx (2 hunks)
  • playground/browser-extension/src/components/nav-bar.tsx (3 hunks)
  • playground/expo/App.tsx (2 hunks)
  • playground/nextjs/app/app-dir/client/page.tsx (1 hunks)
  • playground/nextjs/app/app-dir/page.tsx (3 hunks)
  • playground/nextjs/pages/_app.tsx (2 hunks)
  • playground/react-router/app/root.tsx (2 hunks)
  • playground/vite-react-ts/src/App.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (26)
  • integration/templates/astro-hybrid/src/pages/index.astro
  • playground/nextjs/app/app-dir/client/page.tsx
  • packages/vue/src/components/SubscriptionDetailsButton.vue
  • integration/templates/react-vite/src/App.tsx
  • playground/react-router/app/root.tsx
  • playground/app-router/src/app/protected/page.tsx
  • integration/templates/vue-vite/src/App.vue
  • integration/templates/react-router-node/app/routes/home.tsx
  • playground/vite-react-ts/src/App.tsx
  • integration/templates/tanstack-react-start/src/routes/index.tsx
  • packages/react/src/components/tests/CheckoutButton.test.tsx
  • integration/templates/astro-hybrid/src/pages/ssr.astro
  • integration/templates/vue-vite/src/views/billing/CheckoutBtn.vue
  • integration/templates/astro-node/src/pages/transitions/index.astro
  • playground/browser-extension/src/components/nav-bar.tsx
  • packages/react/src/components/tests/SubscriptionDetailsButton.test.tsx
  • packages/upgrade/src/versions/core-3/changes/protect-signedin-signedout-replaced-by-show.md
  • packages/nextjs/src/app-router/server/tests/controlComponents.test.tsx
  • packages/react/src/components/CheckoutButton.tsx
  • packages/vue/src/components/CheckoutButton.vue
  • integration/templates/astro-node/src/layouts/react/Layout.astro
  • integration/templates/expo-web/app/index.tsx
  • packages/shared/src/types/authorization.ts
  • playground/app-router/src/pages/user/[[...index]].tsx
  • packages/upgrade/src/codemods/tests/fixtures/transform-protect-to-show.fixtures.js
  • integration/templates/astro-node/src/layouts/Layout.astro
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/chrome-extension/docs/clerk-provider.md
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/chrome-extension/docs/clerk-provider.md
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/react-router-library/src/App.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/react-cra/src/App.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/chrome-extension/docs/clerk-provider.md
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • playground/nextjs/pages/_app.tsx
  • integration/templates/next-app-router/src/app/page.tsx
  • packages/react/src/components/PlanDetailsButton.tsx
  • integration/templates/astro-node/src/pages/index.astro
  • packages/astro/src/astro-components/control/ShowCSR.astro
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • integration/templates/vue-vite/src/views/Home.vue
  • integration/templates/nuxt-node/app/pages/index.vue
  • integration/templates/react-router-library/src/App.tsx
  • packages/astro/src/astro-components/control/ShowSSR.astro
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • playground/nextjs/app/app-dir/page.tsx
  • integration/templates/astro-node/src/pages/billing/checkout-btn.astro
  • integration/templates/react-cra/src/App.tsx
  • integration/templates/astro-node/src/pages/react/index.astro
  • packages/upgrade/src/codemods/transform-protect-to-show.cjs
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/chrome-extension/docs/clerk-provider.md
  • packages/astro/src/react/controlComponents.tsx
  • playground/expo/App.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/react-vite/src/protected/index.tsx
  • integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/react/src/components/PlanDetailsButton.tsx
  • packages/vue/src/components/controlComponents.ts
  • packages/react/src/components/controlComponents.tsx
  • packages/react/src/components/SubscriptionDetailsButton.tsx
  • packages/nextjs/src/app-router/server/controlComponents.tsx
  • packages/astro/src/react/controlComponents.tsx
  • packages/shared/src/react/hooks/useCheckout.ts
🧠 Learnings (1)
📚 Learning: 2025-08-27T14:52:13.940Z
Learnt from: CR
Repo: clerk/javascript PR: 0
File: packages/chrome-extension/docs/clerk-provider.md:0-0
Timestamp: 2025-08-27T14:52:13.940Z
Learning: Applies to packages/chrome-extension/docs/**/App.tsx : Use Clerk’s SignedIn/SignedOut components in App.tsx; show <SignInButton mode='modal'/> when SignedOut and <UserButton/> plus protected content when SignedIn

Applied to files:

  • packages/chrome-extension/docs/clerk-provider.md
🧬 Code graph analysis (12)
playground/nextjs/pages/_app.tsx (4)
packages/astro/src/react/controlComponents.tsx (1)
  • Show (59-90)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
packages/vue/src/components/controlComponents.ts (1)
  • Show (124-164)
integration/templates/next-app-router/src/app/page.tsx (1)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/vue/src/components/controlComponents.ts (5)
packages/astro/src/react/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (59-90)
packages/react/src/components/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (85-115)
packages/shared/src/types/authorization.ts (2)
  • ShowProps (79-82)
  • ShowWhenCondition (52-56)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (4)
packages/astro/src/react/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (59-90)
packages/shared/src/types/authorization.ts (2)
  • ShowProps (79-82)
  • ShowWhenCondition (52-56)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
integration/templates/react-router-library/src/App.tsx (5)
playground/react-router/app/root.tsx (1)
  • App (51-67)
packages/astro/src/react/controlComponents.tsx (1)
  • Show (59-90)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
packages/vue/src/components/controlComponents.ts (1)
  • Show (124-164)
integration/templates/react-cra/src/App.tsx (2)
playground/react-router/app/root.tsx (1)
  • App (51-67)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
packages/upgrade/src/codemods/transform-protect-to-show.cjs (1)
packages/upgrade/src/codemods/transform-align-experimental-unstable-prefixes.cjs (1)
  • source (241-241)
packages/astro/src/react/controlComponents.tsx (7)
packages/react/src/components/controlComponents.tsx (3)
  • ShowProps (52-57)
  • Show (85-115)
  • AuthenticateWithRedirectCallback (198-207)
packages/shared/src/types/authorization.ts (2)
  • ShowProps (79-82)
  • ShowWhenCondition (52-56)
packages/astro/src/types.ts (1)
  • ShowProps (71-71)
packages/shared/src/types/session.ts (1)
  • PendingSessionOptions (35-42)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/astro/src/react/utils.tsx (1)
  • withClerk (16-43)
packages/shared/src/types/clerk.ts (1)
  • HandleOAuthCallbackParams (990-1034)
playground/expo/App.tsx (1)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
integration/templates/next-app-router-quickstart/src/app/page.tsx (6)
integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx (1)
  • Home (4-17)
integration/templates/next-app-router/src/app/page.tsx (1)
  • Home (5-39)
integration/templates/react-router-node/app/routes/home.tsx (1)
  • Home (8-16)
packages/astro/src/react/controlComponents.tsx (1)
  • Show (59-90)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
integration/templates/react-vite/src/protected/index.tsx (6)
playground/app-router/src/app/protected/page.tsx (1)
  • Page (7-38)
playground/nextjs/app/app-dir/client/page.tsx (1)
  • Page (4-11)
packages/astro/src/react/controlComponents.tsx (1)
  • Show (59-90)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
packages/vue/src/components/controlComponents.ts (1)
  • Show (124-164)
integration/templates/next-app-router/src/app/billing/checkout-btn/page.tsx (4)
integration/templates/next-app-router-quickstart/src/app/page.tsx (1)
  • Home (3-17)
integration/templates/next-app-router/src/app/page.tsx (1)
  • Home (5-39)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (26)
  • GitHub Check: Unit Tests (shared, clerk-js, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (8)
playground/nextjs/app/app-dir/page.tsx (1)

29-47: The when prop values 'signed-in' and 'signed-out' are correct and match the type definition exactly. The ShowWhenCondition type explicitly includes these kebab-case string literals. Remove the @ts-ignore comments—they are unnecessary.

Likely an incorrect or invalid review comment.

integration/templates/next-app-router-quickstart/src/app/page.tsx (1)

1-17: LGTM!

The migration from SignedIn/SignedOut to Show with when prop is correct and follows the expected usage pattern.

packages/chrome-extension/docs/clerk-provider.md (1)

1-114: LGTM!

Documentation correctly updated to use the new Show component API with when='signed-in' and when='signed-out' patterns.

packages/vue/src/components/controlComponents.ts (1)

103-164: LGTM!

The Show component implementation is correct with proper null checks for has.value (lines 152-156) and comprehensive JSDoc documentation. The authorization logic properly handles all when conditions.

packages/react/src/components/controlComponents.tsx (1)

52-125: LGTM!

The Show component implementation is clean and correct. The checkAuthorization helper (lines 117-125) properly centralizes authorization logic, and the component correctly handles all when condition variants.

packages/astro/src/react/controlComponents.tsx (2)

59-90: LGTM! The Show component implementation is correct.

The control flow correctly handles all when condition types:

  • String shorthands ('signed-in', 'signed-out')
  • Predicate functions receiving has
  • Authorization objects passed to has()

The runtime validation for the required when prop and hydration-safe loading state handling are appropriate.


95-104: LGTM!

The withClerk HOC integration and empty dependency array align with the established pattern from the React package, as addressed in prior review feedback.

packages/nextjs/src/app-router/server/controlComponents.tsx (1)

42-65: LGTM! Server-side Show implementation is correct.

The async server component correctly handles all when condition types and properly integrates with the server-side auth() function. The logic is consistent with the client-side Astro implementation.

@jacekradko
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @jacekradko - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.2.9-snapshot.v20260105214115
@clerk/astro 3.0.0-snapshot.v20260105214115
@clerk/backend 3.0.0-snapshot.v20260105214115
@clerk/chrome-extension 3.0.0-snapshot.v20260105214115
@clerk/clerk-js 6.0.0-snapshot.v20260105214115
@clerk/dev-cli 1.0.0-snapshot.v20260105214115
@clerk/expo 3.0.0-snapshot.v20260105214115
@clerk/expo-passkeys 1.0.0-snapshot.v20260105214115
@clerk/express 2.0.0-snapshot.v20260105214115
@clerk/fastify 2.6.9-snapshot.v20260105214115
@clerk/localizations 4.0.0-snapshot.v20260105214115
@clerk/nextjs 7.0.0-snapshot.v20260105214115
@clerk/nuxt 2.0.0-snapshot.v20260105214115
@clerk/react 6.0.0-snapshot.v20260105214115
@clerk/react-router 3.0.0-snapshot.v20260105214115
@clerk/shared 4.0.0-snapshot.v20260105214115
@clerk/tanstack-react-start 1.0.0-snapshot.v20260105214115
@clerk/testing 2.0.0-snapshot.v20260105214115
@clerk/ui 1.0.0-snapshot.v20260105214115
@clerk/upgrade 2.0.0-snapshot.v20260105214115
@clerk/vue 2.0.0-snapshot.v20260105214115

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/dev-cli

npm i @clerk/[email protected] --save-exact

@clerk/expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/ui

npm i @clerk/[email protected] --save-exact

@clerk/upgrade

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --save-exact

@jacekradko jacekradko merged commit f1f1d09 into main Jan 5, 2026
44 checks passed
@jacekradko jacekradko deleted the feat/protect-refactor branch January 5, 2026 22:22
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.

7 participants