From f4c62901d80e5395ddc652e475e85d30d03c8421 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 2 Feb 2024 09:20:12 -0800 Subject: [PATCH] Remove RCTAppSetupPrepareApp overload and InspectorFlags call (#42642) Summary: Removes call to `InspectorFlags::initFromConfig`, since this approach is being replaced with `ReactNativeFeatureFlags`. This change is separated out as it originally made a public API deprecation. Changelog: [iOS][Deprecated] - **Un-deprecates** `RCTAppSetupPrepareApp` (reverts #41976) Reviewed By: motiz88 Differential Revision: D53048207 --- .../Libraries/AppDelegate/RCTAppDelegate.mm | 2 +- .../Libraries/AppDelegate/RCTAppSetupUtils.h | 14 +------------- .../Libraries/AppDelegate/RCTAppSetupUtils.mm | 17 ----------------- .../AppDelegate/React-RCTAppDelegate.podspec | 1 - 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 718f8ca5f8325f..f0698655ad3895 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -87,7 +87,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *initProps = updateInitialProps([self prepareInitialProps], fabricEnabled); - RCTAppSetupPrepareApp(application, enableTM, *_reactNativeConfig); + RCTAppSetupPrepareApp(application, enableTM); UIView *rootView; if (enableBridgeless) { diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h index ad48fa19bcbf1c..8c5776140e5aa3 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h @@ -11,8 +11,6 @@ #ifdef __cplusplus -#import - #import #if USE_HERMES @@ -43,21 +41,11 @@ std::unique_ptr RCTAppSetupJsExecutorFactory RCTBridge *bridge, const std::shared_ptr &runtimeScheduler); -/** - * Register features and experiments prior to app initialization. - */ -void RCTAppSetupPrepareApp( - UIApplication *application, - BOOL turboModuleEnabled, - const facebook::react::ReactNativeConfig &reactNativeConfig); - #endif // __cplusplus RCT_EXTERN_C_BEGIN -void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) - __deprecated_msg("Use the 3-argument overload of RCTAppSetupPrepareApp instead"); - +void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled); UIView *RCTAppSetupDefaultRootView( RCTBridge *bridge, NSString *moduleName, diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm index 865cac04ff4a5b..7c57844b1b272b 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm @@ -24,9 +24,6 @@ #import #import -// jsinspector-modern -#import - void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) { RCTEnableTurboModule(turboModuleEnabled); @@ -38,20 +35,6 @@ void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) #endif } -void RCTAppSetupPrepareApp( - UIApplication *application, - BOOL turboModuleEnabled, - const facebook::react::ReactNativeConfig &reactNativeConfig) -{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - RCTAppSetupPrepareApp(application, turboModuleEnabled); -#pragma clang diagnostic pop - - auto &inspectorFlags = facebook::react::jsinspector_modern::InspectorFlags::getInstance(); - inspectorFlags.initFromConfig(reactNativeConfig); -} - UIView * RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary *initialProperties, BOOL fabricEnabled) { diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 47eaade4f414f0..35281f25c003ea 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -88,7 +88,6 @@ Pod::Spec.new do |s| add_dependency(s, "React-utils") add_dependency(s, "React-debug") add_dependency(s, "React-rendererdebug") - add_dependency(s, "React-jsinspector") if use_hermes s.dependency "React-hermes"