react-native-windows 0.66.9 → 0.66.10

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,40 @@
2
2
  "name": "react-native-windows",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 31 Jan 2022 16:12:08 GMT",
5
+ "date": "Mon, 07 Feb 2022 16:12:16 GMT",
6
+ "tag": "react-native-windows_v0.66.10",
7
+ "version": "0.66.10",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "UI Manager module is not being destroyed on the UI thread",
12
+ "author": "30809111+acoates-ms@users.noreply.github.com",
13
+ "commit": "9e305803ba81e2375ce6a7cf894a34a23d9002e5",
14
+ "package": "react-native-windows"
15
+ },
16
+ {
17
+ "comment": "Replace __APPLE__ with __clang__ where applicable (#9461)",
18
+ "author": "julio.rocha@microsoft.com",
19
+ "commit": "95b78a0cb078c672a251929d4b56fd104a6b96b8",
20
+ "package": "react-native-windows"
21
+ },
22
+ {
23
+ "comment": "Add additional exports for react-native-win32.dll",
24
+ "author": "30809111+acoates-ms@users.noreply.github.com",
25
+ "commit": "135e512fec934a253ded4bd179171a4608e69fe8",
26
+ "package": "react-native-windows"
27
+ },
28
+ {
29
+ "comment": "Hermes inspector is not starting when Hermes engine is used (#9426)",
30
+ "author": "anandrag@microsoft.com",
31
+ "commit": "507432b5c47971f0bc4e76a608e360d56e37b105",
32
+ "package": "react-native-windows"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Mon, 31 Jan 2022 16:12:38 GMT",
6
39
  "tag": "react-native-windows_v0.66.9",
7
40
  "version": "0.66.9",
8
41
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,28 @@
1
1
  # Change Log - react-native-windows
2
2
 
3
- This log was last generated on Mon, 31 Jan 2022 16:12:08 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 07 Feb 2022 16:12:16 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.66.9
7
+ ## 0.66.10
8
8
 
9
- Mon, 31 Jan 2022 16:12:08 GMT
9
+ Mon, 07 Feb 2022 16:12:16 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Better reporting of failures to load the bundle file (30809111+acoates-ms@users.noreply.github.com)
13
+ - UI Manager module is not being destroyed on the UI thread (30809111+acoates-ms@users.noreply.github.com)
14
+ - Replace __APPLE__ with __clang__ where applicable (#9461) (julio.rocha@microsoft.com)
15
+ - Add additional exports for react-native-win32.dll (30809111+acoates-ms@users.noreply.github.com)
16
+ - Hermes inspector is not starting when Hermes engine is used (#9426) (anandrag@microsoft.com)
14
17
 
18
+ ## 0.66.9
19
+
20
+ Mon, 31 Jan 2022 16:12:38 GMT
21
+
22
+ ### Patches
23
+
24
+ - Better reporting of failures to load the bundle file (30809111+acoates-ms@users.noreply.github.com)
25
+
15
26
  ## 0.66.8
16
27
 
17
28
  Mon, 24 Jan 2022 16:11:33 GMT
@@ -395,7 +395,7 @@ facebook::jsi::JSError const &jsError) { \
395
395
  }
396
396
 
397
397
  /*static*/ ReactNative::JsiRuntime JsiRuntime::GetOrCreate(
398
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
398
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
399
399
  std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept {
400
400
  {
401
401
  std::scoped_lock lock{s_mutex};
@@ -409,7 +409,7 @@ facebook::jsi::JSError const &jsError) { \
409
409
  }
410
410
 
411
411
  /*static*/ ReactNative::JsiRuntime JsiRuntime::Create(
412
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
412
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
413
413
  std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept {
414
414
  // There are some functions that we cannot do using JSI such as
415
415
  // defining a property or using Symbol as a key.
@@ -445,7 +445,7 @@ ReactNative::JsiRuntime JsiRuntime::MakeChakraRuntime() {
445
445
  }
446
446
 
447
447
  JsiRuntime::JsiRuntime(
448
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> &&runtimeHolder,
448
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> &&runtimeHolder,
449
449
  std::shared_ptr<facebook::jsi::Runtime> &&runtime) noexcept
450
450
  : m_runtimeHolder{std::move(runtimeHolder)},
451
451
  m_runtime{std::move(runtime)},
@@ -58,16 +58,16 @@ struct RuntimeAccessor;
58
58
 
59
59
  struct JsiRuntime : JsiRuntimeT<JsiRuntime> {
60
60
  JsiRuntime(
61
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> &&runtimeHolder,
61
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> &&runtimeHolder,
62
62
  std::shared_ptr<facebook::jsi::Runtime> &&runtime) noexcept;
63
63
  ~JsiRuntime() noexcept;
64
64
 
65
65
  static ReactNative::JsiRuntime FromRuntime(facebook::jsi::Runtime &runtime) noexcept;
66
66
  static ReactNative::JsiRuntime GetOrCreate(
67
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
67
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
68
68
  std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept;
69
69
  static ReactNative::JsiRuntime Create(
70
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
70
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
71
71
  std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept;
72
72
 
73
73
  public: // JsiRuntime
@@ -168,7 +168,7 @@ struct JsiRuntime : JsiRuntimeT<JsiRuntime> {
168
168
  void SetError(facebook::jsi::JSINativeException const &nativeException) noexcept;
169
169
 
170
170
  private:
171
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> m_runtimeHolder;
171
+ std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> m_runtimeHolder;
172
172
  std::shared_ptr<facebook::jsi::Runtime> m_runtime;
173
173
  RuntimeAccessor *m_runtimeAccessor{};
174
174
  std::mutex m_mutex;
@@ -514,7 +514,7 @@ UIManager::UIManager() : m_module(std::make_shared<UIManagerModule>()) {}
514
514
  UIManager::~UIManager() {
515
515
  // To make sure that we destroy UI components in UI thread.
516
516
  if (!m_context.UIDispatcher().HasThreadAccess()) {
517
- m_context.UIDispatcher().Post([module = std::move(m_module)]() {});
517
+ m_context.UIDispatcher().Post([module = std::move(m_module)]() mutable { module = nullptr; });
518
518
  }
519
519
  }
520
520
 
@@ -5,9 +5,9 @@
5
5
 
6
6
  #include "React.h"
7
7
 
8
- namespace facebook::jsi {
8
+ namespace Microsoft::JSI {
9
9
  struct RuntimeHolderLazyInit;
10
- } // namespace facebook::jsi
10
+ } // namespace Microsoft::JSI
11
11
 
12
12
  namespace Mso::React {
13
13
 
@@ -893,7 +893,7 @@ void ReactInstanceWin::DispatchEvent(int64_t viewTag, std::string &&eventName, f
893
893
  }
894
894
 
895
895
  winrt::Microsoft::ReactNative::JsiRuntime ReactInstanceWin::JsiRuntime() noexcept {
896
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> jsiRuntimeHolder;
896
+ std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> jsiRuntimeHolder;
897
897
  {
898
898
  std::scoped_lock lock{m_mutex};
899
899
  if (m_jsiRuntime) {
@@ -184,7 +184,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
184
184
  Mso::CntPtr<Mso::React::IDispatchQueue2> m_uiQueue;
185
185
  std::deque<JSCallEntry> m_jsCallQueue;
186
186
 
187
- std::shared_ptr<facebook::jsi::RuntimeHolderLazyInit> m_jsiRuntimeHolder;
187
+ std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> m_jsiRuntimeHolder;
188
188
  winrt::Microsoft::ReactNative::JsiRuntime m_jsiRuntime{nullptr};
189
189
  };
190
190
 
@@ -280,7 +280,7 @@ constexpr void ValidateCoroutineArg() noexcept {
280
280
  static_assert(
281
281
  !std::is_reference_v<TArg> && !std::is_pointer_v<TArg>,
282
282
  "Coroutine parameter must be passed by value for safe access"
283
- #ifndef __APPLE__
283
+ #ifndef __clang__
284
284
  ": " __FUNCSIG__
285
285
  #endif
286
286
  );
@@ -9,6 +9,10 @@
9
9
 
10
10
  namespace Microsoft::JSI {
11
11
 
12
+ facebook::react::JSIEngineOverride ChakraRuntimeHolder::getRuntimeType() noexcept {
13
+ return facebook::react::JSIEngineOverride::Chakra;
14
+ }
15
+
12
16
  std::shared_ptr<facebook::jsi::Runtime> ChakraRuntimeHolder::getRuntime() noexcept {
13
17
  std::call_once(once_flag_, [this]() { initRuntime(); });
14
18
 
@@ -12,9 +12,10 @@
12
12
 
13
13
  namespace Microsoft::JSI {
14
14
 
15
- class ChakraRuntimeHolder final : public facebook::jsi::RuntimeHolderLazyInit {
15
+ class ChakraRuntimeHolder final : public Microsoft::JSI::RuntimeHolderLazyInit {
16
16
  public:
17
17
  std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
18
+ facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
18
19
 
19
20
  ChakraRuntimeHolder(
20
21
  std::shared_ptr<facebook::react::DevSettings> devSettings,
@@ -14,11 +14,9 @@
14
14
  #define STRING_(s) #s
15
15
  #define STRING(s) STRING_(s)
16
16
 
17
- namespace facebook {
18
- namespace jsi {
17
+ namespace Microsoft::JSI {
19
18
  struct RuntimeHolderLazyInit;
20
- }
21
- } // namespace facebook
19
+ } // namespace Microsoft::JSI
22
20
 
23
21
  namespace facebook {
24
22
  namespace react {
@@ -81,7 +79,7 @@ struct DevSettings {
81
79
  /// instance. This object should in general be used only from the JS engine
82
80
  /// thread, unless the specific runtime implementation explicitly guarantees
83
81
  /// reentrancy.
84
- std::shared_ptr<jsi::RuntimeHolderLazyInit> jsiRuntimeHolder;
82
+ std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> jsiRuntimeHolder;
85
83
 
86
84
  // Until the ABI story is addressed we'll use this instead of the above for
87
85
  // the purposes of selecting a JSI Runtime to use.
@@ -72,6 +72,10 @@ class HermesExecutorRuntimeAdapter final : public facebook::hermes::inspector::R
72
72
 
73
73
  } // namespace
74
74
 
75
+ facebook::react::JSIEngineOverride HermesRuntimeHolder::getRuntimeType() noexcept {
76
+ return facebook::react::JSIEngineOverride::Hermes;
77
+ }
78
+
75
79
  std::shared_ptr<jsi::Runtime> HermesRuntimeHolder::getRuntime() noexcept {
76
80
  std::call_once(m_once_flag, [this]() { initRuntime(); });
77
81
 
@@ -12,9 +12,10 @@
12
12
  namespace facebook {
13
13
  namespace react {
14
14
 
15
- class HermesRuntimeHolder : public facebook::jsi::RuntimeHolderLazyInit {
15
+ class HermesRuntimeHolder : public Microsoft::JSI::RuntimeHolderLazyInit {
16
16
  public:
17
17
  std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
18
+ facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
18
19
 
19
20
  HermesRuntimeHolder(
20
21
  std::shared_ptr<facebook::react::DevSettings> devSettings,
@@ -96,7 +96,11 @@ void NapiJsiV8RuntimeHolder::InitRuntime() noexcept {
96
96
  m_ownThreadId = std::this_thread::get_id();
97
97
  }
98
98
 
99
- #pragma region facebook::jsi::RuntimeHolderLazyInit
99
+ #pragma region Microsoft::JSI::RuntimeHolderLazyInit
100
+
101
+ facebook::react::JSIEngineOverride NapiJsiV8RuntimeHolder::getRuntimeType() noexcept {
102
+ return facebook::react::JSIEngineOverride::V8NodeApi;
103
+ }
100
104
 
101
105
  shared_ptr<Runtime> NapiJsiV8RuntimeHolder::getRuntime() noexcept /*override*/
102
106
  {
@@ -112,6 +116,6 @@ shared_ptr<Runtime> NapiJsiV8RuntimeHolder::getRuntime() noexcept /*override*/
112
116
  return m_runtime;
113
117
  }
114
118
 
115
- #pragma endregion facebook::jsi::RuntimeHolderLazyInit
119
+ #pragma endregion Microsoft::JSI::RuntimeHolderLazyInit
116
120
 
117
121
  } // namespace Microsoft::JSI
@@ -10,9 +10,10 @@
10
10
 
11
11
  namespace Microsoft::JSI {
12
12
 
13
- class NapiJsiV8RuntimeHolder : public facebook::jsi::RuntimeHolderLazyInit {
13
+ class NapiJsiV8RuntimeHolder : public Microsoft::JSI::RuntimeHolderLazyInit {
14
14
  public:
15
15
  std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
16
+ facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
16
17
 
17
18
  NapiJsiV8RuntimeHolder(
18
19
  std::shared_ptr<facebook::react::DevSettings> devSettings,
@@ -3,8 +3,9 @@
3
3
  #include <jsi/jsi.h>
4
4
  #include <memory>
5
5
 
6
- namespace facebook {
7
- namespace jsi {
6
+ #include <DevSettings.h>
7
+
8
+ namespace Microsoft::JSI {
8
9
 
9
10
  // An instance of this interface is expected to
10
11
  // a. lazily create a JSI Runtime on the first call to getRuntime
@@ -15,7 +16,7 @@ namespace jsi {
15
16
 
16
17
  struct RuntimeHolderLazyInit {
17
18
  virtual std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept = 0;
19
+ virtual facebook::react::JSIEngineOverride getRuntimeType() noexcept = 0;
18
20
  };
19
21
 
20
- } // namespace jsi
21
- } // namespace facebook
22
+ } // namespace Microsoft::JSI
@@ -113,7 +113,7 @@ class OJSIExecutorFactory : public JSExecutorFactory {
113
113
  }
114
114
 
115
115
  OJSIExecutorFactory(
116
- std::shared_ptr<jsi::RuntimeHolderLazyInit> runtimeHolder,
116
+ std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> runtimeHolder,
117
117
  NativeLoggingHook loggingHook,
118
118
  std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
119
119
  bool isProfilingEnabled,
@@ -125,7 +125,7 @@ class OJSIExecutorFactory : public JSExecutorFactory {
125
125
  isProfilingEnabled_{isProfilingEnabled} {}
126
126
 
127
127
  private:
128
- std::shared_ptr<jsi::RuntimeHolderLazyInit> runtimeHolder_;
128
+ std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> runtimeHolder_;
129
129
  std::shared_ptr<TurboModuleRegistry> turboModuleRegistry_;
130
130
  std::shared_ptr<CallInvoker> jsCallInvoker_;
131
131
  NativeLoggingHook loggingHook_;
@@ -198,6 +198,20 @@ void InstanceImpl::SetInError() noexcept {
198
198
  m_isInError = true;
199
199
  }
200
200
 
201
+ namespace {
202
+ bool shouldStartHermesInspector(DevSettings &devSettings) {
203
+ bool isHermes =
204
+ ((devSettings.jsiEngineOverride == JSIEngineOverride::Hermes) ||
205
+ (devSettings.jsiEngineOverride == JSIEngineOverride::Default && devSettings.jsiRuntimeHolder &&
206
+ devSettings.jsiRuntimeHolder->getRuntimeType() == facebook::react::JSIEngineOverride::Hermes));
207
+
208
+ if (isHermes && devSettings.useDirectDebugger && !devSettings.useWebDebugger)
209
+ return true;
210
+ else
211
+ return false;
212
+ }
213
+ } // namespace
214
+
201
215
  InstanceImpl::InstanceImpl(
202
216
  std::shared_ptr<Instance> &&instance,
203
217
  std::string &&jsBundleBasePath,
@@ -225,8 +239,7 @@ InstanceImpl::InstanceImpl(
225
239
  facebook::react::tracing::initializeETW();
226
240
  #endif
227
241
 
228
- if (m_devSettings->jsiEngineOverride == JSIEngineOverride::Hermes && m_devSettings->useDirectDebugger &&
229
- !m_devSettings->useWebDebugger) {
242
+ if (shouldStartHermesInspector(*m_devSettings)) {
230
243
  m_devManager->StartInspector(m_devSettings->sourceBundleHost, m_devSettings->sourceBundlePort);
231
244
  }
232
245
 
@@ -31,6 +31,10 @@ class TaskRunnerAdapter : public v8runtime::JSITaskRunner {
31
31
  std::shared_ptr<facebook::react::MessageQueueThread> jsQueue_;
32
32
  };
33
33
 
34
+ facebook::react::JSIEngineOverride V8JSIRuntimeHolder::getRuntimeType() noexcept {
35
+ return facebook::react::JSIEngineOverride::V8;
36
+ }
37
+
34
38
  std::shared_ptr<facebook::jsi::Runtime> V8JSIRuntimeHolder::getRuntime() noexcept {
35
39
  std::call_once(once_flag_, [this]() { initRuntime(); });
36
40
 
@@ -13,9 +13,10 @@
13
13
  namespace facebook {
14
14
  namespace react {
15
15
 
16
- class V8JSIRuntimeHolder : public facebook::jsi::RuntimeHolderLazyInit {
16
+ class V8JSIRuntimeHolder : public Microsoft::JSI::RuntimeHolderLazyInit {
17
17
  public:
18
18
  std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
19
+ facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
19
20
 
20
21
  V8JSIRuntimeHolder(
21
22
  std::shared_ptr<facebook::react::DevSettings> devSettings,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.66.9",
3
+ "version": "0.66.10",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",