Summary
ReactiveUI 26.0.0 is a major version because the .NET 11 assemblies are built without runtime-async. The public API does not change.
Why runtime-async is off
- In .NET 10 and older, the C# compiler adds a state machine to each async method. The state machine stores the local variables and tracks where to resume after each
await. - .NET 11 adds a feature called runtime-async. The runtime does this work instead, so async code can run faster.
- ReactiveUI 25.x built the .NET 11 assemblies with runtime-async on. The .NET 8 to 10 and .NET Framework assemblies never used it.
- The feature needs a runtime that supports it. CoreCLR does, and Mono does not.
- Blazor WebAssembly runs on Mono unless you opt into CoreCLR. Avalonia's browser apps, WASI, Android API levels 21 to 23, and apps that set
UseMonoRuntime=truealso run on Mono. - ReactiveUI built with runtime-async can fail in every app that runs on Mono.
- A NuGet package ships one build for every runtime, so ReactiveUI leaves the feature off. This matches ReactiveUI.Binding 9.0.0 and Refit 16.0.0.
- Apps that target .NET 10 or older are not affected. Apps on .NET 11 that run on CoreCLR do not get the speed gain inside ReactiveUI's own async code.
- You can turn on runtime-async in your own app if it runs only on CoreCLR.
Other changes
- View
WhenActivatedis now trim and AOT safe. It watches the view'sViewModelthrough the registeredICreatesObservableForPropertyplugin, as the binding source generator does, instead of reflection. The[RequiresUnreferencedCode]attribute is gone from every viewWhenActivatedoverload, including the WPF ones, so views that callthis.WhenActivated(...)publish with Native AOT without trim warnings. - ReactiveUI.Binding is updated to 9.0.0. That release also fixes
BindCommandUnsafekeeping bindings it had replaced (reactiveui/ReactiveUI.Binding.SourceGenerators#163).
🗞️ What's Changed
🐛 Fixes
- 264b88c fix: make view WhenActivated trim and AOT safe; build without runtime-async (#4532) @glennawatson
🔗 Full Changelog: 25.1.1...26.0.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson