github reactiveui/ReactiveUI 25.0.0

latest release: 25.0.1
3 hours ago

Summary

ReactiveUI 25.0.0 is a major version. Binding moves to a source-generator-first library, the ReactiveUI source generators now come with every install, and the documentation has been rebuilt. Most apps that use ReactiveObject and the usual binding calls keep compiling, but read the breaking changes below before you upgrade.

Binding moves to ReactiveUI.Binding

  • Property observation and binding now run on ReactiveUI.Binding. It generates the code at build time, so it works with trimming and NativeAOT.
  • WhenAny*, WhenAnyValue, ObservableForProperty, Bind, OneWayBind, BindTo, BindCommand, InvokeCommand, BindInteraction, ToProperty and ObservableAsPropertyHelper<T> keep their names. They now come from ReactiveUI.Binding, which ReactiveUI brings in for you. Existing using ReactiveUI; code keeps compiling.
  • If the generator cannot read a property path, use the matching ...Unsafe overload.
  • ReactiveUI's old reflection-based observation and binding engine is removed. That is about 190,000 fewer lines, and far fewer trimming warnings.
  • View location, view hosts, templates, routing, activation and validation presentation stay in ReactiveUI.
  • The default view hosts on WPF, WinForms, WinUI, MAUI, Apple and Android find views without reflection and are AOT safe. Each has an ...Unsafe twin that also asks the service locator.
  • Routing reports navigation through plain observables of values.
  • The migration guide lists the removed types, the behaviour changes and what to change in your code.

Source generators come with ReactiveUI

  • ReactiveUI.Core now brings ReactiveUI.SourceGenerators. Both ReactiveUI and ReactiveUI.Reactive depend on Core, so every project gets the generators with no extra package.
  • [Reactive], [ReactiveCommand], [ReactiveCollection], [BindableDerivedList] and [IReactiveObject] generate your view model properties and commands at build time. This is now the recommended way to write view models.
  • If your project references an older ReactiveUI.SourceGenerators package directly, restore fails with NU1605. Remove that reference, or move it to 4.0.0 or later.
  • [ObservableAsProperty] and [IViewFor] now come from ReactiveUI.Binding.

New documentation and examples

  • The documentation website at https://reactiveui.net/documentation/reactiveui and its related pages have been rewritten.
  • src/examples/Documentation has a runnable example for every public class and method, one project per website page. The website quotes these examples, and each one checks its printed output, so the docs stay in step with the code.
  • Platform examples cover WPF, WinForms, WinUI, MAUI, Blazor, Android and Apple.
  • These examples replace the old reactiveui/ReactiveUI.Samples repository, which is now archived.

Known issues

  • Interaction.Handle returns Task<TOutput> instead of IObservable<TOutput>. This change was not intended.

Other changes

  • Many bug fixes across Android, Apple, MAUI, WPF, WinUI, routing, suspension, the app builder and ReactiveRecord. The full list is below.
  • Android and iOS device tests now run through dotnet test --device.

๐Ÿ—ž๏ธ What's Changed

๐Ÿ’ฅ Breaking Changes

๐Ÿ› Fixes

๐Ÿงน General Changes

โœ… Tests

๐Ÿ“ Documentation

๐Ÿ”— Full Changelog: 24.3.0...25.0.0

๐Ÿ™Œ Contributions

๐Ÿ’– Thanks to all the contributors: @glennawatson

Don't miss a new ReactiveUI release

NewReleases is sending notifications on new releases.