Releases: RailsEventStore/rails_event_store
v0.26
RailsEventStore
-
Deprecate:
subscribe(handler, array_of_event_types)is deprecated. Usesubscribe(handler, to: event_types)instead. Exampleclient = RailsEventStore::Client.new client.subscribe(OrderSummaryEmail.new, to: [OrderPlaced])
-
Deprecate:
subscribe(subscriber, event_types, &task)has been deprecated. Usewithin(&task).subscribe(subscriber, to: event_types).callinstead. #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. Usewithin(&task).subscribe_to_all_events(subscriber).callinstead. #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 callsubscribeorsubscribe_to_all_eventsas many times you want passing either a handler or a block and then callcallto trigger execution of thetaskwith 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
InMemoryAdapterwith multi-threading when used with:anyexpected version on the same stream. This more closely resembles production behavior ofRailsEventStoreActiveRecordrepository. #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
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
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
RailsEventStore
- no changes
RubyEventStore
- no changes
RailsEventStoreActiveRecord
- Change:
get_all_streamsnow explicitly sorts byid
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
RailsEventStore
- Fix: Handle publishing events after commit in case of nested transactions. Fixes
AsyncRecordmissingadd_to_transactionmethod 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
RailsEventStore
- Change: Include
bounded_contextgem as a dependency ofrails_event_store(#146) - Add: Test on Ruby 2.5.0
RubyEventStore
- Fix:
RubyEventStore::Projection#runparametercountis 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
putsthat somehow made it into the release. - Add: Test on Ruby 2.5.0
v0.22.1
v0.22.0
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_versionas 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::Staticis used to serve scripts.
v0.21.0
RailsEventStore
- no changes
RubyEventStore
- Add:
RubyEventStore#whenmethod 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"
endStart 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
RailsEventStore
- no changes
RubyEventStore
- Add: default mapper
RubyEventStore::Mappers::Defaultwhich is responsible for mapping fields of event from/to record viaRubyEventStore::SerializedRecordand configurable serialization. Mapper has configuredYAMLserializer by default. Serializer can be replaced by custom one, followingdumpandloadcontract.
RailsEventStoreActiveRecord
- Fix: Primary key in SQLite on Rails 4.2 not being unique (945419b)
- Deprecate:
LegacyEventRepository(2423ba3) - Fix: Specify minimum working
activerecord-importversion (2e2c08b) - Change:
RailsEventStoreActiveRecord::EventRepositoryimplementation to use default mapperRubyEventStore::Mappers::Defaultprovided byRubyEventStore. Mapper can be replaced by custom one. InRailsEventStoreActiveRecord::Eventimplicit serialization was removed (now is configured and can be customised via mapper).
AggregateRoot
- no changes
RailsEventStore::RSpec
- no changes
BoundedContext
- no changes