-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove local DisposeWith use System.Reactive.Disposables.Fluent #4164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
There was a problem hiding this 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 customDisposeWith
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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 upstreamSystem.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:
DisposableMixins
implementation (DisposeWith
extension method) fromDisposableMixins.cs
since this functionality is now provided bySystem.Reactive.Disposables.Fluent
.System.Reactive.Disposables.Fluent
to global usings inGlobalUsings.cs
forReactiveUI
,ReactiveUI.Maui
, andReactiveUI.AOTTests
, enabling the use ofDisposeWith
throughout the codebase without explicit imports. [1] [2] [3]Code cleanup:
using
directives from multiple test files inReactiveUI.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
Other information: