SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Introduce new BuildConfig to determine if the new architecture is fully enabled into an Android app (#49283)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49283

In this diff I'm introducing a new BuildConfig called UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE to determine if the new architecture is fully enabled into an Android app at build time, fully enabled means:
- no interop
- all view managers migrated to new API
- all native modules migrated to new API
- legacy architecture can be stripped

This BuildConfig is different from ReactNativeFeatureFlags.enableBridgelessArchitecture() because the latter is controlled at runtime, BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE is used at the build system level and it can be accessed from proguard to optimize code that's unused when the app is fully running in the new architecture. Additionally we will use the BuildConfig to assert that some classes and methods are not loaded or executed.

changelog: [Android][Changed] Introduces BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE to determine if the new architecture is fully enabled into an Android app

Reviewed By: cortinico

Differential Revision: D69206248

fbshipit-source-id: f60a059be8333d3051eb7d2efac79939a479f6f8
D
David Vacca committed
b45a3e5cd81997e11b763073daf0a7f5b78188f8
Parent: 7b7c450
Committed by Facebook GitHub Bot <[email protected]> on 2/9/2025, 10:17:38 AM