You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: changes to aggregate::Repository, event::Store, documentation and more (#289)
In the scope of a closer v0.5.0 release, this PR introduces quite some
refactorings to different APIs, which are still experimental:
### refactor: generalize `event::StreamVersionExpected` into
`version::Check`
`version::Check` is a more general phrasing and naming for optimistic
locking, yet expressing quite more precisely its role.
### feat: add new `aggregate::test::Scenario`
It is now possible to write test assertions on `aggregate::Root`
methods, rather than having that only available through a
`command::test::Scenario`.
### refactor(aggregate::repository): split `Repository` traits once
again, use concrete error type
After trying the approach of having an unified `aggregate::Repository`
trait, and use an `AnyRepository` with `Error = anyhow::Error` (so,
opaque) for better usage in trait objects, we've reverted back to
Interface Segregation:
1. Have two separate interfaces -- `Saver` and `Getter` -- and a
`Repository` one, which extends both,
2. The errors returned by those are concrete types, using `thiserror`,
rather than using an associated type to abstract over it.
While this has required the introduction of opaque errors with
`anyhow::Error` in the concrete error types, this should provide a
better ergonomics for consumers of this API.
### refactor(event::store): move symbols to this module, add
`AppendError` concrete type
The `event::Store` follows the same approach as `aggregate::Repository`
now: split interfaces, concrete error types. The only exception being
`Streamer::stream`, where it seems to be fine to abstract over the error
type returned (for now).
### refactor(eventually-macros): remove derive(Message), as it requires
better design
`#[derive(Message)]` requires better design; we've implemented that with
a specific idea in mind, but that's very limiting and wouldn't be used
most of the time.
We remove it for now while we collect some ideas on how it should work.
### chore: add vscode setting for rust-analyzer to use all features
Finally rust-analyzer under VSCode will compile and check the workspace
using all feature flags.
### docs(eventually): add missing documentation
There was A LOT of missing documentation. This PR addresses some of the
missing stuff.
It's not great by any means, we'd likely need some dedicated effort
before releasing.
### refactor: split Serde trait into separate ones, implement
`serde::Convert` and `serde::ProtoJson`
After some production usage, we've collected some different ideas on how
this trait should work, and have implemented that following the previous
concepts: split methods/traits, concrete error types.
### chore: update all versions
Too many open dependabot PRs, this will take care of them all at once
(but `syn`, which is a major change).
0 commit comments