Skip to content

Conversation

ChrisPulman
Copy link
Member

What kind of change does this PR introduce?

update

What is the current behavior?

System.Reactive.Disposables.DisposeWith is a feature within ReactiveUI

What is the new behavior?

This pull request primarily updates the way disposable extension methods are referenced and used throughout the codebase. It removes the local implementation of DisposeWith and instead relies on the upstream System.Reactive.Disposables.Fluent package, which is now imported via global usings. Additionally, it updates some package versions and cleans up unnecessary using directives in test files.

Dependency and API usage updates:

  • Removed the local DisposableMixins implementation (DisposeWith extension method) from DisposableMixins.cs since this functionality is now provided by System.Reactive.Disposables.Fluent.
  • Added System.Reactive.Disposables.Fluent to global usings in GlobalUsings.cs for ReactiveUI, ReactiveUI.Maui, and ReactiveUI.AOTTests, enabling the use of DisposeWith throughout the codebase without explicit imports. [1] [2] [3]

Code cleanup:

  • Removed redundant or unnecessary using directives from multiple test files in ReactiveUI.AOTTests to streamline the code and rely on global usings. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

What might this PR break?

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:

renovate bot and others added 4 commits October 4, 2025 00:26
Removed the local DisposableMixins implementation and updated global usings to reference System.Reactive.Disposables.Fluent. This change reduces code duplication and leverages the upstream implementation for DisposeWith and related extension methods.
Added global and local using directives for System.Reactive.Disposables.Fluent in Blazor and WPF app views to enable fluent disposable extensions.
@glennawatson glennawatson changed the title chore(deps): update rx.net (system.reactive) to 6.1.0 feature: Remove extension now provided by System.Reactive Oct 4, 2025
@ChrisPulman ChrisPulman changed the title feature: Remove extension now provided by System.Reactive Remove local DisposeWith use System.Reactive.Disposables.Fluent Oct 4, 2025
@glennawatson glennawatson requested a review from Copilot October 4, 2025 00:59
Copy link

@Copilot 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

This PR refactors the disposable extension method usage throughout the ReactiveUI codebase by removing the local DisposeWith implementation and migrating to the upstream System.Reactive.Disposables.Fluent package. This change standardizes disposable handling and eliminates code duplication.

  • Removes local DisposableMixins class containing custom DisposeWith implementation
  • Adds System.Reactive.Disposables.Fluent to global usings across multiple projects
  • Cleans up redundant using directives in test files to rely on global usings

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ReactiveUI/Mixins/DisposableMixins.cs Completely removes the local DisposeWith extension method implementation
src/ReactiveUI/GlobalUsings.cs Adds global using for System.Reactive.Disposables.Fluent
src/ReactiveUI.Maui/GlobalUsings.cs Adds global using for System.Reactive.Disposables.Fluent
src/ReactiveUI.Blazor/GlobalUsings.cs Adds global using for System.Reactive.Disposables.Fluent
src/ReactiveUI.Builder.WpfApp/Views/*.cs Adds explicit using for System.Reactive.Disposables.Fluent
src/ReactiveUI.AOTTests/GlobalUsings.cs Adds global using and removes unused System.Threading
src/ReactiveUI.AOTTests/*.cs Removes redundant using directives now covered by global usings

@glennawatson glennawatson merged commit ba46af7 into main Oct 4, 2025
3 checks passed
@glennawatson glennawatson deleted the RemoveDisposeWith branch October 4, 2025 01:09
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.05%. Comparing base (7776b48) to head (3a8c3f5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4164      +/-   ##
==========================================
- Coverage   35.08%   35.05%   -0.04%     
==========================================
  Files         140      139       -1     
  Lines        6016     6013       -3     
  Branches      885      885              
==========================================
- Hits         2111     2108       -3     
  Misses       3743     3743              
  Partials      162      162              

☔ 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.

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