Rails Event Store v0.40.0 Release Notes

Release Date: 2019-06-25 // almost 5 years ago
  • ๐Ÿš… RailsEventStore

    • no changes

    ๐Ÿ’Ž RubyEventStore

    ๐Ÿš… Change: RubyEventStore::Event#correlate_with returns self to allow chaining [#601]

    Change: Deprecate RubyEventStore::Mappers::MissingEncryptionKey const. It has been moved to RubyEventStore::Mappers::Transformation::Encryption::MissingEncryptionKey where it is used. Old const continues to work until next release [#619]

    Add: Introduce the concept of mapper pipeline. That allows composing mapper transformations. RES mappers now consist of such transformations [#572, #600]

    Usage:

    module RubyEventStoremodule Mappersclass Default \< PipelineMapperdef initialize(serializer: YAML, events\_class\_remapping: {}) super(Pipeline.new( transformations: [Transformation::EventClassRemapper.new(events\_class\_remapping), Transformation::SymbolizeMetadataKeys.new, Transformation::Serialization.new(serializer: serializer),] )) endendendend
    
    module RubyEventStoremodule Mappersclass EncryptionMapper \< PipelineMapperdef initialize(key\_repository, serializer: YAML, forgotten\_data: ForgottenData.new) super(Pipeline.new( transformations: [Transformation::Encryption.new(key\_repository, serializer: serializer, forgotten\_data: forgotten\_data), Transformation::Serialization.new(serializer: serializer),] )) endendendend
    

    Change: All errors are now descendant of RubyEventStore::Error [#620]

    Change: Deprecate RubyEventStore::PubSub::Dispatcher, RubyEventStore::PubSub::Subscriptions and RubyEventStore::PubSub::Broker consts. They have been moved to RubyEventStore::Dispatcher, RubyEventStore::Subscriptions and RubyEventStore::Broker respectively. Old consts continues to work until next release [#624]

    ๐Ÿš… RailsEventStoreActiveRecord

    Add: Support JSON data types in ActiveRecord database migration [#598]

    Usage:

    rails generate rails\_event\_store\_active\_record:migration --data\_type=jsonb # or json
    

    AggregateRoot

    Change: AggregateRoot.on now depends on RubyEventStore::Event#type [#578, #579]

    Add: New way to specify custom apply strategy [#584, #587, #597]

    Was:

    class OrderWithCustomStrategyinclude AggregateRootdef apply\_strategy@apply\_strategy ||= CustomOrderApplyStrategy.newendend
    

    Is now:

    class OrderWithCustomStrategyinclude AggregateRoot.with\_strategy(-\>{ CustomOrderApplyStrategy.new })end
    

    Fix: Allow specifying AggregateRoot.on arguments as strings, in addition to passing event class. This opens possibility to use this API with Proto events [#578, #588]

    Usage:

     Google::Protobuf::DescriptorPool.generated\_pool.build do add\_message "res\_testing.OrderPaid" do# ...endendmodule ResTestingOrderPaid= Google::Protobuf::DescriptorPool.generated\_pool.lookup("res\_testing.OrderPaid").msgclass endclass Orderinclude AggregateRoot on 'res\_testing.OrderPaid' do |\_event| @status = :paidendend order = ResTesting::Order.new order\_paid =RubyEventStore::Proto.new( event\_id: "f90b8848-e478-47fe-9b4a-9f2a1d53622b", data: ResTesting::OrderPaid.new ) order.apply(order\_paid)
    

    Remove: Deprecated AggregateRoot#load and AggregateRoot#store are gone [1ea7d2f]

    ๐Ÿš… Add: Instrumentation for AggregateRoot::Repository#load, AggregateRoot::Repository#store and AggregateRoot::Repository#with_aggregate methods [#591]

    Usage:

    ar\_repository = InstrumentedRepository.new( AggregateRoot::Repository.new(event\_store), ActiveSupport::Notifications)
    

    ๐Ÿš… RailsEventStore::RSpec

    • no changes

    BoundedContext

    • no changes

    ๐Ÿ’Ž RubyEventStore::Browser

    Change: Browser's API now returns error 404 when event not found (previously it was error 500) [#603]

    ๐Ÿ“‡ Add: Show link to correlation stream, if correlation_id present. For now, it only supports default correlation metadata field (correlation_id) and prefix ($by_correlation_id_) [#609]

    ๐Ÿ“‡ Add: Show link to causation stream, if causation_id present. For now, it only supports default correlation metadata field (causation_id) and prefix ($by_causation_id_) [#610]

    Add: Show limited (to 20 events) list of caused events by viewed event. [5c462f4]

    Change: Display timestamps in more readable format [#613]

    Change: Display more accurate browser <title /> (instead of hardcoded RubyEventStore::Browser) [#613]

    Add: Show link to the event which caused viewed event [#614]

    Add: Show link to event type stream (for example: $by_type_DummyEvent). For now only supports default prefix. [#617]

    ๐Ÿ’Ž RubyEventStore::ROM

    • Change: Update required versions of dry-types, rom and rom-sql dependencies. It may affect your project if you depend on those gems [#595]