Skip to content

Commit 935f733

Browse files
javachemeta-codesync[bot]
authored andcommitted
Remove RCTInstance runtime diagnostic flags getter/setter (#58384)
Summary: Pull Request resolved: #58384 Removes the `RCTInstanceRuntimeDiagnosticFlags` getter and `RCTInstanceSetRuntimeDiagnosticFlags` setter (and the backing static) from the bridgeless `RCTInstance` runtime, on both the iOS and macOS platform copies. The setter had no callers anywhere, so the getter always returned an empty string and the `RN$DiagnosticFlags` JS global was never defined. The `ReactInstance::JSRuntimeFlags::runtimeDiagnosticFlags` field already defaults to an empty string, so the `initializeRuntime` call site now relies on that default with no change in runtime behavior. Changelog: [iOS][Removed] - Remove `RCTInstanceSetRuntimeDiagnosticFlags` and `RCTInstanceRuntimeDiagnosticFlags` Reviewed By: christophpurrer Differential Revision: D119072229 fbshipit-source-id: c249705231efd4ffe1a9e768758665589a420aae
1 parent df86c5e commit 935f733

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@
1818

1919
NS_ASSUME_NONNULL_BEGIN
2020

21-
/**
22-
* A utility to enable diagnostics mode at runtime. Useful for test runs.
23-
* The flags are comma-separated string tokens, or an empty string when
24-
* nothing is enabled.
25-
*/
26-
RCT_EXTERN NSString *RCTInstanceRuntimeDiagnosticFlags(void);
27-
RCT_EXTERN void RCTInstanceSetRuntimeDiagnosticFlags(NSString *_Nullable flags);
28-
2921
@class RCTBundleManager;
3022
@class RCTInstance;
3123
@class RCTJSThreadManager;

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,6 @@
6161
using namespace facebook;
6262
using namespace facebook::react;
6363

64-
static NSString *sRuntimeDiagnosticFlags = nil;
65-
NSString *RCTInstanceRuntimeDiagnosticFlags(void)
66-
{
67-
return sRuntimeDiagnosticFlags ? [sRuntimeDiagnosticFlags copy] : [NSString new];
68-
}
69-
70-
void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
71-
{
72-
if (!flags) {
73-
return;
74-
}
75-
sRuntimeDiagnosticFlags = [flags copy];
76-
}
77-
7864
__attribute__((deprecated(
7965
"RCTBridgelessDisplayLinkModuleHolder is part of the legacy architecture and will be removed in a future React Native release.")))
8066
@interface RCTBridgelessDisplayLinkModuleHolder : NSObject<RCTDisplayLinkModuleHolder>
@@ -440,9 +426,7 @@ - (void)_start
440426
_displayLink = [RCTDisplayLink new];
441427

442428
auto &inspectorFlags = jsinspector_modern::InspectorFlags::getInstance();
443-
ReactInstance::JSRuntimeFlags options = {
444-
.isProfiling = inspectorFlags.getIsProfilingBuild(),
445-
.runtimeDiagnosticFlags = [RCTInstanceRuntimeDiagnosticFlags() UTF8String]};
429+
ReactInstance::JSRuntimeFlags options = {.isProfiling = inspectorFlags.getIsProfilingBuild()};
446430
_reactInstance->initializeRuntime(options, [=](jsi::Runtime &runtime) {
447431
__strong __typeof(self) strongSelf = weakSelf;
448432
if (!strongSelf) {

0 commit comments

Comments
 (0)