react-native-windows 0.71.24 → 0.71.26

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 (78) hide show
  1. package/Directory.Build.props +5 -0
  2. package/Libraries/Network/RCTNetworking.windows.js +10 -16
  3. package/Microsoft.ReactNative/IReactDispatcher.cpp +4 -0
  4. package/Microsoft.ReactNative/IReactDispatcher.h +1 -0
  5. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +3 -7
  6. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +0 -7
  7. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +43 -21
  8. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +0 -2
  9. package/Microsoft.ReactNative/Views/DevMenu.cpp +3 -3
  10. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiLoader.cpp +16 -0
  11. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +43 -12
  12. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +17 -6
  13. package/Microsoft.ReactNative.Managed/packages.lock.json +73 -4
  14. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +1 -1
  15. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +1 -1
  16. package/PropertySheets/External/Microsoft.ReactNative.WinAppSDK.CSharpApp.targets +1 -1
  17. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  18. package/PropertySheets/JSEngine.props +4 -4
  19. package/PropertySheets/React.Cpp.props +3 -3
  20. package/PropertySheets/Warnings.props +6 -0
  21. package/ReactCommon/ReactCommon.vcxproj +53 -1
  22. package/ReactCommon/cgmanifest.json +15 -0
  23. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +36 -0
  24. package/Shared/BaseFileReaderResource.cpp +95 -0
  25. package/Shared/BaseFileReaderResource.h +41 -0
  26. package/Shared/CreateModules.h +27 -5
  27. package/Shared/DevSupportManager.cpp +2 -9
  28. package/Shared/DevSupportManager.h +2 -6
  29. package/Shared/HermesRuntimeHolder.cpp +344 -84
  30. package/Shared/HermesRuntimeHolder.h +32 -21
  31. package/Shared/HermesSamplingProfiler.cpp +66 -14
  32. package/Shared/HermesSamplingProfiler.h +5 -3
  33. package/Shared/IFileReaderResource.h +36 -0
  34. package/Shared/InspectorPackagerConnection.cpp +62 -108
  35. package/Shared/InspectorPackagerConnection.h +9 -21
  36. package/Shared/JSI/RuntimeHolder.h +2 -2
  37. package/Shared/JSI/ScriptStore.h +18 -20
  38. package/Shared/JSI/V8RuntimeHolder.cpp +260 -0
  39. package/Shared/JSI/V8RuntimeHolder.h +37 -0
  40. package/Shared/Modules/BlobModule.cpp +93 -298
  41. package/Shared/Modules/BlobModule.h +25 -91
  42. package/Shared/Modules/CxxModuleUtilities.cpp +32 -0
  43. package/Shared/Modules/CxxModuleUtilities.h +17 -0
  44. package/Shared/Modules/FileReaderModule.cpp +118 -51
  45. package/Shared/Modules/FileReaderModule.h +27 -1
  46. package/Shared/Modules/HttpModule.cpp +143 -32
  47. package/Shared/Modules/HttpModule.h +33 -1
  48. package/Shared/Modules/IRequestBodyHandler.h +6 -4
  49. package/Shared/Modules/IResponseHandler.h +3 -3
  50. package/Shared/Modules/IUriHandler.h +3 -3
  51. package/Shared/Modules/IWebSocketModuleContentHandler.h +6 -4
  52. package/Shared/Modules/WebSocketModule.cpp +190 -7
  53. package/Shared/Modules/WebSocketTurboModule.h +52 -0
  54. package/Shared/Networking/DefaultBlobResource.cpp +328 -0
  55. package/Shared/Networking/DefaultBlobResource.h +133 -0
  56. package/Shared/Networking/IBlobResource.h +56 -0
  57. package/Shared/Networking/IHttpResource.h +6 -5
  58. package/Shared/Networking/WinRTHttpResource.cpp +49 -32
  59. package/Shared/Networking/WinRTHttpResource.h +4 -3
  60. package/Shared/Networking/WinRTTypes.h +3 -3
  61. package/Shared/OInstance.cpp +32 -68
  62. package/Shared/SafeLoadLibrary.cpp +41 -0
  63. package/Shared/SafeLoadLibrary.h +15 -0
  64. package/Shared/Shared.vcxitems +27 -9
  65. package/Shared/Shared.vcxitems.filters +47 -33
  66. package/package.json +2 -2
  67. package/template/cs-app-WinAppSDK/proj/ExperimentalFeatures.props +1 -1
  68. package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +0 -59
  69. package/Microsoft.ReactNative/Base/CoreNativeModules.h +0 -30
  70. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +0 -2103
  71. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.h +0 -73
  72. package/Shared/HermesShim.cpp +0 -118
  73. package/Shared/HermesShim.h +0 -21
  74. package/Shared/JSI/NapiJsiV8RuntimeHolder.cpp +0 -209
  75. package/Shared/JSI/NapiJsiV8RuntimeHolder.h +0 -44
  76. package/Shared/V8JSIRuntimeHolder.cpp +0 -70
  77. package/Shared/V8JSIRuntimeHolder.h +0 -53
  78. /package/Shared/{Modules/IBlobPersistor.h → IBlobPersistor.h} +0 -0
@@ -24,11 +24,21 @@
24
24
  "Microsoft.SourceLink.Common": "1.0.0"
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.0.0",
30
35
  "contentHash": "z2fpmmt+1Jfl+ZnBki9nSP08S1/tbEOxFdsK1rSR+LBehIJz1Xv9/6qOOoGNqlwnAGGVGis1Oj6S8Kt9COEYlQ=="
31
36
  },
37
+ "Microsoft.JavaScript.Hermes": {
38
+ "type": "Transitive",
39
+ "resolved": "0.1.15",
40
+ "contentHash": "My/u5RvxoymtwWokoweU6iVpuP79w271UjadcmSNqnQ9ESIv00tlVP4sHnIiN3t2lJNDeciyE1EVF4swGPECKQ=="
41
+ },
32
42
  "Microsoft.Net.Native.Compiler": {
33
43
  "type": "Transitive",
34
44
  "resolved": "2.2.7-rel-27913-00",
@@ -53,17 +63,35 @@
53
63
  "Microsoft.NETCore.Platforms": {
54
64
  "type": "Transitive",
55
65
  "resolved": "2.1.0",
56
- "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA=="
66
+ "contentHash": "GmkKfoyerqmsHMn7OZj0AKpcBabD+GaafqphvX2Mw406IwiJRy1pKcKqdCfKJfYmkRyJ6+e+RaUylgdJoDa1jQ=="
57
67
  },
58
68
  "Microsoft.SourceLink.Common": {
59
69
  "type": "Transitive",
60
70
  "resolved": "1.0.0",
61
71
  "contentHash": "G8DuQY8/DK5NN+3jm5wcMcd9QYD90UV7MiLmdljSJixi3U/vNaeBKmmXUqI4DJCOeWizIUEh4ALhSt58mR+5eg=="
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
+ },
86
+ "Microsoft.Windows.SDK.BuildTools": {
87
+ "type": "Transitive",
88
+ "resolved": "10.0.22000.194",
89
+ "contentHash": "4L0P3zqut466SIqT3VBeLTNUQTxCBDOrTRymRuROCRJKazcK7ibLz9yAO1nKWRt50ttCj39oAa2Iuz9ZTDmLlg=="
90
+ },
63
91
  "NETStandard.Library": {
64
92
  "type": "Transitive",
65
93
  "resolved": "2.0.3",
66
- "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
94
+ "contentHash": "548M6mnBSJWxsIlkQHfbzoYxpiYFXZZSL00p4GHYv8PkiqFBnnT68mW5mGEsA/ch9fDO9GkPgkFQpWiXZN7mAQ==",
67
95
  "dependencies": {
68
96
  "Microsoft.NETCore.Platforms": "1.1.0"
69
97
  }
@@ -144,6 +172,7 @@
144
172
  "folly": {
145
173
  "type": "Project",
146
174
  "dependencies": {
175
+ "boost": "[1.76.0, )",
147
176
  "fmt": "[1.0.0, )"
148
177
  }
149
178
  },
@@ -152,13 +181,18 @@
152
181
  "dependencies": {
153
182
  "Common": "[1.0.0, )",
154
183
  "Folly": "[1.0.0, )",
155
- "ReactCommon": "[1.0.0, )"
184
+ "Microsoft.JavaScript.Hermes": "[0.1.15, )",
185
+ "Microsoft.UI.Xaml": "[2.8.0, )",
186
+ "Microsoft.Windows.SDK.BuildTools": "[10.0.22000.194, )",
187
+ "ReactCommon": "[1.0.0, )",
188
+ "boost": "[1.76.0, )"
156
189
  }
157
190
  },
158
191
  "reactcommon": {
159
192
  "type": "Project",
160
193
  "dependencies": {
161
- "Folly": "[1.0.0, )"
194
+ "Folly": "[1.0.0, )",
195
+ "boost": "[1.76.0, )"
162
196
  }
163
197
  }
164
198
  },
@@ -176,6 +210,11 @@
176
210
  "runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
177
211
  }
178
212
  },
213
+ "Microsoft.Web.WebView2": {
214
+ "type": "Transitive",
215
+ "resolved": "1.0.1264.42",
216
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
217
+ },
179
218
  "runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": {
180
219
  "type": "Transitive",
181
220
  "resolved": "6.2.9",
@@ -196,6 +235,11 @@
196
235
  "runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
197
236
  }
198
237
  },
238
+ "Microsoft.Web.WebView2": {
239
+ "type": "Transitive",
240
+ "resolved": "1.0.1264.42",
241
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
242
+ },
199
243
  "runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
200
244
  "type": "Transitive",
201
245
  "resolved": "6.2.9",
@@ -216,6 +260,11 @@
216
260
  "runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
217
261
  }
218
262
  },
263
+ "Microsoft.Web.WebView2": {
264
+ "type": "Transitive",
265
+ "resolved": "1.0.1264.42",
266
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
267
+ },
219
268
  "runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
220
269
  "type": "Transitive",
221
270
  "resolved": "6.2.9",
@@ -236,6 +285,11 @@
236
285
  "runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
237
286
  }
238
287
  },
288
+ "Microsoft.Web.WebView2": {
289
+ "type": "Transitive",
290
+ "resolved": "1.0.1264.42",
291
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
292
+ },
239
293
  "runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": {
240
294
  "type": "Transitive",
241
295
  "resolved": "6.2.9",
@@ -256,6 +310,11 @@
256
310
  "runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
257
311
  }
258
312
  },
313
+ "Microsoft.Web.WebView2": {
314
+ "type": "Transitive",
315
+ "resolved": "1.0.1264.42",
316
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
317
+ },
259
318
  "runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
260
319
  "type": "Transitive",
261
320
  "resolved": "6.2.9",
@@ -276,6 +335,11 @@
276
335
  "runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
277
336
  }
278
337
  },
338
+ "Microsoft.Web.WebView2": {
339
+ "type": "Transitive",
340
+ "resolved": "1.0.1264.42",
341
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
342
+ },
279
343
  "runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": {
280
344
  "type": "Transitive",
281
345
  "resolved": "6.2.9",
@@ -296,6 +360,11 @@
296
360
  "runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
297
361
  }
298
362
  },
363
+ "Microsoft.Web.WebView2": {
364
+ "type": "Transitive",
365
+ "resolved": "1.0.1264.42",
366
+ "contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
367
+ },
299
368
  "runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
300
369
  "type": "Transitive",
301
370
  "resolved": "6.2.9",
@@ -19,7 +19,7 @@
19
19
  <!-- WinUI package name and version are set by WinUI.props -->
20
20
  <PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
21
21
  <!-- Hermes version is set by JSEngine.props -->
22
- <PackageReference Include="ReactNative.Hermes.Windows" Version="$(HermesVersion)" Condition="$(UseHermes)" />
22
+ <PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" Condition="$(UseHermes)" />
23
23
  </ItemGroup>
24
24
 
25
25
  <Import Project="$(ReactNativeWindowsDir)PropertySheets\ManagedCodeGen\Microsoft.ReactNative.Managed.CodeGen.targets"
@@ -19,7 +19,7 @@
19
19
  <!-- WinUI package name and version are set by WinUI.props -->
20
20
  <PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
21
21
  <!-- Hermes version is set by JSEngine.props -->
22
- <PackageReference Include="ReactNative.Hermes.Windows" Version="$(HermesVersion)" Condition="$(UseHermes)" />
22
+ <PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" Condition="$(UseHermes)" />
23
23
  </ItemGroup>
24
24
 
25
25
  <!-- The props file for bundling is not set up to be just defaults, it assumes to be run at the end of the project. -->
@@ -24,7 +24,7 @@
24
24
  <!-- WinUI package name and version are set by WinUI.props -->
25
25
  <PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
26
26
  <!-- Hermes version is set by JSEngine.props -->
27
- <PackageReference Include="ReactNative.Hermes.Windows" Version="$(HermesVersion)" Condition="$(UseHermes)" />
27
+ <PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" Condition="$(UseHermes)" />
28
28
  </ItemGroup>
29
29
 
30
30
  <!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.71.24</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.71.26</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>71</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>24</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>26</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>08c3acfdfe4d3c66f15e24ef3dc795dcf39202c5</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>75c04ff65c61062feaf0ddcf9568a967108ef291</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -14,9 +14,9 @@
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)' == ''">false</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.71.1</HermesVersion>
18
- <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgReactNative_Hermes_Windows)')">$(PkgReactNative_Hermes_Windows)</HermesPackage>
19
- <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\ReactNative.Hermes.Windows\$(HermesVersion)</HermesPackage>
17
+ <HermesVersion Condition="'$(HermesVersion)' == ''">0.1.15</HermesVersion>
18
+ <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgMicrosoft_JavaScript_Hermes)')">$(PkgMicrosoft_JavaScript_Hermes)</HermesPackage>
19
+ <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\Microsoft.JavaScript.Hermes\$(HermesVersion)</HermesPackage>
20
20
  <EnableHermesInspectorInReleaseFlavor Condition="'$(EnableHermesInspectorInReleaseFlavor)' == ''">false</EnableHermesInspectorInReleaseFlavor>
21
21
  <!-- Disable linking Hermes into the output in cases where we need to fully rely on HermesShim -->
22
22
  <HermesNoLink Condition="'$(HermesNoLink)' == '' and '$(Configuration)' == 'Release' and '$(EnableHermesInspectorInReleaseFlavor)' != 'true'">true</HermesNoLink>
@@ -24,7 +24,7 @@
24
24
  <EnableDevServerHBCBundles Condition="'$(EnableDevServerHBCBundles)' == ''">false</EnableDevServerHBCBundles>
25
25
 
26
26
  <UseV8 Condition="'$(UseV8)' == ''">false</UseV8>
27
- <V8Version Condition="'$(V8Version)' == ''">0.71.3</V8Version>
27
+ <V8Version Condition="'$(V8Version)' == ''">0.71.5</V8Version>
28
28
  <V8PackageName>ReactNative.V8Jsi.Windows</V8PackageName>
29
29
  <V8PackageName Condition="'$(V8AppPlatform)' != 'win32'">$(V8PackageName).UWP</V8PackageName>
30
30
  <V8Package>$(NuGetPackageRoot)\$(V8PackageName).$(V8Version)</V8Package>
@@ -20,9 +20,8 @@
20
20
  <Import Project="$(MSBuildThisFileDirectory)NuGet.Cpp.props" />
21
21
 
22
22
  <PropertyGroup Label="Desktop">
23
- <!-- See https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt -->
24
- <WinVer>_WIN32_WINNT_WINBLUE</WinVer>
25
- <EnableBeast Condition="'$(EnableBeast)' == ''">0</EnableBeast>
23
+ <!-- See https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt -->
24
+ <WinVer Condition="'$(WinVer)' == ''">_WIN32_WINNT_WIN10</WinVer>
26
25
  </PropertyGroup>
27
26
 
28
27
  <PropertyGroup>
@@ -57,6 +56,7 @@
57
56
  <PreprocessorDefinitions Condition="'$(EnableDevServerHBCBundles)'=='true'">ENABLE_DEVSERVER_HBCBUNDLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
58
57
  <PreprocessorDefinitions Condition="'$(UseV8)'=='true'">USE_V8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
59
58
  <PreprocessorDefinitions Condition="'$(UseFabric)'=='true'">USE_FABRIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
59
+ <PreprocessorDefinitions>JSI_VERSION=9;%(PreprocessorDefinitions)</PreprocessorDefinitions>
60
60
  </ClCompile>
61
61
  </ItemDefinitionGroup>
62
62
 
@@ -34,6 +34,12 @@
34
34
  <TreatWarningAsError>true</TreatWarningAsError>
35
35
  <WarningLevel>Level4</WarningLevel>
36
36
  </ClCompile>
37
+ <Link>
38
+ <!--
39
+ LNK4199: /DELAYLOAD:v8jsi.dll ignored; no imports found from v8jsi.dll
40
+ -->
41
+ <AdditionalOptions>/ignore:4199 %(AdditionalOptions)</AdditionalOptions>
42
+ </Link>
37
43
  </ItemDefinitionGroup>
38
44
 
39
45
  </Project>
@@ -106,6 +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
110
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.h" />
110
111
  <ClInclude Include="$(YogaDir)\yoga\YGEnums.h" />
111
112
  <ClInclude Include="$(YogaDir)\yoga\YGMacros.h" />
@@ -127,6 +128,7 @@
127
128
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsi\jsi\JSIDynamic.cpp" />
128
129
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp" />
129
130
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp" />
131
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector\InspectorInterfaces.cpp" />
130
132
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.cpp" />
131
133
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp" />
132
134
  <ClCompile Include="$(YogaDir)\yoga\log.cpp" />
@@ -178,6 +180,52 @@
178
180
  <ItemGroup>
179
181
  <PackageReference Include="boost" Version="1.76.0.0" />
180
182
  </ItemGroup>
183
+ <PropertyGroup>
184
+ <NodeApiJsiZipDir>$(NodeApiJsiDir)..\.node-api-jsi-zip</NodeApiJsiZipDir>
185
+ <NodeApiJsiZipFile>$(NodeApiJsiZipDir)\node-api-jsi-$(NodeApiJsiCommitHash).zip</NodeApiJsiZipFile>
186
+ <CGManifestFile>$(MSBuildThisFileDirectory)cgmanifest.json</CGManifestFile>
187
+ </PropertyGroup>
188
+ <Target Name="DownloadNodeApiJsi" BeforeTargets="PrepareForBuild" Inputs="$(NodeApiJsiZipFile)" Outputs="$(NodeApiJsiZipFile)">
189
+ <Message Text="Downloading node-api-jsi..." Importance="High" />
190
+ <DownloadFile
191
+ SourceUrl="https://github.com/microsoft/node-api-jsi/archive/$(NodeApiJsiCommitHash).zip"
192
+ DestinationFileName="$(NodeApiJsiZipFile)"
193
+ DestinationFolder="$(NodeApiJsiZipDir)"
194
+ Retries="10" />
195
+ </Target>
196
+ <Target Name="UnzipNodeApiJsi" BeforeTargets="PrepareForBuild" DependsOnTargets="DownloadNodeApiJsi">
197
+ <Message Text="Unzipping node-api-jsi to $([MSBuild]::NormalizePath($(NodeApiJsiDir)..))." Importance="High"
198
+ Condition="!Exists('$(NodeApiJsiDir)src\NodeApiJsiRuntime.h')" />
199
+ <Unzip
200
+ Condition="!Exists('$(NodeApiJsiDir)src\NodeApiJsiRuntime.h')"
201
+ SourceFiles="$(NodeApiJsiZipFile)"
202
+ DestinationFolder="$([MSBuild]::NormalizePath($(NodeApiJsiDir)..))"
203
+ OverwriteReadOnlyFiles="true" />
204
+ </Target>
205
+ <Target Name="WriteCGManifest" BeforeTargets="PrepareForBuild" DependsOnTargets="DownloadNodeApiJsi" Inputs="$(NodeApiJsiZipFile)" Outputs="$(CGManifestFile)">
206
+ <PropertyGroup>
207
+ <CGManifestText>{
208
+ "$schema": "https://json.schemastore.org/component-detection-manifest.json",
209
+ "Registrations": [
210
+ {
211
+ "Component": {
212
+ "Type": "git",
213
+ "Git": {
214
+ "RepositoryUrl": "https://github.com/microsoft/node-api-jsi",
215
+ "CommitHash": "$(NodeApiJsiCommitHash)"
216
+ }
217
+ },
218
+ "DevelopmentDependency": false
219
+ }
220
+ ]
221
+ }</CGManifestText>
222
+ </PropertyGroup>
223
+ <Message Text="Generating $(CGManifestFile)." Importance="High" />
224
+ <WriteLinesToFile
225
+ File="$(CGManifestFile)"
226
+ Overwrite="true"
227
+ Lines="$(CGManifestText)" />
228
+ </Target>
181
229
  <Target Name="EnsureNodeModuleBuildImports" BeforeTargets="PrepareForBuild">
182
230
  <Error Condition="!Exists('$(ReactNativeDir)')" Text="This project references code in the node_modules folder that is missing on this computer. Use `yarn install` to download them." />
183
231
  <Error Condition="!Exists('$(YogaDir)')" Text="This project references code in the node_modules folder that is missing on this computer. Use `yarn install` to download them." />
@@ -187,7 +235,11 @@
187
235
  </ItemGroup>
188
236
  <Target Name="Deploy" />
189
237
  <!-- Reenable this task if we need to temporarily replace any folly files for fixes, while we wait for PRs to land in folly -->
190
- <Target Name="ApplyReactCommonTemporaryPatch" BeforeTargets="PrepareForBuild">
238
+ <Target Name="ApplyReactCommonTemporaryPatch" BeforeTargets="PrepareForBuild" DependsOnTargets="UnzipNodeApiJsi">
239
+ <ItemGroup>
240
+ <NodeApiJsiFiles Include="$([MSBuild]::NormalizePath($(NodeApiJsiDir)))\jsi\**\*.*" />
241
+ </ItemGroup>
242
+ <Copy DestinationFiles="@(NodeApiJsiFiles->'$(ReactNativeDir)\ReactCommon\jsi\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(NodeApiJsiFiles)" />
191
243
  <Copy DestinationFiles="@(TemporaryReactCommonPatchFiles->'$(ReactNativeDir)\ReactCommon\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(TemporaryReactCommonPatchFiles)" />
192
244
  </Target>
193
245
  </Project>
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/component-detection-manifest.json",
3
+ "Registrations": [
4
+ {
5
+ "Component": {
6
+ "Type": "git",
7
+ "Git": {
8
+ "RepositoryUrl": "https://github.com/microsoft/node-api-jsi",
9
+ "CommitHash": "53b897b03c1c7e57c3372acc6234447a44e150d6"
10
+ }
11
+ },
12
+ "DevelopmentDependency": false
13
+ }
14
+ ]
15
+ }
@@ -15,6 +15,23 @@ Write-Host "Destination root: [$TargetRoot]"
15
15
  Write-Host "React Native root: [$ReactNativeRoot]"
16
16
  Write-Host "ReactCommon Override root: [$ReactCommonOverrideRoot]"
17
17
 
18
+ [xml]$props = gc $PSScriptRoot\..\..\Directory.Build.props
19
+ [string] $NodeApiJsiCommitHash = $props.Project.PropertyGroup.NodeApiJsiCommitHash;
20
+ $NodeApiJsiCommitHash = $NodeApiJsiCommitHash.Trim()
21
+ $NodeApiJsiRoot = "$SourceRoot\node_modules\.node-api-jsi\node-api-jsi-${NodeApiJsiCommitHash}";
22
+ Write-Host "Node-API JSI root: [$NodeApiJsiRoot]"
23
+
24
+ # Download Node-API JSI if running on a machine which hasn't run native build logic to acquire it
25
+ if (!(Test-Path $NodeApiJsiRoot)) {
26
+ Write-Host "Downloading Node-API JSI $NodeApiJsiCommitHash"
27
+ $NodeApiJsiZip = "$SourceRoot\node_modules\.node-api-jsi\node-api-jsi-${NodeApiJsiCommitHash}.zip"
28
+ $NodeApiJsiDest = "$SourceRoot\node_modules\.node-api-jsi"
29
+
30
+ New-Item $NodeApiJsiRoot -ItemType Directory
31
+ Invoke-RestMethod -Uri "https://github.com/microsoft/node-api-jsi/archive/${NodeApiJsiCommitHash}.zip" -OutFile $NodeApiJsiZip
32
+ Expand-Archive -LiteralPath $NodeApiJsiZip -DestinationPath $NodeApiJsiDest
33
+ }
34
+
18
35
  md -Force $TargetRoot
19
36
 
20
37
  $patterns = $Extensions| ForEach-Object {"*.$_"}
@@ -39,6 +56,25 @@ Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\jsi\jsi\jsi.h -Destination $
39
56
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\jsi\jsi\jsi-inl.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\jsi\
40
57
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\jsi\jsi\threadsafe.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\jsi\
41
58
 
59
+ # Microsoft.ReactNative.CXX project Node-API files
60
+ New-Item $TargetRoot\Microsoft.ReactNative.Cxx\node-api -ItemType Directory -Force
61
+ Copy-Item -Force -Path $NodeApiJsiRoot\node-api\js_native_api.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\node-api\
62
+ Copy-Item -Force -Path $NodeApiJsiRoot\node-api\js_native_api_types.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\node-api\
63
+ Copy-Item -Force -Path $NodeApiJsiRoot\node-api\js_runtime_api.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\node-api\
64
+
65
+ # Microsoft.ReactNative.CXX project Node-API JSI files
66
+ New-Item $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders -ItemType Directory -Force
67
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\JSRuntimeApi.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
68
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\JSRuntimeApi.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
69
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\JSRuntimeApi.inc -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
70
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\NodeApi.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
71
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\NodeApi.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
72
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\NodeApi.inc -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
73
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\NodeApi_posix.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
74
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\ApiLoaders\NodeApi_win.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ApiLoaders\
75
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\NodeApiJsiRuntime.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\
76
+ Copy-Item -Force -Path $NodeApiJsiRoot\src\NodeApiJsiRuntime.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\
77
+
42
78
  # Microsoft.ReactNative.CXX project TurboModule files
43
79
  New-Item -ItemType Directory -Path $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon -Force
44
80
  Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\callinvoker\ReactCommon\CallInvoker.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
@@ -0,0 +1,95 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "BaseFileReaderResource.h"
5
+
6
+ // Boost Library
7
+ #include <boost/archive/iterators/base64_from_binary.hpp>
8
+ #include <boost/archive/iterators/ostream_iterator.hpp>
9
+ #include <boost/archive/iterators/transform_width.hpp>
10
+
11
+ // Windows API
12
+ #include <winrt/base.h>
13
+
14
+ using std::function;
15
+ using std::shared_ptr;
16
+ using std::string;
17
+
18
+ namespace Microsoft::React {
19
+
20
+ #pragma region BaseFileReaderResource
21
+
22
+ BaseFileReaderResource::BaseFileReaderResource(std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept
23
+ : m_weakBlobPersistor{weakBlobPersistor} {}
24
+
25
+ #pragma region IFileReaderResource
26
+
27
+ void BaseFileReaderResource::ReadAsText(
28
+ string &&blobId,
29
+ int64_t offset,
30
+ int64_t size,
31
+ string &&encoding,
32
+ function<void(string &&)> &&resolver,
33
+ function<void(string &&)> &&rejecter) noexcept /*override*/ {
34
+ auto persistor = m_weakBlobPersistor.lock();
35
+ if (!persistor) {
36
+ return resolver("Could not find Blob persistor");
37
+ }
38
+
39
+ winrt::array_view<uint8_t const> bytes;
40
+ try {
41
+ bytes = persistor->ResolveMessage(std::move(blobId), offset, size);
42
+ } catch (const std::exception &e) {
43
+ return rejecter(e.what());
44
+ }
45
+
46
+ // #9982 - Handle non-UTF8 encodings
47
+ // See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html
48
+ auto result = string{bytes.cbegin(), bytes.cend()};
49
+
50
+ resolver(std::move(result));
51
+ }
52
+
53
+ void BaseFileReaderResource::ReadAsDataUrl(
54
+ string &&blobId,
55
+ int64_t offset,
56
+ int64_t size,
57
+ string &&type,
58
+ function<void(string &&)> &&resolver,
59
+ function<void(string &&)> &&rejecter) noexcept /*override*/ {
60
+ auto persistor = m_weakBlobPersistor.lock();
61
+ if (!persistor) {
62
+ return rejecter("Could not find Blob persistor");
63
+ }
64
+
65
+ winrt::array_view<uint8_t const> bytes;
66
+ try {
67
+ bytes = persistor->ResolveMessage(std::move(blobId), offset, size);
68
+ } catch (const std::exception &e) {
69
+ return rejecter(e.what());
70
+ }
71
+
72
+ auto result = string{"data:"};
73
+ result += type;
74
+ result += ";base64,";
75
+
76
+ // https://www.boost.org/doc/libs/1_76_0/libs/serialization/doc/dataflow.html
77
+ using namespace boost::archive::iterators;
78
+ typedef base64_from_binary<transform_width<const char *, 6, 8>> encode_base64;
79
+ std::ostringstream oss;
80
+ std::copy(encode_base64(bytes.cbegin()), encode_base64(bytes.cend()), ostream_iterator<char>(oss));
81
+ result += oss.str();
82
+
83
+ resolver(std::move(result));
84
+ }
85
+
86
+ /*static*/ shared_ptr<IFileReaderResource> IFileReaderResource::Make(
87
+ std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept {
88
+ return std::make_shared<BaseFileReaderResource>(weakBlobPersistor);
89
+ }
90
+
91
+ #pragma endregion IFileReaderResource
92
+
93
+ #pragma endregion BaseFileReaderResource
94
+
95
+ } // namespace Microsoft::React
@@ -0,0 +1,41 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+
6
+ #include "IFileReaderResource.h"
7
+
8
+ // Standard Library
9
+ #include <memory>
10
+
11
+ namespace Microsoft::React {
12
+
13
+ class BaseFileReaderResource : public IFileReaderResource, public std::enable_shared_from_this<BaseFileReaderResource> {
14
+ protected:
15
+ std::weak_ptr<IBlobPersistor> m_weakBlobPersistor;
16
+
17
+ public:
18
+ BaseFileReaderResource(std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept;
19
+
20
+ #pragma region IFileReaderResource
21
+
22
+ void ReadAsText(
23
+ std::string &&blobId,
24
+ int64_t offset,
25
+ int64_t size,
26
+ std::string &&encoding,
27
+ std::function<void(std::string &&)> &&resolver,
28
+ std::function<void(std::string &&)> &&rejecter) noexcept override;
29
+
30
+ void ReadAsDataUrl(
31
+ std::string &&blobId,
32
+ int64_t offset,
33
+ int64_t size,
34
+ std::string &&type,
35
+ std::function<void(std::string &&)> &&resolver,
36
+ std::function<void(std::string &&)> &&rejecter) noexcept override;
37
+
38
+ #pragma endregion IFileReaderResource
39
+ };
40
+
41
+ } // namespace Microsoft::React
@@ -5,7 +5,6 @@
5
5
 
6
6
  // React Native
7
7
  #include <cxxreact/CxxModule.h>
8
- #include <smartPtr/cntPtr.h>
9
8
 
10
9
  // Windows API
11
10
  #include <winrt/Windows.Foundation.h>
@@ -14,12 +13,16 @@
14
13
  #include <memory>
15
14
 
16
15
  // Forward declarations. Desktop projects can not access <React.h>
16
+ namespace winrt::Microsoft::ReactNative {
17
+ struct ReactContext;
18
+ struct ReactModuleProvider;
19
+ } // namespace winrt::Microsoft::ReactNative
20
+
17
21
  namespace Mso::React {
18
22
  struct IReactContext;
19
23
  }
20
24
 
21
- namespace facebook {
22
- namespace react {
25
+ namespace facebook::react {
23
26
 
24
27
  class MessageQueueThread;
25
28
 
@@ -29,11 +32,12 @@ class MessageQueueThread;
29
32
  extern std::unique_ptr<facebook::xplat::module::CxxModule> CreateTimingModule(
30
33
  const std::shared_ptr<facebook::react::MessageQueueThread> &nativeThread) noexcept;
31
34
 
32
- } // namespace react
33
- } // namespace facebook
35
+ } // namespace facebook::react
34
36
 
35
37
  namespace Microsoft::React {
36
38
 
39
+ #pragma region CxxModules
40
+
37
41
  extern const char *GetHttpModuleName() noexcept;
38
42
  extern std::unique_ptr<facebook::xplat::module::CxxModule> CreateHttpModule(
39
43
  winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept;
@@ -50,4 +54,22 @@ extern const char *GetFileReaderModuleName() noexcept;
50
54
  extern std::unique_ptr<facebook::xplat::module::CxxModule> CreateFileReaderModule(
51
55
  winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept;
52
56
 
57
+ #pragma endregion CxxModules
58
+
59
+ #pragma region TurboModules
60
+
61
+ extern const wchar_t *GetBlobTurboModuleName() noexcept;
62
+ extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetBlobModuleProvider() noexcept;
63
+
64
+ extern const wchar_t *GetHttpTurboModuleName() noexcept;
65
+ extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetHttpModuleProvider() noexcept;
66
+
67
+ extern const wchar_t *GetFileReaderTurboModuleName() noexcept;
68
+ extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetFileReaderModuleProvider() noexcept;
69
+
70
+ extern const wchar_t *GetWebSocketTurboModuleName() noexcept;
71
+ extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetWebSocketModuleProvider() noexcept;
72
+
73
+ #pragma endregion TurboModules
74
+
53
75
  } // namespace Microsoft::React