Skip to content

chore(expo): clean up the native sync bridge API - #11050

Open
wobsoriano wants to merge 2 commits into
mainfrom
rob/mobile-730-bridge-api-cleanup
Open

wobsoriano wants to merge 2 commits into
mainfrom
rob/mobile-730-bridge-api-cleanup

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Description

Settles the native sync bridge API before @clerk/expo-native-components 1.0.

  • Removes the __experimental_disableNativeClientSync prop from ClerkProvider. Native client sync only runs when @clerk/expo-native-components is installed, so apps without native components never needed it, and apps with them would break their components by turning sync off.
  • Removes the unused idle() and pullFromNative() exports from the sync engine, and the engine handle that only they used.
  • Renames the native configureNative method to configure and bumps the native bridge version to 2. A native build from an older @clerk/expo-native-components now gets the version mismatch error from fix(expo): show a clear error when the native build doesn't match @clerk/expo #11011 instead of a failed configure, and the @clerk/expo-native-components peer range moves to >=0.5.0.

The native contract test now skips shipped releases whose bridge version differs from the one @clerk/expo expects, since the loader refuses them. Without that, it flags configure because 0.1.0 to 0.3.0 shipped a legacy configure with a different signature. Those builds have no bridge version, so JS never calls it.

Fixes MOBILE-730

🤖 Generated with Claude under Rob's supervision.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 30, 2026 10:07pm UTC
swingset Ready Ready Preview Nov 30, 2026 10:07pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
mosaic-docs Ignored Ignored Preview Nov 30, 2026 10:07pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 76546dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/expo Minor
@clerk/expo-native-components Minor

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

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The native configuration method is renamed from configureNative to configure across the Expo JavaScript contract and Android and iOS modules. The bridge version increases to 2, and Expo updates its compatibility checks and native-components peer minimum. ClerkProvider no longer exposes the option to disable native client sync. The sync implementation also removes its idle and pull APIs and associated engine state.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#11011: Adds the bridge-version check used by this change to validate the native module against the expected version.

Suggested reviewers: mikepitre, seanperez29

Merge Risk: Minimal · up to 76546

The change renames the native configure method, bumps the bridge version, and removes an experimental provider prop and unused sync APIs. Older native builds get a clear version-mismatch error. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore(expo): clean up the native sync bridge API" matches the changeset. The PR removes the __experimental_disableNativeClientSync prop, removes the idle() and pullFromNative() exports, ren…
Description check Passed The description states the purpose and scope of the changes. It covers removing the ClerkProvider prop, removing the idle() and pullFromNative() exports, renaming configureNative to configure, bumping…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "chore(expo): clean up the native sync bridge API" matches the changeset. The PR removes the __experimental_disableNativeClientSync prop, removes the idle() and pullFromNative() exports, renames configureNative to configure, and bumps the bridge version to 2. The title names the main theme, though it uses the broad term "clean up" and does not mention the breaking change.

Full details: Description check

Explanation

The description states the purpose and scope of the changes. It covers removing the ClerkProvider prop, removing the idle() and pullFromNative() exports, renaming configureNative to configure, bumping the bridge version to 2, moving the peer range to >=0.5.0, and the native contract test change. It also marks the PR as a breaking change and links MOBILE-730.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: This review skipped 6 repositories. Cross-repository analysis may be incomplete. Check linked repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ae64a53 and 76546dc.

Files selected for processing: 23

  • .changeset/expo-native-bridge-configure.md
  • .changeset/expo-remove-disable-native-client-sync.md
  • packages/expo-native-components/android/src/main/java/expo/modules/clerk/ClerkAuthViewModule.kt
  • packages/expo-native-components/android/src/main/java/expo/modules/clerk/ClerkClientInvalidation.kt
  • packages/expo-native-components/android/src/main/java/expo/modules/clerk/ClerkExpoModule.kt
  • packages/expo-native-components/ios/ClerkClientInvalidation.swift
  • packages/expo-native-components/ios/ClerkExpoModule.swift
  • packages/expo-native-components/ios/ClerkNativeBridge.swift
  • packages/expo/package.json
  • packages/expo/src/constants.ts
  • packages/expo/src/hooks/__tests__/useSignInWithGoogle.test.ts
  • packages/expo/src/provider/ClerkProvider.tsx
  • packages/expo/src/provider/__tests__/nativeClientSync.test.ts
  • packages/expo/src/provider/__tests__/nativeClientSyncBehavior/harness.ts
  • packages/expo/src/provider/__tests__/nativeClientSyncBehavior/nativeClientSync.behavior.test.tsx
  • packages/expo/src/provider/__tests__/nativeClientSyncBehavior/newEngineAdapter.tsx
  • packages/expo/src/provider/nativeClientSync.ts
  • packages/expo/src/specs/NativeClerkModule.types.ts
  • packages/expo/src/specs/__tests__/androidSpecs.test.ts
  • packages/expo/src/specs/__tests__/nativeContract.test.ts
  • packages/expo/src/specs/__tests__/nativeModuleContract.ts
  • packages/expo/src/utils/__tests__/native-module.test.ts
  • packages/expo/src/utils/native-module.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Files with no reviewable changes: 1

  • packages/expo/src/provider/tests/nativeClientSyncBehavior/harness.ts

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.

