Repository navigation
Commit 37fa90a
authored
feat!: run property observation and binding on ReactiveUI.Binding (#4475)
## Summary
ReactiveUI's property observation and binding now run on
ReactiveUI.Binding and its source generator. View location, view hosts,
templates, routing, activation and validation presentation stay in
ReactiveUI.
- `WhenAny*`, `WhenAnyValue`, `ObservableForProperty`, `Bind`,
`OneWayBind`, `BindTo`, `BindCommand`, `InvokeCommand`,
`BindInteraction` and `ToProperty` come from `ReactiveUI.Binding`. Most
calls are generated at build time, and an `...Unsafe` overload covers a
path the generator cannot read.
- `ObservableAsPropertyHelper<T>` and `ToProperty` are generated by
ReactiveUI.Binding, with the same public members.
- `ReactiveUI` depends on `ReactiveUI.Binding` 7.8.0, and
`ReactiveUI.Reactive` on `ReactiveUI.Binding.Reactive`. The generator,
analyzer and build props flow to consuming projects. The WPF, WinForms
and MAUI packages bring the matching Binding platform package.
- Packaged build props add the Binding namespace and keep ReactiveUI's
view locator authoritative, so existing `using ReactiveUI;` code keeps
compiling.
- ReactiveUI's own reflection-based engine is removed: `Reflection`, the
expression helpers, the observation providers, the platform command
binders, the binder implementations, the Apple `NSDate` converters and
the `TypeDescriptor` fallback converter.
- ReactiveUI's hand-written `IReactiveObject` hosts and platform base
types raise `PropertyChanged` for any subscriber, because generated
observation listens to that event.
- `ReactiveUI`, `ReactiveUI.Reactive`, `ReactiveUI.Core`,
`ReactiveUI.Routing` and `ReactiveUI.Drawing` target only the frameworks
they have platform code for. Consumers on the dropped targets resolve
the plain .NET build, which is the same code.
- The README links to the [migration
guide](https://reactiveui.net/documentation/upgrading/reactiveui-binding-migration),
which explains what to change and what behaves differently.
## Why
ReactiveUI kept two engines for the same job: its own reflection-based
observation and binding, and ReactiveUI.Binding, which generates the
code at build time and runs under trimming and NativeAOT. Keeping one
engine removes about 190,000 lines and the reflection paths that needed
trimming attributes.
## Breaking changes
- The removed types listed under "Removed types" in the [migration
guide](https://reactiveui.net/documentation/upgrading/reactiveui-binding-migration)
are gone. The binding methods keep their names and come from
`ReactiveUI.Binding`.
- `Interaction.Handle` returns `Task<TOutput>` instead of
`IObservable<TOutput>`.
- A type that implements `IReactiveObject` by hand raises
`PropertyChanged` only after `SubscribePropertyChangedEvents()`. The
migration guide shows the event accessor to use. Types deriving from
`ReactiveObject` need nothing.
- Behavioural differences: converters are chosen by declared type, and a
conversion delegate cannot refuse a value. Every binding writes on the
thread that owns the view. A broken view-model path leaves the view's
value in place. The migration guide lists them all.
## How this was verified
The full test suite runs against the released ReactiveUI.Binding 7.8.0
on Linux and on real Windows, including the WPF, WinForms, WinUI and
MAUI projects. Tests of the removed engine are gone, and integration
tests cover the replacement. The full solution also builds on Windows
with the Apple and WinUI targets. A NativeAOT console consumer of the
packed packages publishes with no trim or AOT warnings and runs.
## Notes for the reviewer
Most of the diff is deletion of the old engine and its tests, and
regenerated public API baselines; those are safe to skim. Start with
`src/ReactiveShim.props`, the packaged `buildTransitive` props, and
`src/Directory.Packages.props` for how Binding reaches consumers. Then
read the platform base types' event accessors and the WinForms hosts.
The target framework changes are in `src/Directory.Build.props` and the
five project files; the dropped targets compiled no code of their own.
The user-facing summary is the [migration
guide](https://reactiveui.net/documentation/upgrading/reactiveui-binding-migration),
in reactiveui/website#999.
## Checklist
- [x] I have read the [Contribute
guide](https://www.reactiveui.net/contribute/index.html)
- [x] The PR title follows [Conventional
Commits](https://www.conventionalcommits.org/)
- [x] Tests cover this change, or the summary says why they do not
- [x] New or changed public API has XML documentation1 parent 8ba04db commit 37fa90a
852 files changed
Lines changed: 5978 additions & 202998 deletions
File tree
- src
- ReactiveUI.AndroidX.Reactive/PublicAPI
- net10.0-android36.0
- net11.0-android37
- ReactiveUI.AndroidX
- PublicAPI
- net10.0-android36.0
- net11.0-android37
- ReactiveUI.Blazor.Reactive/PublicAPI
- net10.0
- net11.0
- net8.0
- net9.0
- ReactiveUI.Blazor/PublicAPI
- net10.0
- net11.0
- net8.0
- net9.0
- ReactiveUI.Core
- Bindings
- Command
- Converters
- Converter
- Property
- Internal
- Reactive
- EventHandlers
- Expression
- Interactions
- Interfaces
- Mixins
- ObservableForProperty
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- net11.0
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0
- net9.0-windows10.0.19041.0
- net9.0
- View
- ReactiveUI.Drawing.Reactive
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- ReactiveUI.Drawing
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- net11.0
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0
- net9.0-windows10.0.19041.0
- net9.0
- ReactiveUI.Maui.Reactive
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- ReactiveUI.Maui
- Builder
- Common
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- WinUI
- ReactiveUI.Reactive
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- net11.0
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0
- net9.0-windows10.0.19041.0
- net9.0
- buildTransitive
- ReactiveUI.Routing
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- net11.0
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0
- net9.0-windows10.0.19041.0
- net9.0
- ReactiveUI.Testing/PublicAPI
- net10.0
- net11.0
- net462
- net472
- net481
- net8.0
- net9.0
- ReactiveUI.WinUI.Reactive
- PublicAPI
- net10.0-windows10.0.19041.0
- net11.0-windows10.0.19041.0
- net8.0-windows10.0.19041.0
- net9.0-windows10.0.19041.0
- ReactiveUI.WinUI
- Builder
- PublicAPI
- net10.0-windows10.0.19041.0
- net11.0-windows10.0.19041.0
- net8.0-windows10.0.19041.0
- net9.0-windows10.0.19041.0
- ReactiveUI.Winforms.Reactive
- PublicAPI
- net10.0-windows10.0.19041.0
- net10.0-windows
- net11.0-windows10.0.19041.0
- net11.0-windows
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0-windows
- net9.0-windows10.0.19041.0
- net9.0-windows
- ReactiveUI.Winforms
- Builder
- PublicAPI
- net10.0-windows10.0.19041.0
- net10.0-windows
- net11.0-windows10.0.19041.0
- net11.0-windows
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0-windows
- net9.0-windows10.0.19041.0
- net9.0-windows
- ReactiveUI.Wpf.Reactive
- PublicAPI
- net10.0-windows10.0.19041.0
- net10.0-windows
- net11.0-windows10.0.19041.0
- net11.0-windows
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0-windows
- net9.0-windows10.0.19041.0
- net9.0-windows
- buildTransitive
- ReactiveUI.Wpf
- PublicAPI
- net10.0-windows10.0.19041.0
- net10.0-windows
- net11.0-windows10.0.19041.0
- net11.0-windows
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0-windows
- net9.0-windows10.0.19041.0
- net9.0-windows
- buildTransitive
- ReactiveUI
- Platforms
- android
- apple-common
- Converters
- ios
- mac
- net
- tvos
- uikit-common
- PublicAPI
- net10.0-android36.0
- net10.0-ios
- net10.0-maccatalyst
- net10.0-macos
- net10.0-tvos
- net10.0-windows10.0.19041.0
- net10.0
- net11.0-android37
- net11.0-ios
- net11.0-maccatalyst
- net11.0-macos
- net11.0-tvos
- net11.0-windows10.0.19041.0
- net11.0
- net462
- net472
- net481
- net8.0-windows10.0.19041.0
- net8.0
- net9.0-windows10.0.19041.0
- net9.0
- buildTransitive
- benchmarks/ReactiveUI.Benchmarks
- examples
- Documentation
- Common
- Controls
- GitHub
- Todo
- Pages
- commands
- data-binding
- interactions
- routing
- view-location
- view-models
- when-activated
- ReactiveUI.Builder.BlazorServer/ViewModels
- ReactiveUI.Samples.Maui
- ReactiveUI.Samples.Winforms
- tests
- ReactiveUI.AOTTests
- ReactiveUI.Blazor.Tests
- ReactiveUI.Builder.Maui.Tests
- ReactiveUI.Builder.Tests
- Mixins
- Platforms/Blazor
- ReactiveUI.Maui.Tests
- ReactiveUI.NonParallel.Mobile.Tests/Platforms
- AndroidX
- cocoa
- ReactiveUI.Routing.Tests
- WhenAny
- ReactiveUI.Splat.Tests
- ReactiveUI.TestGuiMocks/CommonGuiMocks/Mocks
- ReactiveUI.Testing.Tests
- ReactiveUI.Tests.Reactive
- ReactiveUI.Tests
- Activation
- Bindings
- CommandBindings
- Converters
- PropertyBindings
- Property
- Mocks
- Unit
- TypeConverters
- CommandBinding
- Commands
- Core
- Expressions
- InteractionBinding
- Interactions
- Locator
- Mixins
- Mocks
- ObservableAsPropertyHelper
- Mocks
- ObservableForProperty
- ObservedChanged
- ReactiveObjects
- Resolvers
- WhenAny
- ReactiveUI.WinForms.Tests
- winforms
- Mocks
- ReactiveUI.WinUI.Tests/WinUI
- Mocks
- ReactiveUI.Wpf.Tests.Reactive
- ReactiveUI.Wpf.Tests
- Wpf
- Xaml
- Mocks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
208 | 216 | | |
209 | 217 | | |
210 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
119 | | - | |
| 118 | + | |
| 119 | + | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
106 | 120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
0 commit comments