Skip to content

Remove SalesforceReact (moved to SalesforceMobileSDK-ReactNative)#2904

Merged
wmathurin merged 17 commits into
forcedotcom:devfrom
wmathurin:rn-android-in-react-native
May 27, 2026
Merged

Remove SalesforceReact (moved to SalesforceMobileSDK-ReactNative)#2904
wmathurin merged 17 commits into
forcedotcom:devfrom
wmathurin:rn-android-in-react-native

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

@wmathurin wmathurin commented May 26, 2026

Summary

Removes all React Native code from this repo. The Android bridge modules, activity, SDK manager, tests, and CI have moved to SalesforceMobileSDK-ReactNative/android/.

Why

React Native 0.81.5's New Architecture (bridgeless mode) requires native modules to be discovered through the autolinking system, which generates C++ JNI wrappers at build time. Autolinking only works for code that lives inside the react-native-force npm package — modules in a separate repo included via Gradle composite build fail the TurboModule JNI classloader check at runtime. Moving the bridge code into the npm package (alongside the iOS bridge) solves this and also simplifies the cross-repo development workflow.

Changes

Removed

  • libs/SalesforceReact/ — All source, resources, config, manifest
  • libs/test/SalesforceReactTest/ — Test classes, resources, assets
  • .github/test-shards/SalesforceReact.json — Test sharding config
  • React Native npm section from install.sh and install.vbs
  • SalesforceReact include from settings.gradle.kts
  • JSC Maven repo entries from settings.gradle.kts
  • SalesforceReact from dokka in build.gradle.kts

Updated

  • CLAUDE.md — Removed SalesforceReact from library architecture
  • docs/salesforcereact/ — Added "MOVED" notices pointing to ReactNative repo

Related PRs

Test Plan

  • ./gradlew build passes without SalesforceReact
  • Other libraries unaffected (SalesforceSDK, SmartStore, MobileSync, SalesforceHybrid)

wmathurin added 17 commits May 18, 2026 20:59
The libs.versions.toml had a TODO note about updating react-android in
a dedicated work item; this is the right work item.

- gradle/libs.versions.toml: react-android 0.79.3 -> 0.81.5
- libs/SalesforceReact/build.gradle.kts: removed the TODO comment

Verified: ./gradlew :libs:SalesforceReact:assembleDebug succeeds.

Note on remaining Android work for new architecture: the Java bridge
modules (SalesforceOauthReactBridge, etc.) use @ReactMethod with separate
success and error callbacks. Under new architecture interop mode, RN
can wrap legacy @ReactMethod modules without code changes. Switching
the test app to new architecture requires migrating its ReactNativeHost
to DefaultReactNativeHost; that is best handled as a follow-up.
- Convert all 4 bridge modules from Java to Kotlin
- Add TurboModule interface to all bridges
- Unify callback pattern: single callback(error, result) matching iOS
- Update SalesforceReactActivity for single-callback pattern
- Update ReactBridgeHelper with invokeSuccess/invokeError methods
- Add kotlin jvmToolchain(17) to build.gradle.kts
- Update architecture documentation
NOTE: This must be reverted before merging to dev.
In bridgeless/new architecture mode, modules registered via plain
ReactPackage.createNativeModules() are not discoverable through
TurboModuleRegistry. Switch to BaseReactPackage with getModule()
and ReactModuleInfoProvider so modules are found by name.
BaseReactPackage approach didn't work at runtime. Reverting to plain
ReactPackage with createNativeModules(). Since our modules implement
TurboModule, the RN interop layer should make them available via
TurboModuleRegistry.get() automatically.
Create a proper Kotlin class for the package registration to ensure
BaseReactPackage is recognized by ReactPackageTurboModuleManagerDelegate
in bridgeless new architecture mode.
SalesforceReact Android bridge code now lives in the react-native-force
npm package (SalesforceMobileSDK-ReactNative/android/). This enables
proper React Native autolinking for TurboModule discovery in new
architecture bridgeless mode.

Removed:
- libs/SalesforceReact/ (source, resources, config)
- libs/test/SalesforceReactTest/ (test classes, assets)
- .github/test-shards/SalesforceReact.json
- React Native section from install.sh
- SalesforceReact include from settings.gradle.kts
- JSC maven repos from settings.gradle.kts
- SalesforceReact from dokka in build.gradle.kts
@github-actions
Copy link
Copy Markdown

1 Warning
⚠️ Big PR, try to keep changes smaller if you can.

Generated by 🚫 Danger

@wmathurin
Copy link
Copy Markdown
Contributor Author

Test failure for SalesforceReact is normal (the code and tests are gone, but CI runs using the action defined in the base branch - for security reason).

Copy link
Copy Markdown
Contributor

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce left a comment

Choose a reason for hiding this comment

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

👍🏻

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.07%. Comparing base (2bdebfe) to head (1745d64).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #2904      +/-   ##
============================================
- Coverage     55.08%   55.07%   -0.02%     
+ Complexity     2509     2507       -2     
============================================
  Files           226      226              
  Lines         17774    17774              
  Branches       2327     2327              
============================================
- Hits           9791     9789       -2     
- Misses         6979     6980       +1     
- Partials       1004     1005       +1     
Components Coverage Δ
Analytics 48.71% <ø> (ø)
SalesforceSDK 41.72% <ø> (-0.03%) ⬇️
Hybrid 59.30% <ø> (ø)
SmartStore 78.22% <ø> (ø)
MobileSync 82.12% <ø> (ø)
React 51.50% <ø> (ø)
see 2 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wmathurin wmathurin merged commit f951749 into forcedotcom:dev May 27, 2026
29 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants