callstack / react-native-brownfield

Set of helpers to make your brownfield integration smooth and easy.
MIT License
241 stars 14 forks source link

feat: support new architecture & bridgeless on iOS #79

Closed okwasniewski closed 2 months ago

okwasniewski commented 3 months ago

Summary

This PR adds new architecture & bridgeless support on iOS.

A new architecture config gets picked up if the user passes RCT_NEW_ARCH_ENABLED=1 to pod install.

Users can also opt out of specific new arch features like so:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        ReactNativeBrownfield.shared().entryFile = "example/index"

        // Run your app with only fabric enabled (disable bridgeless and turbo modules)
        ReactNativeBrownfield.shared().turboModuleEnabled = false
        ReactNativeBrownfield.shared().bridgelessEnabled = false
        ReactNativeBrownfield.shared().startReactNative {
            print("loaded")
        }

        return true
    }

Test plan

Test initializing the app in every scenario:

okwasniewski commented 2 months ago

Hey guys @michalchudziak, @atlj @jbroma would you mind looking at this PR? 🙏 I'm planning to create a follow up with Android implementation soon.