From 659ecd47bad0a60646a67e7aeb8abf36bc866d18 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Sat, 22 Jul 2023 23:21:22 -0700 Subject: [PATCH] cleanup isMainQueueExecutionOfConstantToExportDisabled (#38542) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38542 Changelog: [Internal] never shipped, also seems not relevant after shipping TM bypass-github-export-checks Reviewed By: mdvacca, cipolleschi Differential Revision: D47620463 fbshipit-source-id: 8d9120c6cfec60e2b0b25badc46d4e35b18cfc61 --- packages/react-native/React/Base/RCTModuleData.h | 4 ---- packages/react-native/React/Base/RCTModuleData.mm | 13 +------------ .../react-native/React/CxxBridge/RCTCxxBridge.mm | 4 +--- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/packages/react-native/React/Base/RCTModuleData.h b/packages/react-native/React/Base/RCTModuleData.h index a1c5b3a62d7..6e3c0cbf5d7 100644 --- a/packages/react-native/React/Base/RCTModuleData.h +++ b/packages/react-native/React/Base/RCTModuleData.h @@ -8,7 +8,6 @@ #import #import -#import "RCTDefines.h" @protocol RCTBridgeMethod; @protocol RCTBridgeModule; @@ -112,6 +111,3 @@ typedef id (^RCTBridgeModuleProvider)(void); @property (nonatomic, assign, readonly) BOOL implementsPartialBatchDidFlush; @end - -RCT_EXTERN void RCTSetIsMainQueueExecutionOfConstantsToExportDisabled(BOOL val); -RCT_EXTERN BOOL RCTIsMainQueueExecutionOfConstantsToExportDisabled(void); diff --git a/packages/react-native/React/Base/RCTModuleData.mm b/packages/react-native/React/Base/RCTModuleData.mm index 3e7fd3e7f76..dbbc6daa9aa 100644 --- a/packages/react-native/React/Base/RCTModuleData.mm +++ b/packages/react-native/React/Base/RCTModuleData.mm @@ -32,17 +32,6 @@ int32_t getUniqueId() return counter++; } } -static BOOL isMainQueueExecutionOfConstantToExportDisabled = NO; - -void RCTSetIsMainQueueExecutionOfConstantsToExportDisabled(BOOL val) -{ - isMainQueueExecutionOfConstantToExportDisabled = val; -} - -BOOL RCTIsMainQueueExecutionOfConstantsToExportDisabled() -{ - return isMainQueueExecutionOfConstantToExportDisabled; -} @implementation RCTModuleData { NSDictionary *_constantsToExport; @@ -461,7 +450,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init); BridgeNativeModulePerfLogger::moduleJSRequireEndingStart([moduleName UTF8String]); } - if (!RCTIsMainQueueExecutionOfConstantsToExportDisabled() && _requiresMainQueueSetup) { + if (_requiresMainQueueSetup) { if (!RCTIsMainQueue()) { RCTLogWarn(@"Required dispatch_sync to load constants for %@. This may lead to deadlocks", _moduleClass); } diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm index 55793e9d02e..ee4e1df3c95 100644 --- a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -1030,9 +1030,7 @@ struct RCTInstanceCallback : public InstanceCallback { if (self.valid && ![moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) { [self->_performanceLogger appendStartForTag:RCTPLNativeModuleMainThread]; (void)[moduleData instance]; - if (!RCTIsMainQueueExecutionOfConstantsToExportDisabled()) { - [moduleData gatherConstants]; - } + [moduleData gatherConstants]; [self->_performanceLogger appendStopForTag:RCTPLNativeModuleMainThread]; } };