Skip to content

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

Merged
wobsoriano merged 4 commits into
mainfrom
rob/mobile-730-bridge-api-cleanup
Dec 2, 2026
Merged

wobsoriano merged 4 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.

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.

This needs @clerk/expo-native-components 1.0, so it ships together with #11052. Merge #11052 into this branch first, then merge this PR, so both reach main in one commit.

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 Dec 2, 2026 10:43pm UTC
swingset Ready Ready Preview Dec 2, 2026 10:43pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
mosaic-docs Ignored Ignored Preview Dec 2, 2026 10:43pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1550e33

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

This PR includes changesets to release 1 package
Name Type
@clerk/expo 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 bridge-version checking between Expo and native components, which this change updates and uses for compatibility checks.
  • clerk/javascript#11052: Continues the package-versioning work with a native-components 1.0 changeset and an updated Expo peer range.

Suggested reviewers: mikepitre, seanperez29

Merge Risk: Minimal · up to cbf6e

This change renames the native sync configuration method, bumps the bridge version, and removes an experimental provider prop. Older native builds receive a version-mismatch error instead of failing at configuration. No actionable merge 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 main change. The PR removes the __experimental_disableNativeClientSync prop, removes the idle() and pullFromNative() exports, r…
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.
Description check Passed The description is specific and tied to the changeset. It states the removal of the __experimental_disableNativeClientSync prop from ClerkProvider and the removal of the idle() and pullFromNative() ex…
Full details: Title check

Explanation

The title "chore(expo): clean up the native sync bridge API" matches the main change. 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 package scope and the bridge API cleanup, which covers the primary change. It does not list every detail, which is expected.

Full details: Description check

Explanation

The description is specific and tied to the changeset. It states the removal of the __experimental_disableNativeClientSync prop from ClerkProvider and the removal of the idle() and pullFromNative() exports. It also states the rename of configureNative to configure, the bridge version bump to 2, and the contract-test change. It further notes the need to merge with #11052 first. This matches the summary of changes, so the description is related to the changeset.

  • 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 76546dc and cbf6e19.

Files selected for processing: 5

  • packages/expo-native-components/android/src/main/java/expo/modules/clerk/ClerkAuthViewModule.kt
  • packages/expo-native-components/ios/ClerkNativeBridge.swift
  • packages/expo/src/provider/__tests__/nativeClientSync.test.ts
  • packages/expo/src/provider/__tests__/nativeClientSyncBehavior/nativeClientSync.behavior.test.tsx
  • packages/expo/src/provider/nativeClientSync.ts
Linked repositories identified

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

Included review availability: This review used your included allowance. 6 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 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: 1550e33

@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 Older native builds get the version-mismatch error

Tested on cbf6e192 — Head disables both older native shapes with the 'expected 2' mismatch error and loads the v2 configure module. Base loaded both older shapes as v1.

Merge-base

Loader verdicts

This PR cbf6e192

Loader verdicts

Also checked · 3 match

Matches Sync engine configures native via configure
Matches ClerkProvider drops __experimental_disableNativeClientSync
Matches Native contract test skips pre-v2 releases

Proof on 1550e33b (from cbf6e192) · 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-02T22:35:20.441Z

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.9
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 property __experimental_disableNativeClientSync?: boolean from ClerkProviderProps, which is an input type (passed as a prop to ClerkProvider). Removing an optional input property is non-breaking: consumers who never passed it are unaffected, and consumers who did pass it will now have that property ignored — but since it was optional and experimental, no well-typed consumer is required to have used it, and passing an extra property would cause a type error only if the consumer explicitly sets it. Actually, removing an optional property from an input type can be breaking if consumers were setting it. Let me reconsider: removing an optional property from an input object type means consumers who were assigning __experimental_disableNativeClientSync: true will now get a type error (excess property check). This makes it breaking for those consumers.

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) (95%): The only change is the removal of the optional property __experimental_disableNativeClientSync?: boolean from ClerkProviderProps. Since ClerkProviderProps is used as an input (parameter) type for ClerkProvider, removing an optional input property is non-breaking: consumers who passed it were providing an extra optional field that the library accepted, and removing it means consumers who passed it would have excess property errors — however, since it's prefixed with __experimental_, it signals internal/unstable use. More precisely: existing consumers who did NOT pass __experimental_disableNativeClientSync are entirely unaffected; consumers who DID pass it may get excess property check errors, making this technically breaking for those callers.


Report generated by Break Check

Last ran on 1550e33.

@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.

…-api-cleanup

# Conflicts:
#	packages/expo/src/provider/nativeClientSync.ts
@wobsoriano
wobsoriano merged commit f19e728 into main Dec 2, 2026
68 of 69 checks passed
@wobsoriano
wobsoriano deleted the rob/mobile-730-bridge-api-cleanup branch December 2, 2026 22:42

This branch was successfully deployed

2 active deployments
Preview – swingset — 1550e33b Deployed Dec 2, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 1550e33b Deployed Dec 2, 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