Skip to content

Releases: RailsEventStore/rails_event_store

v0.26

06 Mar 10:09

Choose a tag to compare

RailsEventStore

  • Deprecate: subscribe(handler, array_of_event_types) is deprecated. Use subscribe(handler, to: event_types) instead. Example

    client = RailsEventStore::Client.new
    client.subscribe(OrderSummaryEmail.new, to: [OrderPlaced])
  • Deprecate: subscribe(subscriber, event_types, &task) has been deprecated. Use within(&task).subscribe(subscriber, to: event_types).call instead. #155 - Example:

    client = RailsEventStore::Client.new
    client.within do
      PlaceOrder.new
    end.subscribe(OrderSummaryEmail.new, to: [OrderPlaced]).call
  • Deprecate: subscribe_to_all_events(subscriber, &task) has been deprecated. Use within(&task).subscribe_to_all_events(subscriber).call instead. #155 - Example:

    client = RailsEventStore::Client.new
    client.within do
      PlaceOrder.new
    end.subscribe_to_all_events(LogEvents.new).call
  • Fix: Temporary subscribers are thread safe now - #196

  • Fix: Test the gem with newest Rails version. No changes required but the testing infrastructure - #192 #194

  • Add: subscribe(to:, &subscriber) API allows passing a subscriber as proc. - #155 #197 - Example:

    client = RailsEventStore::Client.new
    client.subscribe(to: [OrderPlaced]) do |ev|
      order = Order.find(event.data.fetch(:event_id))
      OrderMailer.summary(order).deliver_later
    end
  • Add: subscribe_to_all_events(&subscriber) API allows passing a subscriber as proc. - #155 #197 - Example:

    client = RailsEventStore::Client.new
    client.subscribe_to_all_events do |ev|
      Rails.logger.debug(ev.inspect)
    end
  • Add: Chainable API for temporary subscribers was added. Start with within(&task) then call subscribe or subscribe_to_all_events as many times you want passing either a handler or a block and then call call to trigger execution of the task with subscribers temporarily subscribed. - #155 #197 - Example:

    success = 0
    failure = 0
    
    client.within do
      ImportCustomer.call
    end.subscribe(to: [CustomerImported]) do |_ev|
      success += 1
    end.subscribe(to: [CustomerImportFailed]) do |_ev|
      failure += 1
    end.subscribe_to_all_events do |ev|
      Rails.logger.debug(ev.inspect)
    end.call

RubyEventStore

  • Deprecate/Add: Same API changes as for RailsEventStore listed above.
  • Fix: No more race conditions for InMemoryAdapter with multi-threading when used with :any expected version on the same stream. This more closely resembles production behavior of RailsEventStoreActiveRecord repository. #188

RailsEventStoreActiveRecord

  • Fix: Testing the gem with newest Rails version - #194

AggregateRoot

  • Add: Support for declarative event handler methods - #171 #190 . You can use on(event_class, &proc) to define a new handler method. Example:

    class Order
      include AggregateRoot
      class HasBeenAlreadySubmitted < StandardError; end
      class HasExpired < StandardError; end
    
      def initialize
        @state = :new
      end
    
      def submit
        raise HasBeenAlreadySubmitted if state == :submitted
        raise HasExpired if state == :expired
        apply OrderSubmitted.new(data: {delivery_date: Time.now + 24.hours})
      end
    
      def expire
        apply OrderExpired.new
      end
    
      on OrderSubmitted do |event|
        @state = :submitted
        @delivery_date = event.data.fetch(:delivery_date)
      end
    
      on OrderExpired do |_event|
        @state = :expired
      end
    
      private
    
      attr_reader :state
    end

RailsEventStore::RSpec

  • No changes

BoundedContext

  • Fix: Testing the gem with newest Rails version - #192

RailsEventStore::Browser

  • No changes

v0.25.2

10 Feb 01:28

Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEventStore::Browser

  • Fix: Excessive encoding of already encoded URLs is no more.
  • Fix: Handle dots in stream names on browser backend. Previously last dot part of name could have been interpreted as a format.

v0.25.1

10 Feb 00:49

Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEventStore::Browser

  • Fix: Encode stream names and event ids for internal links. An unescaped URL with slashes would be incorrectly interpreted by client-side router.

v0.25.0

09 Feb 15:36

Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • Change: get_all_streams now explicitly sorts by id

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEventStore::Browser

  • Change: Streams and events are finally paginated on server-side. As a consequence we can no longer filter streams and events on client-side, so search functionality was removed.
  • Fix: Encode stream names and event ids for URLs. An unescaped URL with slashes would be incorrectly interpreted by browser backend.

v0.24.0

24 Jan 14:34

Choose a tag to compare

RailsEventStore

  • Fix: Handle publishing events after commit in case of nested transactions. Fixes AsyncRecord missing add_to_transaction method needed for Rails 5 integration (#181, #182).

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEventStore::Browser

  • Change: JSON API exchange format between Browser's backend and frontend

v0.23.0

11 Jan 23:42

Choose a tag to compare

RailsEventStore

  • Change: Include bounded_context gem as a dependency of rails_event_store (#146)
  • Add: Test on Ruby 2.5.0

RubyEventStore

  • Fix: RubyEventStore::Projection#run parameter count is now correctly a page limit. Previously it would hard limit the number of process events by projection with a default set to 100 (#173)
  • Add: Test on Ruby 2.5.0

RailsEventStoreActiveRecord

  • Add: Test on Ruby 2.5.0

AggregateRoot

  • Add: Test on Ruby 2.5.0

RailsEventStore::RSpec

  • Add: Test on Ruby 2.5.0

BoundedContext

  • Add: Test on Ruby 2.5.0

RailsEventStore::Browser

  • Fix: Remove obsolete puts that somehow made it into the release.
  • Add: Test on Ruby 2.5.0

v0.22.1

04 Jan 21:04

Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEventStore::Browser

  • Fix: Include new assets directory within released gem package (aa0f1e1).

v0.22.0

04 Jan 21:00

Choose a tag to compare

RailsEventStore

  • Add: Introduce API to link published event in other streams RailsEventStore#link_to_stream (#177)

    This allows aggregating published events in multiple streams and using such streams as a kind of index. Useful for event-sourced process managers.

    Main qualities:

    • linking an existing, published event to given stream does not trigger event handlers
    • you cannot link same event more than once in a given stream
    • linking follows the same rules regarding expected_version as publishing an event for the first time

RubyEventStore

  • Add: Introduce API to link published event in other streams RubyEventStore#link_to_stream (#177)
  • Fix: disallow publishing same event twice using InMemoryRepository (0f4dddc)

RailsEventStoreActiveRecord

  • Add: Introduce API to link published event in other streams RailsEventStoreActiveRecord#link_to_stream (#177)

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEventStore::Browser

  • Change: Browser no longer relies on Sprockets and Asset Pipeline to deliver static files. Instead ActionDispatch::Static is used to serve scripts.

v0.21.0

22 Dec 18:16
a98cdf8

Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • Add: RubyEventStore#when method to handle events array (6adf082)
  • Add: Introduce API to get all stream names RubyEventStore::Client#get_all_streams (b063b59)
  • Add: Introduce API to retrieve single event RubyEventStore::Client#read_event (23a7050)

RailsEventStoreActiveRecord

  • Add: Introduce API to get all stream names RailsEventStoreActiveRecord::EventRepository#get_all_streams (b063b59)
  • Add: Introduce API to retrieve single event RailsEventStoreActiveRecord::EventRepository#read_event (23a7050)

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RailsEvenStore::Browser

First release of a Rails Engine allowing to browse events via web interface

Add this line to your application's Gemfile:

gem 'rails_event_store-browser'

And then execute:

$ bundle

Add to your routes.rb:

Rails.application.routes.draw do
  mount RailsEventStore::Browser::Engine => "/res"
end

Start using it!

Assumptions:

  • you don't need pagination (just not yet implemented in this iteration, beware large streams)
  • you have event store configured at Rails.configuration.event_store (like we recommend in docs)
  • you use Rails with Asset Pipeline (engine delivers assets with AP in this iteration)

v0.20.0

24 Nov 12:44
7a2b523

Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • Add: default mapper RubyEventStore::Mappers::Default which is responsible for mapping fields of event from/to record via RubyEventStore::SerializedRecord and configurable serialization. Mapper has configured YAML serializer by default. Serializer can be replaced by custom one, following dump and load contract.

RailsEventStoreActiveRecord

  • Fix: Primary key in SQLite on Rails 4.2 not being unique (945419b)
  • Deprecate: LegacyEventRepository (2423ba3)
  • Fix: Specify minimum working activerecord-import version (2e2c08b)
  • Change: RailsEventStoreActiveRecord::EventRepository implementation to use default mapper RubyEventStore::Mappers::Default provided by RubyEventStore. Mapper can be replaced by custom one. In RailsEventStoreActiveRecord::Event implicit serialization was removed (now is configured and can be customised via mapper).

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes