Skip to content

Release v2.2.0

Choose a tag to compare

@github-actions github-actions released this 04 Nov 07:05
6fd3005

Choreography can now keep a reusable history of logical operations, undo and redo them as new operations, and a TypeScript package lets React applications drive it.

Added

  • Operation history in Cratis.Choreography.Operations: stable operation identity, scope, actor, kind, lifecycle and the event sequence numbers an operation produced. Operations can emit zero, one or many events, history is append-only, and it can be queried by scope and actor in order. It does not depend on Studio or on Chronicle, and ships with an in-memory storage and the IOperationHistoryStorage abstraction for durable ones. (#180)
  • A fluent definition API for undo and redo, for example Define<RenameModule>().UndoWith(...).CanUndoWhen(...).RedoWith(...), and IOperationEngine with Undo, Redo and GetHistory. Reversal is always explicit: the definition supplies the inverse and nothing is inferred from events. Undo targets the actor's latest operation in the scope and reports why it is blocked instead of skipping to an older one, runs as a new operation that is linked to the original, and reverses multi-event operations as one unit. A new operation by the same actor clears their redo stack. (#181)
  • @cratis/choreography: a typed OperationHistoryClient over a pluggable transport, an HTTP transport for hosts that expose the engine, and @cratis/choreography/react with useOperationHistory, useUndo and useRedo. Hooks report pending, error and blocked outcomes and keep previous history when a refresh fails. (#182)
  • Guides for operation history and undo/redo and using it from React.