react-native-windows 0.73.0-preview.4 → 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.
@@ -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;
@@ -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",
@@ -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>
@@ -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.4</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>cbdae1dd7cb7fd0ce521e3812e81d8c646d9ca6a</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>2013fee73c86ae6d8a21ab8231da30335371d018</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -14,7 +14,7 @@
14
14
  <!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
15
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>
@@ -106,7 +106,7 @@
106
106
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\SystraceSection.h" />
107
107
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.h" />
108
108
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.h" />
109
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsinspector\InspectorInterfaces.h" />
109
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.h" />
110
110
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.h" />
111
111
  <ClInclude Include="$(YogaDir)\yoga\YGEnums.h" />
112
112
  <ClInclude Include="$(YogaDir)\yoga\YGMacros.h" />
@@ -128,7 +128,7 @@
128
128
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsi\jsi\JSIDynamic.cpp" />
129
129
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp" />
130
130
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp" />
131
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector\InspectorInterfaces.cpp" />
131
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.cpp" />
132
132
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.cpp" />
133
133
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp" />
134
134
  <ClCompile Include="$(YogaDir)\yoga\YGEnums.cpp" />
@@ -10,7 +10,7 @@
10
10
  #include <NodeApiJsiRuntime.h>
11
11
  #include <crash/verifyElseCrash.h>
12
12
  #include <cxxreact/SystraceSection.h>
13
- #include <jsinspector/InspectorInterfaces.h>
13
+ #include <jsinspector-modern/InspectorInterfaces.h>
14
14
  #include <mutex>
15
15
  #include "SafeLoadLibrary.h"
16
16
 
@@ -230,10 +230,10 @@ class HermesScriptCache {
230
230
  std::shared_ptr<facebook::jsi::PreparedScriptStore> scriptStore_;
231
231
  };
232
232
 
233
- class HermesLocalConnection : public facebook::react::ILocalConnection {
233
+ class HermesLocalConnection : public facebook::react::jsinspector_modern::ILocalConnection {
234
234
  public:
235
235
  HermesLocalConnection(
236
- std::unique_ptr<facebook::react::IRemoteConnection> remoteConnection,
236
+ std::unique_ptr<facebook::react::jsinspector_modern::IRemoteConnection> remoteConnection,
237
237
  void *connectFunc) noexcept {
238
238
  CRASH_ON_ERROR(getHermesApi().hermes_create_local_connection(
239
239
  connectFunc,
@@ -259,15 +259,15 @@ class HermesLocalConnection : public facebook::react::ILocalConnection {
259
259
 
260
260
  private:
261
261
  static void NAPI_CDECL OnRemoteConnectionSendMessage(hermes_remote_connection remoteConnection, const char *message) {
262
- reinterpret_cast<facebook::react::IRemoteConnection *>(remoteConnection)->onMessage(message);
262
+ reinterpret_cast<facebook::react::jsinspector_modern::IRemoteConnection *>(remoteConnection)->onMessage(message);
263
263
  }
264
264
 
265
265
  static void NAPI_CDECL OnRemoteConnectionDisconnect(hermes_remote_connection remoteConnection) {
266
- reinterpret_cast<facebook::react::IRemoteConnection *>(remoteConnection)->onDisconnect();
266
+ reinterpret_cast<facebook::react::jsinspector_modern::IRemoteConnection *>(remoteConnection)->onDisconnect();
267
267
  }
268
268
 
269
269
  static void NAPI_CDECL OnRemoteConnectionDelete(void *remoteConnection, void * /*deleterData*/) {
270
- delete reinterpret_cast<facebook::react::IRemoteConnection *>(remoteConnection);
270
+ delete reinterpret_cast<facebook::react::jsinspector_modern::IRemoteConnection *>(remoteConnection);
271
271
  }
272
272
 
273
273
  private:
@@ -275,18 +275,18 @@ class HermesLocalConnection : public facebook::react::ILocalConnection {
275
275
  };
276
276
 
277
277
  int32_t NAPI_CDECL addInspectorPage(const char *title, const char *vm, void *connectFunc) noexcept {
278
- return facebook::react::getInspectorInstance().addPage(
278
+ return facebook::react::jsinspector_modern::getInspectorInstance().addPage(
279
279
  title,
280
280
  vm,
281
- [connectFunc,
282
- hermesApi = HermesApi::current()](std::unique_ptr<facebook::react::IRemoteConnection> remoteConnection) {
281
+ [connectFunc, hermesApi = HermesApi::current()](
282
+ std::unique_ptr<facebook::react::jsinspector_modern::IRemoteConnection> remoteConnection) {
283
283
  HermesApi::Scope apiScope(hermesApi);
284
284
  return std::make_unique<HermesLocalConnection>(std::move(remoteConnection), connectFunc);
285
285
  });
286
286
  }
287
287
 
288
288
  void NAPI_CDECL removeInspectorPage(int32_t pageId) noexcept {
289
- facebook::react::getInspectorInstance().removePage(pageId);
289
+ facebook::react::jsinspector_modern::getInspectorInstance().removePage(pageId);
290
290
  }
291
291
 
292
292
  } // namespace
@@ -72,10 +72,10 @@ struct InspectorProtocol {
72
72
  }
73
73
 
74
74
  static folly::dynamic constructGetPagesResponsePayloadForPackager(
75
- const std::vector<facebook::react::InspectorPage> &pages,
75
+ const std::vector<facebook::react::jsinspector_modern::InspectorPage> &pages,
76
76
  InspectorPackagerConnection::BundleStatus bundleStatus) {
77
77
  folly::dynamic payload = folly::dynamic::array;
78
- for (const facebook::react::InspectorPage &page : pages) {
78
+ for (const facebook::react::jsinspector_modern::InspectorPage &page : pages) {
79
79
  folly::dynamic pageDyn = folly::dynamic::object;
80
80
  pageDyn["id"] = page.id;
81
81
  pageDyn["title"] = page.title;
@@ -167,62 +167,63 @@ winrt::fire_and_forget InspectorPackagerConnection::connectAsync() {
167
167
  m_packagerWebSocketConnection->SetOnConnect(
168
168
  []() { facebook::react::tracing::log("Inspector: Websocket connection succeeded."); });
169
169
 
170
- m_packagerWebSocketConnection->SetOnMessage([self = shared_from_this()](
171
- size_t /*length*/, const std::string &message, bool isBinary) {
172
- assert(!isBinary && "We don't expect any binary messages !");
173
- folly::dynamic messageDyn = folly::parseJson(message);
174
-
175
- InspectorProtocol::EventType eventType = InspectorProtocol::getEventType(messageDyn);
176
- switch (eventType) {
177
- case InspectorProtocol::EventType::GetPages: {
178
- std::vector<facebook::react::InspectorPage> inspectorPages = facebook::react::getInspectorInstance().getPages();
179
- folly::dynamic response = InspectorProtocol::constructResponseForPackager(
180
- InspectorProtocol::EventType::GetPages,
181
- InspectorProtocol::constructGetPagesResponsePayloadForPackager(
182
- inspectorPages, self->m_bundleStatusProvider->getBundleStatus()));
183
-
184
- std::string responsestr = folly::toJson(response);
185
- self->sendMessageToPackager(std::move(responsestr));
186
- break;
187
- }
188
-
189
- case InspectorProtocol::EventType::WrappedEvent: {
190
- folly::dynamic payload = messageDyn[InspectorProtocol::Message_PAYLOAD];
191
- int32_t pageId = static_cast<int32_t>(payload[InspectorProtocol::Message_PAGEID].asInt());
192
-
193
- if (self->m_localConnections.find(pageId) == self->m_localConnections.end()) {
194
- break;
195
- }
196
-
197
- std::string wrappedEvent = payload[InspectorProtocol::Message_eventName_wrappedEvent].getString();
198
- self->sendMessageToVM(pageId, std::move(wrappedEvent));
199
- break;
200
- }
201
-
202
- case InspectorProtocol::EventType::Connect: {
203
- folly::dynamic payload = messageDyn[InspectorProtocol::Message_PAYLOAD];
204
- int32_t pageId = static_cast<int32_t>(payload[InspectorProtocol::Message_PAGEID].asInt());
205
-
206
- if (self->m_localConnections.find(pageId) != self->m_localConnections.end()) {
207
- break;
208
- }
209
-
210
- self->m_localConnections[pageId] =
211
- facebook::react::getInspectorInstance().connect(pageId, std::make_unique<RemoteConnection>(pageId, *self));
212
- break;
213
- }
214
-
215
- case InspectorProtocol::EventType::Disconnect: {
216
- folly::dynamic payload = messageDyn[InspectorProtocol::Message_PAYLOAD];
217
- int32_t pageId = static_cast<int32_t>(payload[InspectorProtocol::Message_PAGEID].asInt());
218
- if (self->m_localConnections.find(pageId) != self->m_localConnections.end()) {
219
- self->m_localConnections[pageId]->disconnect();
220
- self->m_localConnections.erase(pageId);
170
+ m_packagerWebSocketConnection->SetOnMessage(
171
+ [self = shared_from_this()](size_t /*length*/, const std::string &message, bool isBinary) {
172
+ assert(!isBinary && "We don't expect any binary messages !");
173
+ folly::dynamic messageDyn = folly::parseJson(message);
174
+
175
+ InspectorProtocol::EventType eventType = InspectorProtocol::getEventType(messageDyn);
176
+ switch (eventType) {
177
+ case InspectorProtocol::EventType::GetPages: {
178
+ std::vector<facebook::react::jsinspector_modern::InspectorPage> inspectorPages =
179
+ facebook::react::jsinspector_modern::getInspectorInstance().getPages();
180
+ folly::dynamic response = InspectorProtocol::constructResponseForPackager(
181
+ InspectorProtocol::EventType::GetPages,
182
+ InspectorProtocol::constructGetPagesResponsePayloadForPackager(
183
+ inspectorPages, self->m_bundleStatusProvider->getBundleStatus()));
184
+
185
+ std::string responsestr = folly::toJson(response);
186
+ self->sendMessageToPackager(std::move(responsestr));
187
+ break;
188
+ }
189
+
190
+ case InspectorProtocol::EventType::WrappedEvent: {
191
+ folly::dynamic payload = messageDyn[InspectorProtocol::Message_PAYLOAD];
192
+ int32_t pageId = static_cast<int32_t>(payload[InspectorProtocol::Message_PAGEID].asInt());
193
+
194
+ if (self->m_localConnections.find(pageId) == self->m_localConnections.end()) {
195
+ break;
196
+ }
197
+
198
+ std::string wrappedEvent = payload[InspectorProtocol::Message_eventName_wrappedEvent].getString();
199
+ self->sendMessageToVM(pageId, std::move(wrappedEvent));
200
+ break;
201
+ }
202
+
203
+ case InspectorProtocol::EventType::Connect: {
204
+ folly::dynamic payload = messageDyn[InspectorProtocol::Message_PAYLOAD];
205
+ int32_t pageId = static_cast<int32_t>(payload[InspectorProtocol::Message_PAGEID].asInt());
206
+
207
+ if (self->m_localConnections.find(pageId) != self->m_localConnections.end()) {
208
+ break;
209
+ }
210
+
211
+ self->m_localConnections[pageId] = facebook::react::jsinspector_modern::getInspectorInstance().connect(
212
+ pageId, std::make_unique<RemoteConnection>(pageId, *self));
213
+ break;
214
+ }
215
+
216
+ case InspectorProtocol::EventType::Disconnect: {
217
+ folly::dynamic payload = messageDyn[InspectorProtocol::Message_PAYLOAD];
218
+ int32_t pageId = static_cast<int32_t>(payload[InspectorProtocol::Message_PAGEID].asInt());
219
+ if (self->m_localConnections.find(pageId) != self->m_localConnections.end()) {
220
+ self->m_localConnections[pageId]->disconnect();
221
+ self->m_localConnections.erase(pageId);
222
+ }
223
+ break;
224
+ }
221
225
  }
222
- break;
223
- }
224
- }
225
- });
226
+ });
226
227
 
227
228
  Microsoft::React::Networking::IWebSocketResource::Protocols protocols;
228
229
  Microsoft::React::Networking::IWebSocketResource::Options options;
@@ -4,7 +4,7 @@
4
4
  #pragma once
5
5
 
6
6
  #include <Networking/WinRTWebSocketResource.h>
7
- #include <jsinspector/InspectorInterfaces.h>
7
+ #include <jsinspector-modern/InspectorInterfaces.h>
8
8
 
9
9
  namespace Microsoft::ReactNative {
10
10
 
@@ -40,13 +40,14 @@ class InspectorPackagerConnection final : public std::enable_shared_from_this<In
40
40
  void sendMessageToVM(int32_t pageId, std::string &&message);
41
41
 
42
42
  private:
43
- std::unordered_map<int32_t, std::unique_ptr<facebook::react::ILocalConnection>> m_localConnections;
43
+ std::unordered_map<int32_t, std::unique_ptr<facebook::react::jsinspector_modern::ILocalConnection>>
44
+ m_localConnections;
44
45
  std::shared_ptr<Microsoft::React::Networking::WinRTWebSocketResource> m_packagerWebSocketConnection;
45
46
  std::shared_ptr<IBundleStatusProvider> m_bundleStatusProvider;
46
47
  std::string m_url;
47
48
  };
48
49
 
49
- class RemoteConnection final : public facebook::react::IRemoteConnection {
50
+ class RemoteConnection final : public facebook::react::jsinspector_modern::IRemoteConnection {
50
51
  public:
51
52
  RemoteConnection(int32_t pageId, const InspectorPackagerConnection &packagerConnection);
52
53
  void onMessage(std::string message) override;
@@ -140,15 +140,19 @@ void DefaultBlobResource::Release(string &&blobId) noexcept /*override*/ {
140
140
  void DefaultBlobResource::AddNetworkingHandler() noexcept /*override*/ {
141
141
  auto propId = msrn::ReactPropertyId<msrn::ReactNonAbiValue<weak_ptr<IHttpModuleProxy>>>{L"HttpModule.Proxy"};
142
142
 
143
+ bool handlerAdded = false;
143
144
  if (auto prop = m_propertyBag.Get(propId)) {
144
145
  if (auto httpHandler = prop.Value().lock()) {
145
146
  httpHandler->AddRequestBodyHandler(m_requestBodyHandler);
146
147
  httpHandler->AddResponseHandler(m_responseHandler);
148
+ handlerAdded = true;
147
149
  }
148
- } else {
149
- // #11439 - The absence of HttpModule.Proxy may be caused by a module initialization race condition.
150
- // Best-effort approach to set up the request/response handlers by exposing this interface to dependents
151
- // (i.e. IHttpResource).
150
+ }
151
+
152
+ // #11439 - The absence of HttpModule.Proxy may be caused by a module initialization race condition.
153
+ // Best-effort approach to set up the request/response handlers by exposing this interface to dependents
154
+ // (i.e. IHttpResource).
155
+ if (!handlerAdded) {
152
156
  auto propId = msrn::ReactPropertyId<msrn::ReactNonAbiValue<weak_ptr<IBlobResource>>>{L"Blob.Resource"};
153
157
  m_propertyBag.Set(propId, weak_ptr<IBlobResource>(shared_from_this()));
154
158
  }
@@ -545,7 +545,7 @@ WinRTHttpResource::PerformSendRequest(HttpMethod &&method, Uri &&rtUri, IInspect
545
545
  if (self->m_onComplete) {
546
546
  self->m_onComplete(reqArgs->RequestId);
547
547
  }
548
- co_return;
548
+ co_return self->UntrackResponse(reqArgs->RequestId);
549
549
  }
550
550
  }
551
551
 
@@ -6,7 +6,7 @@
6
6
  "Type": "git",
7
7
  "Git": {
8
8
  "RepositoryUrl": "https://github.com/fmtlib/fmt",
9
- "CommitHash": "9e8b86fd2d9806672cc73133d21780dd182bfd24"
9
+ "CommitHash": "ca2e3685b160617d3d95fcd9e789c4e06ca88"
10
10
  }
11
11
  },
12
12
  "DevelopmentDependency": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.73.0-preview.4",
3
+ "version": "0.73.0-preview.5",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,31 +23,31 @@
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.0.0",
25
25
  "@jest/create-cache-key-function": "^29.6.3",
26
- "@react-native-community/cli": "12.0.0-alpha.17",
27
- "@react-native-community/cli-platform-android": "12.0.0-alpha.17",
28
- "@react-native-community/cli-platform-ios": "12.0.0-alpha.17",
26
+ "@react-native-community/cli": "12.0.0",
27
+ "@react-native-community/cli-platform-android": "12.0.0",
28
+ "@react-native-community/cli-platform-ios": "12.0.0",
29
29
  "@react-native-windows/cli": "0.73.0-preview.2",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "^0.73.1",
32
32
  "@react-native/codegen": "^0.73.1",
33
- "@react-native/community-cli-plugin": "^0.73.7",
34
- "@react-native/gradle-plugin": "^0.73.2",
33
+ "@react-native/community-cli-plugin": "^0.73.8",
34
+ "@react-native/gradle-plugin": "^0.73.3",
35
35
  "@react-native/js-polyfills": "^0.73.1",
36
36
  "@react-native/normalize-colors": "^0.73.2",
37
- "@react-native/virtualized-lists": "^0.73.2",
37
+ "@react-native/virtualized-lists": "^0.73.3",
38
38
  "abort-controller": "^3.0.0",
39
39
  "anser": "^1.4.9",
40
40
  "ansi-regex": "^5.0.0",
41
41
  "base64-js": "^1.5.1",
42
- "deprecated-react-native-prop-types": "4.2.1",
42
+ "deprecated-react-native-prop-types": "^5.0.0",
43
43
  "event-target-shim": "^5.0.1",
44
44
  "flow-enums-runtime": "^0.0.6",
45
45
  "invariant": "^2.2.4",
46
46
  "jest-environment-node": "^29.6.3",
47
47
  "jsc-android": "^250231.0.0",
48
48
  "memoize-one": "^5.0.0",
49
- "metro-runtime": "0.79.1",
50
- "metro-source-map": "0.79.1",
49
+ "metro-runtime": "^0.80.0",
50
+ "metro-source-map": "^0.80.0",
51
51
  "mkdirp": "^0.5.1",
52
52
  "nullthrows": "^1.1.1",
53
53
  "pretty-format": "^26.5.2",
@@ -81,14 +81,14 @@
81
81
  "just-scripts": "^1.3.3",
82
82
  "prettier": "^2.4.1",
83
83
  "react": "18.2.0",
84
- "react-native": "0.73.0-rc.3",
84
+ "react-native": "0.73.0-rc.4",
85
85
  "react-native-platform-override": "^1.9.16",
86
86
  "react-refresh": "^0.4.0",
87
87
  "typescript": "^4.9.5"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "react": "18.2.0",
91
- "react-native": "^0.73.0-rc.3"
91
+ "react-native": "^0.73.0-rc.4"
92
92
  },
93
93
  "beachball": {
94
94
  "defaultNpmTag": "preview",