react-native-windows 0.84.0-preview.7 → 0.84.0

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 (40) hide show
  1. package/Common/unicode.cpp +36 -0
  2. package/Common/unicode.h +8 -0
  3. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +5 -0
  4. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +106 -24
  5. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +11 -0
  6. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +4 -0
  7. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +1 -0
  8. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +6 -4
  9. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +28 -6
  10. package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +1 -1
  11. package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +80 -0
  12. package/Microsoft.ReactNative/Fabric/Composition/TooltipService.h +17 -0
  13. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +1 -1
  14. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +3 -2
  15. package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +33 -25
  16. package/Microsoft.ReactNative/Utils/LocalBundleReader.h +5 -3
  17. package/Microsoft.ReactNative/Utils/UwpScriptStore.cpp +2 -2
  18. package/Microsoft.ReactNative/Utils/UwpScriptStore.h +3 -2
  19. package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +3 -3
  20. package/Microsoft.ReactNative.Managed.CodeGen/Microsoft.ReactNative.Managed.CodeGen.csproj +10 -10
  21. package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Debug.pubxml +1 -1
  22. package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Release.pubxml +1 -1
  23. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  24. package/PropertySheets/JSEngine.props +1 -1
  25. package/PropertySheets/React.Cpp.props +4 -3
  26. package/PropertySheets/WinUI.props +2 -2
  27. package/Scripts/JustMyXaml.ps1 +8 -8
  28. package/Scripts/UnitTest.ps1 +3 -1
  29. package/Scripts/rnw-dependencies.ps1 +15 -16
  30. package/Shared/DevSupportManager.cpp +55 -48
  31. package/Shared/DevSupportManager.h +0 -1
  32. package/Shared/Modules/IWebSocketModuleContentHandler.h +15 -0
  33. package/Shared/Modules/WebSocketModule.cpp +8 -3
  34. package/Shared/Networking/DefaultBlobResource.cpp +37 -0
  35. package/Shared/Networking/DefaultBlobResource.h +12 -0
  36. package/Shared/Networking/WinRTWebSocketResource.h +5 -1
  37. package/just-task.js +13 -2
  38. package/package.json +6 -6
  39. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
  40. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
@@ -54,7 +54,29 @@ std::string GetBundleFromEmbeddedResource(const winrt::Windows::Foundation::Uri
54
54
  return std::string(start, start + size);
55
55
  }
56
56
 
57
- std::future<std::string> LocalBundleReader::LoadBundleAsync(const std::wstring bundleUri) {
57
+ namespace {
58
+
59
+ std::string BufferToString(const winrt::Windows::Storage::Streams::IBuffer &buffer) {
60
+ std::string result(buffer.Length(), '\0');
61
+ if (!result.empty()) {
62
+ auto reader = winrt::Windows::Storage::Streams::DataReader::FromBuffer(buffer);
63
+ reader.ReadBytes(winrt::array_view<uint8_t>{
64
+ reinterpret_cast<uint8_t *>(&result[0]), reinterpret_cast<uint8_t *>(&result[result.length()])});
65
+ }
66
+ return result;
67
+ }
68
+
69
+ winrt::Windows::Storage::Streams::IBuffer BytesToBuffer(const void *data, uint32_t size) {
70
+ winrt::Windows::Storage::Streams::DataWriter writer;
71
+ auto bytes = static_cast<const uint8_t *>(data);
72
+ writer.WriteBytes(winrt::array_view<const uint8_t>(bytes, bytes + size));
73
+ return writer.DetachBuffer();
74
+ }
75
+
76
+ } // namespace
77
+
78
+ winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer>
79
+ LocalBundleReader::LoadBundleAsync(const std::wstring bundleUri) {
58
80
  try {
59
81
  co_await winrt::resume_background();
60
82
 
@@ -66,41 +88,26 @@ std::future<std::string> LocalBundleReader::LoadBundleAsync(const std::wstring b
66
88
  file = co_await winrt::Windows::Storage::StorageFile::GetFileFromApplicationUriAsync(uri);
67
89
  } else if (bundleUri.starts_with(L"resource://")) {
68
90
  winrt::Windows::Foundation::Uri uri(bundleUri);
69
- co_return GetBundleFromEmbeddedResource(uri);
91
+ auto bytes = GetBundleFromEmbeddedResource(uri);
92
+ co_return BytesToBuffer(bytes.data(), static_cast<uint32_t>(bytes.size()));
70
93
  } else {
71
94
  file = co_await winrt::Windows::Storage::StorageFile::GetFileFromPathAsync(bundleUri);
72
95
  }
73
96
 
74
- // Read the buffer manually to avoid a Utf8 -> Utf16 -> Utf8 encoding
75
- // roundtrip.
76
- auto fileBuffer{co_await winrt::Windows::Storage::FileIO::ReadBufferAsync(file)};
77
- auto dataReader{winrt::Windows::Storage::Streams::DataReader::FromBuffer(fileBuffer)};
78
-
79
- // No need to use length + 1, STL guarantees that string storage is null-terminated.
80
- std::string script(fileBuffer.Length(), '\0');
81
-
82
- // Construct the array_view to slice into the first fileBuffer.Length bytes.
83
- // DataReader.ReadBytes will read as many bytes as are present in the
84
- // array_view. The backing string has fileBuffer.Length() + 1 bytes, without
85
- // an explicit end it will read 1 byte to many and throw.
86
- dataReader.ReadBytes(winrt::array_view<uint8_t>{
87
- reinterpret_cast<uint8_t *>(&script[0]), reinterpret_cast<uint8_t *>(&script[script.length()])});
88
- dataReader.Close();
89
-
90
- co_return script;
97
+ co_return co_await winrt::Windows::Storage::FileIO::ReadBufferAsync(file);
91
98
  }
92
99
  // RuntimeScheduler only handles std::exception or jsi::JSError
93
- catch (winrt::hresult_error const &e) {
94
- throw std::exception(winrt::to_string(e.message()).c_str());
100
+ catch (winrt::hresult_error const &) {
101
+ throw;
95
102
  }
96
103
  }
97
104
 
98
105
  std::string LocalBundleReader::LoadBundle(const std::wstring &bundlePath) {
99
- return LoadBundleAsync(bundlePath).get();
106
+ return BufferToString(LoadBundleAsync(bundlePath).get());
100
107
  }
101
108
 
102
109
  StorageFileBigString::StorageFileBigString(const std::wstring &path) {
103
- m_futureBuffer = LocalBundleReader::LoadBundleAsync(path);
110
+ m_pendingLoad = LocalBundleReader::LoadBundleAsync(path);
104
111
  }
105
112
 
106
113
  bool StorageFileBigString::isAscii() const {
@@ -118,8 +125,9 @@ size_t StorageFileBigString::size() const {
118
125
  }
119
126
 
120
127
  void StorageFileBigString::ensure() const {
121
- if (m_string.empty()) {
122
- m_string = m_futureBuffer.get();
128
+ if (m_pendingLoad) {
129
+ m_string = BufferToString(m_pendingLoad.get());
130
+ m_pendingLoad = nullptr;
123
131
  }
124
132
  }
125
133
 
@@ -3,14 +3,16 @@
3
3
 
4
4
  #pragma once
5
5
  #include <cxxreact/JSBigString.h>
6
- #include <future>
6
+ #include <winrt/Windows.Foundation.h>
7
+ #include <winrt/Windows.Storage.Streams.h>
7
8
  #include <string>
8
9
 
9
10
  namespace Microsoft::ReactNative {
10
11
 
11
12
  class LocalBundleReader {
12
13
  public:
13
- static std::future<std::string> LoadBundleAsync(const std::wstring bundlePath);
14
+ static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer> LoadBundleAsync(
15
+ const std::wstring bundlePath);
14
16
  static std::string LoadBundle(const std::wstring &bundlePath);
15
17
  };
16
18
 
@@ -24,7 +26,7 @@ class StorageFileBigString : public facebook::react::JSBigString {
24
26
  void ensure() const;
25
27
 
26
28
  private:
27
- mutable std::future<std::string> m_futureBuffer;
29
+ mutable winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer> m_pendingLoad;
28
30
  mutable std::string m_string;
29
31
  };
30
32
 
@@ -4,7 +4,6 @@
4
4
  #include <winrt/Windows.Foundation.h>
5
5
  #include <winrt/Windows.Storage.FileProperties.h>
6
6
  #include <winrt/Windows.Storage.h>
7
- #include <future>
8
7
  #include "Unicode.h"
9
8
 
10
9
  namespace winrt {
@@ -43,7 +42,8 @@ facebook::jsi::ScriptVersion_t UwpScriptStore::getScriptVersion(const std::strin
43
42
  return version;
44
43
  }
45
44
 
46
- std::future<facebook::jsi::ScriptVersion_t> UwpScriptStore::getScriptVersionAsync(const std::string &bundleUri) {
45
+ winrt::Windows::Foundation::IAsyncOperation<facebook::jsi::ScriptVersion_t> UwpScriptStore::getScriptVersionAsync(
46
+ const std::string &bundleUri) {
47
47
  co_await winrt::resume_background();
48
48
 
49
49
  const winrt::hstring fileUrl(Microsoft::Common::Unicode::Utf8ToUtf16("ms-appx:///Bundle/" + bundleUri + ".bundle"));
@@ -1,6 +1,6 @@
1
1
  #pragma once
2
2
  #include <JSI/ScriptStore.h>
3
- #include <future>
3
+ #include <winrt/Windows.Foundation.h>
4
4
 
5
5
  namespace Microsoft::ReactNative {
6
6
 
@@ -16,7 +16,8 @@ class UwpScriptStore : public facebook::jsi::ScriptStore {
16
16
  static facebook::jsi::ScriptVersion_t GetFileVersion(const std::wstring &filePath);
17
17
 
18
18
  private:
19
- std::future<facebook::jsi::ScriptVersion_t> getScriptVersionAsync(const std::string &bundleUri);
19
+ winrt::Windows::Foundation::IAsyncOperation<facebook::jsi::ScriptVersion_t> getScriptVersionAsync(
20
+ const std::string &bundleUri);
20
21
  };
21
22
 
22
23
  } // namespace Microsoft::ReactNative
@@ -15,7 +15,7 @@
15
15
  <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
16
16
  <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22621.0</TargetPlatformVersion>
17
17
  <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
18
- <MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
18
+ <MinimumVisualStudioVersion>18.0</MinimumVisualStudioVersion>
19
19
  <FileAlignment>512</FileAlignment>
20
20
  <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
21
21
  <DocumentationFile>bin\$(Platform)\$(Configuration)\Microsoft.ReactNative.Managed.XML</DocumentationFile>
@@ -150,8 +150,8 @@
150
150
  </ItemGroup>
151
151
  </When>
152
152
  </Choose>
153
- <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '17.0' ">
154
- <VisualStudioVersion>17.0</VisualStudioVersion>
153
+ <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '18.0' ">
154
+ <VisualStudioVersion>18.0</VisualStudioVersion>
155
155
  </PropertyGroup>
156
156
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
157
157
  <Target Name="Deploy" />
@@ -3,7 +3,7 @@
3
3
  <PropertyGroup>
4
4
  <OutputType>Exe</OutputType>
5
5
 
6
- <TargetFramework>net8.0</TargetFramework>
6
+ <TargetFramework>net10.0</TargetFramework>
7
7
  <Platforms>x64;x86;ARM64</Platforms>
8
8
  <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
9
9
 
@@ -31,8 +31,8 @@
31
31
  <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.3.1" />
32
32
  <PackageReference Include="RuntimeContracts" Version="0.3.0" />
33
33
 
34
- <!--
35
- NuGet decides to pull in packages with issues. There is no seeming way to diagnose why NuGet is pulling in those versions.
34
+ <!--
35
+ NuGet decides to pull in packages with issues. There is no seeming way to diagnose why NuGet is pulling in those versions.
36
36
  Running restore with -Verbosity Detailed and environment variables:
37
37
  * NUGET_RESTORE_MSBUILD_ARGS=/bl:c:\temp\nuget.binlog
38
38
  * NUGET_RESTORE_MSBUILD_VERBOSITY=diag
@@ -42,7 +42,7 @@
42
42
  <PackageReference Include="System.Private.Uri" Version="4.3.2" />
43
43
  </ItemGroup>
44
44
 
45
- <!--
45
+ <!--
46
46
  This target is used to ensure the tool is deployed and can be used from source.
47
47
  It will return all deployed files so the caller can implement incrementality properly
48
48
  -->
@@ -53,7 +53,7 @@
53
53
  </ItemGroup>
54
54
  </Target>
55
55
 
56
- <!--
56
+ <!--
57
57
  This target returns the location of the deployed executable.
58
58
  -->
59
59
  <Target Name="GetPublishedToolPath" DependsOnTargets="PublishTool" Returns="@(_PublishedToolExecutable)">
@@ -62,13 +62,13 @@
62
62
  </ItemGroup>
63
63
  </Target>
64
64
 
65
- <!--
65
+ <!--
66
66
  This is used during the PR build to ensure we have the artifacts published during the build.
67
67
  -->
68
- <Target
69
- Name="PublishToolDuringBuild"
70
- DependsOnTargets="Publish"
71
- AfterTargets="Build"
68
+ <Target
69
+ Name="PublishToolDuringBuild"
70
+ DependsOnTargets="Publish"
71
+ AfterTargets="Build"
72
72
  Condition="'$(PublishToolDuringBuild)' == 'true'">
73
73
  </Target>
74
74
 
@@ -6,7 +6,7 @@
6
6
  <PublishProtocol>FileSystem</PublishProtocol>
7
7
  <Configuration>Debug</Configuration>
8
8
  <Platform>x64</Platform>
9
- <TargetFramework>net8.0</TargetFramework>
9
+ <TargetFramework>net10.0</TargetFramework>
10
10
  <PublishDir>$(OutDir)publish</PublishDir>
11
11
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
12
12
  <SelfContained>true</SelfContained>
@@ -6,7 +6,7 @@
6
6
  <PublishProtocol>FileSystem</PublishProtocol>
7
7
  <Configuration>Release</Configuration>
8
8
  <Platform>x64</Platform>
9
- <TargetFramework>net8.0</TargetFramework>
9
+ <TargetFramework>net10.0</TargetFramework>
10
10
  <PublishDir>$(OutDir)publish</PublishDir>
11
11
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
12
12
  <SelfContained>true</SelfContained>
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.84.0-preview.7</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.84.0</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>84</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>4c8074d47d675aee1d2110c5b92e9e349bfa1abb</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>691d92a59015db74e72c316204564f7a9d8d7680</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -6,7 +6,7 @@
6
6
  <!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
7
7
  <UseHermes Condition="'$(UseHermes)' == ''">true</UseHermes>
8
8
  <!-- 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 -->
9
- <HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2604.21001-94aa5e1d</HermesVersion>
9
+ <HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2605.6002-2279da22 </HermesVersion>
10
10
  <HermesPackageName Condition="'$(HermesPackageName)' == ''">Microsoft.JavaScript.Hermes</HermesPackageName>
11
11
  <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgMicrosoft_JavaScript_Hermes)')">$(PkgMicrosoft_JavaScript_Hermes)</HermesPackage>
12
12
  <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\$(HermesPackageName)\$(HermesVersion)</HermesPackage>
@@ -43,8 +43,8 @@
43
43
 
44
44
  <PropertyGroup Label="ExternalDependencies">
45
45
  <!-- Google Test Adapter -->
46
- <!-- Property sheets in the adapter's NuGet doesn't consider PlatformToolset=v143 -->
47
- <Force-Enable-Microsoft-googletest-v140-windesktop-msvcstl-static-rt-dyn>false</Force-Enable-Microsoft-googletest-v140-windesktop-msvcstl-static-rt-dyn>
46
+ <!-- If ApplicationType is set, adapter include paths won't be set for MSVC 14.0 (v140) or later -->
47
+ <Force-Enable-Microsoft-googletest-v140-windesktop-msvcstl-static-rt-dyn>true</Force-Enable-Microsoft-googletest-v140-windesktop-msvcstl-static-rt-dyn>
48
48
  </PropertyGroup>
49
49
 
50
50
  <!--
@@ -136,7 +136,8 @@
136
136
  <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
137
137
  <RuntimeTypeInfo>true</RuntimeTypeInfo>
138
138
  <ShowIncludes Condition="'$(ShowIncludes)'=='true'">true</ShowIncludes>
139
- <AdditionalOptions>/utf-8 %(AdditionalOptions) /await</AdditionalOptions>
139
+ <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
140
+ <AdditionalOptions Condition="$(PlatformToolsetVersion)&lt;145">%(AdditionalOptions) /await</AdditionalOptions>
140
141
  <ControlFlowGuard>Guard</ControlFlowGuard>
141
142
  <SpectreMitigation>Spectre</SpectreMitigation>
142
143
 
@@ -2,7 +2,7 @@
2
2
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <PropertyGroup Label="WinUI3 versioning">
4
4
 
5
- <!--
5
+ <!--
6
6
  Internal versions are typically only located at: https://microsoft.visualstudio.com/DefaultCollection/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK/versions
7
7
  For local testing of internal versions, modify WinUI3ExperimentalVersion, and comment out the additional nuget source in NuGet.Config
8
8
  When this version is updated, be sure to update the default for the enableInternalFeed parameter of /.ado/templates/enable-experimental-winui3.yml
@@ -10,7 +10,7 @@
10
10
  <WinUI3ExperimentalVersion Condition="'$(WinUI3ExperimentalVersion)'==''">2.0.0-experimental3</WinUI3ExperimentalVersion>
11
11
  <!-- This value is also used by the CLI, see /packages/@react-native-windows/cli/.../autolinkWindows.ts -->
12
12
  <WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">$(WinUI3ExperimentalVersion)</WinUI3Version>
13
- <WinUI3Version Condition="'$(WinUI3Version)'==''">1.8.260209005</WinUI3Version>
13
+ <WinUI3Version Condition="'$(WinUI3Version)'==''">1.8.260508005</WinUI3Version>
14
14
  <!-- This is needed to prevent build errors with WinAppSDK >= 1.7 trying to double build WindowsAppRuntimeAutoInitializer.cpp -->
15
15
  <WindowsAppSdkAutoInitialize Condition="'$(WindowsAppSdkAutoInitialize)'=='' And $([MSBuild]::VersionGreaterThan('$(WinUI3Version)', '1.7.0'))">false</WindowsAppSdkAutoInitialize>
16
16
  </PropertyGroup>
@@ -1,4 +1,4 @@
1
- # This script enables or disables VS 2022's JustMyXaml feature
1
+ # This script enables or disables VS 2026's JustMyXaml feature
2
2
  [CmdletBinding()]
3
3
  param([bool]$Enable)
4
4
 
@@ -7,14 +7,14 @@ if (!([bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups
7
7
  }
8
8
 
9
9
  $instanceId = & "$(${env:ProgramFiles(x86)})\Microsoft Visual Studio\Installer\vswhere.exe" -property instanceId
10
- $hiveFile = "$($env:LocalAppData)\Microsoft\VisualStudio\17.0_$instanceId\privateregistry.bin"
11
- & reg.exe load HKLM\VS2022_HIVE $hiveFile | Out-Null
12
- New-PSDrive -Name VS2022 -PSProvider Registry -Root HKLM\VS2022_HIVE -ErrorAction Stop | Out-Null
13
- $currentValue = (Get-ItemProperty VS2022:\Software\Microsoft\VisualStudio\17.0_$instanceId\Debugger -Name EnableXamlVisualDiagnosticsJustMyXaml).EnableXamlVisualDiagnosticsJustMyXaml
10
+ $hiveFile = "$($env:LocalAppData)\Microsoft\VisualStudio\18.0_$instanceId\privateregistry.bin"
11
+ & reg.exe load HKLM\VS2026_HIVE $hiveFile | Out-Null
12
+ New-PSDrive -Name VS2026 -PSProvider Registry -Root HKLM\VS2026_HIVE -ErrorAction Stop | Out-Null
13
+ $currentValue = (Get-ItemProperty VS2026:\Software\Microsoft\VisualStudio\18.0_$instanceId\Debugger -Name EnableXamlVisualDiagnosticsJustMyXaml).EnableXamlVisualDiagnosticsJustMyXaml
14
14
  if ($currentValue -eq 0) { $currentValue = $false; } else { $currentValue = $true; }
15
15
  Write-Host "Current value: $currentValue"
16
16
  if ($Enable) { $newValue = 1; } else { $newValue = 0; }
17
- Set-ItemProperty VS2022:\Software\Microsoft\VisualStudio\17.0_$instanceId\Debugger -Name EnableXamlVisualDiagnosticsJustMyXaml -Value $newValue -Type DWord
17
+ Set-ItemProperty VS2026:\Software\Microsoft\VisualStudio\18.0_$instanceId\Debugger -Name EnableXamlVisualDiagnosticsJustMyXaml -Value $newValue -Type DWord
18
18
  Write-Host "New value: $Enable"
19
- Remove-PSDrive -Name VS2022
20
- & reg.exe unload HKLM\VS2022_HIVE | Out-Null
19
+ Remove-PSDrive -Name VS2026
20
+ & reg.exe unload HKLM\VS2026_HIVE | Out-Null
@@ -23,7 +23,9 @@ param (
23
23
  "ReactCommon.UnitTests\ReactCommon.UnitTests.exe")
24
24
  ),
25
25
 
26
- [System.IO.FileInfo] $VsTest = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
26
+ [System.IO.FileInfo] $VsTest =
27
+ "$(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)\" +
28
+ "Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
27
29
  )
28
30
 
29
31
  if ($Include.Count) {
@@ -8,7 +8,7 @@ param(
8
8
  [string]$Check = [CheckId]::All,
9
9
 
10
10
  [Parameter(ValueFromRemainingArguments)]
11
- [ValidateSet('appDev', 'rnwDev', 'buildLab', 'vs2022', 'clone')]
11
+ [ValidateSet('appDev', 'rnwDev', 'buildLab', 'vs2026', 'clone')]
12
12
  [String[]]$Tags = @('appDev'),
13
13
  [switch]$Enterprise = $false
14
14
  )
@@ -94,7 +94,6 @@ $vsComponents = @('Microsoft.Component.MSBuild',
94
94
  $vcToolsComponent,
95
95
  'Microsoft.VisualStudio.ComponentGroup.UWP.Support',
96
96
  'Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core',
97
- 'Microsoft.VisualStudio.Component.Windows10SDK.19041',
98
97
  'Microsoft.VisualStudio.Component.Windows11SDK.22621');
99
98
 
100
99
  # UWP.VC is not needed to build the projects with msbuild, but the VS IDE requires it.
@@ -113,12 +112,12 @@ $wingetver = "1.7.11261";
113
112
 
114
113
  # The minimum VS version to check for
115
114
  # Note: For install to work, whatever min version you specify here must be met by the current package available on winget.
116
- $vsver = "17.11.0";
115
+ $vsver = "18.6.1";
117
116
 
118
117
  # The exact .NET SDK version to check for
119
- $dotnetver = "8.0";
118
+ $dotnetver = "10.0";
120
119
  # Version name of the winget package
121
- $wingetDotNetVer = "8";
120
+ $wingetDotNetVer = "10";
122
121
 
123
122
  $v = [System.Environment]::OSVersion.Version;
124
123
  if ($env:Agent_BuildDirectory) {
@@ -242,9 +241,9 @@ function InstallVS {
242
241
 
243
242
  if ($Enterprise) {
244
243
  # The CI machines need the enterprise version of VS as that is what is hardcoded in all the scripts
245
- WinGetInstall Microsoft.VisualStudio.2022.Enterprise
244
+ WinGetInstall Microsoft.VisualStudio.Enterprise
246
245
  } else {
247
- WinGetInstall Microsoft.VisualStudio.2022.Community
246
+ WinGetInstall Microsoft.VisualStudio.Community
248
247
  }
249
248
 
250
249
  $vsWhere = Get-VSWhere;
@@ -458,8 +457,8 @@ $requirements = @(
458
457
  },
459
458
  @{
460
459
  Id=[CheckId]::VSUWP;
461
- Name = "Visual Studio 2022 (>= $vsver) & req. components";
462
- Tags = @('appDev', 'vs2022');
460
+ Name = "Visual Studio 2026 (>= $vsver) & req. components";
461
+ Tags = @('appDev', 'vs2026');
463
462
  Valid = { CheckVS; }
464
463
  Install = { InstallVS };
465
464
  HasVerboseOutput = $true;
@@ -491,7 +490,7 @@ $requirements = @(
491
490
  $downloadPath = "$env:TEMP\WindowsApplicationDriver.msi"
492
491
  Write-Verbose "Downloading WinAppDriver from $url";
493
492
  Invoke-WebRequest -UseBasicParsing $url -OutFile $downloadPath
494
-
493
+
495
494
  # SDL Compliance: Verify signature (Work Item 58386093)
496
495
  $signature = Get-AuthenticodeSignature $downloadPath
497
496
  if ($signature.Status -ne "Valid") {
@@ -499,10 +498,10 @@ $requirements = @(
499
498
  throw "WinAppDriver signature verification failed"
500
499
  }
501
500
  if ($signature.SignerCertificate.Subject -notlike "*Microsoft*") {
502
- Remove-Item $downloadPath -ErrorAction SilentlyContinue
501
+ Remove-Item $downloadPath -ErrorAction SilentlyContinue
503
502
  throw "WinAppDriver not signed by Microsoft"
504
503
  }
505
-
504
+
506
505
  & $downloadPath /q
507
506
  Remove-Item $downloadPath -ErrorAction SilentlyContinue
508
507
  };
@@ -600,7 +599,7 @@ function WinGetInstall {
600
599
  Write-Verbose "Executing `winget install `"$wingetPackage`"";
601
600
  & winget install "$wingetPackage" --accept-source-agreements --accept-package-agreements
602
601
  }
603
-
602
+
604
603
  # Refresh PATH environment variable to pick up newly installed tools
605
604
  $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
606
605
  }
@@ -693,12 +692,12 @@ foreach ($req in $filteredRequirements)
693
692
  try {
694
693
  $validAfterInstall = Invoke-Command $req.Valid;
695
694
  } catch { }
696
-
695
+
697
696
  if ($validAfterInstall) {
698
697
  $Installed++;
699
698
  continue; # go to the next item
700
699
  }
701
-
700
+
702
701
  if ($LASTEXITCODE -ne 0) {
703
702
  throw "Last exit code was non-zero: $LASTEXITCODE - $outputFromInstall";
704
703
  }
@@ -737,4 +736,4 @@ if ($NeedsRerun -ne 0) {
737
736
  $Tags | Out-File $MarkerFile;
738
737
  if (!$ShellInvocation) { Read-Host 'Press Enter to exit' }
739
738
  exit 0;
740
- }
739
+ }
@@ -33,7 +33,6 @@
33
33
  #include <cxxreact/MessageQueueThread.h>
34
34
  #pragma warning(pop)
35
35
 
36
- #include <future>
37
36
  #include <mutex>
38
37
 
39
38
  #include <AppModel.h>
@@ -47,61 +46,59 @@ using namespace facebook::react;
47
46
 
48
47
  namespace Microsoft::ReactNative {
49
48
 
50
- std::future<std::pair<std::string, bool>> GetJavaScriptFromServerAsync(const std::string &url) {
51
- winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter filter;
52
- filter.CacheControl().ReadBehavior(winrt::Windows::Web::Http::Filters::HttpCacheReadBehavior::NoCache);
53
- winrt::Windows::Web::Http::HttpClient httpClient(filter);
54
- winrt::Windows::Foundation::Uri uri(Microsoft::Common::Unicode::Utf8ToUtf16(url));
49
+ winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer> GetJavaScriptFromServerAsync(
50
+ const std::string &url) {
51
+ try {
52
+ winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter filter;
53
+ filter.CacheControl().ReadBehavior(winrt::Windows::Web::Http::Filters::HttpCacheReadBehavior::NoCache);
54
+ winrt::Windows::Web::Http::HttpClient httpClient(filter);
55
+ winrt::Windows::Foundation::Uri uri(Microsoft::Common::Unicode::Utf8ToUtf16(url));
55
56
 
56
- co_await winrt::resume_background();
57
+ co_await winrt::resume_background();
57
58
 
58
- winrt::Windows::Web::Http::HttpRequestMessage request(winrt::Windows::Web::Http::HttpMethod::Get(), uri);
59
- auto asyncRequest = httpClient.SendRequestAsync(request);
59
+ winrt::Windows::Web::Http::HttpRequestMessage request(winrt::Windows::Web::Http::HttpMethod::Get(), uri);
60
+ auto asyncRequest = httpClient.SendRequestAsync(request);
60
61
  #ifdef DEFAULT_CPPWINRT_EXCEPTIONS
61
- try {
62
62
  winrt::Windows::Web::Http::HttpResponseMessage response = co_await asyncRequest;
63
- } catch (winrt::hresult_error const &e) {
64
- co_return std::make_pair(
65
- Microsoft::Common::Unicode::Utf16ToUtf8(e.message().c_str(), e.message().size()).c_str(), false);
66
- }
67
63
  #else
68
- co_await lessthrow_await_adapter<winrt::Windows::Foundation::IAsyncOperationWithProgress<
69
- winrt::Windows::Web::Http::HttpResponseMessage,
70
- winrt::Windows::Web::Http::HttpProgress>>{asyncRequest};
71
-
72
- HRESULT hr = asyncRequest.ErrorCode();
73
- if (FAILED(hr)) {
74
- std::string error;
75
- if (hr == WININET_E_CANNOT_CONNECT) {
76
- error = fmt::format("A connection with the server {} could not be established.\n\nIs the packager running?", url);
77
- } else {
78
- error = fmt::format("Error 0x{:x} downloading {}.", static_cast<int>(asyncRequest.ErrorCode()), url);
64
+ co_await lessthrow_await_adapter<winrt::Windows::Foundation::IAsyncOperationWithProgress<
65
+ winrt::Windows::Web::Http::HttpResponseMessage,
66
+ winrt::Windows::Web::Http::HttpProgress>>{asyncRequest};
67
+
68
+ HRESULT hr = asyncRequest.ErrorCode();
69
+ if (FAILED(hr)) {
70
+ std::string error;
71
+ if (hr == WININET_E_CANNOT_CONNECT) {
72
+ error =
73
+ fmt::format("A connection with the server {} could not be established.\n\nIs the packager running?", url);
74
+ } else {
75
+ error = fmt::format("Error 0x{:x} downloading {}.", static_cast<int>(asyncRequest.ErrorCode()), url);
76
+ }
77
+ throw winrt::hresult_error(E_FAIL, winrt::to_hstring(error));
79
78
  }
80
- co_return std::make_pair(error, false);
81
- }
82
79
 
83
- winrt::Windows::Web::Http::HttpResponseMessage response = asyncRequest.GetResults();
80
+ winrt::Windows::Web::Http::HttpResponseMessage response = asyncRequest.GetResults();
84
81
  #endif
85
82
 
86
- winrt::Windows::Storage::Streams::IBuffer buffer = co_await response.Content().ReadAsBufferAsync();
87
- auto reader = winrt::Windows::Storage::Streams::DataReader::FromBuffer(buffer);
88
-
89
- reader.UnicodeEncoding(winrt::Windows::Storage::Streams::UnicodeEncoding::Utf8);
90
- uint32_t len = reader.UnconsumedBufferLength();
91
- std::string result;
92
- if (len > 0 || response.IsSuccessStatusCode()) {
93
- std::string data;
94
- data.resize(len);
95
- auto buf = reinterpret_cast<uint8_t *>(data.data());
96
- static_assert(
97
- sizeof(buf[0]) == sizeof(data[0]), "perf optimization relies on uint8_t and char being the same size");
98
- reader.ReadBytes(winrt::array_view(buf, buf + len));
99
- result = std::move(data);
100
- } else {
101
- result = fmt::format("HTTP Error {} downloading {}.", static_cast<int>(response.StatusCode()), url);
102
- }
83
+ winrt::Windows::Storage::Streams::IBuffer buffer = co_await response.Content().ReadAsBufferAsync();
84
+
85
+ if (!response.IsSuccessStatusCode()) {
86
+ std::string error;
87
+ if (buffer.Length() > 0) {
88
+ auto reader = winrt::Windows::Storage::Streams::DataReader::FromBuffer(buffer);
89
+ error.resize(buffer.Length());
90
+ auto buf = reinterpret_cast<uint8_t *>(error.data());
91
+ reader.ReadBytes(winrt::array_view(buf, buf + buffer.Length()));
92
+ } else {
93
+ error = fmt::format("HTTP Error {} downloading {}.", static_cast<int>(response.StatusCode()), url);
94
+ }
95
+ throw winrt::hresult_error(E_FAIL, winrt::to_hstring(error));
96
+ }
103
97
 
104
- co_return std::make_pair(std::move(result), response.IsSuccessStatusCode());
98
+ co_return buffer;
99
+ } catch (winrt::hresult_error const &) {
100
+ throw;
101
+ }
105
102
  }
106
103
 
107
104
  void LaunchDevTools(const facebook::react::DevSettings &settings) {
@@ -185,7 +182,8 @@ std::string GetPackageName(const std::string &bundleAppId) {
185
182
  return packageName;
186
183
  }
187
184
 
188
- std::future<winrt::Windows::Web::Http::HttpStatusCode> PollForLiveReload(const std::string &url) {
185
+ winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Web::Http::HttpStatusCode> PollForLiveReload(
186
+ const std::string &url) {
189
187
  winrt::Windows::Web::Http::HttpClient httpClient;
190
188
  winrt::Windows::Foundation::Uri uri(Microsoft::Common::Unicode::Utf8ToUtf16(url));
191
189
  httpClient.DefaultRequestHeaders().Connection().TryParseAdd(L"keep-alive");
@@ -299,7 +297,16 @@ std::pair<std::string, bool> GetJavaScriptFromServer(
299
297
  inlineSourceMap,
300
298
  hermesBytecodeVersion);
301
299
  try {
302
- return GetJavaScriptFromServerAsync(bundleUrl).get();
300
+ auto buffer = GetJavaScriptFromServerAsync(bundleUrl).get();
301
+ std::string result(buffer.Length(), '\0');
302
+ if (!result.empty()) {
303
+ auto reader = winrt::Windows::Storage::Streams::DataReader::FromBuffer(buffer);
304
+ reader.ReadBytes(winrt::array_view<uint8_t>{
305
+ reinterpret_cast<uint8_t *>(&result[0]), reinterpret_cast<uint8_t *>(&result[result.length()])});
306
+ }
307
+ return std::make_pair(std::move(result), true);
308
+ } catch (std::exception const &e) {
309
+ return std::make_pair(std::string{"Error: "} + e.what(), false);
303
310
  } catch (winrt::hresult_error const &e) {
304
311
  return std::make_pair(
305
312
  "Error: " + Microsoft::Common::Unicode::Utf16ToUtf8(e.message().c_str(), e.message().size()), false);
@@ -10,7 +10,6 @@
10
10
  #include <winrt/Windows.Networking.Sockets.h>
11
11
  #include <atomic>
12
12
  #include <functional>
13
- #include <future>
14
13
  #include <memory>
15
14
  #include <string>
16
15
 
@@ -18,11 +18,26 @@ namespace Microsoft::React {
18
18
  struct IWebSocketModuleContentHandler {
19
19
  virtual ~IWebSocketModuleContentHandler() noexcept {}
20
20
 
21
+ /// Returns true if this handler should process messages for the given socket.
22
+ virtual bool CanHandleSocket(int64_t socketId) noexcept = 0;
23
+
21
24
  virtual void ProcessMessage(std::string &&message, winrt::Microsoft::ReactNative::JSValueObject &params) noexcept = 0;
22
25
 
23
26
  virtual void ProcessMessage(
24
27
  std::vector<uint8_t> &&message,
25
28
  winrt::Microsoft::ReactNative::JSValueObject &params) noexcept = 0;
29
+
30
+ /// Check CanHandleSocket() then ProcessMessage() in one call.
31
+ /// Returns true if the message was handled.
32
+ virtual bool TryProcessMessage(
33
+ int64_t socketId,
34
+ std::string &&message,
35
+ winrt::Microsoft::ReactNative::JSValueObject &params) noexcept = 0;
36
+
37
+ virtual bool TryProcessMessage(
38
+ int64_t socketId,
39
+ std::vector<uint8_t> &&message,
40
+ winrt::Microsoft::ReactNative::JSValueObject &params) noexcept = 0;
26
41
  };
27
42
 
28
43
  } // namespace Microsoft::React