3.0.260520.1 #1580
DefaultRyan
announced in
Announcements
3.0.260520.1
#1580
Replies: 1 comment
-
|
Can anyone provide a fully-working winui 3 project (with absolute minimal changes to the visual studio default project templates) using modules? Preferably all toolchain should be in official release version, not preview version. I am having difficulty to transform my project. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Major additions and breaking changes
In addition to the usual bugfixes and enhancements, this first 3.0 release contains two major updates: support for C++20 modules, and support for deprecated pre-standard coroutines has been removed.
Removing pre-standard coroutines
C++/WinRT has removed support for the pre-standard coroutines via the
/awaitcompiler option and the<experimental/coroutine>header. This aligns with the new behavior in the MSVC Build Tools 14.50 (shipping in Visual Studio 2026) that officially deprecated/await, and will soon deprecate the experimental headers. Standard coroutines are available by default starting in C++20, or if you are still on C++17, use/await:strict.If your existing projects are using the Nupkg support out of the box and have not manually added
/await, you probably won't have to change anything, as we've updated the default behavior inMicrosoft.Windows.CppWinRT.targetsto use/await:strictwhen building with C++17. If for some reason, you need to override this default behavior in the targets file, you can setCppWinRTEnableCpp17Coroutinestofalseto prevent it from auto-setting/await:strict.Module support
Full module support has finally arrived to C++/WinRT! Replace
with
import winrt.Windows.Foundation;and rejoice!
This brings potential improvements in build speed, disk space, and memory usage, particularly for large projects using Xaml projections, and starts to isolate more of the internal C++/WinRT implementation details from the consumer side. Test-driving this work on a quick and dirty prototype fork of Windows Terminal yielded a 10-15% build speed improvement (22 minutes before, 19 minutes after), and a reduction in disk space from 30GB down to 18GB.
If you've ever used C++/WinRT with
Windows.UI.Xaml.*, you've probably moved those headers into your precompiled header (PCH), but then saw your PCH consume well upwards of 1-2GB of disk space per vcxproj, per flavor. In the Terminal prototype, taking these headers out of the PCH and replacing them with a single cppwinrt module, built once and shared between projects, the PCHs shrunk by upwards of 80%, and the time to build each PCH went from ~40 seconds down to ~5 seconds. The single prebuilt cppwinrt modules carried all of the types for the entire Windows.* namespaces and WinUI, and still consumed only 700MB, and took ~80-90 seconds to build. Excluding unused namespaces from the module build can lower those numbers even further. The Terminal prototype didn't do this, and still enjoyed immediate wins on disk space, and the build time wins broke even after converting about 2-3 projects out of the ~15 or so that use C++/WinRT.As part of this large effort, we no longer generate the old monolithic module interface file
winrt.ixx, but instead generate a module interface.ixxfile for each WinRT namespace. There is more documentation at nuget/modules/md to help get you started.What's changed
New Contributors
Full Changelog: 2.0.250303.1...3.0.260520.1
This discussion was created from the release 3.0.260520.1.
Beta Was this translation helpful? Give feedback.
All reactions