Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Nov 25, 2025

Description

Exports the new standalone <TaskResetPassword/> component for reset-password session task

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features
    • Introduces a TaskResetPassword component to guide users through password reset flows.
    • Adds mount/unmount APIs to control the component's visibility and lifecycle programmatically.
    • Adds appearance theme overrides to customize the component's styling.
    • Makes the component available across Clerk JavaScript, React, and Next.js integrations.

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2025

🦋 Changeset detected

Latest commit: b14aadd

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

Adds a new TaskResetPassword UI component across packages, including mount/unmount APIs, lazy loading, pre-mount/hydration support, type and appearance updates, and public re-exports and sandbox routing.

Changes

Cohort / File(s) Summary
Versioning
\.changeset/modern-coins-camp.md
Bumps minor versions for @clerk/clerk-js, @clerk/nextjs, @clerk/clerk-react, and @clerk/shared.
Core API & Runtime
packages/clerk-js/src/core/clerk.ts, packages/clerk-js/sandbox/app.ts
Adds mountTaskResetPassword / unmountTaskResetPassword to Clerk core; records telemetry; registers route /task-reset-password and adds taskResetPassword to sandbox AVAILABLE_COMPONENTS and component controls.
Lazy UI Module
packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/types.ts
Adds lazily-loaded TaskResetPassword entry, exports it in ClerkComponents, and includes TaskResetPasswordProps in AvailableComponentProps union.
React UI Components
packages/react/src/components/uiComponents.tsx, packages/react/src/components/index.ts
Introduces TaskResetPassword React component (withClerk wrapper) and re-exports it from components index.
Isomorphic / Hydration Support
packages/react/src/isomorphicClerk.ts
Adds premount map for TaskResetPassword, hydration-time mounting logic, and public mountTaskResetPassword / unmountTaskResetPassword APIs that either premount or invoke clerk-js when available.
Shared Types & Appearance
packages/shared/src/types/appearance.ts, packages/shared/src/types/clerk.ts
Adds taskResetPassword?: T to Appearance<T> and declares mountTaskResetPassword / unmountTaskResetPassword on the Clerk interface.
Next.js Exports
packages/nextjs/src/client-boundary/uiComponents.tsx, packages/nextjs/src/index.ts
Re-exports TaskResetPassword through Next.js package public surface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review areas requiring attention:
    • packages/react/src/isomorphicClerk.ts: premount map lifecycle, hydration ordering, and concurrency/race conditions during clerk-js load.
    • packages/clerk-js/src/core/clerk.ts: verify mounting/unmounting implementation, preloadHint usage, and telemetry event consistency.
    • Type surface: ensure TaskResetPasswordProps is consistently imported/used across clerk-js, react, and shared packages.
    • Lazy loading export (packages/clerk-js/src/ui/lazyModules/components.ts): dynamic import path correctness and inclusion in ClerkComponents type.

Poem

🐰 A little rabbit hops to say hello,
A reset task planted where the forms all grow,
Mounting, pre-mounting, then unmount on cue,
Themes tucked in pockets and exports through and through 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: exporting a new TaskResetPassword component across clerk-js, clerk-react, and nextjs packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task-export-components

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 359cb33 and b14aadd.

📒 Files selected for processing (12)
  • .changeset/modern-coins-camp.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (3 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (3 hunks)
  • packages/clerk-js/src/ui/types.ts (1 hunks)
  • packages/nextjs/src/client-boundary/uiComponents.tsx (1 hunks)
  • packages/nextjs/src/index.ts (1 hunks)
  • packages/react/src/components/index.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (2 hunks)
  • packages/react/src/isomorphicClerk.ts (4 hunks)
  • packages/shared/src/types/appearance.ts (1 hunks)
  • packages/shared/src/types/clerk.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • .changeset/modern-coins-camp.md
  • packages/shared/src/types/appearance.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/react/src/isomorphicClerk.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/shared/src/types/clerk.ts
  • packages/clerk-js/sandbox/app.ts
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • packages/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.ts
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.ts
**/*.{ts,tsx,js,jsx}

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

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

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • packages/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.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/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.ts
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.ts
**/*.{ts,tsx}

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

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

Files:

  • packages/nextjs/src/index.ts
  • packages/react/src/components/index.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/src/core/clerk.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/nextjs/src/index.ts
  • packages/react/src/components/index.ts
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should be written in camelCase
Use useCardState for card-level state management
Use useFormState for form-level state management
Use useLoadingStatus for managing loading states
Use useFormControl hook for form field state management with validation and localization support
All rendered values must be localized using useLocalizations hook - hard coded values are not allowed
Use localizationKeys for translating UI text with support for parameters and error messages
Use handleError utility for API error handling and provide field states for proper error mapping
Use the styled system sx prop with theme tokens for custom styling instead of inline styles
Use the Card component pattern with Card.Root, Card.Header, Card.Title, Card.Content, and Card.Footer for consistent card layouts
Use FormContainer with headerTitle and headerSubtitle localization keys combined with Form.Root and FormButtons for consistent form layouts
When form submission occurs, manage loading and error states by calling status.setLoading(), card.setLoading(), and card.setError() appropriately

Files:

  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
🧬 Code graph analysis (3)
packages/clerk-js/src/ui/types.ts (1)
packages/shared/src/types/clerk.ts (2)
  • TaskChooseOrganizationProps (2255-2261)
  • TaskResetPasswordProps (2263-2269)
packages/clerk-js/src/ui/lazyModules/components.ts (1)
packages/react/src/components/uiComponents.tsx (1)
  • TaskResetPassword (701-727)
packages/clerk-js/src/core/clerk.ts (2)
packages/shared/src/types/clerk.ts (1)
  • TaskResetPasswordProps (2263-2269)
packages/shared/src/telemetry/events/component-mounted.ts (1)
  • eventPrebuiltComponentMounted (69-75)
⏰ 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). (3)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
packages/react/src/components/index.ts (1)

12-12: TaskResetPassword export matches existing React UI component pattern.

The new named export is consistent with surrounding entries and keeps the tree‑shakable, explicit export style from ./uiComponents.

packages/clerk-js/src/ui/types.ts (1)

62-63: Task type unions look coherent with existing component/type model.*

Adding TaskChooseOrganizationProps and TaskResetPasswordProps to AvailableComponentProps, and the corresponding TaskChooseOrganizationCtx / TaskResetPasswordCtx entries to AvailableComponentCtx, keeps prop and context unions in sync with the new components’ componentName literals.

Also applies to: 149-155, 189-189

packages/nextjs/src/index.ts (1)

38-38: Next.js public export for TaskResetPassword is correctly wired.

The new TaskResetPassword re‑export from ./client-boundary/uiComponents follows the explicit export pattern required for the App Router and mirrors the React components surface.

packages/clerk-js/src/ui/lazyModules/components.ts (1)

26-27: Lazy loading and registration of TaskResetPassword align with existing Task components.*

componentImportPaths.TaskResetPassword, the TaskResetPassword lazy export, and its addition to ClerkComponents mirror the established TaskChooseOrganization pattern (matching key names, chunk name, and export style), so preloading and mounting should behave consistently.

Also applies to: 128-130, 181-181

packages/clerk-js/src/core/clerk.ts (1)

88-88: mountTaskResetPassword/unmountTaskResetPassword follow existing mounting conventions.

The new TaskResetPasswordProps import and the mountTaskResetPassword / unmountTaskResetPassword methods are consistent with other prebuilt component mounts: they assert component readiness, use ensureMounted with preloadHint: 'TaskResetPassword', pass the correct name and appearanceKey: 'taskResetPassword', and record a eventPrebuiltComponentMounted telemetry event. Optional: if you’re keeping inline docs in sync, consider adding a brief JSDoc block for these new public APIs similar to other documented methods in this class. As per coding guidelines, public APIs should be documented with JSDoc.

Also applies to: 1428-1446


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

@vercel
Copy link

vercel bot commented Nov 25, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Dec 2, 2025 6:50am

@octoper octoper changed the title feat(clerk-js,react,nextjs): Export TaskResetPassword components feat(clerk-js,react,nextjs): Export TaskResetPassword component Nov 25, 2025
@octoper octoper changed the title feat(clerk-js,react,nextjs): Export TaskResetPassword component feat(clerk-js,clerk-react,nextjs): Export TaskResetPassword component Nov 25, 2025
@octoper
Copy link
Member Author

octoper commented Nov 25, 2025

!snapshot

@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/agent-toolkit 0.2.5-snapshot.v20251125223005
@clerk/astro 2.16.3-snapshot.v20251125223005
@clerk/backend 2.24.0-snapshot.v20251125223005
@clerk/chrome-extension 2.8.5-snapshot.v20251125223005
@clerk/clerk-js 5.110.0-snapshot.v20251125223005
@clerk/elements 0.23.86-snapshot.v20251125223005
@clerk/clerk-expo 2.19.5-snapshot.v20251125223005
@clerk/expo-passkeys 0.4.22-snapshot.v20251125223005
@clerk/express 1.7.53-snapshot.v20251125223005
@clerk/fastify 2.6.5-snapshot.v20251125223005
@clerk/localizations 3.29.0-snapshot.v20251125223005
@clerk/nextjs 6.35.5-snapshot.v20251125223005
@clerk/nuxt 1.13.3-snapshot.v20251125223005
@clerk/clerk-react 5.57.0-snapshot.v20251125223005
@clerk/react-router 2.2.5-snapshot.v20251125223005
@clerk/remix 4.13.20-snapshot.v20251125223005
@clerk/shared 3.36.0-snapshot.v20251125223005
@clerk/tanstack-react-start 0.27.5-snapshot.v20251125223005
@clerk/testing 1.13.19-snapshot.v20251125223005
@clerk/themes 2.4.40-snapshot.v20251125223005
@clerk/types 4.101.3-snapshot.v20251125223005
@clerk/vue 1.17.0-snapshot.v20251125223005

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

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/vue

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

@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task branch from 6a02388 to 7c71d40 Compare November 26, 2025 17:48
@LauraBeatris LauraBeatris force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task branch from 0c634f6 to 0c6c23a Compare November 26, 2025 23:22
@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task branch from b4c10ab to f4d8faa Compare November 28, 2025 15:00
Base automatically changed from vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task to main November 28, 2025 18:57
@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task-export-components branch from a3a579a to 54621f2 Compare November 28, 2025 19:14
@octoper
Copy link
Member Author

octoper commented Dec 1, 2025

!snapshot

@octoper octoper marked this pull request as ready for review December 1, 2025 17:13
@octoper octoper self-assigned this Dec 1, 2025
@clerk-cookie
Copy link
Collaborator

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

Package Version
@clerk/agent-toolkit 0.2.6-snapshot.v20251201171410
@clerk/astro 2.16.4-snapshot.v20251201171410
@clerk/backend 2.25.0-snapshot.v20251201171410
@clerk/chrome-extension 2.8.7-snapshot.v20251201171410
@clerk/clerk-js 5.112.0-snapshot.v20251201171410
@clerk/elements 0.23.87-snapshot.v20251201171410
@clerk/clerk-expo 2.19.7-snapshot.v20251201171410
@clerk/expo-passkeys 0.4.23-snapshot.v20251201171410
@clerk/express 1.7.54-snapshot.v20251201171410
@clerk/fastify 2.6.6-snapshot.v20251201171410
@clerk/localizations 3.29.0-snapshot.v20251201171410
@clerk/nextjs 6.36.0-snapshot.v20251201171410
@clerk/nuxt 1.13.4-snapshot.v20251201171410
@clerk/clerk-react 5.58.0-snapshot.v20251201171410
@clerk/react-router 2.3.1-snapshot.v20251201171410
@clerk/remix 4.13.21-snapshot.v20251201171410
@clerk/shared 3.37.0-snapshot.v20251201171410
@clerk/tanstack-react-start 0.27.6-snapshot.v20251201171410
@clerk/testing 1.13.20-snapshot.v20251201171410
@clerk/themes 2.4.41-snapshot.v20251201171410
@clerk/types 4.101.4-snapshot.v20251201171410
@clerk/vue 1.17.1-snapshot.v20251201171410

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

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/vue

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d4aef71 and 359cb33.

📒 Files selected for processing (12)
  • .changeset/modern-coins-camp.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (3 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (3 hunks)
  • packages/clerk-js/src/ui/types.ts (1 hunks)
  • packages/nextjs/src/client-boundary/uiComponents.tsx (1 hunks)
  • packages/nextjs/src/index.ts (1 hunks)
  • packages/react/src/components/index.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (2 hunks)
  • packages/react/src/isomorphicClerk.ts (4 hunks)
  • packages/shared/src/types/appearance.ts (1 hunks)
  • packages/shared/src/types/clerk.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • packages/react/src/components/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/sandbox/app.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/react/src/components/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/sandbox/app.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.ts
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/react/src/components/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.ts
**/*.{ts,tsx,js,jsx}

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

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

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • packages/react/src/components/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/sandbox/app.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.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/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.ts
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/react/src/components/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/sandbox/app.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.ts
**/*.{ts,tsx}

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

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

Files:

  • packages/react/src/components/index.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/shared/src/types/appearance.ts
  • packages/clerk-js/src/ui/types.ts
  • packages/react/src/components/uiComponents.tsx
  • packages/clerk-js/src/core/clerk.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
  • packages/clerk-js/sandbox/app.ts
  • packages/shared/src/types/clerk.ts
  • packages/react/src/isomorphicClerk.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/react/src/components/index.ts
  • packages/nextjs/src/index.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:

  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/react/src/components/uiComponents.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/react/src/components/uiComponents.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:

  • packages/nextjs/src/client-boundary/uiComponents.tsx
  • packages/react/src/components/uiComponents.tsx
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should be written in camelCase
Use useCardState for card-level state management
Use useFormState for form-level state management
Use useLoadingStatus for managing loading states
Use useFormControl hook for form field state management with validation and localization support
All rendered values must be localized using useLocalizations hook - hard coded values are not allowed
Use localizationKeys for translating UI text with support for parameters and error messages
Use handleError utility for API error handling and provide field states for proper error mapping
Use the styled system sx prop with theme tokens for custom styling instead of inline styles
Use the Card component pattern with Card.Root, Card.Header, Card.Title, Card.Content, and Card.Footer for consistent card layouts
Use FormContainer with headerTitle and headerSubtitle localization keys combined with Form.Root and FormButtons for consistent form layouts
When form submission occurs, manage loading and error states by calling status.setLoading(), card.setLoading(), and card.setError() appropriately

Files:

  • packages/clerk-js/src/ui/types.ts
  • packages/clerk-js/src/ui/lazyModules/components.ts
🧬 Code graph analysis (4)
packages/react/src/components/uiComponents.tsx (7)
packages/nextjs/src/index.ts (1)
  • TaskResetPassword (38-38)
packages/clerk-js/src/ui/lazyModules/components.ts (1)
  • TaskResetPassword (128-130)
packages/nextjs/src/client-boundary/uiComponents.tsx (1)
  • TaskResetPassword (26-26)
packages/react/src/components/index.ts (1)
  • TaskResetPassword (12-12)
packages/astro/src/react/utils.tsx (1)
  • withClerk (16-43)
packages/shared/src/types/clerk.ts (1)
  • TaskResetPasswordProps (2263-2269)
packages/react/src/utils/useWaitForComponentMount.ts (1)
  • useWaitForComponentMount (71-102)
packages/clerk-js/src/core/clerk.ts (2)
packages/shared/src/types/clerk.ts (1)
  • TaskResetPasswordProps (2263-2269)
packages/shared/src/telemetry/events/component-mounted.ts (1)
  • eventPrebuiltComponentMounted (69-75)
packages/clerk-js/src/ui/lazyModules/components.ts (4)
packages/nextjs/src/index.ts (1)
  • TaskResetPassword (38-38)
packages/nextjs/src/client-boundary/uiComponents.tsx (1)
  • TaskResetPassword (26-26)
packages/react/src/components/index.ts (1)
  • TaskResetPassword (12-12)
packages/react/src/components/uiComponents.tsx (1)
  • TaskResetPassword (701-727)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • TaskResetPasswordProps (2263-2269)
🔇 Additional comments (15)
.changeset/modern-coins-camp.md (1)

1-8: Changeset metadata matches the feature scope

Minor bumps for all affected packages and the description align with introducing <TaskResetPassword/> as a new public task component. No issues here.

packages/nextjs/src/index.ts (1)

23-43: Next.js entrypoint export is wired consistently

Adding TaskResetPassword alongside TaskChooseOrganization in the explicit ./client-boundary/uiComponents export list follows the existing pattern and remains tree‑shaking friendly. No further changes needed.

packages/react/src/components/index.ts (1)

1-17: React components index correctly exposes TaskResetPassword

The new TaskResetPassword export from ./uiComponents is consistent with how other task/UI components are surfaced. Looks good.

packages/nextjs/src/client-boundary/uiComponents.tsx (1)

14-30: Next.js client-boundary now correctly mirrors React TaskResetPassword export

Including TaskResetPassword in the re-export set from @clerk/clerk-react keeps the Next.js client boundary aligned with the React package’s public UI components. No additional changes required.

packages/shared/src/types/appearance.ts (1)

1041-1048: Theming extension for TaskResetPassword is consistent

Defining TaskResetPasswordTheme = Theme and adding a taskResetPassword?: T override slot on Appearance<T> mirror the existing TaskChooseOrganization setup and keep theming consistent across components. Looks good.

Also applies to: 1123-1131

packages/clerk-js/src/ui/lazyModules/components.ts (1)

24-27: Lazy loader wiring for TaskResetPassword matches existing patterns

TaskResetPassword is correctly:

  • Added to componentImportPaths with a dedicated chunk name and the expected SessionTasks path.
  • Exposed via a lazy export mirroring TaskChooseOrganization.
  • Registered in ClerkComponents, so ClerkComponentName and preloadComponent work as expected.

No changes needed here.

Also applies to: 128-130, 181-182

packages/clerk-js/src/ui/types.ts (1)

1-27: Type plumbing for TaskResetPassword is complete and symmetric

  • Importing TaskResetPasswordProps from @clerk/shared/types and adding it to AvailableComponentProps keeps the available prop set in sync with the new component.
  • Defining TaskResetPasswordCtx and including it in AvailableComponentCtx mirrors the existing TaskChooseOrganization pattern and ensures correct typing for session task rendering.

Everything here looks consistent with the existing UI type system.

Also applies to: 45-64, 149-190

packages/clerk-js/sandbox/app.ts (1)

40-40: LGTM!

The sandbox integration for TaskResetPassword follows the established pattern used by TaskChooseOrganization and other components. The component registration, controls, and route handler are all consistent with existing implementations.

Also applies to: 103-103, 357-364

packages/react/src/components/uiComponents.tsx (2)

12-12: LGTM!

Good use of @clerk/shared/types for the import, following the coding guidelines that prefer this over the deprecated @clerk/types alias.


700-727: LGTM!

The TaskResetPassword component implementation correctly follows the established pattern used by TaskChooseOrganization. The component:

  • Uses the withClerk HOC with proper configuration
  • Implements fallback rendering with useWaitForComponentMount
  • Correctly wires up mount/unmount to the Clerk API
  • Handles props updates via __unstable__updateProps
packages/clerk-js/src/core/clerk.ts (2)

88-88: LGTM!

Import correctly added alongside other type imports from @clerk/shared/types.


1428-1446: LGTM!

The mountTaskResetPassword and unmountTaskResetPassword implementations correctly follow the mounting pattern used by other components. The absence of feature-gate checks (unlike TaskChooseOrganization) is appropriate since password reset doesn't require a specific feature flag like organizations do.

Key aspects verified:

  • assertComponentsReady is called first
  • ensureMounted uses the correct preloadHint: 'TaskResetPassword'
  • mountComponent uses appearanceKey: 'taskResetPassword' (correct camelCase convention)
  • Telemetry is recorded via eventPrebuiltComponentMounted
packages/react/src/isomorphicClerk.ts (3)

51-51: LGTM!

Import correctly added alongside other type imports from @clerk/shared/types.


154-154: LGTM!

The premount nodes Map follows the established pattern used by other components.


680-682: LGTM!

Hydration support correctly iterates over premounted nodes and mounts them once ClerkJS is loaded.

@octoper octoper force-pushed the vaggelis/user-4002-implement-the-aio-components-new-flow-and-session-task-export-components branch from 802e277 to b14aadd Compare December 2, 2025 06:49
@octoper octoper marked this pull request as ready for review December 2, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants