Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sad-poets-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-native-node-api": patch
---

Moved and simplify Apple host TurboModule
21 changes: 21 additions & 0 deletions packages/host/apple/NodeApiHostModuleProvider.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#import "CxxNodeApiHostModule.hpp"
#import "WeakNodeApiInjector.hpp"

#import <ReactCommon/CxxTurboModuleUtils.h>
@interface NodeApiHost : NSObject

@end

@implementation NodeApiHost
+ (void)load {
callstack::nodeapihost::injectIntoWeakNodeApi();

facebook::react::registerCxxModuleToGlobalModuleMap(
callstack::nodeapihost::CxxNodeApiHostModule::kModuleName,
[](std::shared_ptr<facebook::react::CallInvoker> jsInvoker) {
return std::make_shared<callstack::nodeapihost::CxxNodeApiHostModule>(
jsInvoker);
});
}

@end
44 changes: 0 additions & 44 deletions packages/host/ios/NodeApiHostModuleProvider.mm

This file was deleted.

2 changes: 1 addition & 1 deletion packages/host/react-native-node-api.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Pod::Spec.new do |s|
s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/callstackincubator/react-native-node-api.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "weak-node-api/include/*.h", "weak-node-api/*.hpp"
s.source_files = "apple/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "weak-node-api/include/*.h", "weak-node-api/*.hpp"
s.public_header_files = "weak-node-api/include/*.h"

s.vendored_frameworks = "auto-linked/apple/*.xcframework", "weak-node-api/weak-node-api.xcframework"
Expand Down
Loading