Skip to content

3.0.0

Latest

Choose a tag to compare

@mauroservienti mauroservienti released this 01 Nov 14:37
· 3 commits to release-3.0 since this release
d00d262

Radical 3.0.0 makes the message broker async-only, and removes the members that 2.1.0 marked obsolete.

The package still targets netstandard2.0. It's built and tested against .NET 10 only.

Radical.Windows 4.0.0 and Radical.Avalonia 1.0.0 are built on this release.

Breaking changes

The message broker is async-only

Subscribers, standalone handlers and publishers all use Task-based APIs (#749, #750). Follow the upgrade guide, which also describes the changes in WPF and Avalonia applications.

Radical 2.x Radical 3.0
Subscribe<T>(subscriber, Action<object, T> callback), and the other overloads taking an Action Subscribe<T>(subscriber, Func<object, T, Task> callback), and the matching overloads
Dispatch(sender, message) await DispatchAsync(sender, message)
Broadcast(sender, message) await BroadcastAsync(sender, message), or a deliberate fire-and-forget _ = BroadcastAsync(sender, message)
IHandleMessage<T>.Handle and AbstractMessageHandler<T>.Handle HandleAsync, returning a Task
  • DispatchAsync invokes the subscribers one at a time, on the publisher's context, as Dispatch did. BroadcastAsync invokes them in parallel, on thread pool threads, as Broadcast did. The documentation explains when to use which.
  • Callback filters, ShouldHandle, Unsubscribe and the invocation models are unchanged.
  • Dispatch, Broadcast and the Subscribe overloads taking an Action are obsolete with an error, so the compiler reports error CS0619 with a link to the upgrade guide. If reached at runtime, through reflection for example, they throw a NotSupportedException.
  • Classes inheriting from AbstractMessageHandler<T>, or implementing IHandleMessage<T> or IMessageBroker, fail with standard compiler errors (CS0534, CS0506 or CS0535) until they implement HandleAsync or DispatchAsync.

The obsolete members are removed in 4.0.0: #752, #753, #754, #755, #756.

Removed members that 2.1.0 marked obsolete

  • The Puzzle container: IPuzzleContainer, IPuzzleContainerEntry, IPuzzleContainerFacility, IPuzzleSetupDescriptor, IContainerEntry, IBootable, Lifestyle and ComponentRegisteredEventArgs (#433). Use Microsoft.Extensions.DependencyInjection.
  • The factories in Radical.ComponentModel.Factories and Radical.Model.Factories: IEntityFactory, IChangeTrackingServiceFactory and ChangeTrackingServiceFactory.
  • IRequireValidationCallback<T>, and the Radical.ComponentModel.Validation namespace with it.
  • The CommandLine and Password helpers in Radical.Helpers.

Removed and changed members without an obsolete release

These weren't marked obsolete in a released 2.x version:

  • CastExtensions, with the As<TResult> and CastTo<TResult> extension methods (#315). Use pattern matching, such as if (obj is TResult result), instead.
  • EntityCollection<T>.OnInitialize() (#437).
  • The AnalyticsEvent.Data setter: Data is read-only (#431).
  • RandomStrings.MinLenght and MaxLenght, misspelled, are renamed to MinLength and MaxLength (#426).

Other changes

  • EntityItemViewValueGetterArgs<T, TValue> becomes EntityItemViewValueGetterArgs<T>: TValue was never used (#435, #746).
  • RandomStrings throws an InvalidOperationException when its constraints can't be satisfied, for example a requested length larger than the available characters with AllowRepeatCharacters disabled, instead of looping forever (#598).
  • LimitedConcurrencyLevelTaskScheduler.MaximumConcurrencyLevel is sealed.

Full changelog: 2.1.0...3.0.0