From 388745a3514e59261937746193702b6cb9173097 Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Mon, 24 Jul 2023 08:13:07 -0700 Subject: [PATCH] Re-orgnize BridgelessApple files to keep proper header file include structure (#38322) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38322 As title, so that we can keep the format ```#import ``` Changelog: [iOS][Changed] - ] Re-orgnize BridgelessApple files to keep proper header file include structure Reviewed By: cipolleschi, dmytrorykun Differential Revision: D47421732 fbshipit-source-id: af14807d20676e8732c66fa7f792580819c33f33 --- .../AppDelegate/React-RCTAppDelegate.podspec | 2 ++ .../ios}/React-BridgelessApple.podspec | 16 +++++++++++----- .../{Core => ReactCommon}/ObjCTimerRegistry.h | 0 .../{Core => ReactCommon}/ObjCTimerRegistry.mm | 0 .../RCTContextContainerHandling.h | 0 .../{Hermes => ReactCommon}/RCTHermesInstance.h | 0 .../{Hermes => ReactCommon}/RCTHermesInstance.mm | 0 .../ios/{Core => ReactCommon}/RCTHost+Internal.h | 0 .../platform/ios/{Core => ReactCommon}/RCTHost.h | 0 .../ios/{Core => ReactCommon}/RCTHost.mm | 0 .../ios/{Core => ReactCommon}/RCTInstance.h | 0 .../ios/{Core => ReactCommon}/RCTInstance.mm | 1 + .../{Core => ReactCommon}/RCTJSThreadManager.h | 0 .../{Core => ReactCommon}/RCTJSThreadManager.mm | 0 .../ios/{JSC => ReactCommon}/RCTJscInstance.h | 0 .../ios/{JSC => ReactCommon}/RCTJscInstance.mm | 0 .../RCTLegacyUIManagerConstantsProvider.h | 0 .../RCTLegacyUIManagerConstantsProvider.mm | 0 .../RCTPerformanceLoggerUtils.h | 0 .../RCTPerformanceLoggerUtils.mm | 0 .../react-native/scripts/cocoapods/bridgeless.rb | 2 +- 21 files changed, 15 insertions(+), 6 deletions(-) rename packages/react-native/ReactCommon/react/bridgeless/{ => platform/ios}/React-BridgelessApple.podspec (83%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/ObjCTimerRegistry.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/ObjCTimerRegistry.mm (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTContextContainerHandling.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Hermes => ReactCommon}/RCTHermesInstance.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Hermes => ReactCommon}/RCTHermesInstance.mm (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTHost+Internal.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTHost.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTHost.mm (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTInstance.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTInstance.mm (99%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTJSThreadManager.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTJSThreadManager.mm (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{JSC => ReactCommon}/RCTJscInstance.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{JSC => ReactCommon}/RCTJscInstance.mm (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{NativeViewConfig => ReactCommon}/RCTLegacyUIManagerConstantsProvider.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{NativeViewConfig => ReactCommon}/RCTLegacyUIManagerConstantsProvider.mm (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTPerformanceLoggerUtils.h (100%) rename packages/react-native/ReactCommon/react/bridgeless/platform/ios/{Core => ReactCommon}/RCTPerformanceLoggerUtils.mm (100%) diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 6f1a24d14f674f..8df2d6a7288e46 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -47,6 +47,8 @@ header_search_paths = [ "$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", "$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", "$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "$(PODS_CONFIGURATION_BUILD_DIR)/React-BridgelessApple/React_BridgelessApple.framework/Headers", + "$(PODS_CONFIGURATION_BUILD_DIR)/React-BridgelessCore/React_BridgelessCore.framework/Headers", "$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers/", "$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers/", "$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/", diff --git a/packages/react-native/ReactCommon/react/bridgeless/React-BridgelessApple.podspec b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/React-BridgelessApple.podspec similarity index 83% rename from packages/react-native/ReactCommon/react/bridgeless/React-BridgelessApple.podspec rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/React-BridgelessApple.podspec index 77ebd3d76c0614..acdac0d0a61644 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/React-BridgelessApple.podspec +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/React-BridgelessApple.podspec @@ -5,7 +5,7 @@ require "json" -package = JSON.parse(File.read(File.join(__dir__, "../../..", "package.json"))) +package = JSON.parse(File.read(File.join(__dir__, "../../../../..", "package.json"))) version = package['version'] source = { :git => 'https://github.com/facebook/react-native.git' } @@ -21,6 +21,12 @@ folly_version = '2021.07.22.00' folly_dep_name = 'RCT-Folly/Fabric' boost_compiler_flags = '-Wno-documentation' +header_search_paths = [ + "$(PODS_ROOT)/boost", + "$(PODS_TARGET_SRCROOT)/../../../..", + "$(PODS_TARGET_SRCROOT)/../../../../..", +] + Pod::Spec.new do |s| s.name = "React-BridgelessApple" s.version = version @@ -30,9 +36,9 @@ Pod::Spec.new do |s| s.author = "Meta Platforms, Inc. and its affiliates" s.platforms = { :ios => min_ios_version_supported } s.source = source - s.source_files = "platform/ios/**/*.{mm,h}" + s.source_files = "ReactCommon/*.{mm,h}" s.header_dir = "ReactCommon" - s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_TARGET_SRCROOT)/../..\" \"$(PODS_TARGET_SRCROOT)/../../..\"", + s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => header_search_paths, "USE_HEADERMAP" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", "GCC_WARN_PEDANTIC" => "YES" } @@ -61,9 +67,9 @@ Pod::Spec.new do |s| if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" s.dependency "hermes-engine" s.dependency "React-BridgelessHermes" - s.exclude_files = "platform/ios/JSC/*.{mm,h}" + s.exclude_files = "ReactCommon/RCTJscInstance.{mm,h}" else s.dependency "React-jsc" - s.exclude_files = "platform/ios/hermes/*.{mm,h}" + s.exclude_files = "ReactCommon/RCTHermesInstance.{mm,h}" end end diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/ObjCTimerRegistry.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/ObjCTimerRegistry.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/ObjCTimerRegistry.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/ObjCTimerRegistry.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/ObjCTimerRegistry.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/ObjCTimerRegistry.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/ObjCTimerRegistry.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/ObjCTimerRegistry.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTContextContainerHandling.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTContextContainerHandling.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTContextContainerHandling.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTContextContainerHandling.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Hermes/RCTHermesInstance.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHermesInstance.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Hermes/RCTHermesInstance.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHermesInstance.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Hermes/RCTHermesInstance.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHermesInstance.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Hermes/RCTHermesInstance.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHermesInstance.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost+Internal.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHost+Internal.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost+Internal.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHost+Internal.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHost.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHost.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHost.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTHost.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTInstance.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTInstance.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTInstance.mm similarity index 99% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTInstance.mm index 74c3722c4b08ac..0842d70c7eff6c 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTInstance.mm @@ -38,6 +38,7 @@ #import "ObjCTimerRegistry.h" #import "RCTJSThreadManager.h" +#import "RCTLegacyUIManagerConstantsProvider.h" #import "RCTPerformanceLoggerUtils.h" #if RCT_DEV_MENU && __has_include() diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTJSThreadManager.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJSThreadManager.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTJSThreadManager.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJSThreadManager.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTJSThreadManager.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJSThreadManager.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTJSThreadManager.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJSThreadManager.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/JSC/RCTJscInstance.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJscInstance.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/JSC/RCTJscInstance.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJscInstance.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/JSC/RCTJscInstance.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJscInstance.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/JSC/RCTJscInstance.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTJscInstance.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/NativeViewConfig/RCTLegacyUIManagerConstantsProvider.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/NativeViewConfig/RCTLegacyUIManagerConstantsProvider.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/NativeViewConfig/RCTLegacyUIManagerConstantsProvider.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/NativeViewConfig/RCTLegacyUIManagerConstantsProvider.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTPerformanceLoggerUtils.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.h similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTPerformanceLoggerUtils.h rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.h diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTPerformanceLoggerUtils.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTPerformanceLoggerUtils.mm rename to packages/react-native/ReactCommon/react/bridgeless/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm diff --git a/packages/react-native/scripts/cocoapods/bridgeless.rb b/packages/react-native/scripts/cocoapods/bridgeless.rb index bd0a97f4502841..efbc030da6342c 100644 --- a/packages/react-native/scripts/cocoapods/bridgeless.rb +++ b/packages/react-native/scripts/cocoapods/bridgeless.rb @@ -11,7 +11,7 @@ def setup_bridgeless!(react_native_path: "../node_modules/react-native", use_her pod "React-jsitracing", :path => "#{react_native_path}/ReactCommon/hermes/executor/" pod "React-runtimescheduler", :path => "#{react_native_path}/ReactCommon/react/renderer/runtimescheduler" pod 'React-BridgelessCore', :path => "#{react_native_path}/ReactCommon/react/bridgeless" - pod 'React-BridgelessApple', :path => "#{react_native_path}/ReactCommon/react/bridgeless" + pod 'React-BridgelessApple', :path => "#{react_native_path}/ReactCommon/react/bridgeless/platform/ios" if use_hermes pod 'React-BridgelessHermes', :path => "#{react_native_path}/ReactCommon/react/bridgeless" end