-
Notifications
You must be signed in to change notification settings - Fork 461
feat(expo): Move Google Sign to a separate package #9015
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e996fdc
feat(expo): Move Google Sign to a new package
wobsoriano 826baf2
chore: remove unused tests
wobsoriano 0acf84e
exclude from pkg-pr-new snapshots
wobsoriano dc85481
exclude from pkg-pr-new snapshots
wobsoriano d6dd173
exclude from pkg-pr-new snapshots
wobsoriano f17c8e3
chore: update changeset
wobsoriano 27a1678
chore: revert ci change
wobsoriano 571197b
chore: dedupe
wobsoriano 5a34117
ci: Add new package to break checn and native build workflow
wobsoriano 5b5fa2f
chore: address coderabbit comments
wobsoriano e3909ec
Merge branch 'main' into rob/mobile-560
wobsoriano 768a88d
Merge branch 'main' into rob/mobile-560
wobsoriano 0554491
test(e2e): cover expo-google-signin build and hook wiring
wobsoriano 1f0027f
chore(expo-google-signin): Bump peer dep
wobsoriano 7739350
chore: update changeset
wobsoriano c9bf3b8
ci: add break check entries to api-changes
wobsoriano e7d27b4
chore: update changeset
wobsoriano 36658f4
chore: update correct package info
wobsoriano 9b40b5a
refactor(expo): Make expo-google-signin a native-only package
wobsoriano f550f7b
chore: update correct package info
wobsoriano a3a6b21
chore: Drop Expo SDK 53 support
wobsoriano 81522a4
Merge branch 'main' into rob/mobile-560
wobsoriano 2196ff5
chore: Bump react-native-url-polyfill to 4.0.0
wobsoriano 9a408fc
chore: revert re-exported types
wobsoriano 2dc5feb
Merge branch 'main' into rob/mobile-560
wobsoriano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| '@clerk/expo': major | ||
| '@clerk/expo-passkeys': major | ||
| --- | ||
|
|
||
| Drop support for Expo SDK 53. The minimum supported version is now Expo SDK 54. | ||
|
|
||
| Expo maintains each SDK release for approximately one year and SDK 53 is now outside that window. Upgrade your app to Expo SDK 54 or later before updating these packages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| '@clerk/expo': major | ||
| '@clerk/expo-google-signin': major | ||
| --- | ||
|
|
||
| The native Google Sign-In module has moved out of `@clerk/expo` into a new optional package, `@clerk/expo-google-signin`. Apps that don't use `useSignInWithGoogle` no longer pull in the native Google Sign-In dependencies during prebuild. | ||
|
|
||
| If you use native Google Sign-In, install the new package: | ||
|
|
||
| ```sh | ||
| npx expo install @clerk/expo-google-signin | ||
| ``` | ||
|
|
||
| add its config plugin alongside `@clerk/expo` in your app config: | ||
|
|
||
| ```json | ||
| { | ||
| "expo": { | ||
| "plugins": ["@clerk/expo", "@clerk/expo-google-signin"] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| then rebuild your native app. The `useSignInWithGoogle` hook is still exported from `@clerk/expo/google` and its API is unchanged; it now requires `@clerk/expo-google-signin` to provide the native module, and throws an actionable error if it is missing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
integration/tests/expo-native/flows/google-sign-in-missing-credentials.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| appId: com.clerk.exponativebuildfixture | ||
| name: useSignInWithGoogle surfaces the missing-credentials error | ||
| --- | ||
| - runFlow: subflows/open-app.yaml | ||
| - tapOn: | ||
| id: 'google-sign-in-button' | ||
| - extendedWaitUntil: | ||
| visible: '.*Google Sign-In credentials not found.*' | ||
| timeout: 15000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| apply plugin: 'com.android.library' | ||
| apply plugin: 'kotlin-android' | ||
| apply plugin: 'maven-publish' | ||
|
|
||
| group = 'expo.modules.clerk.googlesignin' | ||
| version = '1.0.0' | ||
|
|
||
| def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle") | ||
| apply from: expoModulesCorePlugin | ||
| applyKotlinExpoModulesCorePlugin() | ||
| useCoreDependencies() | ||
| useExpoPublishing() | ||
|
|
||
| buildscript { | ||
| ext.safeExtGet = { prop, fallback -> | ||
| rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback | ||
| } | ||
| } | ||
|
|
||
| android { | ||
| namespace "expo.modules.clerk.googlesignin" | ||
|
|
||
| compileSdkVersion safeExtGet("compileSdkVersion", 36) | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion safeExtGet("minSdkVersion", 24) | ||
| targetSdkVersion safeExtGet("targetSdkVersion", 36) | ||
| versionCode 1 | ||
| versionName "1.0.0" | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation project(':expo-modules-core') | ||
| implementation "androidx.credentials:credentials:1.3.0" | ||
| implementation "androidx.credentials:credentials-play-services-auth:1.3.0" | ||
| implementation "com.google.android.libraries.identity.googleid:googleid:1.1.1" | ||
| implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3" | ||
| } |
1 change: 1 addition & 0 deletions
1
packages/expo-google-signin/android/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" /> |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import type { ConfigPlugin } from '@expo/config-plugins'; | ||
|
|
||
| declare const withClerkExpoGoogleSignIn: ConfigPlugin; | ||
|
|
||
| export = withClerkExpoGoogleSignIn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| const { withInfoPlist, createRunOncePlugin } = require('@expo/config-plugins'); | ||
| const pkg = require('./package.json'); | ||
|
|
||
| const withClerkExpoGoogleSignIn = config => { | ||
| const iosUrlScheme = | ||
| process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME || | ||
| (config.extra && config.extra.EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME); | ||
|
|
||
| if (!iosUrlScheme) { | ||
| return config; | ||
| } | ||
|
|
||
| return withInfoPlist(config, modConfig => { | ||
| if (!Array.isArray(modConfig.modResults.CFBundleURLTypes)) { | ||
| modConfig.modResults.CFBundleURLTypes = []; | ||
| } | ||
|
|
||
| const schemeExists = modConfig.modResults.CFBundleURLTypes.some(urlType => | ||
| urlType.CFBundleURLSchemes?.includes(iosUrlScheme), | ||
| ); | ||
|
|
||
| if (!schemeExists) { | ||
| modConfig.modResults.CFBundleURLTypes.push({ | ||
| CFBundleURLSchemes: [iosUrlScheme], | ||
| }); | ||
| } | ||
|
|
||
| return modConfig; | ||
| }); | ||
| }; | ||
|
|
||
| module.exports = createRunOncePlugin(withClerkExpoGoogleSignIn, pkg.name, pkg.version); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "platforms": ["apple", "android"], | ||
| "apple": { | ||
| "modules": ["ClerkGoogleSignInModule"] | ||
| }, | ||
| "android": { | ||
| "modules": ["expo.modules.clerk.googlesignin.ClerkGoogleSignInModule"] | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "name": "@clerk/expo-google-signin", | ||
| "version": "0.1.0", | ||
| "description": "Native Google Sign-In module to be used with Clerk for Expo", | ||
| "keywords": [ | ||
| "react-native", | ||
| "expo", | ||
| "google-signin", | ||
| "clerk" | ||
| ], | ||
| "homepage": "https://clerk.com/", | ||
| "bugs": { | ||
| "url": "https://github.com/clerk/javascript/issues" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/clerk/javascript.git", | ||
| "directory": "packages/expo-google-signin" | ||
| }, | ||
| "license": "MIT", | ||
| "author": "Clerk", | ||
| "files": [ | ||
| "android", | ||
| "ios", | ||
| "expo-module.config.json", | ||
| "app.plugin.js", | ||
| "app.plugin.d.ts" | ||
| ], | ||
| "scripts": { | ||
| "format": "node ../../scripts/format-package.mjs", | ||
| "format:check": "node ../../scripts/format-package.mjs --check" | ||
| }, | ||
| "devDependencies": { | ||
| "@expo/config-plugins": "^54.0.4", | ||
| "expo": "~54.0.36" | ||
| }, | ||
| "peerDependencies": { | ||
| "expo": ">=54 <58" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,14 @@ | ||
| { | ||
| "platforms": ["apple", "android"], | ||
| "apple": { | ||
| "modules": [ | ||
| "ClerkExpoModule", | ||
| "ClerkAuthViewModule", | ||
| "ClerkUserProfileViewModule", | ||
| "ClerkUserButtonViewModule", | ||
| "ClerkGoogleSignInModule" | ||
| ] | ||
| "modules": ["ClerkExpoModule", "ClerkAuthViewModule", "ClerkUserProfileViewModule", "ClerkUserButtonViewModule"] | ||
| }, | ||
| "android": { | ||
| "modules": [ | ||
| "expo.modules.clerk.ClerkExpoModule", | ||
| "expo.modules.clerk.ClerkAuthViewModule", | ||
| "expo.modules.clerk.ClerkUserProfileViewModule", | ||
| "expo.modules.clerk.ClerkUserButtonViewModule", | ||
| "expo.modules.clerk.googlesignin.ClerkGoogleSignInModule" | ||
| "expo.modules.clerk.ClerkUserButtonViewModule" | ||
| ] | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.