Skip to content

Conversation

@scarlac
Copy link
Collaborator

@scarlac scarlac commented Sep 9, 2025

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.

@scarlac scarlac force-pushed the new-arch-no-included-codegen branch from 5bf81ed to b998884 Compare September 9, 2025 20:11
@scarlac scarlac requested a review from Copilot September 9, 2025 20:12
Copy link

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 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 includesGeneratedCode configuration 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
@scarlac scarlac force-pushed the new-arch-no-included-codegen branch from b998884 to 84d11bf Compare September 9, 2025 20:15
@scarlac scarlac merged commit 8634e69 into master Sep 9, 2025
2 of 4 checks passed
@scarlac scarlac deleted the new-arch-no-included-codegen branch September 9, 2025 20:16
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