Skip to content

Conversation

zhukaihan
Copy link
Contributor

@zhukaihan zhukaihan commented Oct 14, 2025

Supports RN new architecture.
Updated Android example app.

  1. Update RN to 0.74.x. Lowest to support new arch with interop layer auto enabled.
  2. Adding codegen config for generating native code.
  3. Adding Spec for native code interface.
  4. Updating native code to conform to spec interface.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for React Native's New Architecture (Fabric and TurboModules) while maintaining backward compatibility with the legacy architecture. The implementation introduces TurboModule specs, platform-specific conditional compilation, and updates the Android example app to the latest React Native version.

  • Implements TurboModule interface for React Native New Architecture support
  • Updates iOS and Android platform code with conditional compilation for architecture detection
  • Modernizes the example app to React Native 0.74.5 with new architecture support

Reviewed Changes

Copilot reviewed 37 out of 62 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/NativeExperimentReactNativeClient.ts TurboModule interface specification for the new architecture
package.json Updates dependencies and adds codegen configuration for new architecture
ios/ExperimentReactNativeClient.swift Adds conditional imports and extension for new architecture
ios/ExperimentReactNativeClient.mm Bridge module implementation with new architecture support
ios/ExperimentReactNativeClient.m Removed legacy bridge module implementation
experiment-react-native-client.podspec Updates iOS platform requirements and dependencies for new architecture
example/ Comprehensive update of Android example app to React Native 0.74.5 with new architecture support
android/ Refactors Android implementation with separate modules for old/new architecture

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shared Android native code implementation.

Copy link
Contributor Author

@zhukaihan zhukaihan Oct 16, 2025

Choose a reason for hiding this comment

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

New arch Android implementation. To conform to the generated spec interface. Redirect call to shared impl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old arch Android implementation. Old interface. Redirect call to shared impl.

Copy link
Contributor Author

@zhukaihan zhukaihan Oct 16, 2025

Choose a reason for hiding this comment

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

Conform implementation to the new spec interface if new arch enabled (through env var). Renaming to use cpp as React needs libs in cpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Conforms to new arch if enabled.

Copy link
Contributor Author

@zhukaihan zhukaihan Oct 16, 2025

Choose a reason for hiding this comment

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

Spec interface for JS on react native side. Also used to generate native code interfaces that native code would implement. File has to begin with Native*.ts to be picked up by codegen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upgraded RN to 0.74, async storage to 2.0.0.
Added codegen config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use spec and turbo module.

@zhukaihan zhukaihan marked this pull request as ready for review October 16, 2025 23:53
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.

1 participant