Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed May 31, 2023
1 parent 2c256b1 commit ea9c50c
Show file tree
Hide file tree
Showing 15 changed files with 185 additions and 138 deletions.
12 changes: 1 addition & 11 deletions Libraries/AppDelegate/React-RCTAppDelegate.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/react/debug/React-debug.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

#include "RuntimeSchedulerBinding.h"
#include <ReactCommon/SchedulerPriority.h>
#include "SchedulerPriority.h"
#include "RuntimeScheduler.h"
#include "SchedulerPriorityUtils.h"
//#include "SchedulerPriorityUtils.h"
#include "primitives.h"

#include <react/debug/react_native_assert.h>
Expand Down
13 changes: 9 additions & 4 deletions ReactCommon/react/renderer/runtimescheduler/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
namespace facebook {
namespace react {

struct TaskWrapper : public jsi::HostObject {
TaskWrapper(std::shared_ptr<Task> const &task) : task(task) {}

std::shared_ptr<Task> task;
};

inline static jsi::Value valueFromTask(
jsi::Runtime &runtime,
std::shared_ptr<Task> task) {
jsi::Object obj(runtime);
obj.setNativeState(runtime, std::move(task));
return obj;
return jsi::Object::createFromHostObject(
runtime, std::make_shared<TaskWrapper>(task));
}

inline static std::shared_ptr<Task> taskFromValue(
Expand All @@ -28,7 +33,7 @@ inline static std::shared_ptr<Task> taskFromValue(
return nullptr;
}

return value.getObject(runtime).getNativeState<Task>(runtime);
return value.getObject(runtime).getHostObject<TaskWrapper>(runtime)->task;
}

} // namespace react
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/react/utils/ManagedObjectWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <memory>

Expand Down
4 changes: 2 additions & 2 deletions ReactCommon/react/utils/ManagedObjectWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -33,4 +33,4 @@ void wrappedManagedObjectDeleter(void *cfPointer) noexcept
@implementation RCTInternalGenericWeakWrapper
@end

#endif
// #endif
2 changes: 1 addition & 1 deletion ReactCommon/react/utils/React-utils.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit ea9c50c

Please sign in to comment.