-
Notifications
You must be signed in to change notification settings - Fork 410
feat(clerk-js,clerk-react,nextjs): Export TaskResetPassword component #7314
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?
feat(clerk-js,clerk-react,nextjs): Export TaskResetPassword component #7314
Conversation
🦋 Changeset detectedLatest commit: b14aadd The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
WalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (7)
🧰 Additional context used📓 Path-based instructions (9)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/**/src/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/**/src/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.ts?(x)📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
Files:
**/index.ts📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
Files:
packages/clerk-js/src/ui/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)
Files:
🧬 Code graph analysis (3)packages/clerk-js/src/ui/types.ts (1)
packages/clerk-js/src/ui/lazyModules/components.ts (1)
packages/clerk-js/src/core/clerk.ts (2)
⏰ 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)
🔇 Additional comments (5)
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
!snapshot |
|
Hey @octoper - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
6a02388 to
7c71d40
Compare
0c634f6 to
0c6c23a
Compare
b4c10ab to
f4d8faa
Compare
a3a579a to
54621f2
Compare
|
!snapshot |
|
Hey @octoper - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
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
📜 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.
📒 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.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/clerk-js/sandbox/app.tspackages/shared/src/types/clerk.tspackages/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.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/clerk-js/sandbox/app.tspackages/shared/src/types/clerk.tspackages/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.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/shared/src/types/clerk.tspackages/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/typesinstead of the deprecated@clerk/typesalias
Files:
packages/react/src/components/index.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/clerk-js/sandbox/app.tspackages/shared/src/types/clerk.tspackages/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.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/shared/src/types/clerk.tspackages/react/src/isomorphicClerk.ts
**/*.ts?(x)
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
Files:
packages/react/src/components/index.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/clerk-js/sandbox/app.tspackages/shared/src/types/clerk.tspackages/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
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/react/src/components/index.tspackages/nextjs/src/index.tspackages/nextjs/src/client-boundary/uiComponents.tsxpackages/shared/src/types/appearance.tspackages/clerk-js/src/ui/types.tspackages/react/src/components/uiComponents.tsxpackages/clerk-js/src/core/clerk.tspackages/clerk-js/src/ui/lazyModules/components.tspackages/clerk-js/sandbox/app.tspackages/shared/src/types/clerk.tspackages/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.tspackages/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.tsxpackages/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.tsxpackages/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.tsxpackages/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.tspackages/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 scopeMinor 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 consistentlyAdding
TaskResetPasswordalongsideTaskChooseOrganizationin the explicit./client-boundary/uiComponentsexport 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 exposesTaskResetPasswordThe new
TaskResetPasswordexport from./uiComponentsis 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 ReactTaskResetPasswordexportIncluding
TaskResetPasswordin the re-export set from@clerk/clerk-reactkeeps 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 forTaskResetPasswordis consistentDefining
TaskResetPasswordTheme = Themeand adding ataskResetPassword?: Toverride slot onAppearance<T>mirror the existingTaskChooseOrganizationsetup 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 forTaskResetPasswordmatches existing patterns
TaskResetPasswordis correctly:
- Added to
componentImportPathswith a dedicated chunk name and the expected SessionTasks path.- Exposed via a
lazyexport mirroringTaskChooseOrganization.- Registered in
ClerkComponents, soClerkComponentNameandpreloadComponentwork 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 forTaskResetPasswordis complete and symmetric
- Importing
TaskResetPasswordPropsfrom@clerk/shared/typesand adding it toAvailableComponentPropskeeps the available prop set in sync with the new component.- Defining
TaskResetPasswordCtxand including it inAvailableComponentCtxmirrors the existingTaskChooseOrganizationpattern 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
TaskResetPasswordfollows the established pattern used byTaskChooseOrganizationand 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/typesfor the import, following the coding guidelines that prefer this over the deprecated@clerk/typesalias.
700-727: LGTM!The
TaskResetPasswordcomponent implementation correctly follows the established pattern used byTaskChooseOrganization. The component:
- Uses the
withClerkHOC with proper configuration- Implements fallback rendering with
useWaitForComponentMount- Correctly wires up mount/unmount to the Clerk API
- Handles props updates via
__unstable__updatePropspackages/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
mountTaskResetPasswordandunmountTaskResetPasswordimplementations correctly follow the mounting pattern used by other components. The absence of feature-gate checks (unlikeTaskChooseOrganization) is appropriate since password reset doesn't require a specific feature flag like organizations do.Key aspects verified:
assertComponentsReadyis called firstensureMounteduses the correctpreloadHint: 'TaskResetPassword'mountComponentusesappearanceKey: 'taskResetPassword'(correct camelCase convention)- Telemetry is recorded via
eventPrebuiltComponentMountedpackages/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.
…elated functionality
…ity in IsomorphicClerk
chore(repo): Add changeset
…eys and delete withTaskGuard HOC
…d to mountTaskResetPassword for clarity
802e277 to
b14aadd
Compare
Description
Exports the new standalone
<TaskResetPassword/>component forreset-passwordsession taskChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.