Skip to content

Commit

Permalink
Remove RCTAppSetupPrepareApp overload and InspectorFlags call (#42642)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #42642

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

fbshipit-source-id: 8624020f1e9e19f9f1ee75af9b177e922e36c5d9
  • Loading branch information
huntie authored and facebook-github-bot committed Feb 13, 2024
1 parent 0575033 commit ce3ce11
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

NSDictionary *initProps = updateInitialProps([self prepareInitialProps], fabricEnabled);

RCTAppSetupPrepareApp(application, enableTM, *_reactNativeConfig);
RCTAppSetupPrepareApp(application, enableTM);

UIView *rootView;
if (enableBridgeless) {
Expand Down
14 changes: 1 addition & 13 deletions packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

#ifdef __cplusplus

#import <react/config/ReactNativeConfig.h>

#import <memory>

#if USE_HERMES
Expand Down Expand Up @@ -43,21 +41,11 @@ std::unique_ptr<facebook::react::JSExecutorFactory> RCTAppSetupJsExecutorFactory
RCTBridge *bridge,
const std::shared_ptr<facebook::react::RuntimeScheduler> &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,
Expand Down
17 changes: 0 additions & 17 deletions packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#import <React/RCTFabricSurface.h>
#import <React/RCTSurfaceHostingProxyRootView.h>

// jsinspector-modern
#import <jsinspector-modern/InspectorFlags.h>

void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled)
{
RCTEnableTurboModule(turboModuleEnabled);
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ce3ce11

Please sign in to comment.