feat(expo): Chris/mobile 405 react native components release#7843
feat(expo): Chris/mobile 405 react native components release#7843chriscanin wants to merge 33 commits intomainfrom
Conversation
- Implemented UserButton component to open UserProfileView on press. - Created UserProfile component for comprehensive profile management. - Integrated native ClerkExpo module for iOS functionality. - Updated ClerkProvider to configure Clerk iOS SDK. - Added exports for new components in the native index file. - Adjusted TypeScript configuration to include additional files. - Modified build process to temporarily skip declaration generation. - Updated dependencies in pnpm-lock.yaml for compatibility.
…d ClerkViewFactory
…ge-ios-to-a-native-module-that-is-available-in-the-expo
…profile management
…ge-android-to-a-native-module-that-is-available-in-the
…ling and UI presentation - Consolidated Clerk SDK initialization and session management in ClerkExpoModule. - Removed ClerkProfileActivity and replaced it with ClerkUserProfileActivity for better clarity and functionality. - Introduced ClerkViewFactory to manage creation of intents for authentication and user profile activities. - Enhanced error handling and promise management for asynchronous operations. - Updated SignIn and UserProfile components to synchronize native and JS session states effectively. - Improved user experience by ensuring the auth modal is always presented, allowing native UI to manage signed-in state. - Added backward-compatible wrappers for SignedIn and SignedOut components.
…and improved session handling
- Updated `clerk-android` versions in `build.gradle` to `0.1.30` for API and `0.1.4` for UI. - Added Kotlin metadata version check skip to address compatibility issues. - Introduced packaging exclusions for duplicate META-INF files in Android. - Enhanced `ClerkAuthActivity` to improve session handling and logging. - Updated `ClerkExpoModule` to include detailed logging for session retrieval. - Improved `ClerkUserProfileActivity` to handle sign-out detection and logging. - Refined `SignIn` and `UserProfile` components to prevent duplicate auth callbacks and improve user state management. - Added packaging exclusions in the Expo config plugin for Android to resolve dependency conflicts.
- Introduced AuthView component to handle sign-in and sign-up using native UI. - Added AuthView types for better type safety. - Removed deprecated SignIn component and its types. - Updated UserButton and UserProfileView components with enhanced documentation. - Refactored ClerkProvider to sync native sessions with JS SDK. - Adjusted TypeScript configurations for improved declaration generation.
…lement crash in React Native
… state management
- packages/expo/package.json: merge new exports (./types) and file entries (google, apple) - packages/expo/src/hooks/index.ts: use main's standard re-exports for useSignIn/useSignUp/useWaitlist - packages/expo/src/provider/singleton/createClerkInstance.ts: use @clerk/clerk-js import (not headless subpath) - packages/react/src/isomorphicClerk.ts: use main's ClerkUI loading pattern via options.ui
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 5aebb5e The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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 |
|
@coderabbitai so.... maybe go back through the over 30 comments you have left in this conversation, and mark the ones as resolved that are resolved, otherwise please post them again here at the bottom. This is not really the best system if you cannot go back through and validate what has been fixed. Please do so, otherwise this will have been a huge waste of my time. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
🏁 Script executed: Length of output: 16985
🏁 Script executed: Length of output: 1681 🏁 Script executed: Length of output: 2198 🏁 Script executed: Length of output: 5672 🏁 Script executed: Length of output: 3198 🏁 Script executed: Length of output: 6477 🏁 Script executed: Length of output: 5465 🏁 Script executed: Length of output: 4452
✅ Issues Addressed (8/22)
❌ Issues Still Present (14/22)High Priority
Medium Priority
Would you like me to create issues for the remaining items, or would you prefer to address them in this PR? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 0 🏁 Script executed: Length of output: 86067
🏁 Script executed: Length of output: 2423 🏁 Script executed: Length of output: 3305 🏁 Script executed: Length of output: 3566 🏁 Script executed: Length of output: 1347 🏁 Script executed: Length of output: 3253 🏁 Script executed: Length of output: 49718
✅ Resolved Issues (8)Successfully marked these as addressed:
❌ Critical Issues Remaining (16)🔴 Blocking Android/iOS functionality:
🟠 Cross-platform session sync failures:
🟡 Build/plugin failures:
🔵 Minor issues:
Bottom line: Most of the critical path is broken. Android Would you like me to provide specific fix suggestions for any of these? |
ClerkViewFactory.swift (iOS): - Add completionCalled guard to ClerkAuthWrapperViewController to prevent double completion calls (#10 - double completion on rapid events) - Add same completionCalled guard to ClerkProfileWrapperViewController InlineAuthView.tsx: - Move authCompletedRef.current = true after successful sync instead of before, allowing retries on transient failures (#7 - authCompletedRef set too early) ClerkProvider.tsx: - Normalize Android session shape in polling: handle both { sessionId } (iOS) and { session: { id } } (Android) (#6 - polling shape mismatch)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/expo/src/provider/ClerkProvider.tsx`:
- Around line 165-183: The current logic sets sessionSyncedRef.current = true
before awaiting clerkInstance.setActive, which prevents retries if setActive
fails; move the assignment so it only runs after a successful await of
clerkInstance.setActive (i.e., call and await clerkInstance.setActive({ session:
pendingSession }) first, then set sessionSyncedRef.current = true), and keep the
try/catch around the setActive call so that on error sessionSyncedRef remains
false and the code path can retry; references: sessionSyncedRef,
pendingNativeSessionRef, clerkInstance.setActive,
clerkAny.__internal_reloadInitialResources.
|
@coderabbitai Fully reevaluate the PR with fresh eyes and context. The evaluations you have provided in the past have been resolved, but you are failing to reevaluate and mark them as resolved (or unresolved), and you are then providing false positives for issues, and additional issues not mentioned previously. All previous conversations have been marked as resolved, regardless of resolution or not, so do not rely on these for any information. Please reevaluate the entire PR fresh, fresh context please. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 5260 🏁 Script executed: Length of output: 7044 🏁 Script executed: Length of output: 9523 🏁 Script executed: Length of output: 6226 🏁 Script executed: Length of output: 2469 🏁 Script executed: Length of output: 1819 🏁 Script executed: Length of output: 5313 🏁 Script executed: Length of output: 2785 🏁 Script executed: Length of output: 2679 🏁 Script executed: Length of output: 997 🏁 Script executed: Length of output: 1337
✅ Code Quality - Excellent ImplementationThe implementation is generally very well done. Most of the architecture is solid:
|
package.json: - Add app.plugin.d.ts to files array so TypeScript declarations are published to npm (#1 - TypeScript declarations won't be published) ios/ClerkViewFactory.swift (fallback): - Fix return type mismatch: createAuthView and createUserProfileView now return UIViewController? (matching protocol) instead of UIView? (#2 - iOS return type mismatch) - Return hostingController instead of hostingController.view to preserve SwiftUI lifecycle when used as child view controller - Add completionCalled guard with completeOnce() to both Auth and Profile wrapper view controllers (align with template) - Remove PII logging (print/NSLog statements with user data) Note: Issue #3 (Android mode parameter) is a false positive — the clerk-android AuthView composable signature is `fun AuthView(modifier: Modifier, clerkTheme: ClerkTheme?)` and does not accept a mode parameter. The SDK auto-determines the auth flow.
|
@coderabbitai I just pushed fixes for these 3 issues, please reevaluate. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1488 🏁 Script executed: Length of output: 2099 🏁 Script executed: Length of output: 1911
✅ Issue 1: TypeScript Declarations - FIXED
"files": [
"dist",
"android",
"ios",
// ...
"app.plugin.js",
"app.plugin.d.ts" // ✓ Added
]TypeScript consumers will now receive type definitions for the plugin when installing from npm. ✅ Issue 2: iOS Return Types - FIXEDBoth inline view methods now correctly return
public func createAuthView(
mode: String,
dismissable: Bool,
onEvent: `@escaping` (String, [String: Any]) -> Void
) -> UIViewController? { // ✓ Correct return type
let hostingController = UIHostingController(...)
return hostingController // ✓ Returns controller, not .view
}
public func createUserProfileView(
dismissable: Bool,
onEvent: `@escaping` (String, [String: Any]) -> Void
) -> UIViewController? { // ✓ Correct return type
let hostingController = UIHostingController(...)
return hostingController // ✓ Returns controller, not .view
}The signatures now match the ✅ Issue 3: Android Mode Parameter - FALSE POSITIVEYour commit message correctly explains this:
The Android Clerk SDK's SummaryAll issues are resolved:
The PR is in excellent shape. Great work addressing the feedback! 🎉 |
|
!snapshot |
|
Hey @chriscanin - 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/agent-toolkit@0.3.0-snapshot.v20260213191703 --save-exact
npm i @clerk/astro@3.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/backend@3.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/chrome-extension@3.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/clerk-js@6.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/dev-cli@1.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/expo@3.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/express@2.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/fastify@2.7.0-snapshot.v20260213191703 --save-exact
npm i @clerk/localizations@4.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/msw@0.0.1-snapshot.v20260213191703 --save-exact
npm i @clerk/nextjs@7.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/nuxt@2.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/react@6.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/react-router@3.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/shared@4.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/testing@2.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/ui@1.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/upgrade@2.0.0-snapshot.v20260213191703 --save-exact
npm i @clerk/vue@2.0.0-snapshot.v20260213191703 --save-exact |
The isConstructor() check already narrows the type, making the `!` assertion on this.options.Clerk redundant. Removing it fixes the @typescript-eslint/no-non-null-assertion lint error.
- Fix import sorting across 7 files (simple-import-sort/imports) - Use type-only imports where required (consistent-type-imports) - Add eslint-disable for conditional require() calls that cannot be static imports (no-require-imports) - Remove unused catch variables (no-unused-vars) - Add curly braces to single-line if-returns (curly) - Remove unnecessary non-null assertions (no-non-null-assertion)
|
!snapshot |
|
Hey @chriscanin - 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/agent-toolkit@0.3.0-snapshot.v20260213202659 --save-exact
npm i @clerk/astro@3.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/backend@3.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/chrome-extension@3.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/clerk-js@6.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/dev-cli@1.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/expo@3.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/express@2.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/fastify@2.7.0-snapshot.v20260213202659 --save-exact
npm i @clerk/localizations@4.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/msw@0.0.1-snapshot.v20260213202659 --save-exact
npm i @clerk/nextjs@7.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/nuxt@2.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/react@6.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/react-router@3.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/shared@4.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/testing@2.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/ui@1.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/upgrade@2.0.0-snapshot.v20260213202659 --save-exact
npm i @clerk/vue@2.0.0-snapshot.v20260213202659 --save-exact |
Description
These changes can be tested by using the snapshot that will be commented in this PR discussion, and installing that into the expo quickstart repo on the branch:
chris/mobile-343-bridge-android-to-a-native-module-that-is-available-in-the(same branch name as here).
https://linear.app/clerk/issue/MOBILE-342/bridge-ios-to-a-native-module-that-is-available-in-the-expo-sdk
MOBILE-289
https://linear.app/clerk/issue/MOBILE-289/expo-google-universal-sign-in
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores