Skip to content

Enhance DI integration and update dependencies#57

Merged
ChrisPulman merged 6 commits intomainfrom
UpdateSplatAndReactiveUI
Jan 24, 2026
Merged

Enhance DI integration and update dependencies#57
ChrisPulman merged 6 commits intomainfrom
UpdateSplatAndReactiveUI

Conversation

@ChrisPulman
Copy link
Member

What kind of change does this PR introduce?

update

What is the current behavior?

Works with ReactiveUI 22.1.1

What is the new behavior?

Improves and documents extension methods for integrating ReactiveUI with various DI containers (Autofac, DryIoc, Microsoft DI, Ninject) in Avalonia applications. Updates test mocks to match expanded IDependencyResolver interface. Refactors and documents AppBuilderExtensions and related classes for clarity and extensibility. Updates dependencies: Avalonia to 11.3.11, Splat to 19.2.1, and ReactiveUI to 23.1.0-beta.1.

What might this PR break?

Splat Breaking changes

Registration of simple types now honours the contract when given and will not return an item registered with a contract when GetServices() is called.

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

Improves and documents extension methods for integrating ReactiveUI with various DI containers (Autofac, DryIoc, Microsoft DI, Ninject) in Avalonia applications. Updates test mocks to match expanded IDependencyResolver interface. Refactors and documents AppBuilderExtensions and related classes for clarity and extensibility. Updates dependencies: Avalonia to 11.3.11, Splat to 19.2.1, and ReactiveUI to 23.1.0-beta.1.
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.32%. Comparing base (621c0cd) to head (9b83919).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/ReactiveUI.Avalonia/AppBuilderExtensions.cs 50.00% 1 Missing ⚠️
src/ReactiveUI.Avalonia/AutoSuspendHelper.cs 80.00% 1 Missing ⚠️
...activeUI.Avalonia/AvaloniaCreatesCommandBinding.cs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
+ Coverage   59.86%   66.32%   +6.46%     
==========================================
  Files          16       16              
  Lines         715      582     -133     
  Branches      103       91      -12     
==========================================
- Hits          428      386      -42     
+ Misses        263      174      -89     
+ Partials       24       22       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ReactiveUI.Avalonia to newer Avalonia/Splat/ReactiveUI versions and refactors the Avalonia integration APIs (notably DI + builder setup), with corresponding test/mocking updates and extensive XML doc improvements.

Changes:

  • Update central package versions (Avalonia 11.3.11, Splat 19.2.1, ReactiveUI 23.1.0-beta.1).
  • Refactor AppBuilder integration APIs to use ReactiveUIBuilder callbacks and improve DI container integration + view registration.
  • Update bindings/activation helpers and unit tests to match updated ReactiveUI/Splat interfaces and behaviors.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/ReactiveUI.Avalonia/ViewModelViewHost.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/RoutedViewHost.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/ReactiveWindow.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/ReactiveUserControl.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/ReactiveUI.Avalonia.csproj Adds many project-level global usings to replace per-file usings.
src/ReactiveUI.Avalonia/AvaloniaScheduler.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/AvaloniaObjectReactiveExtensions.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/AvaloniaObjectObservableForProperty.cs Doc comment updates; minor helper doc added.
src/ReactiveUI.Avalonia/AvaloniaCreatesCommandBinding.cs Refactors command binding API; adds new overloads and documentation.
src/ReactiveUI.Avalonia/AvaloniaActivationForViewFetcher.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/AutoSuspendHelper.cs Switches to RxSuspension.SuspensionHost; doc updates.
src/ReactiveUI.Avalonia/AutoDataTemplateBindingHook.cs Doc comment updates; relies on new global usings.
src/ReactiveUI.Avalonia/AppBuilderExtensions.cs Refactors ReactiveUI setup/DI integration + view registration surface.
src/ReactiveUI.Avalonia.Tests/UseReactiveUIWithDIContainerTests.cs Updates dummy resolver + call sites for new DI/builder signatures.
src/ReactiveUI.Avalonia.Tests/AvaloniaCreatesCommandBindingTests.cs Updates tests to new generic binding APIs and nullability.
src/ReactiveUI.Avalonia.Tests/AutoSuspendHelperTests.cs Updates to RxSuspension.SuspensionHost.
src/ReactiveUI.Avalonia.Tests/AutoDataTemplateBindingHookTests.cs Initializes builder state explicitly before hooks run.
src/ReactiveUI.Avalonia.Tests/AppBuilderExtensionsTests.cs Updates to new UseReactiveUI signature.
src/ReactiveUI.Avalonia.Ninject/AvaloniaMixins.cs Updates DI integration method signature/docs to match new builder pattern.
src/ReactiveUI.Avalonia.Microsoft1.Tests/AvaloniaMixinsMicrosoftTests.cs Updates dummy resolver + call sites for new DI/builder signatures.
src/ReactiveUI.Avalonia.Microsoft.Extensions.DependencyInjection/AvaloniaMixins.cs Updates DI integration method signature/docs to match new builder pattern.
src/ReactiveUI.Avalonia.DryIoc1.Tests/AvaloniaMixinsDryIocTests.cs Updates call sites and contract-related registration expectations.
src/ReactiveUI.Avalonia.DryIoc1.Tests/AvaloniaMixinsDryIocMoreTests.cs Updates call sites for new DI/builder signatures.
src/ReactiveUI.Avalonia.DryIoc/AvaloniaMixins.cs Updates DI integration method signature/docs to match new builder pattern.
src/ReactiveUI.Avalonia.Autofac/AvaloniaMixins.cs Updates DI integration method signature/docs to match new builder pattern.
src/Directory.Packages.props Central version bumps for Avalonia/Splat/ReactiveUI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 29 to 30
public static AppBuilder UseReactiveUI(this AppBuilder builder, Action<ReactiveUIBuilder> withReactiveUIBuilder)
{
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public API change: the parameterless UseReactiveUI(this AppBuilder builder) overload appears to have been removed, and UseReactiveUIWithDIContainer now requires an extra configureReactiveUI argument. If maintaining source compatibility is important for this package, consider reintroducing overloads that preserve the previous signatures (delegating to the new implementations with a no-op callback).

Copilot uses AI. Check for mistakes.
Refactored AutoSuspendHelperTests setup to use ReactiveUIBuilder and WithSuspensionHost for improved test isolation. Updated AppBuilderExtensions to chain WithSuspensionHost<Unit>() in the builder configuration.
Method signatures in AvaloniaCreatesCommandBinding.cs have been reformatted to use multi-line parameter lists for improved readability. The BindCommandToObject overload with custom event handlers now returns Disposable.Empty instead of throwing NotImplementedException.
Corrected the summary comment in the ReactiveWindow constructor to fix a line break and improve readability.
Corrected a line break in the XML documentation comment for the RoutedViewHost constructor to improve readability and maintain consistency.
Removed an unnecessary period at the end of the first sentence in the XML documentation for the ViewModelViewHost constructor to improve consistency and style.
@ChrisPulman ChrisPulman enabled auto-merge (squash) January 24, 2026 12:07
@ChrisPulman ChrisPulman merged commit 49a1bbf into main Jan 24, 2026
4 checks passed
@ChrisPulman ChrisPulman deleted the UpdateSplatAndReactiveUI branch January 24, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants