Skip to content

Commit 3c98238

Browse files
authored
fix(expo): Update useSignInWithApple import to @clerk/expo/apple (#7737)
1 parent 5f88dbb commit 3c98238

6 files changed

Lines changed: 60 additions & 2 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
"@clerk/expo": major
3+
---
4+
5+
Move `useSignInWithApple` and `useSignInWithGoogle` to dedicated entry points to avoid bundling optional dependencies.
6+
7+
**Breaking Change:** Import paths have changed:
8+
9+
```typescript
10+
// Before
11+
import { useSignInWithApple } from '@clerk/expo';
12+
import { useSignInWithGoogle } from '@clerk/expo';
13+
14+
// After
15+
import { useSignInWithApple } from '@clerk/expo/apple';
16+
import { useSignInWithGoogle } from '@clerk/expo/google';
17+
```
18+
19+
This change prevents `expo-crypto` and `expo-apple-authentication` from being bundled when not using native sign-in hooks.

packages/expo/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
"types": "./dist/token-cache/index.d.ts",
4949
"default": "./dist/token-cache/index.js"
5050
},
51+
"./google": {
52+
"types": "./dist/google/index.d.ts",
53+
"default": "./dist/google/index.js"
54+
},
55+
"./apple": {
56+
"types": "./dist/apple/index.d.ts",
57+
"default": "./dist/apple/index.js"
58+
},
5159
"./resource-cache": {
5260
"types": "./dist/resource-cache/index.d.ts",
5361
"default": "./dist/resource-cache/index.js"
@@ -70,6 +78,8 @@
7078
"dist",
7179
"android",
7280
"ios",
81+
"google",
82+
"apple",
7383
"expo-module.config.json",
7484
"app.plugin.js"
7585
],

packages/expo/src/apple/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { useSignInWithApple } from '../hooks/useSignInWithApple';
2+
export type {
3+
StartAppleAuthenticationFlowParams,
4+
StartAppleAuthenticationFlowReturnType,
5+
} from '../hooks/useSignInWithApple';

packages/expo/src/google/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { useSignInWithGoogle } from '../hooks/useSignInWithGoogle';
2+
export type {
3+
StartGoogleAuthenticationFlowParams,
4+
StartGoogleAuthenticationFlowReturnType,
5+
} from '../hooks/useSignInWithGoogle.types';

packages/expo/src/hooks/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export {
1212
useReverification,
1313
} from '@clerk/react';
1414

15-
export * from './useSignInWithApple';
16-
export * from './useSignInWithGoogle';
1715
export * from './useSSO';
1816
export * from './useOAuth';
1917
export * from './useAuth';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: '`useSignInWithApple` and `useSignInWithGoogle` moved to separate entry points'
3+
packages: ['expo']
4+
matcher: "import\\s+\\{[^}]*\\b(useSignInWithApple|useSignInWithGoogle)\\b[^}]*\\}\\s+from\\s+['\"]@clerk/expo['\"]"
5+
matcherFlags: 'm'
6+
category: 'breaking'
7+
---
8+
9+
The `useSignInWithApple` and `useSignInWithGoogle` hooks have been moved to dedicated entry points to avoid bundling optional dependencies.
10+
11+
Update your imports:
12+
13+
```diff
14+
- import { useSignInWithApple } from '@clerk/expo';
15+
+ import { useSignInWithApple } from '@clerk/expo/apple';
16+
17+
- import { useSignInWithGoogle } from '@clerk/expo';
18+
+ import { useSignInWithGoogle } from '@clerk/expo/google';
19+
```
20+
21+
This change prevents `expo-crypto` and `expo-apple-authentication` from being bundled when not using native sign-in hooks.

0 commit comments

Comments
 (0)