Skip to content

Add R3↔Primitives bridges and range fast-paths#5

Merged
ChrisPulman merged 9 commits into
mainfrom
ExtendOptimisation
May 27, 2026
Merged

Add R3↔Primitives bridges and range fast-paths#5
ChrisPulman merged 9 commits into
mainfrom
ExtendOptimisation

Conversation

@ChrisPulman
Copy link
Copy Markdown
Member

@ChrisPulman ChrisPulman commented May 27, 2026

Introduce bridging observers between R3 and Primitives in R3BridgeGenerator to adapt IObserver/Observer semantics and results. Add a new RangeConcatSignal and many range-backed fast paths across operators (Zip, CombineLatest, WithLatest, CollectList/Array, ForkJoin, First/FirstOrDefault/ToTask, Count/Any async helpers, Collect*Async) to avoid per-value subscriptions and allocations for RangeSignal. Extend FromEnumerable to accept CancellationToken and short-circuit array/read-only-list paths when not cancellable; expose ToSignal overloads that accept CancellationToken.
Rename BehaviourSignal→BehaviorSignal and add debugger display + related type updates.
ThreadPoolSequencer: introduce Timer alias, use strongly-typed Timers dictionary and minor null/exception-doc fixes.
Add convenience Publish/Replay/Share extension overloads and multiple small API/documentation cleanups (remove redundant System. prefixes in XML refs, tweak exception tags).
Misc: add helper methods for creating range-backed lists/arrays/values and a few disposable optimizations.
These changes improve interop, performance for RangeSignal scenarios, and cancellation support for synchronous enumeration.

Move ConnectableSignalMixins and StateSignalMixins into their own files and remove duplicate implementations from existing files.
Improve XML documentation across signal operator mixins (SignalOperatorMixins.cs) and clean up pragma warning disables in several signal files (CommandSignal{TResult}.cs, ReadOnlyState{T}.cs, StateSignal{T}.cs, ConnectableSignal{T}.cs). Add RefCount/AutoConnect gate logic with ConnectableSignalMixins and wire up state projection helper in StateSignalMixins.
Miscellaneous small tidy-ups to comments and API contract descriptions.
Affects: ConnectableSignalMixins.cs (new), StateSignalMixins.cs (new), ConnectableSignal{T}.cs, CommandSignal{TResult}.cs, ReadOnlyState{T}.cs, StateSignal{T}.cs, SignalOperatorMixins.cs, SignalOperatorParityMixins.Helpers.cs, SignalOperatorParityMixins.cs.

Introduce debugger-friendly displays across the library by adding System.Diagnostics.DebuggerDisplay attributes to many types and marking them partial.
Add a new DebuggerDisplay.Partials.cs that centralizes private DebuggerDisplay properties (calling ToString()) for those partial types, includes a WINDOWS guard for DispatcherSequencer, and suppresses related analyzer warnings.
Also update numerous types/structs to partial to enable the centralized debugger helpers.
Additionally, update README.md to document new/renamed APIs and overloads (CompositeDisposable alias, Signal.FromEnumerable cancellation overload, Signal.FromAsync/Observable.FromAsync mappings, ToObservable cancellation notes, BehaviorSignal naming clarification, CountAsync/AnyAsync docs, etc.)

Introduce platform sequencers and related utilities: add SynchronizationContextSequencer and a WinForms ControlSequencer, move DispatcherSequencer into a WPF folder and update its timing/debugger logic and disposables. Add EventPattern and FromEventPattern overloads, plus convenience operators and aliases: SubscribeOn, Generate alias, LastAsync/LastOrDefaultAsync, ToArray/ToArrayAsync, ToList/ToListAsync.
Add new ReactiveUI.Primitives.WinForms and ReactiveUI.Primitives.Wpf projects and include them in the solution; update Directory.Build.props with Windows target TFMs and simplify ReactiveUI.Primitives csproj.
Update tests to cover the new sequencers and factory/operator parity branches.

Introduce focused platform integration projects and scheduling primitives for Blazor and MAUI.

  • Add new projects: ReactiveUI.Primitives.Blazor and ReactiveUI.Primitives.Maui and include them in the solution.
  • Add ReactiveComponentBase (Blazor) to manage subscriptions and refresh via ComponentBase.InvokeAsync.
  • Add BlazorRendererSequencer to marshal sequenced work through a Blazor renderer delegate.
  • Add MauiDispatcherSequencer and ToSequencer mixin to schedule work via a MAUI IDispatcher.
  • Update Directory.Build.props to expose BlazorTargetFrameworks and MauiTargetFrameworks.
  • Update Directory.Packages.props with conditional package versions for Microsoft.AspNetCore.Components and Microsoft.Maui.Core.
  • Signals: add Timer overloads (absolute DateTimeOffset variants) and an Amb alias for Race.
  • Fix SubscribeAsyncEnumerable to avoid a race when disposing after completion (use a disposed flag/Interlocked and handle ObjectDisposedException).
  • Update tests (FactoryOperatorContractTests) to exercise Amb, absolute Timer behavior, async-enumerable disposal, and add guard tests.

These changes add cross-platform integration points so ReactiveUI.Primitives can marshal work to Blazor and MAUI UI dispatchers and ensure related factories and tests cover the new behaviors.

Introduce bridging observers between R3 and Primitives in R3BridgeGenerator to adapt IObserver/Observer semantics and results. Add a new RangeConcatSignal and many range-backed fast paths across operators (Zip, CombineLatest, WithLatest, CollectList/Array, ForkJoin, First/FirstOrDefault/ToTask, Count/Any async helpers, Collect*Async) to avoid per-value subscriptions and allocations for RangeSignal. Extend FromEnumerable to accept CancellationToken and short-circuit array/read-only-list paths when not cancellable; expose ToSignal overloads that accept CancellationToken. Rename BehaviourSignal→BehaviorSignal and add debugger display + related type updates. ThreadPoolSequencer: introduce Timer alias, use strongly-typed Timers dictionary and minor null/exception-doc fixes. Add convenience Publish/Replay/Share extension overloads and multiple small API/documentation cleanups (remove redundant System. prefixes in XML refs, tweak exception tags). Misc: add helper methods for creating range-backed lists/arrays/values and a few disposable optimizations. These changes improve interop, performance for RangeSignal scenarios, and cancellation support for synchronous enumeration.
Move ConnectableSignalMixins and StateSignalMixins into their own files and remove duplicate implementations from existing files. Improve XML documentation across signal operator mixins (SignalOperatorMixins.cs) and clean up pragma warning disables in several signal files (CommandSignal{TResult}.cs, ReadOnlyState{T}.cs, StateSignal{T}.cs, ConnectableSignal{T}.cs). Add RefCount/AutoConnect gate logic with ConnectableSignalMixins and wire up state projection helper in StateSignalMixins. Miscellaneous small tidy-ups to comments and API contract descriptions. Affects: ConnectableSignalMixins.cs (new), StateSignalMixins.cs (new), ConnectableSignal{T}.cs, CommandSignal{TResult}.cs, ReadOnlyState{T}.cs, StateSignal{T}.cs, SignalOperatorMixins.cs, SignalOperatorParityMixins.Helpers.cs, SignalOperatorParityMixins.cs.
Introduce debugger-friendly displays across the library by adding System.Diagnostics.DebuggerDisplay attributes to many types and marking them partial. Add a new DebuggerDisplay.Partials.cs that centralizes private DebuggerDisplay properties (calling ToString()) for those partial types, includes a WINDOWS guard for DispatcherSequencer, and suppresses related analyzer warnings. Also update numerous types/structs to partial to enable the centralized debugger helpers. Additionally, update README.md to document new/renamed APIs and overloads (CompositeDisposable alias, Signal.FromEnumerable cancellation overload, Signal.FromAsync/Observable.FromAsync mappings, ToObservable cancellation notes, BehaviorSignal naming clarification, CountAsync/AnyAsync docs, etc.)
Introduce platform sequencers and related utilities: add SynchronizationContextSequencer and a WinForms ControlSequencer, move DispatcherSequencer into a WPF folder and update its timing/debugger logic and disposables. Add EventPattern<TEventArgs> and FromEventPattern overloads, plus convenience operators and aliases: SubscribeOn, Generate alias, LastAsync/LastOrDefaultAsync, ToArray/ToArrayAsync, ToList/ToListAsync. Add new ReactiveUI.Primitives.WinForms and ReactiveUI.Primitives.Wpf projects and include them in the solution; update Directory.Build.props with Windows target TFMs and simplify ReactiveUI.Primitives csproj. Update tests to cover the new sequencers and factory/operator parity branches.
Introduce focused platform integration projects and scheduling primitives for Blazor and MAUI.

- Add new projects: ReactiveUI.Primitives.Blazor and ReactiveUI.Primitives.Maui and include them in the solution.
- Add ReactiveComponentBase (Blazor) to manage subscriptions and refresh via ComponentBase.InvokeAsync.
- Add BlazorRendererSequencer to marshal sequenced work through a Blazor renderer delegate.
- Add MauiDispatcherSequencer and ToSequencer mixin to schedule work via a MAUI IDispatcher.
- Update Directory.Build.props to expose BlazorTargetFrameworks and MauiTargetFrameworks.
- Update Directory.Packages.props with conditional package versions for Microsoft.AspNetCore.Components and Microsoft.Maui.Core.
- Signals: add Timer overloads (absolute DateTimeOffset variants) and an Amb alias for Race.
- Fix SubscribeAsyncEnumerable to avoid a race when disposing after completion (use a disposed flag/Interlocked and handle ObjectDisposedException).
- Update tests (FactoryOperatorContractTests) to exercise Amb, absolute Timer behavior, async-enumerable disposal, and add guard tests.

These changes add cross-platform integration points so ReactiveUI.Primitives can marshal work to Blazor and MAUI UI dispatchers and ensure related factories and tests cover the new behaviors.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 75.71429% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.96%. Comparing base (06260e8) to head (5fff002).

Files with missing lines Patch % Lines
...ReactiveUI.Primitives/Signals/Signal{Factories}.cs 75.43% 12 Missing and 2 partials ⚠️
...tiveUI.Primitives/Core/EventPattern{TEventArgs}.cs 18.18% 8 Missing and 1 partial ⚠️
...ves/Concurrency/SynchronizationContextSequencer.cs 84.90% 4 Missing and 4 partials ⚠️
...eactiveUI.Primitives/SignalOperatorParityMixins.cs 84.21% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   77.34%   77.96%   +0.62%     
==========================================
  Files         103      105       +2     
  Lines        5209     5347     +138     
  Branches      947      970      +23     
==========================================
+ Hits         4029     4169     +140     
+ Misses        909      895      -14     
- Partials      271      283      +12     

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

@ChrisPulman ChrisPulman merged commit 4dee12c into main May 27, 2026
11 of 12 checks passed
@ChrisPulman ChrisPulman deleted the ExtendOptimisation branch May 27, 2026 07:01
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.

1 participant