Significant changes in the new event messaging system in master #4380
waiting-for-dev
announced in
Announcements
Replies: 1 comment 1 reply
-
Amazing. Thanks for the info. I'm just upgrading one of our applications now. So far, so good. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey!
The following is a notice relevant for all people using the Solidus
master
branch.As you probably know, we've been working on replacing the event bus with a new, more friendly and advanced system. As we kept working on it, we realized that the best way to make it evolve was to extract it into a standalone gem. The new gem is called Omnes, and we just merged the PR introducing it on Solidus.
As it's a meaningful change, we want to provide support also to people using
master
(although that's unstable by definition).If you experience any issues or like more information, please feel free to add any comment or DM me on Slack (@waiting_for_dev).
These are the instructions to update:
Skip this message if you're not using Solidus
master
branch.Skip this message if you're not using Solidus events for anything.
Remove
config.events.adapter
setting fromconfig/initializers/spree.rb
.Add
config.use_legacy_events = false
inconfig/initializers/spree.rb
.Replace references to
Spree::Event
forSpree::Bus
.Replace references to
Spree::Bus.fire
forSpree::Bus.publish
.Make sure you always reference to event names as
Symbol
and not asString
(look forSpree::Bus.publish
andSpree::Bus.subscribe
&Spree::Bus.register
).Register events within a
.to_prepare
block in an initializer. E.g.:/.*\.spree$/
, use insteadSpree::Bus.subscribe_to_all
..to_prepare
block. E.g.:If you were using
Spree::TestingSupport::EventHelpers
:Spree::TestingSupport::BusHelpers
(and requirespree/testing_support/bus_helpers
).stub_spree_bus
instead ofstub_spree_event
to_have_been_published
matcher instead ofto_have_been_fired
.Read everything else Omnes provides!!
Thanks!! 🚌
Beta Was this translation helpful? Give feedback.
All reactions