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; adds ClerkLoaded and ClerkLoading for safer loading/hydration.
  • Breaking Changes

    • Protect, SignedIn, and SignedOut removed from public exports; new ShowProps and ShowWhenCondition types added (ProtectProps preserved as an alias).
  • Migration Tools

    • Codemod provided to automate Protect/SignedIn/SignedOut → Show migration.
  • Docs & Tests

    • Examples, templates, docs, and tests updated; runtime messages adjusted to reference 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: d8eb117

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 Dec 19, 2025 8:51pm
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

📝 Walkthrough

Walkthrough

Replaces the Protect, SignedIn, and SignedOut control components with a single Show component and introduces Show-related types (ShowProps, ShowWhenCondition, ProtectParams) in shared types. Updates framework integrations and public exports (React, Next.js app/server, Astro, Vue, Expo, Chrome extension, Nuxt) to export and use Show; removes Protect/SignedIn/SignedOut. Adds ClerkLoaded and ClerkLoading utilities, hydration-safe loading hooks, server- and CSR/SSR-ready Astro Show components, unit tests for Show, and a codemod (transform-protect-to-show) with fixtures to automate migration.

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: migrating the Protect component to Show.
Linked Issues check ✅ Passed Code changes fully implement USER-3389 requirements: renames Protect to Show, removes SignedIn/SignedOut, updates all usages, adds migration codemods, treats as breaking change.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the Protect-to-Show migration: component renames, prop consolidation, codemod additions, template updates, and test fixes.

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: d8eb117

Comment on lines +136 to +137
const fallbackFromSlot = slots.fallback?.() ?? null;
const fallbackFromProp = (props.fallback as VNodeChild | null | undefined) ?? null;
Copy link
Member

Choose a reason for hiding this comment

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

Nice. I like that we accept both a fallback prop and a slot.

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

📜 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 f045134 and be35c47.

📒 Files selected for processing (3)
  • integration/presets/envs.ts (0 hunks)
  • integration/presets/next.ts (1 hunks)
  • integration/templates/next-app-router-quickstart/src/app/page.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • integration/presets/envs.ts
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.ts
**/*.{ts,tsx,js,jsx}

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

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

Files:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.ts
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.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:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • integration/templates/next-app-router-quickstart/src/app/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:

  • integration/templates/next-app-router-quickstart/src/app/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:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.ts
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.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:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.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:

  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/presets/next.ts
🧬 Code graph analysis (1)
integration/templates/next-app-router-quickstart/src/app/page.tsx (5)
packages/react/src/components/controlComponents.tsx (2)
  • ShowProps (52-57)
  • Show (85-115)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/nextjs/src/index.ts (2)
  • Show (76-76)
  • UserButton (40-40)
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)
⏰ 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). (25)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
integration/presets/next.ts (1)

27-42: LGTM!

The removal of the V4 variant and retention of the latest and V6 variants aligns with the PR objectives. The configuration is syntactically correct and properly exported.

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

📜 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 be35c47 and 68b9078.

📒 Files selected for processing (9)
  • 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/server-islands.astro (1 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/index.ts (1 hunks)
  • packages/astro/src/types.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/astro/src/types.ts
🧰 Additional context used
📓 Path-based instructions (11)
**/*

⚙️ 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/astro-node/src/pages/pricing-table.astro
  • integration/templates/astro-node/src/pages/server-islands.astro
  • packages/astro/src/astro-components/control/Show.astro
  • packages/astro/src/astro-components/control/ShowSSR.astro
  • packages/astro/src/astro-components/control/ShowCSR.astro
  • integration/templates/astro-node/src/pages/only-admins.astro
  • packages/astro/src/astro-components/index.ts
  • integration/templates/astro-node/src/pages/only-members.astro
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • packages/astro/src/astro-components/index.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/astro/src/astro-components/index.ts
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/astro/src/astro-components/index.ts
**/*.{ts,tsx,js,jsx}

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

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

Files:

  • packages/astro/src/astro-components/index.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/astro/src/astro-components/index.ts
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/astro/src/astro-components/index.ts
**/*.{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:

  • packages/astro/src/astro-components/index.ts
**/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
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/astro/src/astro-components/index.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:

  • packages/astro/src/astro-components/index.ts
⏰ 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). (25)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
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

📜 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 da39eea and 19c6e3c.

⛔ Files ignored due to path filters (3)
  • 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
📒 Files selected for processing (14)
  • integration/presets/next.ts (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 (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • integration/templates/next-app-router-quickstart-v6/package.json
🧰 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:

  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
  • integration/templates/next-app-router-quickstart-v6/next.config.js
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart-v6/tsconfig.json
  • integration/templates/next-app-router-quickstart-v6/README.md
  • integration/templates/next-app-router-quickstart/tsconfig.json
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
  • integration/templates/next-app-router-quickstart-v6/next.config.js
**/*.{ts,tsx,js,jsx}

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

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

Files:

  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
  • integration/templates/next-app-router-quickstart-v6/next.config.js
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
**/*.{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/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • integration/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
  • integration/templates/next-app-router-quickstart-v6/next.config.js
**/*.{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/templates/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart-v6/tsconfig.json
  • integration/templates/next-app-router-quickstart-v6/README.md
  • integration/templates/next-app-router-quickstart/tsconfig.json
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
  • integration/templates/next-app-router-quickstart-v6/next.config.js
**/*

⚙️ 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/next-app-router-quickstart-v6/src/middleware.ts
  • integration/templates/next-app-router-quickstart-v6/src/app/globals.css
  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.module.css
  • integration/templates/next-app-router-quickstart-v6/tsconfig.json
  • integration/templates/next-app-router-quickstart-v6/README.md
  • integration/templates/next-app-router-quickstart/tsconfig.json
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
  • integration/templates/index.ts
  • integration/presets/next.ts
  • integration/templates/next-app-router-quickstart-v6/next.config.js
**/*.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/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart-v6/README.md
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/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:

  • integration/templates/next-app-router-quickstart-v6/src/app/layout.tsx
  • integration/templates/next-app-router-quickstart/src/app/page.tsx
  • integration/templates/next-app-router-quickstart-v6/src/app/page.tsx
**/README.md

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

Provide usage examples in documentation

Files:

  • integration/templates/next-app-router-quickstart-v6/README.md
**/index.ts

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

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

Files:

  • integration/templates/index.ts
🧬 Code graph analysis (3)
integration/templates/next-app-router-quickstart/src/app/page.tsx (2)
packages/nextjs/src/app-router/server/controlComponents.tsx (1)
  • Show (42-66)
packages/react/src/components/controlComponents.tsx (1)
  • Show (85-115)
integration/templates/next-app-router-quickstart-v6/src/app/page.tsx (2)
integration/templates/next-app-router-quickstart/src/app/page.tsx (1)
  • Home (3-17)
scripts/notify.mjs (1)
  • header (54-54)
integration/presets/next.ts (1)
integration/templates/index.ts (1)
  • templates (3-23)
⏰ 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). (25)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (react-router, 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 (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
Co-authored-by: Dylan Staley <88163+dstaley@users.noreply.github.com>
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.

Comment on lines 237 to 253
} else if (j.JSXMemberExpression.check(openingElement.name)) {
const member = openingElement.name;
if (j.Identifier.check(member.object) && j.Identifier.check(member.property)) {
const objectName = member.object.name;
const propertyName = member.property.name;

if (namespaceImports.has(objectName) && ['Protect', 'SignedIn', 'SignedOut'].includes(propertyName)) {
kind = propertyName === 'Protect' ? 'protect' : propertyName === 'SignedIn' ? 'signedIn' : 'signedOut';

renameNodeToShow = node => {
if (j.JSXMemberExpression.check(node) && j.Identifier.check(node.property)) {
node.property.name = 'Show';
}
};
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

JSXMemberExpression type check requires JSXIdentifier instead of Identifier.

Line 239 uses j.Identifier.check() for both object and property of a JSXMemberExpression, but JSXMemberExpression's object field accepts JSXMemberExpression | JSXIdentifier and property field accepts JSXIdentifier. This causes the codemod to skip namespace components like <Clerk.Protect>.

Update line 239:

- if (j.Identifier.check(member.object) && j.Identifier.check(member.property)) { + if (j.JSXIdentifier.check(member.object) && j.JSXIdentifier.check(member.property)) {
🤖 Prompt for AI Agents
In packages/upgrade/src/codemods/transform-protect-to-show.cjs around lines 237-253 the codemod uses j.Identifier.check for JSXMemberExpression.object and .property which is incorrect for JSX AST nodes; replace those checks so the object is allowed to be a JSXIdentifier or nested JSXMemberExpression and the property is checked with j.JSXIdentifier.check (i.e., change the condition to test for j.JSXIdentifier.check(member.property) and for member.object allow j.JSXIdentifier.check(member.object) || j.JSXMemberExpression.check(member.object)); keep the rest of the logic the same so namespace components like <Clerk.Protect> are recognized and renamed to Show. 
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.

Comment on lines +10 to +13
<Show
when='signed-in'
client:load
>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incorrect when prop values — use camelCase.

The when prop values use kebab-case ('signed-in', 'signed-out') but should use camelCase ('signedIn', 'signedOut') per the PR description and migration pattern. This will cause the Show component to fail matching the authentication state.

🔎 Proposed fix
 <Show - when='signed-in' + when='signedIn' client:load >
 <Show - when='signed-out' + when='signedOut' client:load >

Apply the same fix to all three Show usages in this file (lines 11, 38, and 53).

Also applies to: 37-40, 52-55

🤖 Prompt for AI Agents
integration/templates/astro-node/src/pages/react/index.astro lines 10-13 (also occurrences at 37-40 and 52-55): The Show components use kebab-case string values ('signed-in', 'signed-out') for the when prop which won't match the expected auth state; update each Show usage to use camelCase values 'signedIn' and 'signedOut' respectively (replace 'signed-in' → 'signedIn' and 'signed-out' → 'signedOut' in all three places). 
Comment on lines 18 to 20
* function BasicSubscriptionDetails() {
* return (
* <SubscriptionDetailsButton />
* );
* return <SubscriptionDetailsButton />;
* }
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Example will throw runtime error when user is signed out.

The BasicSubscriptionDetails example renders <SubscriptionDetailsButton /> without any authentication guard, but line 54-57 throws an error if userId is null. This contradicts the docblock requirement at line 10 that states the component must be rendered only when the user is signed in.

🔎 Wrap the example with Show guard
 // Basic usage with default "Subscription details" text function BasicSubscriptionDetails() { - return <SubscriptionDetailsButton />; + return ( + <Show when="signed-in"> + <SubscriptionDetailsButton /> + </Show> + ); }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* function BasicSubscriptionDetails() {
* return (
* <SubscriptionDetailsButton />
* );
* return <SubscriptionDetailsButton />;
* }
* function BasicSubscriptionDetails() {
* return (
* <Show when="signed-in">
* <SubscriptionDetailsButton />
* </Show>
* );
* }
🤖 Prompt for AI Agents
In packages/react/src/components/SubscriptionDetailsButton.tsx around lines 18-20 (error occurs at runtime in lines 54-57 when userId is null), the BasicSubscriptionDetails example renders SubscriptionDetailsButton without an auth guard; update the example to only render the button when the user is signed in by wrapping it with the Show (or equivalent) conditional guard or by checking userId before rendering, and add any necessary import for Show so the docblock requirement (component must be rendered only when signed in) is satisfied. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment