react-native-nitro-modules 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,16 +11,14 @@ Pod::Spec.new do |s|
11
11
  s.homepage = package["homepage"]
12
12
  s.license = package["license"]
13
13
  s.authors = package["author"]
14
-
15
- s.platforms = {
14
+ s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
15
+ s.platforms = {
16
16
  :ios => min_ios_version_supported,
17
17
  :visionos => 1.0,
18
18
  :macos => 10.13,
19
19
  :tvos => 13.4,
20
20
  }
21
- s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }
22
21
 
23
- # VisionCamera Core C++ bindings
24
22
  s.source_files = [
25
23
  # Shared C++ codebase
26
24
  "cpp/**/*.{h,hpp}",
@@ -41,6 +39,7 @@ Pod::Spec.new do |s|
41
39
  "cpp/entrypoint/InstallNitro.hpp",
42
40
  "cpp/registry/HybridObjectRegistry.hpp",
43
41
  "cpp/jsi/JSIConverter.hpp",
42
+ "cpp/platform/NitroLogger.hpp",
44
43
  "cpp/threading/Dispatcher.hpp",
45
44
  "cpp/utils/NitroHash.hpp",
46
45
  "cpp/utils/NitroDefines.hpp",
@@ -59,7 +58,11 @@ Pod::Spec.new do |s|
59
58
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
60
59
  # Enables stricter modular headers
61
60
  "DEFINES_MODULE" => "YES",
61
+ # C++ compiler flags, mainly for folly.
62
+ "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES"
62
63
  }
63
64
 
65
+ s.dependency 'React-jsi'
66
+ s.dependency 'React-callinvoker'
64
67
  install_modules_dependencies(s)
65
68
  end
package/README.md CHANGED
@@ -181,6 +181,12 @@ The following C++ / JS types are supported out of the box:
181
181
  <td>❌</td>
182
182
  <td>❌</td>
183
183
  </tr>
184
+ <tr>
185
+ <td><code>Error</code></td>
186
+ <td><code>std::exception_ptr</code></td>
187
+ <td><code>Error</code></td>
188
+ <td><code>Throwable</code></td>
189
+ </tr>
184
190
  <tr>
185
191
  <td><code>Promise&lt;T&gt;</code></td>
186
192
  <td><code>std::shared_ptr&lt;<a href="./cpp/core/Promise.hpp">Promise&lt;T&gt;</a>&gt;</code></td>
@@ -116,16 +116,6 @@ public:
116
116
  /**
117
117
  * Rejects this Promise with the given error, and calls any pending listeners.
118
118
  */
119
- void reject(const std::exception& exception) {
120
- std::unique_lock lock(*_mutex);
121
- #ifdef NITRO_DEBUG
122
- assertPromiseState(*this, PromiseTask::WANTS_TO_REJECT);
123
- #endif
124
- _state = std::make_exception_ptr(exception);
125
- for (const auto& onRejected : _onRejectedListeners) {
126
- onRejected(std::get<std::exception_ptr>(_state));
127
- }
128
- }
129
119
  void reject(const std::exception_ptr& exception) {
130
120
  std::unique_lock lock(*_mutex);
131
121
  #ifdef NITRO_DEBUG
@@ -324,16 +314,6 @@ public:
324
314
  onResolved();
325
315
  }
326
316
  }
327
- void reject(const std::exception& exception) {
328
- std::unique_lock lock(*_mutex);
329
- #ifdef NITRO_DEBUG
330
- assertPromiseState(*this, PromiseTask::WANTS_TO_REJECT);
331
- #endif
332
- _error = std::make_exception_ptr(exception);
333
- for (const auto& onRejected : _onRejectedListeners) {
334
- onRejected(_error.value());
335
- }
336
- }
337
317
  void reject(const std::exception_ptr& exception) {
338
318
  std::unique_lock lock(*_mutex);
339
319
  #ifdef NITRO_DEBUG
@@ -35,13 +35,18 @@ public:
35
35
  std::string name = typeName;
36
36
  #if __has_include(<cxxabi.h>)
37
37
  int status = 0;
38
- char* demangled_name = abi::__cxa_demangle(name.c_str(), NULL, NULL, &status);
38
+ char* demangled_name = abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status);
39
39
  if (demangled_name != nullptr) {
40
40
  name = demangled_name;
41
41
  std::free(demangled_name);
42
42
  }
43
43
  #endif
44
44
 
45
+ #ifdef ANDROID
46
+ // std::__ndk1 -> std::__1
47
+ name = replaceRegex(name, R"(std::__ndk1)", "std::__1");
48
+ #endif
49
+
45
50
  // Make a few edge-cases nicer.
46
51
  name = replaceRegex(name, R"(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>)", "std::string");
47
52
  name = replaceRegex(name, R"(std::__1::vector<([^>]+), std::__1::allocator<\1>>)", "std::vector<$1>");
@@ -7,6 +7,7 @@
7
7
 
8
8
  #pragma once
9
9
 
10
+ #include "TypeInfo.hpp"
10
11
  #include <exception>
11
12
  #include <string>
12
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-modules",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Insanely fast native C++, Swift or Kotlin modules with a statically compiled binding layer to JSI.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",