Repository navigation
Release v2.2.0
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 theIOperationHistoryStorageabstraction for durable ones. (#180) - A fluent definition API for undo and redo, for example
Define<RenameModule>().UndoWith(...).CanUndoWhen(...).RedoWith(...), andIOperationEnginewithUndo,RedoandGetHistory. 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 typedOperationHistoryClientover a pluggable transport, an HTTP transport for hosts that expose the engine, and@cratis/choreography/reactwithuseOperationHistory,useUndoanduseRedo. 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.