-
Notifications
You must be signed in to change notification settings - Fork 408
fix(shared): Update method return types #7250
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
Conversation
🦋 Changeset detectedLatest commit: fc3e088 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR updates method return type signatures in the Clerk shared package's custom flow APIs, replacing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
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: 0
🧹 Nitpick comments (1)
packages/shared/src/types/signInFuture.ts (1)
1-1: SignInFuture methods now consistently returnPromise<{ error: ClerkError | null }>The added
ClerkErrorimport and the updated signatures for allSignInFutureResourcemethods that expose an error (create,password, allemailCode/emailLink/phoneCode/resetPasswordEmailCodehelpers,sso,mfa.*,ticket,web3,passkey,finalize) are consistent and align this shared type with the implementation and withSignUpFutureResource. This removes the previousunknownerror typing and gives consumers a concrete, uniformClerkError | nullsurface without introducing any apparent inconsistencies in this file.As a low-priority follow-up (not needed for this PR), you might consider extending or linking the JSDoc to briefly describe or reference the
ClerkErrorshape so integrators know what to inspect onerror.Also applies to: 344-488
📜 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 (3)
.changeset/orange-grapes-peel.md(1 hunks)packages/shared/src/types/signInFuture.ts(7 hunks)packages/shared/src/types/signUpFuture.ts(3 hunks)
⏰ 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). (5)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
.changeset/orange-grapes-peel.md (1)
1-5: Changeset entry is properly formatted.The YAML frontmatter, package specification, and description are all correct. The
patchversion bump is appropriate for a type signature fix that corrects API return types without introducing new functionality.Please verify that:
- The related type files (
SignInFutureResourceandSignUpFutureResourceinterfaces) have been updated to returnPromise<{ error: ClerkError | null }>as described in the PR summary.- JSDoc comments in the type definition files have been added or updated, if applicable.
- Tests and builds pass (
pnpm testandpnpm build).Since the actual type file changes are not provided in this review, I recommend running verification scripts to confirm the type updates are consistent across the codebase.
packages/shared/src/types/signUpFuture.ts (1)
1-1: SignUpFuture error typing now consistently reflectsClerkErrorThe new
ClerkErrorimport and the updatedSignUpFutureResourcemethod signatures all align onPromise<{ error: ClerkError | null }>, which matches the described runtime behavior and removes the vagueunknowntyping. The changes look internally consistent acrosscreate,update,verifications.*,password,sso,ticket,web3, andfinalize, with no remaining{ error: unknown }in this interface.Also applies to: 402-458
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
Description
This PR fixes the method return types of our new custom flow APIs, which are declared in two locations. Previously, we updated the method return type on the actual implemented method to
Promise<{ error: ClerkError | null }>, but neglected to update the interface types withinshared/typeswith the new return type.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit