React Native New Architecture: Android TurboModule support#2902
Closed
wmathurin wants to merge 13 commits into
Closed
React Native New Architecture: Android TurboModule support#2902wmathurin wants to merge 13 commits into
wmathurin wants to merge 13 commits into
Conversation
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.
…d into rn-migration
…d into rn-migration
- 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.
2 tasks
Generated by 🚫 Danger |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Bridge Conversion (Java → Kotlin + TurboModule)
SalesforceOauthReactBridge.java→.ktSalesforceNetReactBridge.java→.ktSmartStoreReactBridge.java→.ktMobileSyncReactBridge.java→.ktSupporting Changes
ReactBridgeHelper.java— newinvokeSuccess()/invokeError()methodsSalesforceReactActivity.java— single-callbackauthenticate(),getAuthCredentials(),logout()build.gradle.kts— addedkotlin { jvmToolchain(17) }package.json— points atwmathurin#rn-migrationfor test bundledocs/salesforcereact/ARCHITECTURE.md— new architecture sectionTesting
./gradlew :libs:SalesforceReact:assembleDebugpassesRelated PRs
Before merging
libs/SalesforceReact/package.jsonreact-native-force toforcedotcom#dev