Skip to content

Releases: nalu-development/sharpstate

4.0.0

13 May 14:15

Choose a tag to compare

New major release allowing you to await for asynchronous reactions in the same execution context.

Added WhenEnteredAsync and WhenExitedAsync to provide further customization in case of common reaction code upon different transitions ending up in the same state.

Also improved the performance by a lot!

👨🏼‍💻 Contributors

No contributors

3.2.0

11 May 13:44

Choose a tag to compare

Replace .Target with .TransitionTo across all state configurations to improve naming clarity.

👨🏼‍💻 Contributors

No contributors

3.1.0

11 May 11:26

Choose a tag to compare

Improved dev-experience for triggers with no parameters.

👨🏼‍💻 Contributors

No contributors

3.0.0

11 May 10:31

Choose a tag to compare

New version, improving syntax for dependency injection.

👨🏼‍💻 Contributors

No contributors

2.1.0

08 May 09:11

Choose a tag to compare

  • Add overloads for WhenEntering and WhenExiting with DI support
  • Add convenient way to configure the created service scope with Microsoft DI

👨🏼‍💻 Contributors

@albyrock87

2.0.0

07 May 23:21

Choose a tag to compare

This release separates Context from Dependencies.

The machine context should hold state owned by the machine: counters, flags, domain values, and data that transitions mutate. Dependencies such as loggers, repositories, clients, and service facades now flow through a service-provider resolver instead of being stored on the context.

Breaking Changes

  • Generated actors now require an IStateMachineServiceProviderResolver<TServiceProvider> when created.
  • [StateMachineDefinition] now has a service-provider type argument. It defaults to IServiceProvider.
  • Runtime types such as StateMachineDefinition, StateMachineEngine, StateConfigurator, Transition, and trigger builders now include TServiceProvider.
  • Guard, target, Invoke, and ReactAsync overloads can receive TServiceProvider.

Migration

  • If your machine does not use dependencies, pass StateMachineEmptyServiceProviderResolver.Instance.
  • If you have a simple dependency facade, use [StateMachineDefinition(typeof(MyContext), typeof(IMyServices))] and pass new StateMachineStaticServiceProviderResolver<IMyServices>(services).
  • If you use Microsoft DI, add Nalu.SharpState.DependencyInjection and use StateMachineServiceProviderResolver or the IServiceCollection helpers.
  • Keep request data needed by ReactAsync in the context, trigger arguments, or an immutable snapshot. Do not depend on live HttpContext in background reactions.

New Helpers

  • StateMachineEmptyServiceProviderResolver
  • StateMachineStaticServiceProviderResolver<TServiceProvider>
  • Nalu.SharpState.DependencyInjection package with Microsoft DI resolver registrations

👨🏼‍💻 Contributors

@albyrock87

1.2.1

06 May 17:47

Choose a tag to compare

Improve Mermaid output on complex use cases by leveraging ELK layout.

👨🏼‍💻 Contributors

@albyrock87

1.2.0

06 May 16:57

Choose a tag to compare

Add export to Mermaid format

👨🏼‍💻 Contributors

@albyrock87

1.1.1

05 May 11:16

Choose a tag to compare

  • Fix ToDot region stay triggers layout

👨🏼‍💻 Contributors

@albyrock87

1.1.0

04 May 19:59

Choose a tag to compare

Improve DOT and state change

  • Fix missing Stay in DOT diagram
  • Add IStateAwareContext
  • Improve state definition for better DOT output

👨🏼‍💻 Contributors

@albyrock87