react-native-windows 0.73.0-preview.3 → 0.73.0-preview.5

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.
Files changed (39) hide show
  1. package/Directory.Build.props +2 -2
  2. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Microsoft.ReactNative/JSDispatcherWriter.cpp +18 -11
  5. package/Microsoft.ReactNative/JSDispatcherWriter.h +1 -0
  6. package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +37 -1
  7. package/Microsoft.ReactNative/ReactHost/React.h +3 -0
  8. package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +16 -0
  9. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +19 -3
  10. package/Microsoft.ReactNative/TurboModulesProvider.cpp +92 -40
  11. package/Microsoft.ReactNative/packages.lock.json +3 -3
  12. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +1 -0
  13. package/Microsoft.ReactNative.Managed/packages.lock.json +67 -3
  14. package/Microsoft.ReactNative.Managed.CodeGen/Microsoft.ReactNative.Managed.CodeGen.csproj +2 -1
  15. package/PropertySheets/External/Microsoft.ReactNative.Composition.Common.props +8 -0
  16. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  17. package/PropertySheets/JSEngine.props +4 -3
  18. package/PropertySheets/React.Cpp.props +1 -0
  19. package/ReactCommon/ReactCommon.vcxproj +4 -4
  20. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManagerBinding.cpp +30 -34
  21. package/Shared/HermesRuntimeHolder.cpp +11 -11
  22. package/Shared/InspectorPackagerConnection.cpp +58 -57
  23. package/Shared/InspectorPackagerConnection.h +4 -3
  24. package/Shared/JSI/V8RuntimeHolder.cpp +1 -1
  25. package/Shared/Networking/DefaultBlobResource.cpp +8 -4
  26. package/Shared/Networking/WinRTHttpResource.cpp +1 -1
  27. package/Shared/OInstance.cpp +19 -1
  28. package/Shared/SafeLoadLibrary.cpp +44 -8
  29. package/Shared/SafeLoadLibrary.h +5 -1
  30. package/Shared/Shared.vcxitems +4 -0
  31. package/Shared/Shared.vcxitems.filters +16 -11
  32. package/Shared/V8JSIRuntimeHolder.cpp +71 -0
  33. package/Shared/V8JSIRuntimeHolder.h +56 -0
  34. package/fmt/cgmanifest.json +1 -1
  35. package/metro.config.js +1 -1
  36. package/package.json +13 -13
  37. package/templates/cpp-app/windows/ExperimentalFeatures.props +0 -1
  38. package/templates/old/generateWrapper.js +3 -3
  39. package/templates/old/uwp-cpp-lib/template.config.js +1 -1
@@ -19,8 +19,8 @@
19
19
  <FollyVersion>2023.03.06.00</FollyVersion>
20
20
  <FollyCommitHash>ce2b95715de229fcb51bd97410469a3ad4d2bfb2</FollyCommitHash>
21
21
  <!-- When bumping the fmt version, be sure to bump the git hash of that version's commit and build fmt.vcxproj (to update its cgmanifest.json) too. -->
22
- <FmtVersion>8.0.0</FmtVersion>
23
- <FmtCommitHash>9e8b86fd2d9806672cc73133d21780dd182bfd24</FmtCommitHash>
22
+ <FmtVersion>10.1.0</FmtVersion>
23
+ <FmtCommitHash>ca2e3685b160617d3d95fcd9e789c4e06ca88</FmtCommitHash>
24
24
  <!-- Commit hash for https://github.com/microsoft/node-api-jsi code. -->
25
25
  <NodeApiJsiCommitHash>53b897b03c1c7e57c3372acc6234447a44e150d6</NodeApiJsiCommitHash>
26
26
  </PropertyGroup>
@@ -30,7 +30,7 @@ function createAnimatedStyle(
30
30
  const animatedStyles: any = {};
31
31
  for (const key in style) {
32
32
  const value = style[key];
33
- if (key === 'transform') {
33
+ if (value != null && key === 'transform') {
34
34
  animatedStyles[key] =
35
35
  ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform()
36
36
  ? new AnimatedObject(value)
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
15
  patch: 0,
16
- prerelease: 'rc.3',
16
+ prerelease: 'rc.4',
17
17
  };
@@ -33,6 +33,12 @@ JSDispatcherWriter::JSDispatcherWriter(
33
33
  std::weak_ptr<LongLivedJsiRuntime> jsiRuntimeHolder) noexcept
34
34
  : m_jsDispatcher(jsDispatcher), m_jsiRuntimeHolder(std::move(jsiRuntimeHolder)) {}
35
35
 
36
+ JSDispatcherWriter::~JSDispatcherWriter() {
37
+ if (auto jsiRuntimeHolder = m_jsiRuntimeHolder.lock()) {
38
+ jsiRuntimeHolder->allowRelease();
39
+ }
40
+ }
41
+
36
42
  void JSDispatcherWriter::WithResultArgs(
37
43
  Mso::Functor<void(facebook::jsi::Runtime &rt, facebook::jsi::Value const *args, size_t argCount)>
38
44
  handler) noexcept {
@@ -49,17 +55,18 @@ void JSDispatcherWriter::WithResultArgs(
49
55
  VerifyElseCrash(!m_jsiWriter);
50
56
  folly::dynamic dynValue = m_dynamicWriter->TakeValue();
51
57
  VerifyElseCrash(dynValue.isArray());
52
- m_jsDispatcher.Post([handler, dynValue = std::move(dynValue), weakJsiRuntimeHolder = m_jsiRuntimeHolder]() {
53
- if (auto jsiRuntimeHolder = weakJsiRuntimeHolder.lock()) {
54
- std::vector<facebook::jsi::Value> args;
55
- args.reserve(dynValue.size());
56
- auto &runtime = jsiRuntimeHolder->Runtime();
57
- for (auto const &item : dynValue) {
58
- args.emplace_back(facebook::jsi::valueFromDynamic(runtime, item));
59
- }
60
- handler(runtime, args.data(), args.size());
61
- }
62
- });
58
+ m_jsDispatcher.Post(
59
+ [handler, dynValue = std::move(dynValue), weakJsiRuntimeHolder = m_jsiRuntimeHolder, self = get_strong()]() {
60
+ if (auto jsiRuntimeHolder = weakJsiRuntimeHolder.lock()) {
61
+ std::vector<facebook::jsi::Value> args;
62
+ args.reserve(dynValue.size());
63
+ auto &runtime = jsiRuntimeHolder->Runtime();
64
+ for (auto const &item : dynValue) {
65
+ args.emplace_back(facebook::jsi::valueFromDynamic(runtime, item));
66
+ }
67
+ handler(runtime, args.data(), args.size());
68
+ }
69
+ });
63
70
  }
64
71
  }
65
72
 
@@ -14,6 +14,7 @@ namespace winrt::Microsoft::ReactNative {
14
14
  // In case if writing is done outside of JSDispatcher, it uses DynamicWriter to create
15
15
  // folly::dynamic which then is written to JsiWriter in JSDispatcher.
16
16
  struct JSDispatcherWriter : winrt::implements<JSDispatcherWriter, IJSValueWriter> {
17
+ ~JSDispatcherWriter();
17
18
  JSDispatcherWriter(
18
19
  IReactDispatcher const &jsDispatcher,
19
20
  std::weak_ptr<LongLivedJsiRuntime> jsiRuntimeHolder) noexcept;
@@ -121,6 +121,42 @@ bool ReactSettingsSnapshot::UseDeveloperSupport() const noexcept {
121
121
  return false;
122
122
  }
123
123
 
124
+ struct WeakRefPropertyBag : winrt::implements<WeakRefPropertyBag, winrt::Microsoft::ReactNative::IReactPropertyBag> {
125
+ WeakRefPropertyBag(winrt::Microsoft::ReactNative::IReactPropertyBag propertyBag) : m_wkPropBag(propertyBag) {}
126
+
127
+ IInspectable Get(winrt::Microsoft::ReactNative::IReactPropertyName const &name) noexcept {
128
+ if (auto propBag = m_wkPropBag.get()) {
129
+ return propBag.Get(name);
130
+ }
131
+ return nullptr;
132
+ }
133
+
134
+ IInspectable GetOrCreate(
135
+ winrt::Microsoft::ReactNative::IReactPropertyName const &name,
136
+ winrt::Microsoft::ReactNative::ReactCreatePropertyValue const &createValue) noexcept {
137
+ if (auto propBag = m_wkPropBag.get()) {
138
+ return propBag.GetOrCreate(name, createValue);
139
+ }
140
+ return nullptr;
141
+ }
142
+
143
+ IInspectable Set(winrt::Microsoft::ReactNative::IReactPropertyName const &name, IInspectable const &value) noexcept {
144
+ if (auto propBag = m_wkPropBag.get()) {
145
+ return propBag.Set(name, value);
146
+ }
147
+ return nullptr;
148
+ }
149
+
150
+ void CopyFrom(winrt::Microsoft::ReactNative::IReactPropertyBag const &value) noexcept {
151
+ if (auto propBag = m_wkPropBag.get()) {
152
+ return propBag.CopyFrom(value);
153
+ }
154
+ }
155
+
156
+ private:
157
+ winrt::weak_ref<winrt::Microsoft::ReactNative::IReactPropertyBag> m_wkPropBag;
158
+ };
159
+
124
160
  //=============================================================================================
125
161
  // ReactContext implementation
126
162
  //=============================================================================================
@@ -131,7 +167,7 @@ ReactContext::ReactContext(
131
167
  winrt::Microsoft::ReactNative::IReactNotificationService const &notifications) noexcept
132
168
  : m_reactInstance{std::move(reactInstance)},
133
169
  m_settings{Mso::Make<ReactSettingsSnapshot>(Mso::Copy(m_reactInstance))},
134
- m_properties{properties},
170
+ m_properties{winrt::make<WeakRefPropertyBag>(properties)},
135
171
  m_notifications{notifications} {}
136
172
 
137
173
  void ReactContext::Destroy() noexcept {
@@ -275,6 +275,9 @@ struct ReactOptions {
275
275
  winrt::Microsoft::ReactNative::IReactPropertyBag const &properties,
276
276
  JSIEngine value) noexcept;
277
277
 
278
+ bool JsiEngineV8NodeApi() const noexcept;
279
+ static bool JsiEngineV8NodeApi(winrt::Microsoft::ReactNative::IReactPropertyBag const &properties) noexcept;
280
+
278
281
  //! Enable live reload to load the source bundle from the React Native packager.
279
282
  //! When the file is saved, the packager will trigger reloading.
280
283
  void SetUseLiveReload(bool enable) noexcept;
@@ -3,6 +3,7 @@
3
3
 
4
4
  #include "ReactHost.h"
5
5
  #include <Future/FutureWait.h>
6
+ #include <ReactPropertyBag.h>
6
7
  #include <winrt/Windows.Foundation.h>
7
8
 
8
9
  namespace Mso::React {
@@ -35,6 +36,12 @@ winrt::Microsoft::ReactNative::IReactPropertyName JSIEngineProperty() noexcept {
35
36
  return propName;
36
37
  }
37
38
 
39
+ winrt::Microsoft::ReactNative::ReactPropertyId<bool> JSIEngineV8NodeApiProperty() noexcept {
40
+ static winrt::Microsoft::ReactNative::ReactPropertyId<bool> propId{
41
+ L"ReactNative.ReactOptions", L"JSIEngineV8NodeApi"};
42
+ return propId;
43
+ }
44
+
38
45
  winrt::Microsoft::ReactNative::IReactPropertyName LiveReloadEnabledProperty() noexcept {
39
46
  static winrt::Microsoft::ReactNative::IReactPropertyName propName =
40
47
  winrt::Microsoft::ReactNative::ReactPropertyBagHelper::GetName(
@@ -137,6 +144,15 @@ void ReactOptions::SetJsiEngine(JSIEngine value) noexcept {
137
144
  properties.Set(JSIEngineProperty(), winrt::box_value(static_cast<uint32_t>(value)));
138
145
  }
139
146
 
147
+ /*static*/ bool ReactOptions::JsiEngineV8NodeApi(
148
+ winrt::Microsoft::ReactNative::IReactPropertyBag const &properties) noexcept {
149
+ return winrt::Microsoft::ReactNative::ReactPropertyBag(properties).Get(JSIEngineV8NodeApiProperty()).value_or(false);
150
+ }
151
+
152
+ bool ReactOptions::JsiEngineV8NodeApi() const noexcept {
153
+ return JsiEngineV8NodeApi(Properties);
154
+ }
155
+
140
156
  /*static*/ void ReactOptions::SetUseFastRefresh(
141
157
  winrt::Microsoft::ReactNative::IReactPropertyBag const &properties,
142
158
  bool value) noexcept {
@@ -76,7 +76,9 @@
76
76
 
77
77
  #if defined(USE_V8)
78
78
  #include <winrt/Windows.Storage.h>
79
+ #include "BaseScriptStoreImpl.h"
79
80
  #include "JSI/V8RuntimeHolder.h"
81
+ #include "V8JSIRuntimeHolder.h"
80
82
  #endif // USE_V8
81
83
 
82
84
  #include "RedBox.h"
@@ -253,6 +255,11 @@ ReactInstanceWin::ReactInstanceWin(
253
255
  m_whenDestroyedResult =
254
256
  m_whenDestroyed.AsFuture().Then<Mso::Executors::Inline>([whenLoaded = m_whenLoaded,
255
257
  onDestroyed = m_options.OnInstanceDestroyed,
258
+ // instance might be the only thing keeping
259
+ // the propertyBag alive.
260
+ // We want it to remain alive for the
261
+ // InstanceDestroyed callbacks
262
+ propBag = m_options.Properties,
256
263
  reactContext = m_reactContext]() noexcept {
257
264
  whenLoaded.TryCancel(); // It only has an effect if whenLoaded was not set before
258
265
  Microsoft::ReactNative::HermesRuntimeHolder::storeTo(ReactPropertyBag(reactContext->Properties()), nullptr);
@@ -491,7 +498,6 @@ void ReactInstanceWin::Initialize() noexcept {
491
498
 
492
499
  switch (m_options.JsiEngine()) {
493
500
  case JSIEngine::Hermes: {
494
- // TODO: Should we use UwpPreparedScriptStore?
495
501
  if (Microsoft::ReactNative::HasPackageIdentity()) {
496
502
  preparedScriptStore =
497
503
  std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationTempFolder());
@@ -529,8 +535,18 @@ void ReactInstanceWin::Initialize() noexcept {
529
535
  enableMultiThreadSupport = Microsoft::ReactNative::IsFabricEnabled(m_reactContext->Properties());
530
536
  #endif // USE_FABRIC
531
537
 
532
- devSettings->jsiRuntimeHolder = std::make_shared<Microsoft::ReactNative::V8RuntimeHolder>(
533
- devSettings, m_jsMessageThread.Load(), std::move(preparedScriptStore), enableMultiThreadSupport);
538
+ if (m_options.JsiEngineV8NodeApi()) {
539
+ devSettings->jsiRuntimeHolder = std::make_shared<Microsoft::ReactNative::V8RuntimeHolder>(
540
+ devSettings, m_jsMessageThread.Load(), std::move(preparedScriptStore), enableMultiThreadSupport);
541
+ } else {
542
+ devSettings->jsiRuntimeHolder = std::make_shared<facebook::react::V8JSIRuntimeHolder>(
543
+ devSettings,
544
+ m_jsMessageThread.Load(),
545
+ std::move(scriptStore),
546
+ std::move(preparedScriptStore),
547
+ enableMultiThreadSupport);
548
+ }
549
+
534
550
  break;
535
551
  }
536
552
  #endif // USE_V8
@@ -221,11 +221,46 @@ class TurboModuleImpl : public facebook::react::TurboModule {
221
221
  VerifyElseCrash(argCount > 1);
222
222
  if (auto strongLongLivedObjectCollection = longLivedObjectCollection.lock()) {
223
223
  auto jsiRuntimeHolder = LongLivedJsiRuntime::CreateWeak(strongLongLivedObjectCollection, rt);
224
+ auto weakCallback1 = LongLivedJsiFunction::CreateWeak(
225
+ strongLongLivedObjectCollection, rt, args[argCount - 2].getObject(rt).getFunction(rt));
226
+ auto weakCallback2 = LongLivedJsiFunction::CreateWeak(
227
+ strongLongLivedObjectCollection, rt, args[argCount - 1].getObject(rt).getFunction(rt));
228
+
224
229
  method(
225
230
  winrt::make<JsiReader>(rt, args, argCount - 2),
226
231
  winrt::make<JSDispatcherWriter>(jsDispatcher, jsiRuntimeHolder),
227
- MakeCallback(rt, strongLongLivedObjectCollection, args[argCount - 2]),
228
- MakeCallback(rt, strongLongLivedObjectCollection, args[argCount - 1]));
232
+ [weakCallback1, weakCallback2, jsiRuntimeHolder](const IJSValueWriter &writer) noexcept {
233
+ writer.as<JSDispatcherWriter>()->WithResultArgs(
234
+ [weakCallback1, weakCallback2, jsiRuntimeHolder](
235
+ facebook::jsi::Runtime &rt, facebook::jsi::Value const *args, size_t count) {
236
+ if (auto callback1 = weakCallback1.lock()) {
237
+ callback1->Value().call(rt, args, count);
238
+ callback1->allowRelease();
239
+ }
240
+ if (auto callback2 = weakCallback2.lock()) {
241
+ callback2->allowRelease();
242
+ }
243
+ if (auto runtimeHolder = jsiRuntimeHolder.lock()) {
244
+ runtimeHolder->allowRelease();
245
+ }
246
+ });
247
+ },
248
+ [weakCallback1, weakCallback2, jsiRuntimeHolder](const IJSValueWriter &writer) noexcept {
249
+ writer.as<JSDispatcherWriter>()->WithResultArgs(
250
+ [weakCallback1, weakCallback2, jsiRuntimeHolder](
251
+ facebook::jsi::Runtime &rt, facebook::jsi::Value const *args, size_t count) {
252
+ if (auto callback2 = weakCallback2.lock()) {
253
+ callback2->Value().call(rt, args, count);
254
+ callback2->allowRelease();
255
+ }
256
+ if (auto callback1 = weakCallback1.lock()) {
257
+ callback1->allowRelease();
258
+ }
259
+ if (auto runtimeHolder = jsiRuntimeHolder.lock()) {
260
+ runtimeHolder->allowRelease();
261
+ }
262
+ });
263
+ });
229
264
  }
230
265
  return facebook::jsi::Value::undefined();
231
266
  });
@@ -247,49 +282,65 @@ class TurboModuleImpl : public facebook::react::TurboModule {
247
282
  auto argWriter = winrt::make<JSDispatcherWriter>(jsDispatcher, jsiRuntimeHolder);
248
283
  return facebook::react::createPromiseAsJSIValue(
249
284
  rt,
250
- [method, argReader, argWriter, strongLongLivedObjectCollection](
285
+ [method, argReader, argWriter, strongLongLivedObjectCollection, jsiRuntimeHolder](
251
286
  facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::Promise> promise) {
287
+ auto weakResolve = LongLivedJsiFunction::CreateWeak(
288
+ strongLongLivedObjectCollection, runtime, std::move(promise->resolve_));
289
+ auto weakReject = LongLivedJsiFunction::CreateWeak(
290
+ strongLongLivedObjectCollection, runtime, std::move(promise->reject_));
252
291
  method(
253
292
  argReader,
254
293
  argWriter,
255
- [weakResolve = LongLivedJsiFunction::CreateWeak(
256
- strongLongLivedObjectCollection, runtime, std::move(promise->resolve_))](
257
- const IJSValueWriter &writer) {
258
- writer.as<JSDispatcherWriter>()->WithResultArgs([weakResolve](
259
- facebook::jsi::Runtime &runtime,
260
- facebook::jsi::Value const *args,
261
- size_t argCount) {
262
- VerifyElseCrash(argCount == 1);
263
- if (auto resolveHolder = weakResolve.lock()) {
264
- resolveHolder->Value().call(runtime, args[0]);
265
- }
266
- });
294
+ [weakResolve, weakReject, jsiRuntimeHolder](const IJSValueWriter &writer) {
295
+ writer.as<JSDispatcherWriter>()->WithResultArgs(
296
+ [weakResolve, weakReject, jsiRuntimeHolder](
297
+ facebook::jsi::Runtime &runtime,
298
+ facebook::jsi::Value const *args,
299
+ size_t argCount) {
300
+ VerifyElseCrash(argCount == 1);
301
+ if (auto resolveHolder = weakResolve.lock()) {
302
+ resolveHolder->Value().call(runtime, args[0]);
303
+ resolveHolder->allowRelease();
304
+ }
305
+ if (auto rejectHolder = weakReject.lock()) {
306
+ rejectHolder->allowRelease();
307
+ }
308
+ if (auto runtimeHolder = jsiRuntimeHolder.lock()) {
309
+ runtimeHolder->allowRelease();
310
+ }
311
+ });
267
312
  },
268
- [weakReject = LongLivedJsiFunction::CreateWeak(
269
- strongLongLivedObjectCollection, runtime, std::move(promise->reject_))](
270
- const IJSValueWriter &writer) {
271
- writer.as<JSDispatcherWriter>()->WithResultArgs([weakReject](
272
- facebook::jsi::Runtime &runtime,
273
- facebook::jsi::Value const *args,
274
- size_t argCount) {
275
- VerifyElseCrash(argCount == 1);
276
- if (auto rejectHolder = weakReject.lock()) {
277
- // To match the Android and iOS TurboModule behavior we create the Error object for
278
- // the Promise rejection the same way as in updateErrorWithErrorData method.
279
- // See react-native/Libraries/BatchedBridge/NativeModules.js for details.
280
- auto error = runtime.global()
281
- .getPropertyAsFunction(runtime, "Error")
282
- .callAsConstructor(runtime, {});
283
- auto &errorData = args[0];
284
- if (errorData.isObject()) {
285
- runtime.global()
286
- .getPropertyAsObject(runtime, "Object")
287
- .getPropertyAsFunction(runtime, "assign")
288
- .call(runtime, error, errorData.getObject(runtime));
289
- }
290
- rejectHolder->Value().call(runtime, args[0]);
291
- }
292
- });
313
+ [weakResolve, weakReject, jsiRuntimeHolder](const IJSValueWriter &writer) {
314
+ writer.as<JSDispatcherWriter>()->WithResultArgs(
315
+ [weakResolve, weakReject, jsiRuntimeHolder](
316
+ facebook::jsi::Runtime &runtime,
317
+ facebook::jsi::Value const *args,
318
+ size_t argCount) {
319
+ VerifyElseCrash(argCount == 1);
320
+ if (auto rejectHolder = weakReject.lock()) {
321
+ // To match the Android and iOS TurboModule behavior we create the Error object
322
+ // for the Promise rejection the same way as in updateErrorWithErrorData method.
323
+ // See react-native/Libraries/BatchedBridge/NativeModules.js for details.
324
+ auto error = runtime.global()
325
+ .getPropertyAsFunction(runtime, "Error")
326
+ .callAsConstructor(runtime, {});
327
+ auto &errorData = args[0];
328
+ if (errorData.isObject()) {
329
+ runtime.global()
330
+ .getPropertyAsObject(runtime, "Object")
331
+ .getPropertyAsFunction(runtime, "assign")
332
+ .call(runtime, error, errorData.getObject(runtime));
333
+ }
334
+ rejectHolder->Value().call(runtime, args[0]);
335
+ rejectHolder->allowRelease();
336
+ }
337
+ if (auto resolveHolder = weakResolve.lock()) {
338
+ resolveHolder->allowRelease();
339
+ }
340
+ if (auto runtimeHolder = jsiRuntimeHolder.lock()) {
341
+ runtimeHolder->allowRelease();
342
+ }
343
+ });
293
344
  });
294
345
  });
295
346
  }
@@ -347,6 +398,7 @@ class TurboModuleImpl : public facebook::react::TurboModule {
347
398
  [weakCallback](facebook::jsi::Runtime &rt, facebook::jsi::Value const *args, size_t count) {
348
399
  if (auto callback = weakCallback.lock()) {
349
400
  callback->Value().call(rt, args, count);
401
+ callback->allowRelease();
350
402
  }
351
403
  });
352
404
  };
@@ -10,9 +10,9 @@
10
10
  },
11
11
  "Microsoft.JavaScript.Hermes": {
12
12
  "type": "Direct",
13
- "requested": "[0.1.15, )",
14
- "resolved": "0.1.15",
15
- "contentHash": "My/u5RvxoymtwWokoweU6iVpuP79w271UjadcmSNqnQ9ESIv00tlVP4sHnIiN3t2lJNDeciyE1EVF4swGPECKQ=="
13
+ "requested": "[0.1.18, )",
14
+ "resolved": "0.1.18",
15
+ "contentHash": "5K8rRihGwIs2XNOTP2Jsw3T6cegxCBQXcpPS4optONU/AmFElGAfnA6XBQJ4UqlCFCl9Nf9zQrgvCUPBWYHiag=="
16
16
  },
17
17
  "Microsoft.SourceLink.GitHub": {
18
18
  "type": "Direct",
@@ -36,6 +36,7 @@
36
36
  $(NodeApiJsiSrcDir);
37
37
  %(AdditionalIncludeDirectories)
38
38
  </AdditionalIncludeDirectories>
39
+ <PreprocessorDefinitions>JSI_VERSION=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
39
40
  </ClCompile>
40
41
  <Midl>
41
42
  <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -24,11 +24,21 @@
24
24
  "Microsoft.SourceLink.Common": "1.1.1"
25
25
  }
26
26
  },
27
+ "boost": {
28
+ "type": "Transitive",
29
+ "resolved": "1.76.0",
30
+ "contentHash": "p+w3YvNdXL8Cu9Fzrmexssu0tZbWxuf6ywsQqHjDlKFE5ojXHof1HIyMC3zDLfLnh80dIeFcEUAuR2Asg/XHRA=="
31
+ },
27
32
  "Microsoft.Build.Tasks.Git": {
28
33
  "type": "Transitive",
29
34
  "resolved": "1.1.1",
30
35
  "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q=="
31
36
  },
37
+ "Microsoft.JavaScript.Hermes": {
38
+ "type": "Transitive",
39
+ "resolved": "0.1.18",
40
+ "contentHash": "5K8rRihGwIs2XNOTP2Jsw3T6cegxCBQXcpPS4optONU/AmFElGAfnA6XBQJ4UqlCFCl9Nf9zQrgvCUPBWYHiag=="
41
+ },
32
42
  "Microsoft.Net.Native.Compiler": {
33
43
  "type": "Transitive",
34
44
  "resolved": "2.2.7-rel-27913-00",
@@ -60,6 +70,19 @@
60
70
  "resolved": "1.1.1",
61
71
  "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
62
72
  },
73
+ "Microsoft.UI.Xaml": {
74
+ "type": "Transitive",
75
+ "resolved": "2.8.0",
76
+ "contentHash": "vxdHxTr63s5KVtNddMFpgvjBjUH50z7seq/5jLWmmSuf8poxg+sXrywkofUdE8ZstbpO9y3FL/IXXUcPYbeesA==",
77
+ "dependencies": {
78
+ "Microsoft.Web.WebView2": "1.0.1264.42"
79
+ }
80
+ },
81
+ "Microsoft.Web.WebView2": {
82
+ "type": "Transitive",
83
+ "resolved": "1.0.1264.42",
84
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
85
+ },
63
86
  "NETStandard.Library": {
64
87
  "type": "Transitive",
65
88
  "resolved": "2.0.3",
@@ -144,7 +167,8 @@
144
167
  "folly": {
145
168
  "type": "Project",
146
169
  "dependencies": {
147
- "fmt": "[1.0.0, )"
170
+ "Fmt": "[1.0.0, )",
171
+ "boost": "[1.76.0, )"
148
172
  }
149
173
  },
150
174
  "microsoft.reactnative": {
@@ -152,13 +176,18 @@
152
176
  "dependencies": {
153
177
  "Common": "[1.0.0, )",
154
178
  "Folly": "[1.0.0, )",
155
- "ReactCommon": "[1.0.0, )"
179
+ "Microsoft.JavaScript.Hermes": "[0.1.18, )",
180
+ "Microsoft.SourceLink.GitHub": "[1.1.1, )",
181
+ "Microsoft.UI.Xaml": "[2.8.0, )",
182
+ "ReactCommon": "[1.0.0, )",
183
+ "boost": "[1.76.0, )"
156
184
  }
157
185
  },
158
186
  "reactcommon": {
159
187
  "type": "Project",
160
188
  "dependencies": {
161
- "Folly": "[1.0.0, )"
189
+ "Folly": "[1.0.0, )",
190
+ "boost": "[1.76.0, )"
162
191
  }
163
192
  }
164
193
  },
@@ -176,6 +205,11 @@
176
205
  "runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
177
206
  }
178
207
  },
208
+ "Microsoft.Web.WebView2": {
209
+ "type": "Transitive",
210
+ "resolved": "1.0.1264.42",
211
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
212
+ },
179
213
  "runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": {
180
214
  "type": "Transitive",
181
215
  "resolved": "6.2.9",
@@ -196,6 +230,11 @@
196
230
  "runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
197
231
  }
198
232
  },
233
+ "Microsoft.Web.WebView2": {
234
+ "type": "Transitive",
235
+ "resolved": "1.0.1264.42",
236
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
237
+ },
199
238
  "runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
200
239
  "type": "Transitive",
201
240
  "resolved": "6.2.9",
@@ -216,6 +255,11 @@
216
255
  "runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
217
256
  }
218
257
  },
258
+ "Microsoft.Web.WebView2": {
259
+ "type": "Transitive",
260
+ "resolved": "1.0.1264.42",
261
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
262
+ },
219
263
  "runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
220
264
  "type": "Transitive",
221
265
  "resolved": "6.2.9",
@@ -236,6 +280,11 @@
236
280
  "runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
237
281
  }
238
282
  },
283
+ "Microsoft.Web.WebView2": {
284
+ "type": "Transitive",
285
+ "resolved": "1.0.1264.42",
286
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
287
+ },
239
288
  "runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": {
240
289
  "type": "Transitive",
241
290
  "resolved": "6.2.9",
@@ -256,6 +305,11 @@
256
305
  "runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
257
306
  }
258
307
  },
308
+ "Microsoft.Web.WebView2": {
309
+ "type": "Transitive",
310
+ "resolved": "1.0.1264.42",
311
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
312
+ },
259
313
  "runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
260
314
  "type": "Transitive",
261
315
  "resolved": "6.2.9",
@@ -276,6 +330,11 @@
276
330
  "runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
277
331
  }
278
332
  },
333
+ "Microsoft.Web.WebView2": {
334
+ "type": "Transitive",
335
+ "resolved": "1.0.1264.42",
336
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
337
+ },
279
338
  "runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": {
280
339
  "type": "Transitive",
281
340
  "resolved": "6.2.9",
@@ -296,6 +355,11 @@
296
355
  "runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
297
356
  }
298
357
  },
358
+ "Microsoft.Web.WebView2": {
359
+ "type": "Transitive",
360
+ "resolved": "1.0.1264.42",
361
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
362
+ },
299
363
  "runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
300
364
  "type": "Transitive",
301
365
  "resolved": "6.2.9",
@@ -11,7 +11,8 @@
11
11
  <!-- We are a tool, so on all platforms force win-x64 -->
12
12
  <PlatformTarget>x64</PlatformTarget>
13
13
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
14
-
14
+ <SelfContained>true</SelfContained>
15
+
15
16
  <Nullable>enable</Nullable>
16
17
  <LangVersion>8.0</LangVersion>
17
18
  </PropertyGroup>
@@ -8,5 +8,13 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <Target Name="EnsureUseHermes" BeforeTargets="PrepareForBuild" Condition="'$(UseHermes)' == 'false'">
12
+ <Warning Text="Property 'UseHermes' was set to 'false'. Projects built against Microsoft.ReactNative.Composition require Hermes and it will be set to true." />
13
+ </Target>
14
+
15
+ <PropertyGroup>
16
+ <UseHermes>true</UseHermes>
17
+ </PropertyGroup>
18
+
11
19
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Common.props" />
12
20
  </Project>
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.73.0-preview.3</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.73.0-preview.5</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>73</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>727387f5fd3b039d39d3b58d600b08204690b6e7</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>2013fee73c86ae6d8a21ab8231da30335371d018</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -12,9 +12,9 @@
12
12
  <PropertyGroup>
13
13
  <JsEnginePropsDefined>true</JsEnginePropsDefined>
14
14
  <!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
15
- <UseHermes Condition="'$(UseHermes)' == ''">false</UseHermes>
15
+ <UseHermes Condition="'$(UseHermes)' == ''">true</UseHermes>
16
16
  <!-- This will be true if (1) the client want to use hermes by setting UseHermes to true OR (2) We are building for UWP where dynamic switching is enabled -->
17
- <HermesVersion Condition="'$(HermesVersion)' == ''">0.1.15</HermesVersion>
17
+ <HermesVersion Condition="'$(HermesVersion)' == ''">0.1.18</HermesVersion>
18
18
  <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgMicrosoft_JavaScript_Hermes)')">$(PkgMicrosoft_JavaScript_Hermes)</HermesPackage>
19
19
  <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\Microsoft.JavaScript.Hermes\$(HermesVersion)</HermesPackage>
20
20
  <EnableHermesInspectorInReleaseFlavor Condition="'$(EnableHermesInspectorInReleaseFlavor)' == ''">false</EnableHermesInspectorInReleaseFlavor>
@@ -24,9 +24,10 @@
24
24
  <EnableDevServerHBCBundles Condition="'$(EnableDevServerHBCBundles)' == ''">false</EnableDevServerHBCBundles>
25
25
 
26
26
  <UseV8 Condition="'$(UseV8)' == ''">false</UseV8>
27
- <V8Version Condition="'$(V8Version)' == ''">0.71.5</V8Version>
27
+ <V8Version Condition="'$(V8Version)' == ''">0.71.8</V8Version>
28
28
  <V8PackageName>ReactNative.V8Jsi.Windows</V8PackageName>
29
29
  <V8PackageName Condition="'$(V8AppPlatform)' != 'win32'">$(V8PackageName).UWP</V8PackageName>
30
+ <V8Package>$(NuGetPackageRoot)\$(V8PackageName).$(V8Version)</V8Package>
30
31
  </PropertyGroup>
31
32
 
32
33
  </Project>