NEW
Notice something different? Meet the new Solidus brand!

Solidus v3.0

Solidus logo

Solidus Core Team

20 Apr 2021 - 5 mins read

Cover image of Solidus v3.0 post

We've just released Solidus v3.0.0!

One of the primary goals that drives the development of Solidus is allowing easy upgrades.

Easy upgrades allow teams that use Solidus to take advantage of the latest platform improvements, but it's equally crucial for faciliating community contribution: using a recent version of Solidus lets teams easily contribute to the platform. Due to this exchange, Solidus mirrors what's really needed by its users as closely as possible and the whole community benefits from new features and fixes.

Solidus v3.0 is a release that respects this mindset. In fact, Solidus v3.0 is nearly identical to the last v2.11.x version, with the only difference that the new one doesn't have the code that we deprecated during the v2.x lifecycle: if you don't see deprecation messages in your application logs, you should be good to upgrade your store with minimal effort.

Despite the easy upgrade path, there are some relevant things to consider when upgrading:

We do not require all of Rails by default anymore

By requiring rails/all, Solidus was loading a bunch of unnecessary code that was probably consuming more memory than necessary. This change only loads what's strictly needed and allows stores that want to cherry-pick certain parts of Rails to benefit from the more attentive choice.

Active Storage by Default

Both Solidus v2.11 and Solidus v3.0 come with full support for Rails 6.1, 6.0 and 5.2. With Solidus v3.0 as default on new stores, we ship fully working Active Storage support. In future versions, we will remove the Paperclip dependency because Active Storage is becoming the new standard for Rails developers.

This change won't impact your existing store as long as you keep using Paperclip as the attachment module with:

Spree::Config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
Spree::Config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment'

Discarded Paranoia

We finally completed the heroic work started by John Hawthorn to remove paranoia and introduce a new gem for soft-deleting records. This gem is called discard and provides a more explicit interface when dealing with record deletion. After a deprecation cycle, this is now the only supported way to soft-delete records in the codebase. No more surprises when deleting or destroying records!

Unified Name in Address

We removed all usage of split firstname and lastname for addresses since this concept is not valid in all cultures around the world. Now we have a single field in the system called name.

In the last version of Solidus in the v2.x series, we added the name attribute to the database and started to populate it with the combination of firstname and lastname. We also provided a rake task to populate the name field for existing records, in order to make the database consistent, and ready to switch Spree::Config.use_combined_first_and_last_name_in_address to true, which will be the only supported value in Solidus v3.0.

We suggest migrating to this new schema before the upgrade to v3.0. You can follow this approach:

  1. Upgrade to the latest v2.11.x version
  2. Run bin/rails railties:install:migrations and bin/rails db:migrate
  3. Run the dedicated rake task bin/rails solidus:upgrade:two_point_eleven that will migrate the address fields
  4. Switch the Spree::Config.use_combined_first_and_last_name_in_address preference to true

This process will make your application behave exactly as it will with v3.0, which only removes the support for that preference being false.

Removed preferences

We removed some preferences that were controlling deprecated behaviors. You probably already changed their value to remove the deprecations from your logs but when upgrading, be sure they are not used in your codebase since they do not exist anymore. They are:

  • Spree::Config.raise_with_invalid_currency
  • Spree::Config.redirect_back_on_unauthorized
  • Spree::Config.run_order_validations_on_order_updater
  • Spree::Config.use_legacy_order_state_machine
  • Spree::Config.use_legacy_store_credit_reimbursement_category_name
  • Spree::Config.consider_actionless_promotion_active
  • Spree::Config.use_legacy_address_state_validator
  • Spree::Config.use_combined_first_and_last_name_in_address

Please take a look at the CHANGELOG for a detailed list of changes.

Troubles upgrading?

If you have any issue when upgrading, you can find support on this thread on GitHub Discussion or in the #support channel of our Slack Workspace.

Thanks!

Thanks to all code contributors that made Pull Requests during the 2.x lifecycle, especially to John Hawthorn and the rest of what was the Stembolt team.

Thanks to all financial contributors that help the ecosystem supporting the development of Solidus and its community via our Open Collective page.

This release couldn't be possible without you all!