Fixed support for RN 0.76 and other older RN versions#746
Merged
Conversation
5bf81ed to
b998884
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR addresses React Native compatibility issues by refactoring the code generation approach and adding support for both new and old React Native architectures. The main purpose is to remove the unreliable includesGeneratedCode configuration and implement separate codepaths for new architecture (Fabric/TurboModules) and old architecture support.
Key changes:
- Removed
includesGeneratedCodeconfiguration and switched to standard React Native codegen behavior - Created separate Android source directories for new architecture (
newarch) and old architecture (oldarch) implementations - Updated iOS imports to use standard generated header paths instead of custom paths
Reviewed Changes
Copilot reviewed 11 out of 58 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| react-native.config.js | Removed cmakeListsPath configuration |
| package.json | Updated codegen script and configuration, removed custom output directories |
| ios/ReactNativeCameraKit/RNCameraKitModule.h | Updated import path for generated spec |
| ios/ReactNativeCameraKit/CKCameraViewComponentView.mm | Updated imports to use standard React Native component paths |
| example/ios/Podfile | Added commented option to disable new architecture |
| android/src/oldarch/java/com/rncamerakit/RNCameraKitModule.kt | New old architecture implementation |
| android/src/oldarch/java/com/rncamerakit/CKCameraManager.kt | New old architecture camera manager |
| android/src/newarch/java/com/rncamerakit/RNCameraKitModule.kt | Updated new architecture module import |
| android/src/newarch/java/com/rncamerakit/CKCameraManager.kt | Updated new architecture manager with context parameter |
| android/src/main/java/com/rncamerakit/RNCameraKitPackage.kt | Updated to pass ReactApplicationContext to CKCameraManager |
| android/build.gradle | Updated source sets to conditionally include architecture-specific code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Removed includesGeneratedCode since it's unreliable and is temporary Added new/old arch code split for Android
b998884 to
84d11bf
Compare
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.
Removed includesGeneratedCode since it's unreliable and is temporary Added new/old arch code split for Android
Summary
New arch has changed several times, and keeps changing, which makes it extremely difficult to maintain the library and use
includesGeneratedCode. This means we have to fork our code base to support the old arch and revert to using generated interfaces. With this change we are also temporarily adding support for old arch back, although it should be considered deprecated at this point.Issues like #744 should be fixed with this change.
How did you test this change?
Tested on iOS, Android, physical devices, and in sims.