From 61335a13670385b5e43e0be067b428aca5aa4abf Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Fri, 12 May 2023 22:26:10 -0700 Subject: [PATCH] rename host preload -> start (#37422) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37422 Changelog: [Internal] in this simple change, i renamed the `preload` API, which triggers all the rct instance / javascript runtime creation to `start`. `preload` is a confusing API on the host because the host should be agnostic of when the timing to create its dependencies are, and the consumer should determine when initialization is lazy, early, etc. Reviewed By: cipolleschi Differential Revision: D45760583 fbshipit-source-id: bea26d21f950474352280292426a5facbe52b60f --- .../ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h | 2 +- .../ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h index 917e9544ee9be4..ff2e088abf5c39 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h @@ -67,7 +67,7 @@ typedef std::shared_ptr (^RCTHostJSEngineProv * main thread, but it should be threadsafe. * TODO T74233481 - Verify if this function is threadsafe. */ -- (void)preload; +- (void)start; - (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName mode:(facebook::react::DisplayMode)displayMode diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm index e2f3e2a2c26a9c..1450c809c342b0 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm @@ -140,7 +140,7 @@ - (instancetype)initWithHostDelegate:(id)hostDelegate #pragma mark - Public -- (void)preload +- (void)start { if (_instance) { RCTLogWarn(