Skip to content

Commit

Permalink
I can import it
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jun 20, 2024
1 parent 7b9501f commit 31696d7
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 92 deletions.
95 changes: 25 additions & 70 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ PODS:
- hermes-engine (0.74.2):
- hermes-engine/Pre-built (= 0.74.2)
- hermes-engine/Pre-built (0.74.2)
- NitroModules (0.0.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RCT-Folly (2024.01.01.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -935,72 +956,6 @@ PODS:
- React-Mapbuffer (0.74.2):
- glog
- React-debug
- react-native-nitro-modules (0.0.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- "react-native-nitro-modules/C++-Bindings (= 0.0.3)"
- react-native-nitro-modules/Swift-Bindings (= 0.0.3)
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- "react-native-nitro-modules/C++-Bindings (0.0.3)":
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-nitro-modules/Swift-Bindings (0.0.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- "react-native-nitro-modules/C++-Bindings"
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- React-nativeconfig (0.74.2)
- React-NativeModulesApple (0.74.2):
- glog
Expand Down Expand Up @@ -1240,6 +1195,7 @@ DEPENDENCIES:
- fmt (from `../../node_modules/react-native/third-party-podspecs/fmt.podspec`)
- glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (from `../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- NitroModules (from `../../node_modules/react-native-nitro-modules`)
- RCT-Folly (from `../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTDeprecation (from `../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
Expand All @@ -1266,7 +1222,6 @@ DEPENDENCIES:
- React-jsitracing (from `../../node_modules/react-native/ReactCommon/hermes/executor/`)
- React-logger (from `../../node_modules/react-native/ReactCommon/logger`)
- React-Mapbuffer (from `../../node_modules/react-native/ReactCommon`)
- react-native-nitro-modules (from `../../node_modules/react-native-nitro-modules`)
- React-nativeconfig (from `../../node_modules/react-native/ReactCommon`)
- React-NativeModulesApple (from `../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-perflogger (from `../../node_modules/react-native/ReactCommon/reactperflogger`)
Expand Down Expand Up @@ -1310,6 +1265,8 @@ EXTERNAL SOURCES:
hermes-engine:
:podspec: "../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
:tag: hermes-2024-06-03-RNv0.74.2-bb1e74fe1e95c2b5a2f4f9311152da052badc2bc
NitroModules:
:path: "../../node_modules/react-native-nitro-modules"
RCT-Folly:
:podspec: "../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTDeprecation:
Expand Down Expand Up @@ -1358,8 +1315,6 @@ EXTERNAL SOURCES:
:path: "../../node_modules/react-native/ReactCommon/logger"
React-Mapbuffer:
:path: "../../node_modules/react-native/ReactCommon"
react-native-nitro-modules:
:path: "../../node_modules/react-native-nitro-modules"
React-nativeconfig:
:path: "../../node_modules/react-native/ReactCommon"
React-NativeModulesApple:
Expand Down Expand Up @@ -1416,6 +1371,7 @@ SPEC CHECKSUMS:
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
hermes-engine: 01d3e052018c2a13937aca1860fbedbccd4a41b7
NitroModules: 16e8fac285dd9355d9ad84a4d4ad6c59c4aa55de
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: b03c35057846b685b3ccadc9bfe43e349989cdb2
RCTRequired: 194626909cfa8d39ca6663138c417bc6c431648c
Expand All @@ -1440,7 +1396,6 @@ SPEC CHECKSUMS:
React-jsitracing: 0fa7f78d8fdda794667cb2e6f19c874c1cf31d7e
React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
react-native-nitro-modules: 508dc0720fb51ca3cbf35f588a6d1ae74db79c9c
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::UI.puts "[NitroModules] Your app is boosted by nitro modules! 🔥"

Pod::Spec.new do |s|
s.name = "react-native-nitro-modules"
s.name = "NitroModules"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
Expand All @@ -15,27 +15,17 @@ Pod::Spec.new do |s|
s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/mrousavy/react-native-nitro.git", :tag => "#{s.version}" }

s.subspec 'C++-Bindings' do |ss|
# VisionCamera Core C++ bindings
ss.source_files = [
"cpp/**/*.{h,c}",
"cpp/**/*.{hpp,cpp}"
]
ss.public_header_files = [
"cpp/**/*.{h,hpp}"
]
end

s.subspec 'Swift-Bindings' do |ss|
# VisionCamera Swift bindings
ss.source_files = [
"ios/**/*.swift",
"ios/**/*.h",
"ios/**/*.modulemap",
]

ss.dependency "react-native-nitro-modules/C++-Bindings"
end
# VisionCamera Core C++ bindings
s.source_files = [
"cpp/**/*.{h,c}",
"cpp/**/*.{hpp,cpp}",
"ios/**/*.swift",
"ios/**/*.h",
"ios/**/*.modulemap",
]
s.public_header_files = [
"cpp/**/*.{h,hpp}"
]

s.pod_target_xcconfig = {
# Enables C++ <-> Swift interop (by default it's only C)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "react-native-nitro.hpp"

#include <react-native-nitro-modules/react-native-nitro-modules-umbrella.h>
#include <swift/bridging>
#include "NitroModules-Swift.h"

namespace nitro {
double multiply(double a, double b) {
Expand Down
15 changes: 15 additions & 0 deletions packages/react-native-nitro-modules/ios/core/HybridObject.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// HybridObject.swift
// NitroModules
//
// Created by Marc Rousavy on 20.06.24.
//

import Foundation

public class HybridObject {

init(value: String) {
print("Hey \(value)!")
}
}
15 changes: 15 additions & 0 deletions packages/react-native-nitro-modules/ios/core/Promise.swift
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@

import Foundation

/**
Represents a JavaScript Promise.
Uses the highly efficient C++ JSI implementation under the hood.
*/
public class Promise {
private let promise: margelo.Promise

init() {
let hy: margelo.HybridObject? = nil
let x: margelo.PromiseFactory.RunPromise? = nil
let y = nitro.multiply(0, 0)
}

}

0 comments on commit 31696d7

Please sign in to comment.