From e1b55129b266abfe4689a1eddbd96f67af3f221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 28 Oct 2024 07:44:44 -0700 Subject: [PATCH] Migrate feature flag for automatic Fabric interop to new feature flag system Summary: Changelog: [internal] Differential Revision: D65062305 --- .../react-native/Libraries/AppDelegate/RCTAppDelegate.mm | 4 ++++ .../ReactCommon/react/config/ReactNativeConfig.cpp | 3 --- .../react/renderer/componentregistry/CMakeLists.txt | 2 +- .../componentregistry/ComponentDescriptorRegistry.cpp | 8 ++------ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index baca356003be7f..0a8915da123415 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -316,6 +316,10 @@ bool enableFabricRenderer() override { return true; } + bool useFabricInterop() override + { + return true; + } bool useTurboModules() override { return true; diff --git a/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp b/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp index dbeae137424e88..7838f19c4c2384 100644 --- a/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp +++ b/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp @@ -10,9 +10,6 @@ namespace facebook::react { bool EmptyReactNativeConfig::getBool(const std::string& param) const { - if (param == "react_fabric:enabled_automatic_interop_android") { - return true; - } return false; } diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/CMakeLists.txt b/packages/react-native/ReactCommon/react/renderer/componentregistry/CMakeLists.txt index 5ea2f55a490c88..52cc286324bf83 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/CMakeLists.txt @@ -23,8 +23,8 @@ target_link_libraries(react_render_componentregistry folly_runtime glog_init jsi - react_config react_debug + react_featureflags react_render_core react_render_debug react_utils diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp index cbf6bcc1bd506f..e1e4f87bb4e135 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp @@ -9,8 +9,8 @@ #include "componentNameByReactViewName.h" -#include #include +#include #include #include #include @@ -84,11 +84,7 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at( } if (it == _registryByName.end()) { - auto reactNativeConfig_ = - contextContainer_->at>( - "ReactNativeConfig"); - if (reactNativeConfig_->getBool( - "react_fabric:enabled_automatic_interop_android")) { + if (ReactNativeFeatureFlags::useFabricInterop()) { auto componentDescriptor = std::make_shared< const UnstableLegacyViewManagerAutomaticComponentDescriptor>( parameters_, unifiedComponentName);