{{ message }}
Repository navigation
feat!: bring ReactiveUI.SourceGenerators with ReactiveUI.Core - #4516
Merged
Merged
Conversation
ReactiveUI.Core now references ReactiveUI.SourceGenerators 4.0.0 with PrivateAssets="none". ReactiveUI and ReactiveUI.Reactive both build on Core, so every consumer of either flavour gets the [Reactive], [ReactiveCommand], [ReactiveCollection], [BindableDerivedList] and [IReactiveObject] generators without installing the package. The generators detect the flavour the consumer references and write code against it. New integration tests use the attributes in the shared test source, so ReactiveUI.Tests and ReactiveUI.Tests.Reactive check the generated properties and commands against both flavours, together with ReactiveUI.Binding's WhenAnyValue and [ObservableAsProperty]. The README explains the package layout: the two flavours, ReactiveUI.Core bringing the source generators, ReactiveUI.Binding bringing bindings, and the platform packages. It opens with a view model built from the generators. Rodney Littles II and Colt Bauman move to the alumni team. BREAKING CHANGE: The ReactiveUI.SourceGenerators generators and analyzers now run in every project that references ReactiveUI or ReactiveUI.Reactive. A project that references an older ReactiveUI.SourceGenerators itself fails to restore with NU1605; remove that reference or move it to 4.0.0 or later.
4 tasks done
|
This was referenced Sep 26, 2026
glennawatson
added a commit
that referenced
this pull request
Sep 26, 2026
## Summary **ReactiveUI.Core now brings ReactiveUI.SourceGenerators 4.0.1.** - **The WinForms `[RoutedControlHost]` and `[ViewModelControlHost]` hosts work.** 4.0.1 stops the generated hosts from calling `WhenAny`, which threw at construction because no generated binding dispatch matched the call. Hosts declared in the global namespace, or nested in another type, now get their members on the right type. ## Why **4.0.0, which #4516 made a ReactiveUI.Core dependency, generated WinForms hosts that threw when constructed.** Every ReactiveUI consumer now gets the fixed generators. ## Breaking changes **None.** ## How this was verified **ReactiveUI.Core builds with warnings as errors, and the ReactiveUI tests, including the source generator integration tests, pass against 4.0.1.** ## Notes for the reviewer **One line in `src/Directory.Packages.props`.** ## 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 - [ ] New or changed public API has XML documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Every ReactiveUI project now gets the ReactiveUI.SourceGenerators generators, brought in through ReactiveUI.Core.
PrivateAssets="none". ReactiveUI and ReactiveUI.Reactive both depend on Core, so[Reactive],[ReactiveCommand],[ReactiveCollection],[BindableDerivedList]and[IReactiveObject]work in either flavour with no extra package.ReactiveUI.Reactive.ReactiveCommand<Unit, T>; a ReactiveUI project getsReactiveUI.ReactiveCommand<RxVoid, T>.WhenAnyValueand[ObservableAsProperty].Why
Source generators are the recommended way to write ReactiveUI view models, so they should arrive with ReactiveUI rather than as a separate install. ReactiveUI already brings ReactiveUI.Binding the same way.
Breaking changes
The ReactiveUI.SourceGenerators generators and analyzers now run in every project that references ReactiveUI or ReactiveUI.Reactive.
[ObservableAsProperty]and[IViewFor]to ReactiveUI.Binding. Code written against the 3.x attributes follows the ReactiveUI.SourceGenerators 4.0.0 release notes.How this was verified
The new tests cover generated properties and commands in both flavours. Scratch console apps against packed ReactiveUI and ReactiveUI.Reactive packages exercised every attribute, the README example and a NativeAOT publish. A Windows Forms app checked that the generator's host attributes compile next to ReactiveUI.Winforms' own
RoutedControlHostandViewModelControlHostcontrols.Notes for the reviewer
The code change is two lines of MSBuild; the rest is tests and README.
WhenAnyValuecannot observe a property the generators write from a[Reactive]field. ReactiveUI.Binding's generator cannot see that property, so the call throws at run time. The README tells readers to use the partial-property form; the fix belongs in ReactiveUI.Binding.[RoutedControlHost]and[ViewModelControlHost]hosts from ReactiveUI.SourceGenerators 4.0.0 throw when constructed. Their generated constructor callsWhenAny, and ReactiveUI.Binding writes no dispatch for a call inside another generator's output. This already affects anyone using those attributes with ReactiveUI 24; the fix belongs in ReactiveUI.SourceGenerators, so the README does not advertise them.Checklist