From 438f6cf5915786e611ebea3bfc9b96c3106c2aa9 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Fri, 5 May 2023 15:14:24 -0700 Subject: [PATCH] delete RCTJSScriptLoaderModule (#37284) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37284 Changelog: [iOS][Removed] in the past, we had this protocol so we could decorate the `RCTDevSplitBundleLoader`, which was removed by motiz88. now that doesn't exist anymore, we should delete this protocol. i did a quick grep on github and this protocol was only used by `RCTDevSplitBundleLoader`, so i don't think this will be a major breaking change Reviewed By: christophpurrer Differential Revision: D45591882 fbshipit-source-id: 23656d0c04fa4e1c4cfc65b1052d4c3614ba8708 --- .../React/Base/RCTJSScriptLoaderModule.h | 22 ------------------- .../platform/ios/Core/RCTInstance.mm | 7 ------ 2 files changed, 29 deletions(-) delete mode 100644 packages/react-native/React/Base/RCTJSScriptLoaderModule.h diff --git a/packages/react-native/React/Base/RCTJSScriptLoaderModule.h b/packages/react-native/React/Base/RCTJSScriptLoaderModule.h deleted file mode 100644 index f05d361a579411..00000000000000 --- a/packages/react-native/React/Base/RCTJSScriptLoaderModule.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -@class RCTSource; - -NS_ASSUME_NONNULL_BEGIN - -/** - * This protocol should be adopted when a turbo module needs to tell React Native to load a script. - * In bridge-less React Native, it is a replacement for [_bridge loadAndExecuteSplitBundleURL:]. - */ -@protocol RCTJSScriptLoaderModule - -@property (nonatomic, copy) void (^loadScript)(RCTSource *source); - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm index 872647242a43ba..a30f029e65f022 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm @@ -19,7 +19,6 @@ #import #import #import -#import #import #import #import @@ -259,12 +258,6 @@ - (Class)getModuleClassFromName:(const char *)name - (void)_attachBridgelessAPIsToModule:(id)module FB_OBJC_DIRECT { __weak RCTInstance *weakInstance = self; - if ([module respondsToSelector:@selector(setLoadScript:)]) { - ((id)module).loadScript = ^(RCTSource *source) { - [weakInstance loadScriptFromSource:(source)]; - }; - } - if ([module respondsToSelector:@selector(setDispatchToJSThread:)]) { ((id)module).dispatchToJSThread = ^(dispatch_block_t block) { __strong __typeof(self) strongSelf = weakInstance;