Skip to content
TypeScript

chore(deps): update Clerk SDKs and reconcile native patch (#20359)

Julius Marmingea3e8cf69deba
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index 9177f4787e7..81619148cee 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -47,7 +47,7 @@
},
"dependencies": {
"@clerk/expo": "catalog:",
- "@clerk/expo-native-components": "0.1.1",
+ "@clerk/expo-native-components": "0.2.0",
"@effect/atom-react": "catalog:",
"@expo-google-fonts/dm-sans": "^0.4.2",
"@expo/metro-runtime": "~58.0.14",
diff --git a/patches/@[email protected] b/patches/@[email protected]
deleted file mode 100644
index e7669a82038..00000000000
--- a/patches/@[email protected]
+++ /dev/null
@@ -1,138 +0,0 @@
-diff --git a/android/build.gradle b/android/build.gradle
-index 0946d68..1926024 100644
---- a/android/build.gradle
-+++ b/android/build.gradle
-@@ -147,6 +147,12 @@ dependencies {
- implementation "androidx.activity:activity-compose:$activityComposeVersion"
- implementation "androidx.lifecycle:lifecycle-runtime-compose:$lifecycleVersion"
- implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion"
-+ // ClerkComposeNativeViewHost imports LocalSavedStateRegistryOwner and
-+ // LocalLifecycleOwner from these artifacts. Earlier SDKs leaked them onto
-+ // the compile classpath through clerk-android-ui's navigation3 runtime
-+ // dependency; AGP 9 resolves the compile classpath on its own.
-+ implementation "androidx.savedstate:savedstate-compose:1.4.0"
-+ implementation "androidx.lifecycle:lifecycle-runtime-compose:2.10.0"
-
- testImplementation "junit:junit:4.13.2"
- }
-diff --git a/ios/ClerkAuthNativeView.swift b/ios/ClerkAuthNativeView.swift
-index 5f8d2ba..b170304 100644
---- a/ios/ClerkAuthNativeView.swift
-+++ b/ios/ClerkAuthNativeView.swift
-@@ -111,7 +111,12 @@ public class ClerkAuthNativeView: ClerkNativeViewHost {
-
- override func makeHostedController() -> UIViewController? {
- let hostBackAction: (() -> Void)? = currentHostBackButton
-- ? { [weak self] in self?.onHostBack([:]) }
-+ ? { [weak self] in
-+ guard let self else { return }
-+ if !self.popEnclosingNavigationRoute() {
-+ self.onHostBack([:])
-+ }
-+ }
- : nil
-
- return ClerkNativeBridge.shared.makeAuthViewController(
-diff --git a/ios/ClerkNativeBridge.swift b/ios/ClerkNativeBridge.swift
-index e9527c6..a59ee3b 100644
---- a/ios/ClerkNativeBridge.swift
-+++ b/ios/ClerkNativeBridge.swift
-@@ -1557,6 +1557,8 @@ private struct ClerkReactEmbeddedUserProfileCustomPage: View {
- }
-
- private struct ClerkReactUserProfileCustomPageContent: View {
-+ @Environment(\.clerkTheme) private var theme
-+
- let path: String
- let rows: [ClerkUserProfileCustomRowConfig]
- let state: ClerkUserProfileCustomPageState
-@@ -1570,8 +1572,13 @@ private struct ClerkReactUserProfileCustomPageContent: View {
- }
- }
- .frame(maxWidth: .infinity, maxHeight: .infinity)
-+ // Match Clerk's own profile pages so the navigation bar and page share
-+ // the theme's page background instead of a bare hosting container.
-+ .background(theme.colors.muted)
- .navigationTitle(userProfileCustomPageLabel(for: path, rows: rows))
- .navigationBarTitleDisplayMode(.inline)
-+ .preGlassSolidNavBar()
-+ .background(theme.colors.background)
- }
- }
-
-diff --git a/ios/ClerkNativeViewHost.swift b/ios/ClerkNativeViewHost.swift
-index 4e6540a..6897350 100644
---- a/ios/ClerkNativeViewHost.swift
-+++ b/ios/ClerkNativeViewHost.swift
-@@ -5,6 +5,7 @@ public class ClerkNativeViewHost: ExpoView {
- private lazy var hostingCoordinator = ClerkNativeHostingCoordinator(containerView: self)
- private var hasInitialized: Bool = false
- private var configuredObserver: NSObjectProtocol?
-+ private var isPoppingHostRoute = false
-
- public required init(appContext: AppContext? = nil) {
- super.init(appContext: appContext)
-@@ -23,6 +24,7 @@ public class ClerkNativeViewHost: ExpoView {
- super.didMoveToWindow()
-
- guard window != nil else {
-+ isPoppingHostRoute = false
- if hasInitialized {
- hostedViewDidDetachFromWindow()
- }
-@@ -58,6 +60,37 @@ public class ClerkNativeViewHost: ExpoView {
-
- func hostedViewDidDetachFromWindow() {}
-
-+ /// Pops the React Navigation route that contains this view without waiting for
-+ /// the JavaScript event loop. React Native Screens reports the native dismissal
-+ /// back to React Navigation so its state remains synchronized.
-+ func popEnclosingNavigationRoute() -> Bool {
-+ guard !isPoppingHostRoute else { return true }
-+
-+ var responder: UIResponder? = self
-+
-+ while let nextResponder = responder?.next {
-+ if let viewController = nextResponder as? UIViewController,
-+ let navigationController = viewController.navigationController,
-+ navigationController.viewControllers.count > 1 {
-+ isPoppingHostRoute = true
-+ if navigationController.popViewController(animated: true) != nil {
-+ if let coordinator = navigationController.transitionCoordinator {
-+ coordinator.animate(alongsideTransition: nil) { [weak self] _ in
-+ self?.isPoppingHostRoute = false
-+ }
-+ } else {
-+ isPoppingHostRoute = false
-+ }
-+ return true
-+ }
-+ isPoppingHostRoute = false
-+ }
-+ responder = nextResponder
-+ }
-+
-+ return false
-+ }
-+
- private func addConfiguredObserver() {
- guard configuredObserver == nil else { return }
-
-diff --git a/ios/ClerkUserProfileNativeView.swift b/ios/ClerkUserProfileNativeView.swift
-index f2ca604..46f406d 100644
---- a/ios/ClerkUserProfileNativeView.swift
-+++ b/ios/ClerkUserProfileNativeView.swift
-@@ -47,7 +47,12 @@ public class ClerkUserProfileNativeView: ClerkUserProfileCustomPageHost {
-
- override func makeHostedController() -> UIViewController? {
- let hostBackAction: (() -> Void)? = currentHostBackButton
-- ? { [weak self] in self?.onHostBack([:]) }
-+ ? { [weak self] in
-+ guard let self else { return }
-+ if !self.popEnclosingNavigationRoute() {
-+ self.onHostBack([:])
-+ }
-+ }
- : nil
-
- return ClerkNativeBridge.shared.makeUserProfileViewController(
diff --git a/patches/@[email protected] b/patches/@[email protected]
new file mode 100644
index 00000000000..d40b77ec86b
--- /dev/null
+++ b/patches/@[email protected]
@@ -0,0 +1,132 @@
+diff --git a/ios/ClerkAuthNativeView.swift b/ios/ClerkAuthNativeView.swift
+index 5f8d2ba..b170304 100644
+--- a/ios/ClerkAuthNativeView.swift
++++ b/ios/ClerkAuthNativeView.swift
+@@ -111,7 +111,12 @@ public class ClerkAuthNativeView: ClerkNativeViewHost {
+
+ override func makeHostedController() -> UIViewController? {
+ let hostBackAction: (() -> Void)? = currentHostBackButton
+- ? { [weak self] in self?.onHostBack([:]) }
++ ? { [weak self] in
++ guard let self else { return }
++ if !self.popEnclosingNavigationRoute() {
++ self.onHostBack([:])
++ }
++ }
+ : nil
+
+ return ClerkNativeBridge.shared.makeAuthViewController(
+diff --git a/ios/ClerkUserProfileNativeView.swift b/ios/ClerkUserProfileNativeView.swift
+index f2ca604..46f406d 100644
+--- a/ios/ClerkUserProfileNativeView.swift
++++ b/ios/ClerkUserProfileNativeView.swift
+@@ -47,7 +47,12 @@ public class ClerkUserProfileNativeView: ClerkUserProfileCustomPageHost {
+
+ override func makeHostedController() -> UIViewController? {
+ let hostBackAction: (() -> Void)? = currentHostBackButton
+- ? { [weak self] in self?.onHostBack([:]) }
++ ? { [weak self] in
++ guard let self else { return }
++ if !self.popEnclosingNavigationRoute() {
++ self.onHostBack([:])
++ }
++ }
+ : nil
+
+ return ClerkNativeBridge.shared.makeUserProfileViewController(
+diff --git a/ios/ClerkNativeViewHost.swift b/ios/ClerkNativeViewHost.swift
+--- a/ios/ClerkNativeViewHost.swift
++++ b/ios/ClerkNativeViewHost.swift
+@@ -5,6 +5,7 @@
+ private lazy var hostingCoordinator = ClerkNativeHostingCoordinator(containerView: self)
+ private var hasInitialized: Bool = false
+ private var configuredObserver: NSObjectProtocol?
++ private var isPoppingHostRoute = false
+
+ public required init(appContext: AppContext? = nil) {
+ super.init(appContext: appContext)
+@@ -23,6 +24,7 @@
+ super.didMoveToWindow()
+
+ guard window != nil else {
++ isPoppingHostRoute = false
+ if hasInitialized {
+ hostedViewDidDetachFromWindow()
+ }
+@@ -58,6 +60,39 @@
+
+ func hostedViewDidDetachFromWindow() {}
+
++ func popEnclosingNavigationRoute() -> Bool {
++ guard !isPoppingHostRoute else { return true }
++
++ // Follow controller containment, not the responder chain: past a presented controller the
++ // responder chain continues to its presenter, so a host inside a modal would pop the screen
++ // behind the modal instead of letting `onHostBack` dismiss it.
++ var route = enclosingViewController(of: self)
++
++ while let candidate = route {
++ if let navigationController = candidate.parent as? UINavigationController,
++ navigationController.viewControllers.count > 1 {
++ guard navigationController.topViewController === candidate else { return false }
++
++ isPoppingHostRoute = true
++ guard navigationController.popViewController(animated: true) != nil else {
++ isPoppingHostRoute = false
++ return false
++ }
++ if let coordinator = navigationController.transitionCoordinator {
++ coordinator.animate(alongsideTransition: nil) { [weak self] _ in
++ self?.isPoppingHostRoute = false
++ }
++ } else {
++ isPoppingHostRoute = false
++ }
++ return true
++ }
++ route = candidate.parent
++ }
++
++ return false
++ }
++
+ private func addConfiguredObserver() {
+ guard configuredObserver == nil else { return }
+
+@@ -162,7 +197,7 @@
+ controller.view.frame = containerView.bounds
+ controller.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+
+- if let parentVC = findViewController(from: containerView) {
++ if let parentVC = enclosingViewController(of: containerView) {
+ parentVC.addChild(controller)
+ containerView.addSubview(controller.view)
+ controller.didMove(toParent: parentVC)
+@@ -190,15 +225,15 @@
+ guard let containerView else { return }
+ hostingController?.view.frame = containerView.bounds
+ }
+-
+- private func findViewController(from view: UIView) -> UIViewController? {
+- var responder: UIResponder? = view
+- while let nextResponder = responder?.next {
+- if let vc = nextResponder as? UIViewController {
+- return vc
+- }
+- responder = nextResponder
+- }
+- return nil
+- }
+-}
++}
++
++private func enclosingViewController(of view: UIView) -> UIViewController? {
++ var responder: UIResponder? = view
++ while let nextResponder = responder?.next {
++ if let viewController = nextResponder as? UIViewController {
++ return viewController
++ }
++ responder = nextResponder
++ }
++ return nil
++}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e1ef8366399..d5f98a4c8b6 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -101,17 +101,17 @@ overrides:
'@alchemy.run/sigil>react-reconciler': '-'
'@alchemy.run/sigil>scheduler': '-'
alchemy>@prisma/dev: '-'
- '@clerk/backend': 3.24.0
- '@clerk/clerk-js': 6.39.0
+ '@clerk/backend': 3.25.0
+ '@clerk/clerk-js': 6.39.1
'@clerk/clerk-js>@base-org/account': '-'
'@clerk/clerk-js>@coinbase/wallet-sdk': '-'
'@clerk/clerk-js>@solana/wallet-adapter-base': '-'
'@clerk/clerk-js>@solana/wallet-adapter-react': '-'
'@clerk/clerk-js>@solana/wallet-standard': '-'
'@clerk/clerk-js>@wallet-standard/core': '-'
- '@clerk/electron': 0.1.0
+ '@clerk/electron': 0.1.1
'@clerk/electron-passkeys': 0.0.3
- '@clerk/expo': 4.12.0
+ '@clerk/expo': 4.13.0
'@clerk/react': 6.17.8
'@clerk/shared': 4.40.0
'@effect/atom-react': 4.0.5
@@ -149,7 +149,7 @@ overrides:
packageExtensionsChecksum: sha256-EowbsmlBFaoO0Ypufw901RnvdyjKG5dcdk2FRbc7Dr0=
patchedDependencies:
- '@clerk/[email protected]': 5f3738f8e5d50bfa467ce8afbaf7c2aa7c7c9adb95a2307424eb908f6af0d299
+ '@clerk/[email protected]': 7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4
'@effect/[email protected]': 2731c9c3761c595f25ddc625a7d61ca376b389d5b3049ecb837c8940f21cfa02
'@expo/[email protected]': 90fa980e8b6480631fb2fbb04559834e3c612db40c550cd828f11be297d8d760
'@expo/[email protected]': 5a26480373850c1a7943919aa21f904151b335a0cb01042109e0746def37923e
@@ -203,8 +203,8 @@ importers:
apps/desktop:
dependencies:
'@clerk/electron':
- specifier: 0.1.0
+ specifier: 0.1.1
'@clerk/electron-passkeys':
specifier: 0.0.3
version: 0.0.3
@@ -310,11 +310,11 @@ importers:
apps/mobile:
dependencies:
'@clerk/expo':
- specifier: 4.12.0
- version: 4.12.0(fc0c782bb008f08bb0dbe9eee6e857d7)
+ specifier: 4.13.0
+ version: 4.13.0(e294ebd82d3b120007fa8b3c194f08cb)
'@clerk/expo-native-components':
- specifier: 0.1.1
+ specifier: 0.2.0
'@effect/atom-react':
specifier: 4.0.5
@@ -768,11 +768,11 @@ importers:
specifier: ^1.4.1
'@clerk/clerk-js':
- specifier: 6.39.0
+ specifier: 6.39.1
'@clerk/electron':
- specifier: 0.1.0
+ specifier: 0.1.1
'@clerk/react':
specifier: 6.17.8
@@ -1009,8 +1009,8 @@ importers:
infra/relay:
dependencies:
'@clerk/backend':
- specifier: 3.24.0
+ specifier: 3.25.0
'@effect/sql-pg':
specifier: 4.0.5
version: 4.0.5([email protected])
@@ -2682,12 +2682,12 @@ packages:
resolution: {integrity: sha512-dlT1m5e/0yUL0kRNcQn7yGLVThkgbB0Ga/1AmfDDC/8ik6AIiSf2QLQO2zPYvefsHP0aFgxO93cVLCCfDp7kzQ==}
engines: {node: '>= 20.12.0'}
- '@clerk/[email protected]':
- resolution: {integrity: sha512-ak5U2IabnBvYzhTrPl7de0ywiLmrBqfA4aonjhC5Kmt9IUEwXIPf294zgfXfFeDy3JGTSTvgWAy7p+15OagirA==}
+ '@clerk/[email protected]':
+ resolution: {integrity: sha512-hmJS0a61FO08PDaV2MtZ/hj6pE+cQBRmpxR8oUFGQTXewOQLLOAbcgob0rmFAnMNuHgXfsYf3NVxcQCUOWE+QA==}
engines: {node: '>=20.9.0'}
- '@clerk/[email protected]':
- resolution: {integrity: sha512-1vGRCP+220kawQn827xgrcdUubSrCVmSlQT64WBHQoM60FaXkAzNaK7aPNEIMTRfg5Ync4SNBwCBr9YbwIUZLg==}
+ '@clerk/[email protected]':
+ resolution: {integrity: sha512-QtxMDDgtnZ6V/N3rOcjyEGqXHsugWOSFYzv176htNF57wN5lcRieUxwEYbXfpOdq2z4FYmS2bUDB1s+5AU0QsA==}
engines: {node: '>=20.9.0'}
@@ -2714,8 +2714,8 @@ packages:
resolution: {integrity: sha512-OHhIe88qDL+FxyBalXdXNHAS5eEramr6Rerp+6iNkfkjqT8rx4hHNmfpmjg5/T1/am8QfknbOBZkqoXZlCrjPg==}
engines: {node: '>=20.9.0'}
- '@clerk/[email protected]':
- resolution: {integrity: sha512-O91JqP7VFgCl3U13Ht9Mi4R8ddJQS8efoQcVglF2DpNDDmlYU5ZiOI+6Q1XC5hSYoUTzOSsxYg9C7UiHmV3mXg==}
+ '@clerk/[email protected]':
+ resolution: {integrity: sha512-ZnZTVBCjWQ7+YYrzjkG5G9bDpA2wEHdBggyijY4Q6Cny7l9aHdimz/iEaRNvz6ELeVmR2BBL4ictfFfzCqLjnA==}
engines: {node: '>=20.9.0'}
peerDependencies:
'@clerk/electron-passkeys': 0.0.3
@@ -2731,23 +2731,23 @@ packages:
react-dom:
optional: true
- '@clerk/[email protected]':
- resolution: {integrity: sha512-KgN1+7yP+BfacxHQBtmRypj04x/tCG5a6TZlsBW0oKIUdg98xJvJxP1+gLWevGdRLVY2NyBs7/Rd4+E9v4sa4w==}
+ '@clerk/[email protected]':
+ resolution: {integrity: sha512-9EffqP+phLspxAm4AzwqPP8DAG6u410W3Sixfx1zwXYCna0UiG8yUPXUHOtrquGiq0qrmn2e+Ov8leo6nKX3SA==}
engines: {node: '>=20.9.0'}
peerDependencies:
- expo: '>=54 <58'
+ expo: '>=54 <59'
react: ^18.0.0 || ^19.0.0
react-native: '>=0.75'
- '@clerk/[email protected]':
- resolution: {integrity: sha512-jLnyEtWc/D+7PbCTuddO1WEn8Anv4I/h1OujpeqLOPDCWiRHOOpP9UoDVIxKUAh+hTkO2bq6U4OpGtt4KDk9Lw==}
+ '@clerk/[email protected]':
+ resolution: {integrity: sha512-Hxss//4FE4lWCEtiLRchhnQOkWwy3KJUjPDj8khqqZ+K78ujqwPPaNDoQDM3c2O2gEd1Snp7KaHO4CQKkwehMA==}
engines: {node: '>=20.9.0'}
peerDependencies:
'@clerk/expo-biometrics': '>=0.1.0'
'@clerk/expo-google-signin': '>=0.1.0'
'@clerk/expo-native-components': '>=0.1.0'
'@clerk/expo-passkeys': '>=0.0.6'
- expo: '>=54 <58'
+ expo: '>=54 <59'
expo-apple-authentication: '>=7.0.0'
expo-auth-session: '>=5'
expo-constants: 58.0.12
@@ -13595,7 +13595,7 @@ snapshots:
fast-wrap-ansi: 0.2.2
sisteransi: 1.0.5
dependencies:
standardwebhooks: 1.0.0
@@ -13604,7 +13604,7 @@ snapshots:
- react
- react-dom
dependencies:
'@stripe/stripe-js': 5.6.0
@@ -13621,7 +13621,7 @@ snapshots:
- react
- react-dom
dependencies:
'@stripe/stripe-js': 5.6.0
@@ -13657,9 +13657,9 @@ snapshots:
'@clerk/electron-passkeys-win32-arm64-msvc': 0.0.3
'@clerk/electron-passkeys-win32-x64-msvc': 0.0.3
dependencies:
electron: 44.4.5
@@ -13670,9 +13670,9 @@ snapshots:
electron-store: 8.2.0
react-dom: 19.2.6([email protected])
dependencies:
electron: 44.4.5
@@ -13683,7 +13683,7 @@ snapshots:
electron-store: 8.2.0
react-dom: 19.3.0([email protected])
dependencies:
'@expo/config-plugins': 58.0.9([email protected])
expo: 58.0.11(0279ba067f3e563cec3a046cc8b71592)
@@ -13694,9 +13694,9 @@ snapshots:
- supports-color
- typescript
- '@clerk/[email protected](fc0c782bb008f08bb0dbe9eee6e857d7)':
+ '@clerk/[email protected](e294ebd82d3b120007fa8b3c194f08cb)':
dependencies:
'@expo/config-plugins': 58.0.9([email protected])
@@ -13707,7 +13707,7 @@ snapshots:
tslib: 2.8.1
optionalDependencies:
- '@clerk/expo-native-components': 0.1.1(patch_hash=5f3738f8e5d50bfa467ce8afbaf7c2aa7c7c9adb95a2307424eb908f6af0d299)([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])([email protected])
+ '@clerk/expo-native-components': 0.2.0(patch_hash=7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4)([email protected])([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])([email protected])
expo-crypto: 58.0.6([email protected])
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index ede421587dc..3722de98c15 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -27,11 +27,11 @@ allowBuilds:
workerd: false
catalog:
- "@clerk/backend": 3.24.0
- "@clerk/clerk-js": 6.39.0
- "@clerk/electron": 0.1.0
+ "@clerk/backend": 3.25.0
+ "@clerk/clerk-js": 6.39.1
+ "@clerk/electron": 0.1.1
"@clerk/electron-passkeys": 0.0.3
- "@clerk/expo": 4.12.0
+ "@clerk/expo": 4.13.0
"@clerk/react": 6.17.8
"@clerk/shared": 4.40.0
"@effect/atom-react": 4.0.5
@@ -88,11 +88,11 @@ minimumReleaseAgeExclude:
- - "@clerk/[email protected]"
- - "@clerk/[email protected]"
- - "@clerk/[email protected]"
- - "@clerk/[email protected]"
- - "@clerk/[email protected]"
+ - "@clerk/[email protected]"
+ - "@clerk/[email protected]"
+ - "@clerk/[email protected]"
+ - "@clerk/[email protected]"
+ - "@clerk/[email protected]"
- "@clerk/[email protected]"
- "@clerk/[email protected]"
- "@distilled.cloud/[email protected]"
@@ -311,7 +311,7 @@ patchedDependencies: