Skip to content

Remove legacy Coroutines TS compiler support - #16577

Merged
Vladimir Morozov (vmoroz) merged 1 commit into
microsoft:mainfrom
vmoroz:PR/remove-legacy-coroutine-fallbacks
Nov 5, 2026
Merged

Vladimir Morozov (vmoroz) merged 1 commit into
microsoft:mainfrom
vmoroz:PR/remove-legacy-coroutine-fallbacks

Conversation

@vmoroz

@vmoroz Vladimir Morozov (vmoroz) commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Description

Type of Change

Erase all that don't apply.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Why

C++20 is already required, and the remaining std::future coroutine returns were replaced in #16170. The legacy Coroutines TS build flags and experimental coroutine-handle fallback are no longer needed.

Related: #12331.

What

  • Standard coroutines. Remove /await from shared native build settings and test projects. Use std::coroutine_handle with an explicit <coroutine> include so every supported build uses the same coroutine implementation.
  • Build guidance. Document that native builds use C++20 coroutines and should not enable /await.

Screenshots

Not applicable; no UI changes.

Testing

All 1,786 native tests passed. The Desktop build, lint, formatting, and change-file checks passed. All affected New Architecture native projects built, but the full solution failed in the unchanged CsWinRT project's automatic Yarn restore: anonymous feed access to @microsoft/api-extractor@7.60.0 was rejected (YN0041).

Exact local commands and results
  • yarn lint:fix - passed.
  • yarn format - passed.
  • yarn beachball check --branch upstream/main --no-fetch - passed.
  • msbuild vnext\ReactWindows-Desktop.sln /t:React_Windows_Desktop_UnitTests /p:Configuration=Debug /p:Platform=x64 /p:CL_MPCount=4 /m:4 /nr:false /v:minimal - passed.
  • msbuild vnext\Microsoft.ReactNative.NewArch.sln /p:Configuration=Debug /p:Platform=x64 /p:CL_MPCount=4 /m:4 /nr:false /v:minimal - failed only at the CsWinRT restore described above; production RNW and both native test executables built.
  • vnext\target\x64\Debug\Mso.UnitTests\Mso.UnitTests.exe - passed, 1,267 tests.
  • vnext\target\x64\Debug\Microsoft.ReactNative.Cxx.UnitTests\Microsoft.ReactNative.Cxx.UnitTests.exe - passed, 365 tests.
  • vnext\target\x64\Debug\Microsoft.ReactNative.IntegrationTests\Microsoft.ReactNative.IntegrationTests.exe - passed, 149 tests.
  • vstest.console.exe vnext\target\x64\Debug\React.Windows.Desktop.UnitTests\React.Windows.Desktop.UnitTests.dll /TestCaseFilter:FullyQualifiedName~WinRTWebSocketResourceUnitTest /InIsolation "/Logger:trx;LogFileName=coroutine-websocket.trx" /ResultsDirectory:vnext\target\x64\Debug\TestResults\Coroutines - passed, all 5 WebSocket tests executed.

Changelog

Should this change be included in the release notes: no

Use C++20 standard coroutines without the legacy /await flag.

Microsoft Reviewers: Open in CodeFlow

Use C++20 coroutine handles consistently and remove obsolete /await flags from native projects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 04:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the migration from legacy Coroutines TS support to standard C++20 coroutines.

No open issues 🎉

What changed in this PR

Removes legacy Coroutines TS support from React Native Windows, aligning native builds with the existing C++20 requirement and the earlier replacement of std::future coroutine returns.

Changes:

  • Removes conditional /await flags from shared build settings and native projects.
  • Uses std::coroutine_handle unconditionally with an explicit <coroutine> include.
  • Documents standard coroutine usage and adds a prerelease change entry.
File Description
vnext/​Shared/​Networking/​WinRTWebSocketResource.h Replaces the experimental fallback with standard coroutine handles.
vnext/​PropertySheets/​React.Cpp.props Removes the shared legacy /await flag.
vnext/​Mso.UnitTests/​Mso.UnitTests.vcxproj Removes /await and its comment entry.
vnext/​Microsoft.ReactNative/​Microsoft.ReactNative.vcxproj Removes /await from the native runtime project.
vnext/​Microsoft.ReactNative.IntegrationTests/​Microsoft.ReactNative.IntegrationTests.vcxproj Removes /await and its comment entry.
vnext/​Microsoft.ReactNative.Cxx.UnitTests/​Microsoft.ReactNative.Cxx.UnitTests.vcxproj Removes /await from C++ unit tests.
vnext/​Desktop.UnitTests/​React.Windows.Desktop.UnitTests.vcxproj Removes /await from Desktop unit tests.
docs/​building-rnw.md Documents C++20 coroutines and advises against /await.
change/​react-native-windows-b2e3a4fc-d1d2-4f1d-b2b6-af7b5a170381.json Records the coroutine build change for prerelease versioning.

Review effort: Balanced

@vmoroz
Vladimir Morozov (vmoroz) merged commit bfa7a8e into microsoft:main Nov 5, 2026
32 checks passed
@vmoroz
Vladimir Morozov (vmoroz) deleted the PR/remove-legacy-coroutine-fallbacks branch November 5, 2026 22:05
Vladimir Morozov (vmoroz) added a commit that referenced this pull request Nov 7, 2026
Backport #16577, adapting the guarded compiler flags and WinRTWebSocketResource2 header while preserving Paper and Fabric behavior.

(cherry picked from commit bfa7a8e)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Vladimir Morozov (vmoroz) added a commit that referenced this pull request Nov 7, 2026
Backport #16577 without changing compiler requirements. Use a patch change file for the stable branch.

(cherry picked from commit bfa7a8e)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants