Add R3↔Primitives bridges and range fast-paths#5
Merged
Conversation
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 Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.