-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Upgrade to Visual Studio 2026 #16170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JunielKatarn
wants to merge
11
commits into
microsoft:main
Choose a base branch
from
jurocha-ms:vs18
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b3d694d
Update deps script. TODO: test
JunielKatarn cbd83c4
Upgrade rnw-deps to .NET 10
JunielKatarn d8f3b11
Defer findPowershell to layoutMSRNCxx
JunielKatarn 0965aa3
Upgrade VS version to 18.6.1
JunielKatarn 1c486a3
Merge branch 'main' of github.com:microsoft/react-native-windows into…
JunielKatarn 579a76f
Drop /async in MSVC 14.5
JunielKatarn ed2d572
Replace std::future coroutines with WinRT types
JunielKatarn bc0863a
clang format
JunielKatarn 3fa3412
Change files
JunielKatarn 34c4be4
Drop Windows10SDK.19041
JunielKatarn 01b54cf
Change files
JunielKatarn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@react-native-windows-cli-543cf36f-0ce7-4df7-a391-285985d3f62c.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Upgrade to Visual Studio 2026", | ||
| "packageName": "@react-native-windows/cli", | ||
| "email": "julio.rocha@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-2a20c629-48b2-458d-80e6-26b5546c04e0.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Upgrade to Visual Studio 2026", | ||
| "packageName": "react-native-windows", | ||
| "email": "julio.rocha@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,6 @@ | |
| #include <cxxreact/MessageQueueThread.h> | ||
| #pragma warning(pop) | ||
|
|
||
| #include <future> | ||
| #include <mutex> | ||
|
|
||
| #include <AppModel.h> | ||
|
|
@@ -47,7 +46,9 @@ using namespace facebook::react; | |
|
|
||
| namespace Microsoft::ReactNative { | ||
|
|
||
| std::future<std::pair<std::string, bool>> GetJavaScriptFromServerAsync(const std::string &url) { | ||
| winrt::Windows::Foundation::IAsyncAction GetJavaScriptFromServerAsync( | ||
| const std::string &url, | ||
| std::pair<std::string, bool> &result) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same here. We must not use the out parameters with async functions. |
||
| winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter filter; | ||
| filter.CacheControl().ReadBehavior(winrt::Windows::Web::Http::Filters::HttpCacheReadBehavior::NoCache); | ||
| winrt::Windows::Web::Http::HttpClient httpClient(filter); | ||
|
|
@@ -61,8 +62,9 @@ std::future<std::pair<std::string, bool>> GetJavaScriptFromServerAsync(const std | |
| try { | ||
| winrt::Windows::Web::Http::HttpResponseMessage response = co_await asyncRequest; | ||
| } catch (winrt::hresult_error const &e) { | ||
| co_return std::make_pair( | ||
| Microsoft::Common::Unicode::Utf16ToUtf8(e.message().c_str(), e.message().size()).c_str(), false); | ||
| result = | ||
| std::make_pair(Microsoft::Common::Unicode::Utf16ToUtf8(e.message().c_str(), e.message().size()).c_str(), false); | ||
| co_return; | ||
| } | ||
| #else | ||
| co_await lessthrow_await_adapter<winrt::Windows::Foundation::IAsyncOperationWithProgress< | ||
|
|
@@ -77,7 +79,8 @@ std::future<std::pair<std::string, bool>> GetJavaScriptFromServerAsync(const std | |
| } else { | ||
| error = fmt::format("Error 0x{:x} downloading {}.", static_cast<int>(asyncRequest.ErrorCode()), url); | ||
| } | ||
| co_return std::make_pair(error, false); | ||
| result = std::make_pair(error, false); | ||
| co_return; | ||
| } | ||
|
|
||
| winrt::Windows::Web::Http::HttpResponseMessage response = asyncRequest.GetResults(); | ||
|
|
@@ -88,20 +91,20 @@ std::future<std::pair<std::string, bool>> GetJavaScriptFromServerAsync(const std | |
|
|
||
| reader.UnicodeEncoding(winrt::Windows::Storage::Streams::UnicodeEncoding::Utf8); | ||
| uint32_t len = reader.UnconsumedBufferLength(); | ||
| std::string result; | ||
| std::string resultStr; | ||
| if (len > 0 || response.IsSuccessStatusCode()) { | ||
| std::string data; | ||
| data.resize(len); | ||
| auto buf = reinterpret_cast<uint8_t *>(data.data()); | ||
| static_assert( | ||
| sizeof(buf[0]) == sizeof(data[0]), "perf optimization relies on uint8_t and char being the same size"); | ||
| reader.ReadBytes(winrt::array_view(buf, buf + len)); | ||
| result = std::move(data); | ||
| resultStr = std::move(data); | ||
| } else { | ||
| result = fmt::format("HTTP Error {} downloading {}.", static_cast<int>(response.StatusCode()), url); | ||
| resultStr = fmt::format("HTTP Error {} downloading {}.", static_cast<int>(response.StatusCode()), url); | ||
| } | ||
|
|
||
| co_return std::make_pair(std::move(result), response.IsSuccessStatusCode()); | ||
| result = std::make_pair(std::move(resultStr), response.IsSuccessStatusCode()); | ||
| } | ||
|
|
||
| void LaunchDevTools(const facebook::react::DevSettings &settings) { | ||
|
|
@@ -185,7 +188,8 @@ std::string GetPackageName(const std::string &bundleAppId) { | |
| return packageName; | ||
| } | ||
|
|
||
| std::future<winrt::Windows::Web::Http::HttpStatusCode> PollForLiveReload(const std::string &url) { | ||
| winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Web::Http::HttpStatusCode> PollForLiveReload( | ||
| const std::string &url) { | ||
| winrt::Windows::Web::Http::HttpClient httpClient; | ||
| winrt::Windows::Foundation::Uri uri(Microsoft::Common::Unicode::Utf8ToUtf16(url)); | ||
| httpClient.DefaultRequestHeaders().Connection().TryParseAdd(L"keep-alive"); | ||
|
|
@@ -299,7 +303,9 @@ std::pair<std::string, bool> GetJavaScriptFromServer( | |
| inlineSourceMap, | ||
| hermesBytecodeVersion); | ||
| try { | ||
| return GetJavaScriptFromServerAsync(bundleUrl).get(); | ||
| std::pair<std::string, bool> result; | ||
| GetJavaScriptFromServerAsync(bundleUrl, result).get(); | ||
| return result; | ||
| } catch (winrt::hresult_error const &e) { | ||
| return std::make_pair( | ||
| "Error: " + Microsoft::Common::Unicode::Utf16ToUtf8(e.message().c_str(), e.message().size()), false); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not look safe if someone would want to use it without thread lock. If we want to keep this function async, then it is better to use IAsyncOperation with hstring.