Skip to content

Conversation

@mdvacca
Copy link
Contributor

@mdvacca mdvacca commented Apr 9, 2025

Summary:
In this diff I'm introducing a new lint error called UseReactNativeNewArchitectureFeatureFlagDetector to prevent usages of:

ReactNativeFeatureFlags.enableBridgelessArchitecture
ReactNativeFeatureFlags.enableFabricRenderer
ReactNativeFeatureFlags.useFabricInterop
ReactNativeFeatureFlags.useTurboModuleInterop
ReactNativeFeatureFlags.useTurboModules

in favor of:

ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture
ReactNativeNewArchitectureFeatureFlags.enableFabricRenderer
ReactNativeNewArchitectureFeatureFlags.useFabricInterop
ReactNativeNewArchitectureFeatureFlags.useTurboModuleInterop
ReactNativeNewArchitectureFeatureFlags.useTurboModules

I created lint by following: https://www.internalfb.com/wiki/Android-lint/adding-a-new-lint-detector/

Reviewed By: cortinico

Differential Revision: D72028734

mdvacca added 5 commits April 9, 2025 16:30
Summary:

Mark ReactPackageLogger as LegacyArchitecture

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D72067076
…FY_LEGACY_ARCHITECTURE == true

Summary:
ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE asume Fabric and TurboModule interops are disabled, in this diff I'm adding an assertion to validate this at runtime

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D71854550
Summary:
In order to help Proguard to stripping-out bytecode, we need a way to statically enable all Feature Flags used by the New Architecture at build time (e.g. enableBridgelessArchitecture, useTurboModule, etc). The React Native Feature Flag system is mostly implemented in C++ and unfortunately Proguard can’t follow C++ code to understand what feature flags are enabled or disabled at build time.

After analyzing several proposals, we decided to introduce a new internal API called ReactNativeNewArchitectureFeatureFlags, this API will help us detect if an app is using the new architecture at build time.
In order to make this API to work I’ve migrated all usages of new architecture feature flags from ReactNativeFeatureFlags -> ReactNativeNewArchitectureFeatureFlags 

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D71988912
…lags for new architecture feature flags

Summary:
This diff migrates all usages of new architecture feature flags from ReactNativeFeatureFlags -> ReactNativeNewArchitectureFeatureFlags 

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D71988913
Summary:
In this diff I'm introducing a new lint error called UseReactNativeNewArchitectureFeatureFlagDetector to prevent usages of: 

```
ReactNativeFeatureFlags.enableBridgelessArchitecture
ReactNativeFeatureFlags.enableFabricRenderer
ReactNativeFeatureFlags.useFabricInterop
ReactNativeFeatureFlags.useTurboModuleInterop
ReactNativeFeatureFlags.useTurboModules
```

in favor of:
```
ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture
ReactNativeNewArchitectureFeatureFlags.enableFabricRenderer
ReactNativeNewArchitectureFeatureFlags.useFabricInterop
ReactNativeNewArchitectureFeatureFlags.useTurboModuleInterop
ReactNativeNewArchitectureFeatureFlags.useTurboModules
```

I created lint by following: https://www.internalfb.com/wiki/Android-lint/adding-a-new-lint-detector/

Reviewed By: cortinico

Differential Revision: D72028734
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Apr 9, 2025
@javache
Copy link
Member

javache commented Apr 23, 2025

Merged as 767462a

@javache javache closed this Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants