Links

4.3 to 4.4

This guide covers upgrading a 4.3 Spree application to Spree 4.4.
If you have any questions or suggestions feel free to reach out through Spree slack channels
If you're on an older version than 4.3 please follow previous upgrade guides and perform those upgrades incrementally, eg.
This is the safest and recommended method.

Update Gemfile

gem 'spree', '>= 4.4.0.rc1'

Remove gems merged into Spree Core

(Optional) Remove Spree Digital

If you used that gem in the past you need to remove it. Digital products are now incorporated into Spree core and you cannot use that gem anymore.
  1. 1.
    Remove spree_digital from your Gemfile

(Optional) Remove Spree Wishlist

If you used that gem in the past you need to remove it. Wishlists are now incorporated into Spree core and you cannot use that gem anymore.
  1. 1.
    Remove spree_wishlist from your Gemfile
  2. 2.
    (Optional) Remove //= require spree/frontend/spree_wishlist from vendor/assets/javascripts/spree/frontend/all.js
  3. 3.
    (Optional) Remove *= require spree/frontend/spree_wishlist from vendor/assets/stylesheets/spree/frontend/all.css

Update gems

bundle update

Install missing migrations

bin/rake railties:install:migrations

Run migrations

bin/rails db:migrate

Update Spree Dashboard (spree_backend)

Update Gemfile

gem 'spree_backend', '>= 4.4.0.rc1'

Update gems

bundle update

Install jsbundling-rails gem

spree_backend 4.4 uses Hotwire (Turbo and Stimulus) and requires some javascript bundling provided by the excellent jsbundling-rails gem developed by the Rails core team.
This requires that you have both Node and yarn installed on your system.
bin/rails javascript:install:esbuild

Install @spree/dashboard NPM package

JavaScript required by the spree_backend gem is distributed as a NPM package.
bin/rails g spree:backend:install
From now on when you run your app locally you need to use bin/dev instead of bin/rails s.

Make sure that Node is available in your cloud environment

On Heroku, you need to add the node buildpack - https://devcenter.heroku.com/articles/buildpacks#using-multiple-buildpacks

Additional fixes and hints

Add ActiveJob queues

Spree uses ActiveJob for processing long running operations to not interrupt your web server performance. You need to update your config/sidekiq.yml file if you're using the Sidekiq gem.
Make sure that spree_stock_location_stock_items and spree_webhooks queues are there. You can check spree_starter's config as a guideline.

Disabling webhooks

Spree 4.4 introduces webhook events for most of the Spree resources (Products, Orders, Customers, etc). If you wish to disable this globally you can set the environment variable:
DISABLE_SPREE_WEBHOOKS=true
If you would like to disable firing webhooks for certain elements of your application you can wrap these methods in a block:
Spree::Webhooks.disable_webhooks do
... run your code here ...
end
Webhooks do not fire on touch events. Webhooks also do not do anything until there is a first webhook subscriber created which can be done in the Admin Dashboard or via Platform API.

Update Spree SDK

To use the new features such as Wishlists and Digital Products in your storefront please update Spree SDK to v4.12 at least.

Update Spree Dependencies that was renamed

Please change in your codebase:
Spree::Dependencies.account_update_address_service
to
Spree::Dependencies.address_update_service

Read the release notes

For information about changes contained within this release, please read the CHANGELOG.

More info

If you have any questions or suggestions feel free to contact us via email or through Spree slack channels