github reactiveui/ReactiveUI 26.0.0

3 hours ago

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=true also 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 WhenActivated is now trim and AOT safe. It watches the view's ViewModel through the registered ICreatesObservableForProperty plugin, as the binding source generator does, instead of reflection. The [RequiresUnreferencedCode] attribute is gone from every view WhenActivated overload, including the WPF ones, so views that call this.WhenActivated(...) publish with Native AOT without trim warnings.
  • ReactiveUI.Binding is updated to 9.0.0. That release also fixes BindCommandUnsafe keeping bindings it had replaced (reactiveui/ReactiveUI.Binding.SourceGenerators#163).

🗞️ What's Changed

🐛 Fixes

🔗 Full Changelog: 25.1.1...26.0.0

🙌 Contributions

💖 Thanks to all the contributors: @glennawatson

Don't miss a new ReactiveUI release

NewReleases is sending notifications on new releases.