feat(expo): Move Google Sign to a separate package#9015
Conversation
🦋 Changeset detectedLatest commit: 01dae50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughNative Google Sign-In functionality is extracted from ChangesGoogle Sign-In package extraction
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant App
participant ClerkExpoGoogle as "`@clerk/expo/google`"
participant ClerkGoogleSignIn as "`@clerk/expo-google-signin`"
App->>ClerkExpoGoogle: import useSignInWithGoogle
ClerkExpoGoogle->>ClerkGoogleSignIn: re-export useSignInWithGoogle
ClerkGoogleSignIn-->>App: provide hook implementation
Possibly related issues
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
771cade to
91717af
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
!snapshot |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
🔴 Breaking changes index (17)Every breaking change, up front. Full diffs are in the package sections below.
@clerk/expoCurrent version: 3.6.5 Subpath
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
packages/expo-google-signin/app.plugin.d.ts (1)
3-5: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a JSDoc comment for this public config-plugin export.
withClerkExpoGoogleSignInis the public entrypoint developers reference in theirapp.json/app.config.jsplugins array. Since Clerk Docs generates reference pages from JSDoc inpackages/**, a short JSDoc block describing usage/behavior (e.g., that it wires the iOS URL scheme) would help keep generated docs accurate if this symbol is surfaced.As per path instructions, "Pay special attention to changes that add, remove, or modify JSDoc comments on public APIs... that may appear in generated reference docs."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/expo-google-signin/app.plugin.d.ts` around lines 3 - 5, Add a short JSDoc block to the public config-plugin export in withClerkExpoGoogleSignIn so generated reference docs have usage/behavior context. Update the declaration around the withClerkExpoGoogleSignIn symbol to describe what the plugin does (for example, wiring the iOS URL scheme) and keep the export signature unchanged.Source: Path instructions
packages/expo-google-signin/app.plugin.js (1)
9-11: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winSilent no-op when the iOS URL scheme env var is missing.
If
EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEMEisn't set, the plugin silently returns the config unmodified. For apps intending to use native Google Sign-In on iOS, this fails silently at build time rather than surfacing an actionable error, making the eventual runtime sign-in failure harder to diagnose.As per coding guidelines, "Provide meaningful error messages to developers" and "Include error recovery suggestions where applicable."
💡 Proposed fix to warn when the scheme is missing
if (!iosUrlScheme) { + console.warn( + '[`@clerk/expo-google-signin`] EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME is not set. ' + + 'Native Google Sign-In will not work on iOS until this is configured.', + ); return config; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/expo-google-signin/app.plugin.js` around lines 9 - 11, The iOS URL scheme check in the plugin currently returns the config unchanged when EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME is missing, which hides a misconfiguration. Update the app.plugin.js logic around the iosUrlScheme guard to surface an actionable build-time error or warning with a clear message and recovery hint instead of silently no-oping, so developers can fix the missing native Google Sign-In setup before runtime. Reference the existing plugin flow and the iosUrlScheme handling to keep the behavior explicit and easy to locate.Source: Coding guidelines
packages/expo-google-signin/vitest.setup.mts (1)
18-18: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueEmpty
beforeAllis a no-op.
beforeAll(() => {});does nothing; can be removed unless intended as a placeholder for future setup.🧹 Proposed removal
- -beforeAll(() => {});🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/expo-google-signin/vitest.setup.mts` at line 18, The empty beforeAll in vitest.setup.mts is a no-op and should be removed. Delete the beforeAll(() => {}) call unless you plan to add real setup logic there later, keeping the file clean and avoiding unnecessary test hooks.packages/expo-google-signin/src/useSignInWithGoogle.ts (1)
24-25: 📐 Maintainability & Code Quality | 🔵 TrivialDocs-team review may be needed for the removed migration note.
This public JSDoc paragraph was deleted, so please confirm the generated reference still points users to the standalone package/plugin migration steps somewhere else. As per path instructions, public/reference-facing JSDoc changes should be checked for generated docs drift.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/expo-google-signin/src/useSignInWithGoogle.ts` around lines 24 - 25, The public JSDoc in useSignInWithGoogle was shortened by removing a migration note, so verify that the standalone package/plugin migration guidance is still available in the generated reference. Update the surrounding docs comment in useSignInWithGoogle (and any related public docs entry points) so users are still directed to the correct migration steps, or restore an equivalent reference elsewhere in the reference-facing JSDoc.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/expo-google-signin/package.json`:
- Around line 51-63: The devDependency versions in the package.json for
expo-google-signin are misaligned with the Expo SDK being targeted, specifically
the react-native version is too new for SDK 54. Update the expo-related
devDependencies in this package to match the Expo 54-compatible versions, and
keep the peerDependencies range broad enough to support the intended SDKs; use
the existing package.json dependency block and peerDependencies block as the
place to align the versions.
In `@packages/expo-google-signin/src/useSignInWithGoogle.types.ts`:
- Around line 3-7: The StartGoogleAuthenticationFlowParams type currently
redeclares SignUpUnsafeMetadata as a plain Record, which bypasses the shared
ambient contract and any app-specific augmentation. Update
useSignInWithGoogle.types so StartGoogleAuthenticationFlowParams references the
shared SignUpUnsafeMetadata symbol directly instead of defining a local alias,
keeping the unsafeMetadata field aligned with the common contract.
---
Nitpick comments:
In `@packages/expo-google-signin/app.plugin.d.ts`:
- Around line 3-5: Add a short JSDoc block to the public config-plugin export in
withClerkExpoGoogleSignIn so generated reference docs have usage/behavior
context. Update the declaration around the withClerkExpoGoogleSignIn symbol to
describe what the plugin does (for example, wiring the iOS URL scheme) and keep
the export signature unchanged.
In `@packages/expo-google-signin/app.plugin.js`:
- Around line 9-11: The iOS URL scheme check in the plugin currently returns the
config unchanged when EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME is missing, which
hides a misconfiguration. Update the app.plugin.js logic around the iosUrlScheme
guard to surface an actionable build-time error or warning with a clear message
and recovery hint instead of silently no-oping, so developers can fix the
missing native Google Sign-In setup before runtime. Reference the existing
plugin flow and the iosUrlScheme handling to keep the behavior explicit and easy
to locate.
In `@packages/expo-google-signin/src/useSignInWithGoogle.ts`:
- Around line 24-25: The public JSDoc in useSignInWithGoogle was shortened by
removing a migration note, so verify that the standalone package/plugin
migration guidance is still available in the generated reference. Update the
surrounding docs comment in useSignInWithGoogle (and any related public docs
entry points) so users are still directed to the correct migration steps, or
restore an equivalent reference elsewhere in the reference-facing JSDoc.
In `@packages/expo-google-signin/vitest.setup.mts`:
- Line 18: The empty beforeAll in vitest.setup.mts is a no-op and should be
removed. Delete the beforeAll(() => {}) call unless you plan to add real setup
logic there later, keeping the file clean and avoiding unnecessary test hooks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 2eb2524a-7c13-4f0f-9303-ae45c2177857
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (35)
.changeset/expo-google-signin-package.mdpackages/expo-google-signin/android/build.gradlepackages/expo-google-signin/android/src/main/AndroidManifest.xmlpackages/expo-google-signin/android/src/main/java/expo/modules/clerk/googlesignin/ClerkGoogleSignInModule.ktpackages/expo-google-signin/app.plugin.d.tspackages/expo-google-signin/app.plugin.jspackages/expo-google-signin/expo-module.config.jsonpackages/expo-google-signin/ios/ClerkGoogleSignIn.podspecpackages/expo-google-signin/ios/ClerkGoogleSignInModule.swiftpackages/expo-google-signin/package.jsonpackages/expo-google-signin/src/__tests__/useSignInWithGoogle.test.tspackages/expo-google-signin/src/global.d.tspackages/expo-google-signin/src/google-one-tap/ClerkGoogleOneTapSignIn.tspackages/expo-google-signin/src/google-one-tap/index.tspackages/expo-google-signin/src/google-one-tap/types.tspackages/expo-google-signin/src/index.tspackages/expo-google-signin/src/specs/NativeClerkGoogleSignIn.android.tspackages/expo-google-signin/src/specs/NativeClerkGoogleSignIn.tspackages/expo-google-signin/src/useSignInWithGoogle.android.tspackages/expo-google-signin/src/useSignInWithGoogle.ios.tspackages/expo-google-signin/src/useSignInWithGoogle.shared.tspackages/expo-google-signin/src/useSignInWithGoogle.tspackages/expo-google-signin/src/useSignInWithGoogle.types.tspackages/expo-google-signin/tsconfig.declarations.jsonpackages/expo-google-signin/tsconfig.jsonpackages/expo-google-signin/tsup.config.tspackages/expo-google-signin/vitest.config.mtspackages/expo-google-signin/vitest.setup.mtspackages/expo/android/build.gradlepackages/expo/app.plugin.jspackages/expo/expo-module.config.jsonpackages/expo/package.jsonpackages/expo/src/google/index.tspackages/expo/src/plugin/withClerkExpo.tspackages/expo/src/types/index.ts
💤 Files with no reviewable changes (3)
- packages/expo/android/build.gradle
- packages/expo/src/types/index.ts
- packages/expo/app.plugin.js
| "expo": "~54.0.34", | ||
| "expo-constants": "^18.0.13", | ||
| "expo-crypto": "^15.0.9", | ||
| "react": "catalog:react", | ||
| "react-native": "^0.85.2", | ||
| "tsup": "catalog:repo" | ||
| }, | ||
| "peerDependencies": { | ||
| "expo": ">=53 <57", | ||
| "expo-constants": ">=12", | ||
| "expo-crypto": ">=12", | ||
| "react": "^18.0.0 || ^19.0.0", | ||
| "react-native": ">=0.75" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Which React Native version does Expo SDK 54 require, and is react-native 0.85 compatible with expo 54?
💡 Result:
Expo SDK 54 requires React Native 0.81 [1][2]. It is not compatible with React Native 0.85 [3][4]. Each version of Expo SDK is designed to work with a specific React Native version, and using mismatched versions is generally not supported [3]. React Native 0.85 was introduced as the target version for Expo SDK 56 [3][4].
Citations:
- 1: https://docs.expo.dev/versions/v54.0.0/
- 2: https://expo.dev/sdk/54
- 3: https://docs.expo.dev/versions/latest/
- 4: https://expo.dev/blog/upgrading-to-sdk-56
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the package manifest and nearby workspace context.
sed -n '1,220p' packages/expo-google-signin/package.json
printf '\n---\n'
git ls-files 'packages/expo-google-signin/*' | sed -n '1,120p'Repository: clerk/javascript
Length of output: 3499
Align the Expo devDependency versions. Expo SDK 54 ships with React Native 0.81, so react-native@^0.85.2 is out of sync here and can break local installs or builds for this package.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/expo-google-signin/package.json` around lines 51 - 63, The
devDependency versions in the package.json for expo-google-signin are misaligned
with the Expo SDK being targeted, specifically the react-native version is too
new for SDK 54. Update the expo-related devDependencies in this package to match
the Expo 54-compatible versions, and keep the peerDependencies range broad
enough to support the intended SDKs; use the existing package.json dependency
block and peerDependencies block as the place to align the versions.
| type SignUpUnsafeMetadata = Record<string, unknown>; | ||
|
|
||
| export type StartGoogleAuthenticationFlowParams = { | ||
| unsafeMetadata?: SignUpUnsafeMetadata; | ||
| }; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Reuse the shared SignUpUnsafeMetadata contract.
Record<string, unknown> freezes this field to a plain record and drops any app-specific augmentation on the shared SignUpUnsafeMetadata interface. Please reference the ambient shared type here instead of redefining it locally.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/expo-google-signin/src/useSignInWithGoogle.types.ts` around lines 3
- 7, The StartGoogleAuthenticationFlowParams type currently redeclares
SignUpUnsafeMetadata as a plain Record, which bypasses the shared ambient
contract and any app-specific augmentation. Update useSignInWithGoogle.types so
StartGoogleAuthenticationFlowParams references the shared SignUpUnsafeMetadata
symbol directly instead of defining a local alias, keeping the unsafeMetadata
field aligned with the common contract.
| @@ -0,0 +1,73 @@ | |||
| { | |||
| "name": "@clerk/expo-google-signin", | |||
There was a problem hiding this comment.
Should we do anything for the first-publish path here, or is the plan to force this check once and publish immediately after merge?
pkg-pr-new --compact --pnpm ./packages/* is failing because @clerk/expo-google-signin does not exist on npm yet. If this might sit on main before the first publish, should we exclude it from compact previews or make that workflow tolerate brand-new packages?
| @@ -0,0 +1,8 @@ | |||
| --- | |||
| '@clerk/expo': major | |||
| '@clerk/expo-google-signin': minor | |||
There was a problem hiding this comment.
Should we add @clerk/expo-google-signin to the API Changes/break-check coverage too? @clerk/expo and @clerk/expo-passkeys are already tracked there, so it seems like this new public package should get the same declaration snapshot coverage.
| @@ -0,0 +1,9 @@ | |||
| { | |||
| "platforms": ["apple", "android"], | |||
There was a problem hiding this comment.
Should the Expo native matrix exercise this package as part of the split? The current workflow still only triggers on packages/expo/** and only packs/installs @clerk/expo, so it proves the main package still prebuilds but not that the new native Google Sign-In package works in a clean app.
Description
Moves the native Google Sign-In implementation out of
@clerk/expoand into a new optional package,@clerk/expo-google-signin.The Expo SDK currently includes the native Google Sign-In module even for apps that never call
useSignInWithGoogle(). That means every Expo app using@clerk/expocan pick up the extra native iOS/Android Google Sign-In dependencies during prebuild/autolinking. This split keeps the native Google module opt-in while preserving the existing JS-facing API through a re-export.This is intended for the next major version because apps using native Google Sign-In will need to install the new package and add its Expo config plugin.
Migration
Apps that use native Google Sign-In now need to install the new package:
and add its config plugin:
{ "expo": { "plugins": [ "@clerk/expo", "@clerk/expo-google-signin" ] } }The existing import path can continue to work:
but the native module is no longer included unless
@clerk/expo-google-signinis installed and prebuilt into the app.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Breaking Changes
Bug Fixes