@pkg-pr-new

pkg-pr-new Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@11050

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@11050

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@11050

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@11050

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@11050

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@11050

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@11050

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@11050

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@11050

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@11050

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@11050

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@11050

@clerk/express

npm i https://pkg.pr.new/@clerk/express@11050

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@11050

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@11050

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@11050

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@11050

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@11050

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@11050

@clerk/react

npm i https://pkg.pr.new/@clerk/react@11050

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@11050

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@11050

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@11050

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@11050

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@11050

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@11050

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@11050

commit: 76546dc

@wobsoriano wobsoriano changed the title chore(expo): clean up the native sync bridge API before 1.0 chore(expo): clean up the native sync bridge API Nov 30, 2026
@wobsoriano
wobsoriano added this pull request to stack #11053 November 30, 2026 22:43
@wobsoriano
wobsoriano marked this pull request as ready for review December 1, 2026 00:12
@blacksmith-sh

blacksmith-sh Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Matches Loader accepts only bridge v2 native builds

On head only the v2 build (bridgeVersion 2, configure) loads; 0.1.0, 0.3.0, 0.4.0 and 0.4.10 shapes are refused with the mismatch error, where base loaded 0.3.0 to 0.4.10.

Loader per native build

Also checked · 2 match

Matches ClerkProvider always syncs via native configure
Matches Native module sources match the bridge v2 contract · Narrowed from "The iOS and Android ClerkExpo native modules export configure and bridgeVersion 2, and the native contract test passes against every shipped @⁠clerk/expo-native-components release, skipping releases..."

Proof on 76546dc3 · mocked: ClerkExpo native module (iOS needs macOS; fakes carry the exact function names and bridgeVersion parsed f...) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-12-01T00:16:24.111Z

Summary

Metric Count
Packages analyzed 20
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 2
🟢 Additions 0

🤖 This report was reviewed by claude-sonnet-4-6.


@clerk/expo

Current version: 4.17.8
Recommended bump: MINOR → 4.18.0

Subpath .

🟡 Non-breaking Changes (1)

Modified: ClerkProviderProps
// ... 2 unchanged lines elided ...
      tokenCache?: TokenCache;
      __experimental_passkeys?: BuildClerkOptions['__experimental_passkeys'];
      __experimental_resourceCache?: BuildClerkOptions['__experimental_resourceCache'];
-     __experimental_disableNativeClientSync?: boolean;
      updateRequiredViewEnabled?: boolean;
  };

Static analyzer: Breaking change in type alias ClerkProviderProps: Type changed: !Omit:type<import("@clerk/react").ClerkProviderProps<TUi>,'publishableKey'>&{publishableKey:string;tokenCache?:import("… → !Omit:type<import("@clerk/react").ClerkProviderProps<TUi>,'publishableKey'>&{publishableKey:string;tokenCache?:import("…

🤖 AI review (reclassified as non-breaking) (90%): The only difference is the removal of the optional __experimental_disableNativeClientSync?: boolean property; since ClerkProviderProps is used exclusively as a function input (parameter to ClerkProvider), removing an optional input property cannot break existing callers — no consumer was required to pass it, and removing it only means consumers who did pass it may get an excess-property error (but as an optional field on a spread/intersection type used in JSX, callers passing it would break; however, since it is prefixed __experimental_ it signals an intentionally unstable API). Actually, removing an optional input property can cause a type error for consumers who were passing it. Let me reconsider: removing a property from an input type means consumers who were supplying that property will now get an excess-property-check error.

Subpath ./types

🟡 Non-breaking Changes (1)

Modified: ClerkProviderProps
// ... 2 unchanged lines elided ...
      tokenCache?: TokenCache;
      __experimental_passkeys?: BuildClerkOptions['__experimental_passkeys'];
      __experimental_resourceCache?: BuildClerkOptions['__experimental_resourceCache'];
-     __experimental_disableNativeClientSync?: boolean;
      updateRequiredViewEnabled?: boolean;
  };

Static analyzer: Breaking change in type alias ClerkProviderProps: Type changed: !Omit:type<import("@clerk/react").ClerkProviderProps<TUi>,'publishableKey'>&{publishableKey:string;tokenCache?:import("… → !Omit:type<import("@clerk/react").ClerkProviderProps<TUi>,'publishableKey'>&{publishableKey:string;tokenCache?:import("…

🤖 AI review (reclassified as non-breaking) (90%): The only difference is the removal of the optional property __experimental_disableNativeClientSync?: boolean from ClerkProviderProps, which is an input type (passed as props to ClerkProvider). Removing an optional input property means consumers who were passing that property now have excess property in their objects, which could cause a type error if they explicitly set it. However, since it was __experimental_ prefixed and optional, consumers who relied on it would need to stop passing it.


Report generated by Break Check

Last ran on 76546dc.

@wobsoriano
wobsoriano requested a review from a team December 1, 2026 00:19

@swolfand swolfand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified no remaining references to configureNative, __experimental_disableNativeClientSync, or pullFromNative, bridge version 2 matches across JS/iOS/Android, and nativeContract.test.ts still validates current specs against current native modules while skipping pre-v2 tags.

This branch was successfully deployed

2 active deployments
Preview – swingset — 76546dc3 Deployed Nov 30, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 76546dc3 Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants