-
Notifications
You must be signed in to change notification settings - Fork 382
fix(clerk-expo): Re-export useReverification
hook
#6182
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: c693a5f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 Git ↗︎
|
useReverification
hook
📝 WalkthroughWalkthroughThis change introduces a re-export of the Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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/backend/src/mock-server.ts (1)
22-22
: Consider improving type safety for error responses.The
as unknown as ResponseBodyType
pattern bypasses TypeScript's type checking and may lead to runtime issues if callers expect the genericResponseBodyType
structure but receive error objects witherror
andmessage
properties.Consider defining a proper error response type:
+type ErrorResponse = { + error: string; + message: string; +}; + +type ApiResponse<T> = T | ErrorResponse; export function validateHeaders< Params extends PathParams, RequestBodyType extends DefaultBodyType, - ResponseBodyType extends DefaultBodyType, + ResponseBodyType extends DefaultBodyType, >( - resolver: HttpResponseResolver<Params, RequestBodyType, ResponseBodyType>, -): HttpResponseResolver<Params, RequestBodyType, ResponseBodyType> { + resolver: HttpResponseResolver<Params, RequestBodyType, ResponseBodyType>, +): HttpResponseResolver<Params, RequestBodyType, ApiResponse<ResponseBodyType>> {This approach provides better type safety and makes the error response structure explicit.
Also applies to: 31-31, 40-40
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.changeset/fair-ways-create.md
(1 hunks)packages/backend/src/mock-server.ts
(3 hunks)packages/expo/src/hooks/index.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
`**/*.{js,ts,tsx,jsx}`: All code must pass ESLint checks with the project's configuration. Use Prettier for consistent code formatting.
**/*.{js,ts,tsx,jsx}
: All code must pass ESLint checks with the project's configuration.
Use Prettier for consistent code formatting.
packages/expo/src/hooks/index.ts
packages/backend/src/mock-server.ts
`**/*.{ts,tsx}`: Maintain comprehensive JSDoc comments for public APIs.
**/*.{ts,tsx}
: Maintain comprehensive JSDoc comments for public APIs.
packages/expo/src/hooks/index.ts
packages/backend/src/mock-server.ts
`packages/**`: All publishable packages under the @clerk namespace must be located in the packages/ directory.
packages/**
: All publishable packages under the @clerk namespace must be located in the packages/ directory.
packages/expo/src/hooks/index.ts
packages/backend/src/mock-server.ts
`**/index.ts`: Use index.ts files for clean imports but avoid deep barrel exports.
**/index.ts
: Use index.ts files for clean imports but avoid deep barrel exports.
packages/expo/src/hooks/index.ts
`**/*.ts`: Always define explicit return types for functions, especially public APIs. Use proper type annotations for variables and parameters where inference isn't clear. Avoid `a...
**/*.ts
: Always define explicit return types for functions, especially public APIs.
Use proper type annotations for variables and parameters where inference isn't clear.
Avoidany
type; preferunknown
when type is uncertain, then narrow with type guards.
Useinterface
for object shapes that might be extended; usetype
for unions, primitives, and computed types.
Preferreadonly
properties for immutable data structures.
Useprivate
for internal implementation details,protected
for inheritance, andpublic
explicitly for clarity in public APIs.
Prefer composition and interfaces over deep inheritance chains; use mixins for shared behavior.
Use ES6 imports/exports consistently; avoid barrel files (index.ts re-exports) to prevent circular dependencies.
Use type-only imports (import type { ... }) where possible.
Useas const
for literal types and thesatisfies
operator for type checking without widening.
Enable--incremental
and--tsBuildInfoFile
for faster builds.
Use ESLint with @typescript-eslint/recommended rules and Prettier for formatting.
Use lint-staged and Husky for pre-commit checks.
Use type-coverage to measure type safety.
packages/expo/src/hooks/index.ts
packages/backend/src/mock-server.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
packages/expo/src/hooks/index.ts (1)
11-11
: ```shell
#!/bin/bashCheck how hooks are re-exported from the main entry point in @clerk/clerk-react
List all export statements in the React package entrypoint
rg -n "^export" packages/react/src/index.ts
Specifically look for wildcard exports from hooks
rg -n "from './hooks'" packages/react/src/index.ts
</details> <details> <summary>.changeset/fair-ways-create.md (1)</summary> `1-6`: **LGTM! Changeset properly documents the update.** The changeset correctly identifies this as a minor version bump for `@clerk/clerk-expo` and accurately describes the re-export of the `useReverification` hook. The format follows changeset conventions. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@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: |
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.
Looks good, but we should probably start snapshoting the public API being exported from this package
@jacekradko Agreed. I tried, but it was having issues with Expo so I punted for the time being. |
Description
Re-export
useReverification
hook from@clerk/clerk-react
USER-2128
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit
New Features
useReverification
hook for use in Expo projects.Documentation
useReverification
hook.Refactor