- Notifications
You must be signed in to change notification settings - Fork 419
feat(repo): Migrate Protect to Show #7373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d8eb117 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughReplaces 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)
✅ Passed checks (4 passed)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
d24d455 to 12a12f5 Compare | const fallbackFromSlot = slots.fallback?.() ?? null; | ||
| const fallbackFromProp = (props.fallback as VNodeChild | null | undefined) ?? null; |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
📒 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.tsxintegration/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.tsxintegration/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.tsxintegration/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.tsxintegration/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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly 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 likeOmit,Partial, andPickfor 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
Useconst assertionswithas constfor literal types
Usesatisfiesoperator 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.tsxintegration/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.tsxintegration/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.tsxintegration/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.tsxintegration/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.
integration/templates/next-app-router-quickstart/src/app/page.tsx Outdated Show resolved Hide resolved
There was a problem hiding this 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.
📒 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.astrointegration/templates/astro-node/src/pages/server-islands.astropackages/astro/src/astro-components/control/Show.astropackages/astro/src/astro-components/control/ShowSSR.astropackages/astro/src/astro-components/control/ShowCSR.astrointegration/templates/astro-node/src/pages/only-admins.astropackages/astro/src/astro-components/index.tsintegration/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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly 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 likeOmit,Partial, andPickfor 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
Useconst assertionswithas constfor literal types
Usesatisfiesoperator 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
There was a problem hiding this 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.
⛔ Files ignored due to path filters (3)
integration/templates/next-app-router-quickstart-v6/public/next.svgis excluded by!**/*.svgintegration/templates/next-app-router-quickstart-v6/public/vercel.svgis excluded by!**/*.svgintegration/templates/next-app-router-quickstart-v6/src/app/favicon.icois 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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/presets/next.tsintegration/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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart-v6/tsconfig.jsonintegration/templates/next-app-router-quickstart-v6/README.mdintegration/templates/next-app-router-quickstart/tsconfig.jsonintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/presets/next.tsintegration/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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/presets/next.tsintegration/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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly 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 likeOmit,Partial, andPickfor 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
Useconst assertionswithas constfor literal types
Usesatisfiesoperator 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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/presets/next.tsintegration/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.tsintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart-v6/tsconfig.jsonintegration/templates/next-app-router-quickstart-v6/README.mdintegration/templates/next-app-router-quickstart/tsconfig.jsonintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/presets/next.tsintegration/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.tsintegration/templates/next-app-router-quickstart-v6/src/app/globals.cssintegration/templates/next-app-router-quickstart-v6/src/app/layout.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.module.cssintegration/templates/next-app-router-quickstart-v6/tsconfig.jsonintegration/templates/next-app-router-quickstart-v6/README.mdintegration/templates/next-app-router-quickstart/tsconfig.jsonintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/next-app-router-quickstart-v6/src/app/page.tsxintegration/templates/index.tsintegration/presets/next.tsintegration/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.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/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.tsxintegration/templates/next-app-router-quickstart-v6/README.mdintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/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.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/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
8c0e79d to 042d550 Compare Co-authored-by: Dylan Staley <88163+dstaley@users.noreply.github.com>
There was a problem hiding this 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
hrefon a React RouterLink, which is incorrect. React Router'sLinkcomponent uses thetoprop, nothref. 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: GuardcustomElements.defineto 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.
⛔ Files ignored due to path filters (6)
integration/templates/next-app-router-quickstart-v6/public/next.svgis excluded by!**/*.svgintegration/templates/next-app-router-quickstart-v6/public/vercel.svgis excluded by!**/*.svgintegration/templates/next-app-router-quickstart-v6/src/app/favicon.icois excluded by!**/*.icopackages/chrome-extension/src/__tests__/__snapshots__/exports.test.ts.snapis excluded by!**/*.snappackages/react-router/src/__tests__/__snapshots__/exports.test.ts.snapis excluded by!**/*.snappackages/tanstack-react-start/src/__tests__/__snapshots__/exports.test.ts.snapis 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.vueintegration/scripts/logger.tsintegration/templates/astro-node/src/pages/react/only-admins.astropackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxintegration/templates/astro-node/src/pages/only-members.astroplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxintegration/templates/next-app-router-quickstart/tsconfig.jsonpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxintegration/templates/astro-node/src/pages/pricing-table.astrointegration/templates/astro-node/src/pages/react/only-members.astropackages/shared/src/types/index.tsintegration/templates/astro-node/src/pages/billing/checkout-btn.astrointegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/astro/src/astro-components/control/ShowCSR.astropackages/nextjs/src/components.client.tsintegration/templates/astro-hybrid/src/pages/ssr.astropackages/astro/src/react/controlComponents.tsxintegration/templates/astro-node/src/pages/only-admins.astrointegration/templates/vue-vite/src/App.vuepackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tsintegration/templates/next-app-router-quickstart-v6/src/app/globals.csspackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jsintegration/templates/astro-hybrid/src/pages/only-admins.astroplayground/browser-extension/src/components/nav-bar.tsxintegration/templates/vue-vite/src/views/Home.vuepackages/upgrade/src/codemods/transform-protect-to-show.cjspackages/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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jsplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxintegration/templates/next-app-router-quickstart/tsconfig.jsonpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jsplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jsplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxplayground/browser-extension/src/components/nav-bar.tsxpackages/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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly 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 likeOmit,Partial, andPickfor 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
Useconst assertionswithas constfor literal types
Usesatisfiesoperator 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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jsplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/chrome-extension/src/react/re-exports.tsintegration/templates/react-vite/src/App.tsxplayground/react-router/app/root.tsxpackages/astro/src/astro-components/index.tsintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxintegration/templates/next-app-router-quickstart/tsconfig.jsonpackages/nextjs/src/index.tspackages/astro/src/types.tsintegration/templates/next-app-router/src/app/page.tsxpackages/shared/src/types/index.tsintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/presets/next.tsintegration/tests/nuxt/basic.test.tspackages/vue/src/components/controlComponents.tsintegration/templates/react-vite/src/protected/index.tsxpackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxintegration/templates/index.tspackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jsplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/astro/src/astro-components/index.tspackages/nextjs/src/index.tspackages/astro/src/types.tspackages/shared/src/types/index.tspackages/vue/src/components/controlComponents.tspackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxpackages/react/src/components/controlComponents.tsxpackages/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.tspackages/astro/src/astro-components/index.tspackages/nextjs/src/index.tspackages/astro/src/types.tspackages/shared/src/types/index.tspackages/vue/src/components/controlComponents.tspackages/nextjs/src/components.client.tspackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxpackages/react/src/components/controlComponents.tsxpackages/upgrade/src/versions/core-3/index.jspackages/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.tsxplayground/react-router/app/root.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxintegration/templates/next-app-router/src/app/page.tsxintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/templates/react-vite/src/protected/index.tsxpackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxpackages/react/src/components/controlComponents.tsxplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tsxplayground/react-router/app/root.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxintegration/templates/next-app-router/src/app/page.tsxintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/templates/react-vite/src/protected/index.tsxpackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxpackages/react/src/components/controlComponents.tsxplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tsxplayground/react-router/app/root.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxplayground/expo/App.tsxplayground/vite-react-ts/src/App.tsxintegration/templates/next-app-router/src/app/page.tsxintegration/templates/tanstack-react-start/src/routes/index.tsxplayground/app-router/src/app/protected/page.tsxintegration/templates/react-vite/src/protected/index.tsxpackages/astro/src/react/controlComponents.tsxpackages/react/src/components/__tests__/SubscriptionDetailsButton.test.tsxpackages/react/src/components/controlComponents.tsxplayground/browser-extension/src/components/nav-bar.tsxpackages/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.tspackages/nextjs/src/index.tspackages/shared/src/types/index.tsintegration/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.tspackages/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.tspackages/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.tspackages/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
ProtecttoShowis implemented correctly. The admin/not-admin gating logic using both the object shorthand and callback forms of thewhenprop 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
Showimplementation correctly handles allwhencondition 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
Showimplementation correctly addresses the previous review concerns:
- Null handling for
has.valueis now consistent (lines 152-156 checkhasValuebefore 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
Showimplementation is clean and well-structured:
- The
checkAuthorizationhelper nicely encapsulates the function/object condition evaluation- The type narrowing with
Exclude<ShowWhenCondition, 'signedIn' | 'signedOut'>is precise- Logic flow correctly handles all
whencondition types in the right orderpackages/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
whenprop construction- Type reference updates (
ProtectProps→ShowProps)- 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.
| } 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'; | ||
| } | ||
| }; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. There was a problem hiding this 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 bothmember.objectandmember.property, but JSXMemberExpression nodes containJSXIdentifiernodes, notIdentifiernodes. 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.
📒 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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/chrome-extension/docs/clerk-provider.mdpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/chrome-extension/docs/clerk-provider.mdpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly 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 likeOmit,Partial, andPickfor 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
Useconst assertionswithas constfor literal types
Usesatisfiesoperator 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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/react-router-library/src/App.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/react-cra/src/App.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/chrome-extension/docs/clerk-provider.mdpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxintegration/templates/next-app-router/src/app/page.tsxpackages/react/src/components/PlanDetailsButton.tsxintegration/templates/astro-node/src/pages/index.astropackages/astro/src/astro-components/control/ShowCSR.astropackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxintegration/templates/vue-vite/src/views/Home.vueintegration/templates/nuxt-node/app/pages/index.vueintegration/templates/react-router-library/src/App.tsxpackages/astro/src/astro-components/control/ShowSSR.astropackages/react/src/components/SubscriptionDetailsButton.tsxplayground/nextjs/app/app-dir/page.tsxintegration/templates/astro-node/src/pages/billing/checkout-btn.astrointegration/templates/react-cra/src/App.tsxintegration/templates/astro-node/src/pages/react/index.astropackages/upgrade/src/codemods/transform-protect-to-show.cjspackages/nextjs/src/app-router/server/controlComponents.tsxpackages/chrome-extension/docs/clerk-provider.mdpackages/astro/src/react/controlComponents.tsxplayground/expo/App.tsxintegration/templates/next-app-router-quickstart/src/app/page.tsxintegration/templates/react-vite/src/protected/index.tsxintegration/templates/next-app-router/src/app/billing/checkout-btn/page.tsxpackages/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.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxpackages/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.tsxpackages/vue/src/components/controlComponents.tspackages/react/src/components/controlComponents.tsxpackages/react/src/components/SubscriptionDetailsButton.tsxpackages/nextjs/src/app-router/server/controlComponents.tsxpackages/astro/src/react/controlComponents.tsxpackages/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. TheShowWhenConditiontype explicitly includes these kebab-case string literals. Remove the@ts-ignorecomments—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/SignedOuttoShowwithwhenprop 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
Showcomponent API withwhen='signed-in'andwhen='signed-out'patterns.packages/vue/src/components/controlComponents.ts (1)
103-164: LGTM!The
Showcomponent implementation is correct with proper null checks forhas.value(lines 152-156) and comprehensive JSDoc documentation. The authorization logic properly handles allwhenconditions.packages/react/src/components/controlComponents.tsx (1)
52-125: LGTM!The
Showcomponent implementation is clean and correct. ThecheckAuthorizationhelper (lines 117-125) properly centralizes authorization logic, and the component correctly handles allwhencondition variants.packages/astro/src/react/controlComponents.tsx (2)
59-90: LGTM! The Show component implementation is correct.The control flow correctly handles all
whencondition types:
- String shorthands (
'signed-in','signed-out')- Predicate functions receiving
has- Authorization objects passed to
has()The runtime validation for the required
whenprop and hydration-safe loading state handling are appropriate.
95-104: LGTM!The
withClerkHOC 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
whencondition types and properly integrates with the server-sideauth()function. The logic is consistent with the client-side Astro implementation.
| <Show | ||
| when='signed-in' | ||
| client:load | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). | * function BasicSubscriptionDetails() { | ||
| * return ( | ||
| * <SubscriptionDetailsButton /> | ||
| * ); | ||
| * return <SubscriptionDetailsButton />; | ||
| * } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| * 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.
Description
Renaming the
Protectcomponent toShow. Also adjusting how props are passed to it, with a singularwhenprop that accepts a variety of conditions.Removed
SignedInandSignedOutcomponents and replaced them with usages of<Show when="signed-in">etc.Added codemods for these changes
Fixes: USER-3389
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Breaking Changes
Migration Tools
Docs & Tests
✏️ Tip: You can customize this high-level summary in your review settings.