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,ToPropertyandObservableAsPropertyHelper<T>keep their names. They now come from ReactiveUI.Binding, which ReactiveUI brings in for you. Existingusing ReactiveUI;code keeps compiling.- If the generator cannot read a property path, use the matching
...Unsafeoverload. - 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
...Unsafetwin 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/Documentationhas 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.HandlereturnsTask<TOutput>instead ofIObservable<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
- 37fa90a feat!: run property observation and binding on ReactiveUI.Binding (#4475) @glennawatson
- aba5bb2 feat!: bring ReactiveUI.SourceGenerators with ReactiveUI.Core (#4516) @glennawatson
- b0262cf refactor(builder)!: remove BuilderMixins members shadowed by IReactiveUIBuilder (#4498) @glennawatson
- 2a59e1d feat(routing)!: report navigation through plain observables of values (#4497) @glennawatson
- e267cca fix(winui)!: build the default item template without XAML type lookup (#4496) @glennawatson
- 6def5a6 fix!: make every default view host AOT safe on Binding 8.1.0 (#4505) @glennawatson
๐ Fixes
- 1a39846 fix(maui): navigate from an empty RoutedViewHost and follow ViewModelViewHost contract changes (#4493) @glennawatson
- a579b33 fix(android): stop ServiceBound disposing the caller's context (#4514) @glennawatson
- a4baf2a fix: close first-read race in RxState, RxSuspension and RxCacheSize (#4519) @glennawatson
- f0074d3 fix(android): raise the view model change when it is set through IViewFor (#4513) @glennawatson
- 037a0f2 fix(android): return the display rotation from PlatformOperations.GetOrientation (#4495) @glennawatson
- 8eceb3c fix(apple): ignore lifecycle callbacks that arrive after dispose (#4523) @glennawatson
- 76926d8 fix(reactiverecord): keep notification state out of derived record ToString and equality (#4482) @glennawatson
- a9fb343 fix(routing): deliver scheduled notifications in order so Navigate returns its view model (#4484) @glennawatson
- 3d470f9 fix(android): skip the layout host's own View in opt-out wire-up (#4512) @glennawatson
- 8dcabad fix: honour ViewContract in WinUI ViewModelViewHost and add ReactiveWindowController (#4527) @glennawatson
- de754f8 fix(suspension): keep the suspension driver and pending load per host (#4483) @glennawatson
- 8ebe4a1 fix(wpf): raise TransitionCompleted once per transition (#4485) @glennawatson
- edc6355 fix(builder): keep the view locator's mappings and leave global state alone on a second build (#4490) @glennawatson
๐งน General Changes
- c9645bb build(deps): bump ReactiveUI.Binding to 8.3.0 (#4520) @glennawatson
- b049aa5 build(deps): bump TUnit to 1.69.16 (#4500) @glennawatson
- d86f9e5 build(deps): bump ReactiveUI.SourceGenerators to 4.2.0 (#4524) @glennawatson
- c6fa7ea build(deps): bump ReactiveUI.SourceGenerators to 4.0.1 (#4518) @glennawatson
- ec21eda build(deps): bump ReactiveUI.SourceGenerators to 4.1.0 (#4521) @glennawatson
- 92d5953 build(deps): bump ReactiveUI.Binding to 8.2.0 (#4515) @glennawatson
- 32746d8 build(deps): bump ReactiveUI.Binding to 8.4.0 (#4525) @glennawatson
- 1fcd23c chore: Delete .github/CODEOWNERS @glennawatson
โ Tests
- dde34a2 test: add Android and iOS device tests run through dotnet test --device (#4506) @glennawatson
- f3c4b26 test: finish each dispatcher-thread test only after its teardown (#4501) @glennawatson
- 21fb115 test(wpf): stop the TransitioningContentControl tests waiting on WPF's render loop (#4499) @glennawatson
๐ Documentation
- 66e73a4 docs: add runnable documentation examples for the public API (#4503) @glennawatson
- 8ba04db docs(readme): add a Sponsors section @glennawatson
- 04209a0 docs: examples for the remaining public API, including Apple platforms (#4526) @glennawatson
- bbe16fa docs(examples): show default and Unsafe view hosts after #4505 (#4507) @glennawatson
๐ Full Changelog: 24.3.0...25.0.0
๐ Contributions
๐ Thanks to all the contributors: @glennawatson