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
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
The following is a notice relevant for all people using the Solidus
masterbranch.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
masterbranch.Skip this message if you're not using Solidus events for anything.
Remove
config.events.adaptersetting fromconfig/initializers/spree.rb.Add
config.use_legacy_events = falseinconfig/initializers/spree.rb.Replace references to
Spree::EventforSpree::Bus.Replace references to
Spree::Bus.fireforSpree::Bus.publish.Make sure you always reference to event names as
Symboland not asString(look forSpree::Bus.publishandSpree::Bus.subscribe&Spree::Bus.register).Register events within a
.to_prepareblock in an initializer. E.g.:/.*\.spree$/, use insteadSpree::Bus.subscribe_to_all..to_prepareblock. E.g.:If you were using
Spree::TestingSupport::EventHelpers:Spree::TestingSupport::BusHelpers(and requirespree/testing_support/bus_helpers).stub_spree_businstead ofstub_spree_eventto_have_been_publishedmatcher instead ofto_have_been_fired.Read everything else Omnes provides!!
Thanks!! 🚌
Beta Was this translation helpful? Give feedback.
All reactions