diff --git a/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 4d89f36e0fd778..6445a37e73b840 100644 --- a/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -37,16 +37,6 @@ header_search_paths = [ ].concat(use_hermes ? [ "$(PODS_ROOT)/Headers/Public/React-hermes", "$(PODS_ROOT)/Headers/Public/hermes-engine" -] : []).concat(use_frameworks ? [ - "$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers/", - "$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/", - "$(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-RCTFabric/RCTFabric.framework/Headers/", - "$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers/", - "$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/", - "$(PODS_CONFIGURATION_BUILD_DIR)/React-runtimescheduler/React_runtimescheduler.framework/Headers/", ] : []).map{|p| "\"#{p}\""}.join(" ") Pod::Spec.new do |s| @@ -77,7 +67,7 @@ Pod::Spec.new do |s| s.dependency "ReactCommon/turbomodule/core" s.dependency "React-RCTNetwork" s.dependency "React-RCTImage" - s.dependency "React-NativeModulesApple" + # s.dependency "React-NativeModulesApple" s.dependency "React-CoreModules" s.dependency "React-runtimescheduler" diff --git a/ReactCommon/react/debug/React-debug.podspec b/ReactCommon/react/debug/React-debug.podspec index dab4a31652edfa..d52dd1f0f76dcb 100644 --- a/ReactCommon/react/debug/React-debug.podspec +++ b/ReactCommon/react/debug/React-debug.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => min_ios_version_supported } + s.platforms = { :ios => min_ios_version_supported, :osx => "10.15" } # [macOS] s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "react/debug" diff --git a/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec b/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec index 14c9ed0daa0825..601a611ba5877b 100644 --- a/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +++ b/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => min_ios_version_supported } + s.platforms = { :ios => min_ios_version_supported, :osx => "10.15" } # [macOS] s.source = source s.source_files = "**/*.{cpp,h}" s.compiler_flags = folly_compiler_flags diff --git a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp index fe3b9cfe9ecfb6..bc0c9794f896be 100644 --- a/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +++ b/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp @@ -6,9 +6,9 @@ */ #include "RuntimeSchedulerBinding.h" -#include +#include "SchedulerPriority.h" #include "RuntimeScheduler.h" -#include "SchedulerPriorityUtils.h" +//#include "SchedulerPriorityUtils.h" #include "primitives.h" #include diff --git a/ReactCommon/react/renderer/runtimescheduler/primitives.h b/ReactCommon/react/renderer/runtimescheduler/primitives.h index 67c085da251186..e234dd19e897fc 100644 --- a/ReactCommon/react/renderer/runtimescheduler/primitives.h +++ b/ReactCommon/react/renderer/runtimescheduler/primitives.h @@ -13,12 +13,17 @@ namespace facebook { namespace react { +struct TaskWrapper : public jsi::HostObject { + TaskWrapper(std::shared_ptr const &task) : task(task) {} + + std::shared_ptr task; +}; + inline static jsi::Value valueFromTask( jsi::Runtime &runtime, std::shared_ptr task) { - jsi::Object obj(runtime); - obj.setNativeState(runtime, std::move(task)); - return obj; + return jsi::Object::createFromHostObject( + runtime, std::make_shared(task)); } inline static std::shared_ptr taskFromValue( @@ -28,7 +33,7 @@ inline static std::shared_ptr taskFromValue( return nullptr; } - return value.getObject(runtime).getNativeState(runtime); + return value.getObject(runtime).getHostObject(runtime)->task; } } // namespace react diff --git a/ReactCommon/react/utils/ManagedObjectWrapper.h b/ReactCommon/react/utils/ManagedObjectWrapper.h index 3af8b158eb663c..afcc10c9bd415c 100644 --- a/ReactCommon/react/utils/ManagedObjectWrapper.h +++ b/ReactCommon/react/utils/ManagedObjectWrapper.h @@ -14,7 +14,7 @@ #endif #if defined(__OBJC__) && defined(__cplusplus) -#if TARGET_OS_MAC +#if TARGET_OS_MAC && (TARGET_OS_IPHONE || TARGET_OS_OSX) #include diff --git a/ReactCommon/react/utils/ManagedObjectWrapper.mm b/ReactCommon/react/utils/ManagedObjectWrapper.mm index 44e4241f48460c..474972d8454587 100644 --- a/ReactCommon/react/utils/ManagedObjectWrapper.mm +++ b/ReactCommon/react/utils/ManagedObjectWrapper.mm @@ -7,7 +7,7 @@ #include "ManagedObjectWrapper.h" -#if TARGET_OS_MAC +#if TARGET_OS_MAC && (TARGET_OS_IPHONE || TARGET_OS_OSX) namespace facebook { namespace react { @@ -33,4 +33,4 @@ void wrappedManagedObjectDeleter(void *cfPointer) noexcept @implementation RCTInternalGenericWeakWrapper @end -#endif +// #endif diff --git a/ReactCommon/react/utils/React-utils.podspec b/ReactCommon/react/utils/React-utils.podspec index d262c559241052..1ccd743eb8afa3 100644 --- a/ReactCommon/react/utils/React-utils.podspec +++ b/ReactCommon/react/utils/React-utils.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => min_ios_version_supported } + s.platforms = { :ios => min_ios_version_supported, :osx => "10.15" } # [macOS] s.source = source s.source_files = "**/*.{cpp,h,mm}" s.compiler_flags = folly_compiler_flags diff --git a/package.json b/package.json index 133c5ea5db21d6..29e8c67b70fd7e 100644 --- a/package.json +++ b/package.json @@ -201,6 +201,7 @@ "shouldPublish": false }, "resolutions": { + "@babel/runtime": "7.21.0", "async": "^3.2.2", "debug": ">=3.1.0", "es5-ext": "0.10.53", diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 321f7ae5430a4e..93c9bad35e9ccc 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -43,7 +43,9 @@ PODS: - React-RCTVibration (= 0.71.9) - React-callinvoker (0.71.9) - React-Codegen (0.71.9): + - DoubleConversion - FBReactNativeSpec + - glog - RCT-Folly - RCTRequired - RCTTypeSafety @@ -57,32 +59,38 @@ PODS: - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default (= 0.71.9) - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/CoreModulesHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/Default (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/DevSupport (0.71.9): @@ -90,133 +98,157 @@ PODS: - RCT-Folly (= 2021.07.22.00) - React-Core/Default (= 0.71.9) - React-Core/RCTWebSocket (= 0.71.9) - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) + - React-jsi + - React-jsiexecutor - React-jsinspector (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTActionSheetHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTAnimationHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTBlobHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTImageHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTLinkingHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTNetworkHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTPushNotificationHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTSettingsHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTTextHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTVibrationHeaders (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTWebSocket (0.71.9): - glog - RCT-Folly (= 2021.07.22.00) - React-Core/Default (= 0.71.9) - - React-cxxreact (= 0.71.9) + - React-cxxreact - React-jsc - - React-jsi (= 0.71.9) - - React-jsiexecutor (= 0.71.9) - - React-perflogger (= 0.71.9) + - React-jsi + - React-jsiexecutor + - React-perflogger + - React-runtimeexecutor + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-CoreModules (0.71.9): @@ -240,6 +272,7 @@ PODS: - React-logger (= 0.71.9) - React-perflogger (= 0.71.9) - React-runtimeexecutor (= 0.71.9) + - React-debug (0.71.9) - React-jsc (0.71.9): - React-jsc/Fabric (= 0.71.9) - React-jsi (= 0.71.9) @@ -276,10 +309,10 @@ PODS: - RCTTypeSafety - React-Core - React-CoreModules - - React-hermes - - React-NativeModulesApple + - React-jsc - React-RCTImage - React-RCTNetwork + - React-runtimescheduler - ReactCommon/turbomodule/core - React-RCTBlob (0.71.9): - RCT-Folly (= 2021.07.22.00) @@ -338,6 +371,17 @@ PODS: - ReactCommon/turbomodule/core (= 0.71.9) - React-runtimeexecutor (0.71.9): - React-jsi (= 0.71.9) + - React-runtimescheduler (0.71.9): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-callinvoker + - React-debug + - React-jsi + - React-runtimeexecutor + - React-utils (0.71.9): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-debug - ReactCommon/turbomodule/bridging (0.71.9): - DoubleConversion - glog @@ -370,7 +414,6 @@ PODS: - React-perflogger (= 0.71.9) - ReactCommon/turbomodule/core (= 0.71.9) - ScreenshotManager (0.0.1): - - glog - RCT-Folly (= 2021.07.22.00) - React-Core - SocketRocket (0.6.0) @@ -393,6 +436,7 @@ DEPENDENCIES: - React-Core/RCTWebSocket (from `../../`) - React-CoreModules (from `../../React/CoreModules`) - React-cxxreact (from `../../ReactCommon/cxxreact`) + - React-debug (from `../../ReactCommon/react/debug`) - React-jsc (from `../../ReactCommon/jsc`) - React-jsi (from `../../ReactCommon/jsi`) - React-jsiexecutor (from `../../ReactCommon/jsiexecutor`) @@ -412,6 +456,8 @@ DEPENDENCIES: - React-RCTText (from `../../Libraries/Text`) - React-RCTVibration (from `../../Libraries/Vibration`) - React-runtimeexecutor (from `../../ReactCommon/runtimeexecutor`) + - React-runtimescheduler (from `../../ReactCommon/react/renderer/runtimescheduler`) + - React-utils (from `../../ReactCommon/react/utils`) - ReactCommon/turbomodule/core (from `../../ReactCommon`) - ReactCommon/turbomodule/samples (from `../../ReactCommon`) - ScreenshotManager (from `NativeModuleExample`) @@ -452,6 +498,8 @@ EXTERNAL SOURCES: :path: "../../React/CoreModules" React-cxxreact: :path: "../../ReactCommon/cxxreact" + React-debug: + :path: "../../ReactCommon/react/debug" React-jsc: :path: "../../ReactCommon/jsc" React-jsi: @@ -490,6 +538,10 @@ EXTERNAL SOURCES: :path: "../../Libraries/Vibration" React-runtimeexecutor: :path: "../../ReactCommon/runtimeexecutor" + React-runtimescheduler: + :path: "../../ReactCommon/react/renderer/runtimescheduler" + React-utils: + :path: "../../ReactCommon/react/utils" ReactCommon: :path: "../../ReactCommon" ScreenshotManager: @@ -510,10 +562,11 @@ SPEC CHECKSUMS: RCTTypeSafety: 181fe186459a5d0bb58b4a9598ed49e696075a0f React: 45aa27aa368b664472f4c7417a95c92d1becd3ba React-callinvoker: 141ab2c8eaf432dd1fe904c8645da883d780f8a1 - React-Codegen: 55b9cf16d7aee7f13f535822fd7782c213ff4d64 - React-Core: 4c6388c919b8834b38c80698da94ca2e304e209d + React-Codegen: 6ee96fba241942a237493f88e96f8125c0224db4 + React-Core: c3960fa40d5574b8572b42b63935a4a97bf3245a React-CoreModules: 3a79aac89e612cbc27d5afb4f1050e3de6ff755d - React-cxxreact: 642aeef37306c95317afe17072034c0b27203f57 + React-cxxreact: 22030cf18291852acdf4036758e4941e06f673a1 + React-debug: 6063d5aa2222cbe91691da3bb7f400d9812f5a3e React-jsc: 20c9378136666b09f2340ee6c0e3a7e7fd184ba4 React-jsi: 4529e3bdae4f54aff6a985a28ec7a735b4937e09 React-jsiexecutor: d1917e283b18ea4a8c1ae15183390eb153422047 @@ -522,7 +575,7 @@ SPEC CHECKSUMS: React-perflogger: ad12d16b6909321cf0a243c533a5563fda359c8f React-RCTActionSheet: d6e2fa6593bc218feb667db89d5c494e82a7dc03 React-RCTAnimation: b9a0fbc96b8418d7015b77a14abe4796209bd2c0 - React-RCTAppDelegate: 33aca1ace4605d527c74e894800951722001e942 + React-RCTAppDelegate: e4bf9b6b06af3b371d788e54734d4598b5a577bc React-RCTBlob: 2249dc79d1d5c21aef9a73af3d2ec8048ad42e01 React-RCTImage: 0ed16720bee34ab6a0d86ce81f87ae43936ed61f React-RCTLinking: f52ef6a373db2e524e46b734573ec0386cb3abc4 @@ -533,6 +586,8 @@ SPEC CHECKSUMS: React-RCTText: 4f2e960be025fabdb786ee723fa2b9d42e393163 React-RCTVibration: e4dcf84e762dd211abd7cdde3927582030fb1b80 React-runtimeexecutor: 4dd1aaa5446bbfbd87000eea67c61a7467172984 + React-runtimescheduler: 8b9f903b174f86379f6d96bb726b5362bc58b077 + React-utils: 93d649cac943085463227f44343f36daf1b63bce ReactCommon: f2b2050e72d839e4442ab0bdaa0d9ef3eac9b374 ScreenshotManager: 2fac62be553326d7d32ef3019c9fa4fd7b59918d SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index 6ee9d7353fddce..78afcaeb5bc232 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -244,6 +244,7 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge delegate:self jsInvoker:callInvoker]; [bridge setRCTTurboModuleRegistry:turboModuleManager]; + _turboModuleManager = turboModuleManager; #if RCT_DEV /** @@ -259,20 +260,19 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge #else return std::make_unique( #endif - facebook::react::RCTJSIExecutorRuntimeInstaller([weakSelf, bridge](facebook::jsi::Runtime &runtime) { + facebook::react::RCTJSIExecutorRuntimeInstaller([weakSelf, bridge, &turboModuleManager](facebook::jsi::Runtime &runtime) { if (!bridge) { return; } __typeof(self) strongSelf = weakSelf; - if (strongSelf) { - facebook::react::RuntimeExecutor syncRuntimeExecutor = - [&](std::function &&callback) { callback(runtime); }; - [strongSelf->_turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor]; - } + if (strongSelf && strongSelf->_runtimeScheduler) { + facebook::react::RuntimeSchedulerBinding::createAndInstallIfNeeded(runtime, strongSelf->_runtimeScheduler); + } facebook::react::RuntimeExecutor syncRuntimeExecutor = [&](std::function &&callback) { callback(runtime); }; - [turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor]; + [strongSelf->_turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor]; + })); } @@ -286,16 +286,16 @@ - (Class)getModuleClassFromName:(const char *)name - (std::shared_ptr)getTurboModule:(const std::string &)name jsInvoker:(std::shared_ptr)jsInvoker { - // [macOS Github#1734: Disable React-TurboModuleCxx RNW implementation as React Native now has C++ sharing support and examples - // if (!_turboModulesProvider) { - // _turboModulesProvider = std::make_shared(); - // _turboModulesProvider->SetReactContext(winrt::Microsoft::ReactNative::CreateMacOSReactContext(jsInvoker)); - - // _turboModulesProvider->AddModuleProvider( - // L"ScreenshotManager", winrt::Microsoft::ReactNative::MakeModuleProvider()); - // } - // return _turboModulesProvider->getModule(name, jsInvoker); - // macOS] +// [macOS Github#1734: Disable React-TurboModuleCxx RNW implementation as React Native now has C++ sharing support and examples +// if (!_turboModulesProvider) { +// _turboModulesProvider = std::make_shared(); +// _turboModulesProvider->SetReactContext(winrt::Microsoft::ReactNative::CreateMacOSReactContext(jsInvoker)); +// +// _turboModulesProvider->AddModuleProvider( +// L"ScreenshotManager", winrt::Microsoft::ReactNative::MakeModuleProvider()); +// } +// return _turboModulesProvider->getModule(name, jsInvoker); +// macOS] return facebook::react::RNTesterTurboModuleProvider(name, jsInvoker); } diff --git a/scripts/cocoapods/__tests__/new_architecture-test.rb b/scripts/cocoapods/__tests__/new_architecture-test.rb index d1764d981198b2..560631f0959cc0 100644 --- a/scripts/cocoapods/__tests__/new_architecture-test.rb +++ b/scripts/cocoapods/__tests__/new_architecture-test.rb @@ -137,7 +137,7 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths { :dependency_name => "RCTTypeSafety" }, { :dependency_name => "ReactCommon/turbomodule/bridging" }, { :dependency_name => "ReactCommon/turbomodule/core" }, - { :dependency_name => "React-NativeModulesApple" }, + # { :dependency_name => "React-NativeModulesApple" }, { :dependency_name => "Yoga" }, { :dependency_name => "React-Fabric" }, { :dependency_name => "React-graphics" }, diff --git a/scripts/cocoapods/codegen_utils.rb b/scripts/cocoapods/codegen_utils.rb index 280b2cb8a95dfa..8d374b64db3f0c 100644 --- a/scripts/cocoapods/codegen_utils.rb +++ b/scripts/cocoapods/codegen_utils.rb @@ -85,22 +85,22 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa ] framework_search_paths = [] - if use_frameworks - header_search_paths.concat([ - "\"$(PODS_ROOT)/DoubleConversion\"", - "\"$(PODS_TARGET_SRCROOT)\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\"", - "\"$(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-RCTFabric/RCTFabric.framework/Headers\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"", - ]) - end + # if use_frameworks + # header_search_paths.concat([ + # "\"$(PODS_ROOT)/DoubleConversion\"", + # "\"$(PODS_TARGET_SRCROOT)\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\"", + # "\"$(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-RCTFabric/RCTFabric.framework/Headers\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", + # "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"", + # ]) + # end spec = { 'name' => "React-Codegen", @@ -136,7 +136,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa "React-jsi": [], "ReactCommon/turbomodule/bridging": [], "ReactCommon/turbomodule/core": [], - "React-NativeModulesApple": [], + # "React-NativeModulesApple": [], "glog": [], "DoubleConversion": [], } diff --git a/scripts/cocoapods/new_architecture.rb b/scripts/cocoapods/new_architecture.rb index e156163b5b8d49..1a00fae4e1c6f8 100644 --- a/scripts/cocoapods/new_architecture.rb +++ b/scripts/cocoapods/new_architecture.rb @@ -84,6 +84,9 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" end + + boost_search_path = "\"$(PODS_ROOT)/boost\"" + header_search_paths_string = header_search_paths.join(" ") spec.compiler_flags = compiler_flags.empty? ? @@folly_compiler_flags : "#{compiler_flags} #{@@folly_compiler_flags}" current_config["HEADER_SEARCH_PATHS"] = current_headers.empty? ? boost_search_path : "#{current_headers} #{boost_search_path}" @@ -102,7 +105,7 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) spec.dependency "RCTTypeSafety" spec.dependency "ReactCommon/turbomodule/bridging" spec.dependency "ReactCommon/turbomodule/core" - spec.dependency "React-NativeModulesApple" + # spec.dependency "React-NativeModulesApple" spec.dependency "Yoga" spec.dependency "React-Fabric" spec.dependency "React-graphics" diff --git a/yarn.lock b/yarn.lock index 91fbf710dd4af1..48ff4e74c65c7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -947,17 +947,10 @@ core-js-pure "^3.25.1" regenerator-runtime "^0.13.11" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.18.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.8.4": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" - integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== +"@babel/runtime@7.21.0", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.8.4": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" + integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== dependencies: regenerator-runtime "^0.13.11" @@ -6331,7 +6324,7 @@ regenerator-runtime@^0.13.11: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: +regenerator-runtime@^0.13.2: version "0.13.9" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==