Microsoft’s Project Reunion: Win32 and UWP unite

Microsoft announced it is bringing Win32 and UWP together at last. How is it going to happen?

Microsoft’s Project Reunion: Win32 and UWP unite

Build 2020 saw Microsoft unveil “Project Reunion,” a set of technologies that aims to finally bring Windows’ divergent application development models together. It builds on the approach pioneered with WinUI 3 to merge the old familiar Win32 and the newer UWP (Universal Windows Platform), with support for desktop and store installers.

Where we are and how we got here

To understand what Microsoft is planning, it’s important to start with context about where we are and how we got here. It used to be easy to define a Windows application and understand how it was put together. The collection of SDKs, controls, and APIs that make up Win32 were an evolution of the old familiar Windows development model, from Windows NT to XP to Vista and Windows 7.

Then Windows 8 arrived, shaking up Windows development. Its modern application model owed much to a new generation of lightweight mobile apps that worked with fledgling cloud services to deliver experiences that crossed the boundaries between Web and device, between different operating systems and form factors. WinRT was a powerful tool, but it was different, working by new rules: To save power, apps wouldn’t run in the background, and when hibernating they could be terminated at any time if the system needed their resources.

Developers familiar with the old Windows way had to rethink code from scratch for the new platform, and many didn’t make the migration. If you were building apps for Windows 8, you had to choose between Windows Store WinRT code and Win32 code that felt as if it had been relegated to a lower desktop league. Even the desktop wasn’t the old familiar desktop. It was treated as an app and could be hibernated just like any WinRT app.

Windows 8.1 and Windows 10 aimed to change that way of working, bringing back the Start menu and moving away from the touch-centric Start screen, back to the familiar desktop. But there was still a wall between store apps and Win32, a wall that tools like Windows 10’s desktop bridge aimed to break down. In Windows 10, WinRT was now UWP, a cross-platform development model that mixed support for desktop apps with Xamarin.

Meanwhile the familiar .NET was changing too, with a systems-programming focused .NET Core slowly picking up APIs, moving to parity with the .NET Framework with a set of .NET Standard APIs that would simplify migrating code from one implementation of .NET to another.

The foundations of Project Reunion

Two key developments set the scene for merging UWP and Win32 into a single development framework. The first was the introduction of MSIX, a new installation format that mixed concepts from the long-lived MSI with the Windows Store’s APPX. MSIX apps aren’t limited to the store and can be delivered as stand-alone apps or through existing enterprise deployment tools. By separating app customization from installer files, MSIX ensures enterprise-deployed apps can be kept up to date without requiring repackaging with each new update. MSIX allows Win32 code to take advantage of the Windows 10 desktop bridge and use its isolation features to improve application security.

The second development was XAML Islands, a way to allow UWP controls to run in Windows 10 Win32 apps, with an option to use Win32 controls on older Windows platforms. That option has become less important with Windows 7 coming to end of life and retiring from many enterprise fleets. During the past couple of years the XAML Islands approach has evolved, leading to the separation of UI components from the Windows UWP SDKs and the birth of the portable WinUI 3.

That brings us to today and the launch of Project Reunion. Building on the ongoing erosion of walls between the two development approaches, it’s intended to give you a common way to access both Win32 and UWP APIs, shipping as a NuGet package hosting both libraries and bundled application components.

Decoupling the Windows SDKs from Windows

Project Reunion is taking a leaf from the WinUI book. Where WinUI 3 finally decouples UI components from the underlying SDK, allowing them to evolve more quickly where necessary, Project Reunion aims to do the same for Win32 and UWP APIs, separating them from the OS. That may well be the biggest change to Windows application development yet, with SDKs no longer tied to Windows releases. Windows 10 gave us new SDKs on a six-month cycle; this new approach will allow individual APIs to change as and when needed.

For this new decoupled approach to work, there will need to be changes to how applications are deployed. This is where MSIX will come in, allowing application components to be updated in the background without affecting users.

One key feature in Project Reunion is support for polyfills, code that will bring modern APIs to older, supported Windows versions. There’s a lot of work to be done here, providing translations and shims that will allow complex functions to be supported. However, it’s essential work, as we’ve learned from the Web where polyfills have allowed new features to roll out more quickly, supporting older browsers while still letting newer versions take advantage of built-in features.

You may not get the same performance running Project Reunion code on an older Windows release, but at least it will run. This will allow you to use it for software that runs on long-term-support releases, for Windows IoT hardware, without having to deliver version-specific code. Managing down-level support can hold back new releases, and this approach should allow you to keep updating your applications without compromising on new features.

The impossible takes a little longer: the Project Reunion roadmap

Microsoft has published an initial roadmap for Project Reunion. One thing is clear: Don’t expect a big bang update. With releases scheduled for the next few years, it’s clear that the best strategy is to stay the course with your current application development model, shifting first to WinUI 3 and then adding key merged APIs as necessary. Rewriting code from scratch is expensive in time and resources, something that Microsoft has recognized and is doing its best to mitigate the effects of change.

The first steps were announced at Build: a preview release of WinUI 3 for UWP and Win32, MSIX support for the Azure-hosted Windows Virtual Desktop, and a preview of the new Chromium-based WebView2 control that will update on a similar schedule to the new Edge. By the end of the year there will be a preview of more API support and further WinUI previews. There’s an ambitious aim for 2021 and beyond: multiple Project Reunion releases each year, with a focus initially on application compatibility along with new APIs.

Getting ready for Project Reunion

There are two tasks to start getting your code ready for Project Reunion. First, move to packaging and deploying as MSIX. Secondly, begin the process of migrating controls to WinUI. That’s easier in UWP, with WinUI 2 already available and WinUI 3 in preview. For Win32, begin with XAML Islands and start exploring WinUI 3. You should also start working with WebView2 where possible, to get the benefit of a Chromium-based Web control.

By building on existing projects, it’s clear that Project Reunion isn’t something brand new. Instead it’s part of a more considered approach, giving a name to a set of technologies that has been under development and in preview for the past few years. Where it goes beyond the current work is the point of finally separating the Windows OS from application SDKs, a change that’s been a long time coming.

Copyright © 2020 IDG Communications, Inc.