Skip to content

Refactor: use hcommons#38

Merged
Hissal merged 4 commits into
mainfrom
refactor/use-hcommons
Feb 21, 2026
Merged

Refactor: use hcommons#38
Hissal merged 4 commits into
mainfrom
refactor/use-hcommons

Conversation

@Hissal
Copy link
Copy Markdown
Owner

@Hissal Hissal commented Feb 21, 2026

This pull request removes all test files for the DisposableEvents.Disposables namespace and updates the test project to use the external HCommons.Disposables package instead. All test usages of disposables and related types are now redirected to the new package, and the previous test implementations for disposable-related functionality have been deleted.

Dependency update:

  • Added a reference to the HCommons.Disposables NuGet package in DisposableEvents.Tests.csproj to replace the local implementation of disposables.

Test code cleanup:

  • Removed all test files for DisposableEvents.Disposables, including tests for CompositeDisposable, DisposableBag, DisposableBuilder, DisposableCombine, DisposableDispose, DisposableExtensions, and Disposable. [1] [2] [3] [4] [5] [6] [7]

Codebase migration:

  • Updated imports in event-related test files to use HCommons.Disposables and HCommons.Void.Void instead of local DisposableEvents.Disposables and DisposableEvents.Void. (EventCoreTest.cs, ForwardingEventTest.cs, VoidDisposableEventTest.cs, IEventSubscriberTest.cs) [1] [2] [3] [4]

These changes collectively migrate the project’s test infrastructure to rely on a shared external package for disposables, simplifying maintenance and ensuring consistency across tests.

Copy link
Copy Markdown
Contributor

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

Migrates DisposableEvents away from in-repo “Disposables/Void/Buffers” implementations to the external HCommons.* packages, and removes the now-obsolete disposable-focused tests while updating remaining tests/code to reference the external types.

Changes:

  • Removed local implementations for DisposableEvents.Disposables, DisposableEvents.Void, and the internal pooled buffer type.
  • Updated library code to use HCommons.Disposables, HCommons.Void, and HCommons.Buffers.
  • Removed disposable-specific test suites and updated remaining tests to reference HCommons equivalents.

Reviewed changes

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

Show a summary per file
File Description
DisposableEvents/Void.cs Removed local Void type.
DisposableEvents/Internal/PooledArray.cs Removed local pooled array implementation.
DisposableEvents/Internal/NullEvent.cs Switched disposables dependency to HCommons.Disposables.
DisposableEvents/Internal/LazyInnerEvent.cs Switched disposables dependency to HCommons.Disposables.
DisposableEvents/Funcs/VoidFuncExtensions.cs Uses HCommons.Void.Void for void-arg func helpers.
DisposableEvents/Funcs/FuncTypes/DisposableFunc.cs Uses HCommons.Void.Void for void specialization.
DisposableEvents/Funcs/FuncHandlerSnapshot.cs Switched snapshot buffer dependency to HCommons.Buffers.
DisposableEvents/Funcs/FuncHandler.cs Uses HCommons.Void.Void for void handler types.
DisposableEvents/Funcs/FuncCore.cs Switched buffers/disposables dependencies to HCommons.*.
DisposableEvents/Filters/PredicateEventFilter.cs Uses HCommons.Void.Void for void predicate filters.
DisposableEvents/Events/VoidEventExtensions.cs Uses HCommons.Void.Void for void event helpers.
DisposableEvents/Events/EventTypes/ForwardingEvent.cs Switched disposables dependency to HCommons.Disposables.
DisposableEvents/Events/EventTypes/DisposableEvent.cs Uses HCommons.Void.Void for void event type.
DisposableEvents/Events/EventSubscribeOnceExtensions.cs Uses HCommons.Void.Void for void subscribe-once overloads.
DisposableEvents/Events/EventHandlerSnapshot.cs Switched snapshot buffer dependency to HCommons.Buffers.
DisposableEvents/Events/EventHandler.cs Uses HCommons.Void.Void for void handler types.
DisposableEvents/Events/EventCore.cs Switched buffers/disposables dependencies to HCommons.*.
DisposableEvents/EventPipeline.cs Switched disposables dependency to HCommons.Disposables.
DisposableEvents/Disposables/DisposableExtensions.cs Removed local disposable extensions.
DisposableEvents/Disposables/DisposableBuilder.cs Removed local disposable builder.
DisposableEvents/Disposables/DisposableBag.cs Removed local disposable bag.
DisposableEvents/Disposables/Disposable.cs Removed local disposable factory/utilities.
DisposableEvents/Disposables/CompositeDisposable.cs Removed local composite disposable implementation.
DisposableEvents/Disposables/BooleanDisposable.cs Removed local boolean disposable.
DisposableEvents/DisposableEvents.csproj Added HCommons.Disposables, HCommons.Void, HCommons.Buffers package references.
DisposableEvents.Tests/Internal/LazyInnerEventTest.cs Updated disposable alias to HCommons.Disposables.
DisposableEvents.Tests/Filters/VoidPredicateEventFilterTest.cs Updated void type usage to HCommons.Void.Void.
DisposableEvents.Tests/Filters/StatefulVoidPredicateEventFilterTest.cs Updated void type usage to HCommons.Void.Void.
DisposableEvents.Tests/Extensions/ObservableEventExtensionsTest.cs Updated disposable usage to HCommons.Disposables.
DisposableEvents.Tests/Events/VoidEventHandlerTest.cs Updated void type usage to HCommons.Void.Void.
DisposableEvents.Tests/Events/VoidEventExtensionsTest.cs Updated void type usage to HCommons.Void.Void.
DisposableEvents.Tests/Events/SubscribeOnceExtensionsTest.cs Updated void type usage to HCommons.Void.Void.
DisposableEvents.Tests/Events/IEventSubscriberTest.cs Updated disposables namespace import to HCommons.Disposables.
DisposableEvents.Tests/Events/EventTypes/VoidDisposableEventTest.cs Updated void type usage to HCommons.Void.Void.
DisposableEvents.Tests/Events/EventTypes/ForwardingEventTest.cs Updated disposables namespace import to HCommons.Disposables.
DisposableEvents.Tests/Events/EventCoreTest.cs Updated disposable alias to HCommons.Disposables.
DisposableEvents.Tests/Disposables/DisposableTest.cs Removed tests for deleted in-repo Disposable implementation.
DisposableEvents.Tests/Disposables/DisposableExtensionsTest.cs Removed tests for deleted in-repo disposable extensions.
DisposableEvents.Tests/Disposables/DisposableDisposeTest.cs Removed tests for deleted in-repo dispose helpers.
DisposableEvents.Tests/Disposables/DisposableCombineTest.cs Removed tests for deleted in-repo combine helpers.
DisposableEvents.Tests/Disposables/DisposableBuilderTest.cs Removed tests for deleted in-repo builder.
DisposableEvents.Tests/Disposables/DisposableBagTest.cs Removed tests for deleted in-repo bag.
DisposableEvents.Tests/Disposables/CompositeDisposableTest.cs Removed tests for deleted in-repo composite disposable.
DisposableEvents.Tests/DisposableEvents.Tests.csproj Added HCommons.Disposables package reference for tests.

Comment on lines +69 to +73
<ItemGroup>
<PackageReference Include="HCommons.Disposables" Version="1.0.0" />
<PackageReference Include="HCommons.Void" Version="1.0.0" />
<PackageReference Include="HCommons.Buffers" Version="1.0.0" />
</ItemGroup>
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The PR description focuses on migrating tests, but this PR also adds new runtime dependencies (HCommons.*) to the main DisposableEvents library and removes the in-repo implementations (Void, Disposables, PooledArray). Please update the PR description to explicitly call out these production/library changes and their impact (including the resulting public API break) so reviewers and release notes are accurate.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to 6
using Void = HCommons.Void.Void;

namespace DisposableEvents;

public static class VoidEventExtensions {
public static void Publish(this IEventPublisher<Void> publisher) => publisher.Publish(Void.Value);
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

This switches the public surface from DisposableEvents.Void to HCommons.Void.Void (via type alias) after deleting DisposableEvents/Void.cs. That is a binary breaking change for any consumers using the old type in generic parameters/signatures. If backward compatibility is desired, consider reintroducing DisposableEvents.Void as a public forwarding type (or multi-targeting with a type-forwarder), and/or document this as a breaking change requiring a major version bump.

Copilot uses AI. Check for mistakes.
@Hissal Hissal merged commit 249230a into main Feb 21, 2026
5 checks passed
@Hissal Hissal deleted the refactor/use-hcommons branch February 21, 2026 16:09
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