react-native-windows 0.0.0-canary.783 → 0.0.0-canary.785

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 (37) hide show
  1. package/Libraries/Components/Pressable/Pressable.windows.js +1 -0
  2. package/Libraries/Core/ReactNativeVersion.js +9 -2
  3. package/Libraries/Core/ReactNativeVersionCheck.js +5 -3
  4. package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
  5. package/Libraries/Pressability/Pressability.windows.js +3 -2
  6. package/Libraries/ReactNative/BridgelessUIManager.js +55 -3
  7. package/Libraries/ReactNative/FabricUIManager.js +6 -0
  8. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +1 -1
  9. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +9 -0
  10. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.cpp +0 -2
  11. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +5 -1
  12. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/WindowsViewEvents.h +2 -4
  13. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorParser.h +11 -3
  14. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +54 -46
  15. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +8 -0
  16. package/Microsoft.ReactNative/packages.lock.json +42 -70
  17. package/Microsoft.ReactNative.Managed/packages.lock.json +5 -72
  18. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  19. package/Shared/DevSettings.h +6 -0
  20. package/Shared/JSI/JSExecutorFactoryDelegate.h +12 -0
  21. package/Shared/JSI/JSExecutorFactorySettings.cpp +30 -0
  22. package/Shared/JSI/JSExecutorFactorySettings.h +21 -0
  23. package/Shared/OInstance.cpp +2 -0
  24. package/Shared/Shared.vcxitems +5 -0
  25. package/Shared/Shared.vcxitems.filters +12 -1
  26. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +52 -0
  27. package/codegen/NativeUIManagerSpec.g.h +3 -3
  28. package/codegen/rnwcoreJSI-generated.cpp +30 -1
  29. package/codegen/rnwcoreJSI.h +76 -3
  30. package/package.json +20 -20
  31. package/src/private/featureflags/NativeReactNativeFeatureFlags.js +36 -0
  32. package/src/private/featureflags/ReactNativeFeatureFlags.js +68 -0
  33. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +80 -0
  34. package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js +78 -0
  35. package/src/private/specs/modules/NativeUIManager.js +1 -1
  36. package/Libraries/Performance/QuickPerformanceLogger.js +0 -155
  37. package/ReactCommon/Yoga.cpp +0 -900
@@ -24,21 +24,11 @@
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
- },
32
27
  "Microsoft.Build.Tasks.Git": {
33
28
  "type": "Transitive",
34
29
  "resolved": "1.1.1",
35
30
  "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q=="
36
31
  },
37
- "Microsoft.JavaScript.Hermes": {
38
- "type": "Transitive",
39
- "resolved": "0.1.18",
40
- "contentHash": "5K8rRihGwIs2XNOTP2Jsw3T6cegxCBQXcpPS4optONU/AmFElGAfnA6XBQJ4UqlCFCl9Nf9zQrgvCUPBWYHiag=="
41
- },
42
32
  "Microsoft.Net.Native.Compiler": {
43
33
  "type": "Transitive",
44
34
  "resolved": "2.2.7-rel-27913-00",
@@ -63,30 +53,17 @@
63
53
  "Microsoft.NETCore.Platforms": {
64
54
  "type": "Transitive",
65
55
  "resolved": "2.1.0",
66
- "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA=="
56
+ "contentHash": "GmkKfoyerqmsHMn7OZj0AKpcBabD+GaafqphvX2Mw406IwiJRy1pKcKqdCfKJfYmkRyJ6+e+RaUylgdJoDa1jQ=="
67
57
  },
68
58
  "Microsoft.SourceLink.Common": {
69
59
  "type": "Transitive",
70
60
  "resolved": "1.1.1",
71
61
  "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
72
62
  },
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
- },
86
63
  "NETStandard.Library": {
87
64
  "type": "Transitive",
88
65
  "resolved": "2.0.3",
89
- "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
66
+ "contentHash": "548M6mnBSJWxsIlkQHfbzoYxpiYFXZZSL00p4GHYv8PkiqFBnnT68mW5mGEsA/ch9fDO9GkPgkFQpWiXZN7mAQ==",
90
67
  "dependencies": {
91
68
  "Microsoft.NETCore.Platforms": "1.1.0"
92
69
  }
@@ -159,10 +136,7 @@
159
136
  "contentHash": "qF6RRZKaflI+LR1YODNyWYjq5YoX8IJ2wx5y8O+AW2xO+1t/Q6Mm+jQ38zJbWnmXbrcOqUYofn7Y3/KC6lTLBQ=="
160
137
  },
161
138
  "common": {
162
- "type": "Project",
163
- "dependencies": {
164
- "boost": "[1.76.0, )"
165
- }
139
+ "type": "Project"
166
140
  },
167
141
  "fmt": {
168
142
  "type": "Project"
@@ -170,7 +144,6 @@
170
144
  "folly": {
171
145
  "type": "Project",
172
146
  "dependencies": {
173
- "boost": "[1.76.0, )",
174
147
  "fmt": "[1.0.0, )"
175
148
  }
176
149
  },
@@ -179,18 +152,13 @@
179
152
  "dependencies": {
180
153
  "Common": "[1.0.0, )",
181
154
  "Folly": "[1.0.0, )",
182
- "Microsoft.JavaScript.Hermes": "[0.1.18, )",
183
- "Microsoft.SourceLink.GitHub": "[1.1.1, )",
184
- "Microsoft.UI.Xaml": "[2.8.0, )",
185
- "ReactCommon": "[1.0.0, )",
186
- "boost": "[1.76.0, )"
155
+ "ReactCommon": "[1.0.0, )"
187
156
  }
188
157
  },
189
158
  "reactcommon": {
190
159
  "type": "Project",
191
160
  "dependencies": {
192
- "Folly": "[1.0.0, )",
193
- "boost": "[1.76.0, )"
161
+ "Folly": "[1.0.0, )"
194
162
  }
195
163
  }
196
164
  },
@@ -208,11 +176,6 @@
208
176
  "runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
209
177
  }
210
178
  },
211
- "Microsoft.Web.WebView2": {
212
- "type": "Transitive",
213
- "resolved": "1.0.1264.42",
214
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
215
- },
216
179
  "runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": {
217
180
  "type": "Transitive",
218
181
  "resolved": "6.2.9",
@@ -233,11 +196,6 @@
233
196
  "runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
234
197
  }
235
198
  },
236
- "Microsoft.Web.WebView2": {
237
- "type": "Transitive",
238
- "resolved": "1.0.1264.42",
239
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
240
- },
241
199
  "runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
242
200
  "type": "Transitive",
243
201
  "resolved": "6.2.9",
@@ -258,11 +216,6 @@
258
216
  "runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
259
217
  }
260
218
  },
261
- "Microsoft.Web.WebView2": {
262
- "type": "Transitive",
263
- "resolved": "1.0.1264.42",
264
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
265
- },
266
219
  "runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
267
220
  "type": "Transitive",
268
221
  "resolved": "6.2.9",
@@ -283,11 +236,6 @@
283
236
  "runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
284
237
  }
285
238
  },
286
- "Microsoft.Web.WebView2": {
287
- "type": "Transitive",
288
- "resolved": "1.0.1264.42",
289
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
290
- },
291
239
  "runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": {
292
240
  "type": "Transitive",
293
241
  "resolved": "6.2.9",
@@ -308,11 +256,6 @@
308
256
  "runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
309
257
  }
310
258
  },
311
- "Microsoft.Web.WebView2": {
312
- "type": "Transitive",
313
- "resolved": "1.0.1264.42",
314
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
315
- },
316
259
  "runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
317
260
  "type": "Transitive",
318
261
  "resolved": "6.2.9",
@@ -333,11 +276,6 @@
333
276
  "runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
334
277
  }
335
278
  },
336
- "Microsoft.Web.WebView2": {
337
- "type": "Transitive",
338
- "resolved": "1.0.1264.42",
339
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
340
- },
341
279
  "runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": {
342
280
  "type": "Transitive",
343
281
  "resolved": "6.2.9",
@@ -358,11 +296,6 @@
358
296
  "runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
359
297
  }
360
298
  },
361
- "Microsoft.Web.WebView2": {
362
- "type": "Transitive",
363
- "resolved": "1.0.1264.42",
364
- "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
365
- },
366
299
  "runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
367
300
  "type": "Transitive",
368
301
  "resolved": "6.2.9",
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.0.0-canary.783</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.0.0-canary.785</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>0</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>true</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>c3f4edf2ba3f926a04c9a7573e155dfc573bc792</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>995fd76f4541ba9572bdb7ecd48ee19cd86464b3</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -2,6 +2,8 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  #pragma once
5
+
6
+ #include "JSI/JSExecutorFactoryDelegate.h"
5
7
  #include "Logging.h"
6
8
 
7
9
  #include <IRedBoxHandler.h>
@@ -86,6 +88,10 @@ struct DevSettings {
86
88
  /// reentrancy.
87
89
  std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> jsiRuntimeHolder;
88
90
 
91
+ /// A function that can be called with the current Instance to get
92
+ /// a JSExecutorFactory. This can be used to bypass the ABI JSI.
93
+ JSExecutorFactoryDelegate jsExecutorFactoryDelegate{nullptr};
94
+
89
95
  // Until the ABI story is addressed we'll use this instead of the above for
90
96
  // the purposes of selecting a JSI Runtime to use.
91
97
  JSIEngineOverride jsiEngineOverride{JSIEngineOverride::Default};
@@ -0,0 +1,12 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include <functional>
5
+ #include <memory>
6
+
7
+ namespace facebook::react {
8
+ class CallInvoker;
9
+ class JSExecutorFactory;
10
+ using JSExecutorFactoryDelegate =
11
+ std::function<std::shared_ptr<JSExecutorFactory>(std::shared_ptr<CallInvoker> const &callInvoker)>;
12
+ } // namespace facebook::react
@@ -0,0 +1,30 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "JSExecutorFactorySettings.h"
5
+
6
+ namespace Microsoft::JSI::JSExecutorFactorySettings {
7
+
8
+ winrt::Microsoft::ReactNative::ReactPropertyId<
9
+ winrt::Microsoft::ReactNative::ReactNonAbiValue<facebook::react::JSExecutorFactoryDelegate>>
10
+ JSExecutorFactoryDelegateProperty() noexcept {
11
+ winrt::Microsoft::ReactNative::ReactPropertyId<
12
+ winrt::Microsoft::ReactNative::ReactNonAbiValue<facebook::react::JSExecutorFactoryDelegate>>
13
+ propId{L"ReactNative.JSI", L"JSExecutorFactory"};
14
+ return propId;
15
+ }
16
+ void SetJSExecutorFactoryDelegate(
17
+ winrt::Microsoft::ReactNative::ReactPropertyBag properties,
18
+ facebook::react::JSExecutorFactoryDelegate const &value) noexcept {
19
+ properties.Set(JSExecutorFactoryDelegateProperty(), value);
20
+ }
21
+
22
+ const facebook::react::JSExecutorFactoryDelegate GetJSExecutorFactoryDelegate(
23
+ winrt::Microsoft::ReactNative::ReactPropertyBag properties) noexcept {
24
+ const auto jsExecutorFactoryDelegate = properties.Get(JSExecutorFactoryDelegateProperty());
25
+ if (!jsExecutorFactoryDelegate)
26
+ return nullptr;
27
+ return jsExecutorFactoryDelegate.Value();
28
+ }
29
+
30
+ } // namespace Microsoft::JSI::JSExecutorFactorySettings
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+
6
+ #include "JSExecutorFactoryDelegate.h"
7
+ #include "ReactPropertyBag.h"
8
+
9
+ namespace facebook::react {
10
+ class JSExecutorFactory;
11
+ }
12
+
13
+ namespace Microsoft::JSI::JSExecutorFactorySettings {
14
+
15
+ void SetJSExecutorFactoryDelegate(
16
+ winrt::Microsoft::ReactNative::ReactPropertyBag properties,
17
+ facebook::react::JSExecutorFactoryDelegate const &value) noexcept;
18
+ const facebook::react::JSExecutorFactoryDelegate GetJSExecutorFactoryDelegate(
19
+ winrt::Microsoft::ReactNative::ReactPropertyBag properties) noexcept;
20
+
21
+ } // namespace Microsoft::JSI::JSExecutorFactorySettings
@@ -417,6 +417,8 @@ InstanceImpl::InstanceImpl(
417
417
  assert(m_devSettings->jsiEngineOverride == JSIEngineOverride::Default);
418
418
  jsef = std::make_shared<OJSIExecutorFactory>(
419
419
  m_devSettings->jsiRuntimeHolder, m_devSettings->loggingCallback, !m_devSettings->useFastRefresh);
420
+ } else if (m_devSettings->jsExecutorFactoryDelegate != nullptr) {
421
+ jsef = m_devSettings->jsExecutorFactoryDelegate(m_innerInstance->getJSCallInvoker());
420
422
  } else {
421
423
  assert(m_devSettings->jsiEngineOverride != JSIEngineOverride::Default);
422
424
  switch (m_devSettings->jsiEngineOverride) {
@@ -224,6 +224,7 @@
224
224
  <ClCompile Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.cpp">
225
225
  <ExcludedFromBuild Condition="'$(UseV8)' != 'true'">true</ExcludedFromBuild>
226
226
  </ClCompile>
227
+ <ClCompile Include="$(MSBuildThisFileDirectory)JSI\JSExecutorFactorySettings.cpp"/>
227
228
  <ClCompile Include="$(MSBuildThisFileDirectory)LayoutAnimation.cpp" />
228
229
  <ClCompile Include="$(MSBuildThisFileDirectory)Logging.cpp" />
229
230
  <ClCompile Include="$(MSBuildThisFileDirectory)MemoryMappedBuffer.cpp" />
@@ -370,6 +371,8 @@
370
371
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.h" />
371
372
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\RuntimeHolder.h" />
372
373
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\ScriptStore.h" />
374
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\JSExecutorFactoryDelegate.h" />
375
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\JSExecutorFactorySettings.h" />
373
376
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.h" />
374
377
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobModule.h" />
375
378
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\CxxModuleUtilities.h" />
@@ -472,6 +475,8 @@
472
475
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeSchedulerCallInvoker.cpp" />
473
476
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\Task.cpp" />
474
477
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\utils\CoreFeatures.cpp" />
478
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\featureflags\ReactNativeFeatureFlags.cpp" />
479
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\featureflags\ReactNativeFeatureFlagsAccessor.cpp" />
475
480
  </ItemGroup>
476
481
  <ItemGroup>
477
482
  <None Include="$(MSBuildThisFileDirectory)tracing\rnw.wprp" />
@@ -91,6 +91,9 @@
91
91
  <ClCompile Include="$(MSBuildThisFileDirectory)JSI\ChakraJsiRuntime_edgemode.cpp">
92
92
  <Filter>Source Files\JSI</Filter>
93
93
  </ClCompile>
94
+ <ClCompile Include="$(MSBuildThisFileDirectory)JSI\JSExecutorFactorySettings.cpp">
95
+ <Filter>Source Files\JSI</Filter>
96
+ </ClCompile>
94
97
  <ClCompile Include="$(MSBuildThisFileDirectory)InspectorPackagerConnection.cpp">
95
98
  <Filter>Source Files</Filter>
96
99
  </ClCompile>
@@ -303,6 +306,8 @@
303
306
  <ClCompile Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\Modules\ExceptionsManager.cpp" />
304
307
  <ClCompile Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\Modules\SourceCode.cpp" />
305
308
  <ClCompile Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\Modules\Timing.cpp" />
309
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\featureflags\ReactNativeFeatureFlags.cpp" />
310
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\featureflags\ReactNativeFeatureFlagsAccessor.cpp" />
306
311
  </ItemGroup>
307
312
  <ItemGroup>
308
313
  <Filter Include="Source Files">
@@ -580,6 +585,12 @@
580
585
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\RuntimeHolder.h">
581
586
  <Filter>Header Files\JSI</Filter>
582
587
  </ClInclude>
588
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\JSExecutorFactoryDelegate.h">
589
+ <Filter>Header Files\JSI</Filter>
590
+ </ClInclude>
591
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\JSExecutorFactorySettings.h">
592
+ <Filter>Header Files\JSI</Filter>
593
+ </ClInclude>
583
594
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\ScriptStore.h">
584
595
  <Filter>Header Files\JSI</Filter>
585
596
  </ClInclude>
@@ -814,4 +825,4 @@
814
825
  <Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactNativeHost.idl" />
815
826
  <Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\RedBoxHandler.idl" />
816
827
  </ItemGroup>
817
- </Project>
828
+ </Project>
@@ -0,0 +1,52 @@
1
+
2
+ /*
3
+ * This file is auto-generated from a NativeModule spec file in js.
4
+ *
5
+ * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
6
+ * in a way that also verifies at compile time that the native module matches the interface required
7
+ * by the TurboModule JS spec.
8
+ */
9
+ #pragma once
10
+
11
+ #include <NativeModules.h>
12
+ #include <tuple>
13
+
14
+ namespace Microsoft::ReactNativeSpecs {
15
+
16
+
17
+ struct ReactNativeFeatureFlagsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
18
+ static constexpr auto methods = std::tuple{
19
+ SyncMethod<bool() noexcept>{0, L"commonTestFlag"},
20
+ SyncMethod<bool() noexcept>{1, L"useModernRuntimeScheduler"},
21
+ SyncMethod<bool() noexcept>{2, L"enableMicrotasks"},
22
+ SyncMethod<bool() noexcept>{3, L"batchRenderingUpdatesInEventLoop"},
23
+ };
24
+
25
+ template <class TModule>
26
+ static constexpr void ValidateModule() noexcept {
27
+ constexpr auto methodCheckResults = CheckMethods<TModule, ReactNativeFeatureFlagsSpec>();
28
+
29
+ REACT_SHOW_METHOD_SPEC_ERRORS(
30
+ 0,
31
+ "commonTestFlag",
32
+ " REACT_SYNC_METHOD(commonTestFlag) bool commonTestFlag() noexcept { /* implementation */ }\n"
33
+ " REACT_SYNC_METHOD(commonTestFlag) static bool commonTestFlag() noexcept { /* implementation */ }\n");
34
+ REACT_SHOW_METHOD_SPEC_ERRORS(
35
+ 1,
36
+ "useModernRuntimeScheduler",
37
+ " REACT_SYNC_METHOD(useModernRuntimeScheduler) bool useModernRuntimeScheduler() noexcept { /* implementation */ }\n"
38
+ " REACT_SYNC_METHOD(useModernRuntimeScheduler) static bool useModernRuntimeScheduler() noexcept { /* implementation */ }\n");
39
+ REACT_SHOW_METHOD_SPEC_ERRORS(
40
+ 2,
41
+ "enableMicrotasks",
42
+ " REACT_SYNC_METHOD(enableMicrotasks) bool enableMicrotasks() noexcept { /* implementation */ }\n"
43
+ " REACT_SYNC_METHOD(enableMicrotasks) static bool enableMicrotasks() noexcept { /* implementation */ }\n");
44
+ REACT_SHOW_METHOD_SPEC_ERRORS(
45
+ 3,
46
+ "batchRenderingUpdatesInEventLoop",
47
+ " REACT_SYNC_METHOD(batchRenderingUpdatesInEventLoop) bool batchRenderingUpdatesInEventLoop() noexcept { /* implementation */ }\n"
48
+ " REACT_SYNC_METHOD(batchRenderingUpdatesInEventLoop) static bool batchRenderingUpdatesInEventLoop() noexcept { /* implementation */ }\n");
49
+ }
50
+ };
51
+
52
+ } // namespace Microsoft::ReactNativeSpecs
@@ -30,7 +30,7 @@ struct UIManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
30
30
  Method<void(::React::JSValue, Callback<>, Callback<::React::JSValue>) noexcept>{11, L"configureNextLayoutAnimation"},
31
31
  Method<void(std::optional<double>, std::vector<double>) noexcept>{12, L"setChildren"},
32
32
  Method<void(std::optional<double>, std::vector<double>, std::vector<double>, std::vector<double>, std::vector<double>, std::vector<double>) noexcept>{13, L"manageChildren"},
33
- SyncMethod<::React::JSValue(std::string) noexcept>{14, L"getConstantsForViewManager"},
33
+ SyncMethod<std::optional<::React::JSValue>(std::string) noexcept>{14, L"getConstantsForViewManager"},
34
34
  SyncMethod<std::vector<std::string>() noexcept>{15, L"getDefaultEventTypes"},
35
35
  Method<void(bool) noexcept>{16, L"setLayoutAnimationEnabledExperimental"},
36
36
  Method<void(std::optional<double>, double) noexcept>{17, L"sendAccessibilityEvent"},
@@ -118,8 +118,8 @@ struct UIManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
118
118
  REACT_SHOW_METHOD_SPEC_ERRORS(
119
119
  14,
120
120
  "getConstantsForViewManager",
121
- " REACT_SYNC_METHOD(getConstantsForViewManager) ::React::JSValue getConstantsForViewManager(std::string viewManagerName) noexcept { /* implementation */ }\n"
122
- " REACT_SYNC_METHOD(getConstantsForViewManager) static ::React::JSValue getConstantsForViewManager(std::string viewManagerName) noexcept { /* implementation */ }\n");
121
+ " REACT_SYNC_METHOD(getConstantsForViewManager) std::optional<::React::JSValue> getConstantsForViewManager(std::string viewManagerName) noexcept { /* implementation */ }\n"
122
+ " REACT_SYNC_METHOD(getConstantsForViewManager) static std::optional<::React::JSValue> getConstantsForViewManager(std::string viewManagerName) noexcept { /* implementation */ }\n");
123
123
  REACT_SHOW_METHOD_SPEC_ERRORS(
124
124
  15,
125
125
  "getDefaultEventTypes",
@@ -11,6 +11,34 @@
11
11
 
12
12
  namespace facebook::react {
13
13
 
14
+ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->commonTestFlag(
16
+ rt
17
+ );
18
+ }
19
+ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useModernRuntimeScheduler(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
20
+ return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useModernRuntimeScheduler(
21
+ rt
22
+ );
23
+ }
24
+ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMicrotasks(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
25
+ return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->enableMicrotasks(
26
+ rt
27
+ );
28
+ }
29
+ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_batchRenderingUpdatesInEventLoop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
30
+ return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->batchRenderingUpdatesInEventLoop(
31
+ rt
32
+ );
33
+ }
34
+
35
+ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
36
+ : TurboModule("NativeReactNativeFeatureFlagsCxx", jsInvoker) {
37
+ methodMap_["commonTestFlag"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag};
38
+ methodMap_["useModernRuntimeScheduler"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useModernRuntimeScheduler};
39
+ methodMap_["enableMicrotasks"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_enableMicrotasks};
40
+ methodMap_["batchRenderingUpdatesInEventLoop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_batchRenderingUpdatesInEventLoop};
41
+ }
14
42
  static jsi::Value __hostFunction_NativeAccessibilityInfoCxxSpecJSI_isReduceMotionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
43
  static_cast<NativeAccessibilityInfoCxxSpecJSI *>(&turboModule)->isReduceMotionEnabled(
16
44
  rt,
@@ -2667,10 +2695,11 @@ static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_manageChildren(jsi::R
2667
2695
  return jsi::Value::undefined();
2668
2696
  }
2669
2697
  static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getConstantsForViewManager(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2670
- return static_cast<NativeUIManagerCxxSpecJSI *>(&turboModule)->getConstantsForViewManager(
2698
+ auto result = static_cast<NativeUIManagerCxxSpecJSI *>(&turboModule)->getConstantsForViewManager(
2671
2699
  rt,
2672
2700
  args[0].asString(rt)
2673
2701
  );
2702
+ return result ? jsi::Value(std::move(*result)) : jsi::Value::null();
2674
2703
  }
2675
2704
  static jsi::Value __hostFunction_NativeUIManagerCxxSpecJSI_getDefaultEventTypes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
2676
2705
  return static_cast<NativeUIManagerCxxSpecJSI *>(&turboModule)->getDefaultEventTypes(
@@ -15,6 +15,79 @@
15
15
  namespace facebook::react {
16
16
 
17
17
 
18
+ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeReactNativeFeatureFlagsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual bool commonTestFlag(jsi::Runtime &rt) = 0;
24
+ virtual bool useModernRuntimeScheduler(jsi::Runtime &rt) = 0;
25
+ virtual bool enableMicrotasks(jsi::Runtime &rt) = 0;
26
+ virtual bool batchRenderingUpdatesInEventLoop(jsi::Runtime &rt) = 0;
27
+
28
+ };
29
+
30
+ template <typename T>
31
+ class JSI_EXPORT NativeReactNativeFeatureFlagsCxxSpec : public TurboModule {
32
+ public:
33
+ jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
34
+ return delegate_.get(rt, propName);
35
+ }
36
+
37
+ static constexpr std::string_view kModuleName = "NativeReactNativeFeatureFlagsCxx";
38
+
39
+ protected:
40
+ NativeReactNativeFeatureFlagsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
41
+ : TurboModule(std::string{NativeReactNativeFeatureFlagsCxxSpec::kModuleName}, jsInvoker),
42
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
43
+
44
+ private:
45
+ class Delegate : public NativeReactNativeFeatureFlagsCxxSpecJSI {
46
+ public:
47
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
48
+ NativeReactNativeFeatureFlagsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {}
49
+
50
+ bool commonTestFlag(jsi::Runtime &rt) override {
51
+ static_assert(
52
+ bridging::getParameterCount(&T::commonTestFlag) == 1,
53
+ "Expected commonTestFlag(...) to have 1 parameters");
54
+
55
+ return bridging::callFromJs<bool>(
56
+ rt, &T::commonTestFlag, jsInvoker_, instance_);
57
+ }
58
+ bool useModernRuntimeScheduler(jsi::Runtime &rt) override {
59
+ static_assert(
60
+ bridging::getParameterCount(&T::useModernRuntimeScheduler) == 1,
61
+ "Expected useModernRuntimeScheduler(...) to have 1 parameters");
62
+
63
+ return bridging::callFromJs<bool>(
64
+ rt, &T::useModernRuntimeScheduler, jsInvoker_, instance_);
65
+ }
66
+ bool enableMicrotasks(jsi::Runtime &rt) override {
67
+ static_assert(
68
+ bridging::getParameterCount(&T::enableMicrotasks) == 1,
69
+ "Expected enableMicrotasks(...) to have 1 parameters");
70
+
71
+ return bridging::callFromJs<bool>(
72
+ rt, &T::enableMicrotasks, jsInvoker_, instance_);
73
+ }
74
+ bool batchRenderingUpdatesInEventLoop(jsi::Runtime &rt) override {
75
+ static_assert(
76
+ bridging::getParameterCount(&T::batchRenderingUpdatesInEventLoop) == 1,
77
+ "Expected batchRenderingUpdatesInEventLoop(...) to have 1 parameters");
78
+
79
+ return bridging::callFromJs<bool>(
80
+ rt, &T::batchRenderingUpdatesInEventLoop, jsInvoker_, instance_);
81
+ }
82
+
83
+ private:
84
+ T *instance_;
85
+ };
86
+
87
+ Delegate delegate_;
88
+ };
89
+
90
+
18
91
  class JSI_EXPORT NativeAccessibilityInfoCxxSpecJSI : public TurboModule {
19
92
  protected:
20
93
  NativeAccessibilityInfoCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
@@ -9409,7 +9482,7 @@ public:
9409
9482
  virtual void configureNextLayoutAnimation(jsi::Runtime &rt, jsi::Object config, jsi::Function callback, jsi::Function errorCallback) = 0;
9410
9483
  virtual void setChildren(jsi::Runtime &rt, std::optional<double> containerTag, jsi::Array reactTags) = 0;
9411
9484
  virtual void manageChildren(jsi::Runtime &rt, std::optional<double> containerTag, jsi::Array moveFromIndices, jsi::Array moveToIndices, jsi::Array addChildReactTags, jsi::Array addAtIndices, jsi::Array removeAtIndices) = 0;
9412
- virtual jsi::Object getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) = 0;
9485
+ virtual std::optional<jsi::Object> getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) = 0;
9413
9486
  virtual jsi::Array getDefaultEventTypes(jsi::Runtime &rt) = 0;
9414
9487
  virtual void setLayoutAnimationEnabledExperimental(jsi::Runtime &rt, bool enabled) = 0;
9415
9488
  virtual void sendAccessibilityEvent(jsi::Runtime &rt, std::optional<double> reactTag, double eventType) = 0;
@@ -9561,12 +9634,12 @@ private:
9561
9634
  return bridging::callFromJs<void>(
9562
9635
  rt, &T::manageChildren, jsInvoker_, instance_, std::move(containerTag), std::move(moveFromIndices), std::move(moveToIndices), std::move(addChildReactTags), std::move(addAtIndices), std::move(removeAtIndices));
9563
9636
  }
9564
- jsi::Object getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) override {
9637
+ std::optional<jsi::Object> getConstantsForViewManager(jsi::Runtime &rt, jsi::String viewManagerName) override {
9565
9638
  static_assert(
9566
9639
  bridging::getParameterCount(&T::getConstantsForViewManager) == 2,
9567
9640
  "Expected getConstantsForViewManager(...) to have 2 parameters");
9568
9641
 
9569
- return bridging::callFromJs<jsi::Object>(
9642
+ return bridging::callFromJs<std::optional<jsi::Object>>(
9570
9643
  rt, &T::getConstantsForViewManager, jsInvoker_, instance_, std::move(viewManagerName));
9571
9644
  }
9572
9645
  jsi::Array getDefaultEventTypes(jsi::Runtime &rt) override {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.0.0-canary.783",
3
+ "version": "0.0.0-canary.785",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,18 +23,18 @@
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": "13.0.0",
27
- "@react-native-community/cli-platform-android": "13.0.0",
28
- "@react-native-community/cli-platform-ios": "13.0.0",
29
- "@react-native-windows/cli": "0.0.0-canary.203",
26
+ "@react-native-community/cli": "13.5.1",
27
+ "@react-native-community/cli-platform-android": "13.5.1",
28
+ "@react-native-community/cli-platform-ios": "13.5.1",
29
+ "@react-native-windows/cli": "0.0.0-canary.204",
30
30
  "@react-native/assets": "1.0.0",
31
- "@react-native/assets-registry": "0.74.0-nightly-20240122-4e92f87df",
32
- "@react-native/codegen": "0.74.0-nightly-20240122-4e92f87df",
33
- "@react-native/community-cli-plugin": "0.74.0-nightly-20240122-4e92f87df",
34
- "@react-native/gradle-plugin": "0.74.0-nightly-20240122-4e92f87df",
35
- "@react-native/js-polyfills": "0.74.0-nightly-20240122-4e92f87df",
36
- "@react-native/normalize-colors": "0.74.0-nightly-20240122-4e92f87df",
37
- "@react-native/virtualized-lists": "0.74.0-nightly-20240122-4e92f87df",
31
+ "@react-native/assets-registry": "0.74.0-nightly-20240129-39cb02f6f",
32
+ "@react-native/codegen": "0.74.0-nightly-20240129-39cb02f6f",
33
+ "@react-native/community-cli-plugin": "0.74.0-nightly-20240129-39cb02f6f",
34
+ "@react-native/gradle-plugin": "0.74.0-nightly-20240129-39cb02f6f",
35
+ "@react-native/js-polyfills": "0.74.0-nightly-20240129-39cb02f6f",
36
+ "@react-native/normalize-colors": "0.74.0-nightly-20240129-39cb02f6f",
37
+ "@react-native/virtualized-lists": "0.74.0-nightly-20240129-39cb02f6f",
38
38
  "abort-controller": "^3.0.0",
39
39
  "anser": "^1.4.9",
40
40
  "ansi-regex": "^5.0.0",
@@ -64,12 +64,12 @@
64
64
  "yargs": "^17.6.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@react-native-windows/codegen": "0.0.0-canary.79",
68
- "@react-native/metro-config": "0.74.0-nightly-20240122-4e92f87df",
67
+ "@react-native-windows/codegen": "0.0.0-canary.80",
68
+ "@react-native/metro-config": "0.74.0-nightly-20240129-39cb02f6f",
69
69
  "@rnw-scripts/babel-react-native-config": "0.0.0",
70
- "@rnw-scripts/eslint-config": "1.2.7",
71
- "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.11",
72
- "@rnw-scripts/just-task": "2.3.23",
70
+ "@rnw-scripts/eslint-config": "1.2.8",
71
+ "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.12",
72
+ "@rnw-scripts/just-task": "2.3.24",
73
73
  "@rnw-scripts/metro-dev-config": "0.0.0",
74
74
  "@rnx-kit/jest-preset": "^0.1.0",
75
75
  "@types/node": "^18.0.0",
@@ -81,14 +81,14 @@
81
81
  "just-scripts": "^1.3.3",
82
82
  "prettier": "2.8.8",
83
83
  "react": "18.2.0",
84
- "react-native": "0.74.0-nightly-20240122-4e92f87df",
85
- "react-native-platform-override": "^1.9.23",
84
+ "react-native": "0.74.0-nightly-20240129-39cb02f6f",
85
+ "react-native-platform-override": "^1.9.24",
86
86
  "react-refresh": "^0.14.0",
87
87
  "typescript": "5.0.4"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "react": "18.2.0",
91
- "react-native": "0.74.0-nightly-20240122-4e92f87df"
91
+ "react-native": "0.74.0-nightly-20240129-39cb02f6f"
92
92
  },
93
93
  "beachball": {
94
94
  "defaultNpmTag": "canary",