iOS: deprecate undocumented RCT_ENABLE_LOADING_VIEW, replacing it with RCT_DEV_MENU (#37213)

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

`RCT_ENABLE_LOADING_VIEW` was added a long time ago with some internal-only use cases that no longer exist today. To avoid confusion, let's deprecate this flag, and re-use RCT_DEV_MENU, which was actually designed for similar dev workflow use cases.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D45509523

fbshipit-source-id: 3d73929ec6811496d26a24f24e8741b43ccbc100
This commit is contained in:
Kevin Gozali
2023-05-03 23:23:10 -07:00
committed by Facebook GitHub Bot
parent 523c77da59
commit 8e1d9a0b75
4 changed files with 9 additions and 9 deletions
@@ -25,7 +25,7 @@ using namespace facebook::react;
@interface RCTDevLoadingView () <NativeDevLoadingViewSpec>
@end
#if RCT_DEV | RCT_ENABLE_LOADING_VIEW
#if RCT_DEV_MENU
@implementation RCTDevLoadingView {
UIWindow *_window;
@@ -64,7 +64,7 @@
#import <React/RCTFBSystrace.h>
#endif
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#import <React/RCTDevLoadingViewProtocol.h>
#endif
@@ -476,7 +476,7 @@ struct RCTInstanceCallback : public InstanceCallback {
dispatch_group_enter(prepareBridge);
__block NSData *sourceCode;
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
{
id<RCTDevLoadingViewProtocol> loadingView = [self moduleForName:@"DevLoadingView" lazilyLoadIfNecessary:YES];
[loadingView showWithURL:self.bundleURL];
@@ -493,7 +493,7 @@ struct RCTInstanceCallback : public InstanceCallback {
dispatch_group_leave(prepareBridge);
}
onProgress:^(RCTLoadingProgress *progressData) {
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
id<RCTDevLoadingViewProtocol> loadingView = [weakSelf moduleForName:@"DevLoadingView"
lazilyLoadIfNecessary:YES];
[loadingView updateProgress:progressData];
@@ -1092,7 +1092,7 @@ struct RCTInstanceCallback : public InstanceCallback {
__weak __typeof(self) weakSelf = self;
[RCTJavaScriptLoader loadBundleAtURL:bundleURL
onProgress:^(RCTLoadingProgress *progressData) {
#if (RCT_DEV_MENU | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if (RCT_DEV_MENU | RCT_DEV_MENU) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
id<RCTDevLoadingViewProtocol> loadingView = [weakSelf moduleForName:@"DevLoadingView"
lazilyLoadIfNecessary:YES];
[loadingView updateProgress:progressData];
@@ -7,7 +7,7 @@
#import "RCTDevLoadingViewSetEnabled.h"
#if RCT_DEV | RCT_ENABLE_LOADING_VIEW
#if RCT_DEV_MENU
static BOOL isDevLoadingViewEnabled = YES;
#else
static BOOL isDevLoadingViewEnabled = NO;
@@ -38,7 +38,7 @@
#import "RCTJSThreadManager.h"
#import "RCTPerformanceLoggerUtils.h"
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#import <PikaOptimizationsMacros/PikaOptimizationsMacros.h>
#import <React/RCTDevLoadingViewProtocol.h>
#endif
@@ -319,7 +319,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
- (void)loadJSBundle:(NSURL *)sourceURL FB_OBJC_DIRECT
{
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
{
id<RCTDevLoadingViewProtocol> loadingView =
(id<RCTDevLoadingViewProtocol>)[_turboModuleManager moduleForName:"DevLoadingView"];
@@ -335,7 +335,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
return;
}
#if (RCT_DEV | RCT_ENABLE_LOADING_VIEW) && __has_include(<React/RCTDevLoadingViewProtocol.h>)
#if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
id<RCTDevLoadingViewProtocol> loadingView =
(id<RCTDevLoadingViewProtocol>)[strongSelf->_turboModuleManager moduleForName:"DevLoadingView"];
[loadingView updateProgress:progressData];