Major/New Features
Rails 6.0 support 💥 💥 💥
Spree 4.0 is fully compatible with Rails 6.0 and the new default Zeitwerk code autoloader.
Storefront and Admin Panel moved to Bootstrap 4.2 🎨
We've migrated both the default Spree frontend and Admin Panel from Bootstrap 3 to Bootstrap 4.2. This update brings all of the new features and fixes introduced in Bootstrap 4, 4.1 and 4.2. Accessibility and RWD were also improved in the process.
Besides the Spree Frontend and Admin Panel we've also upgraded all extensions that required fixes, that is:
- Auth Devise
- I18n
- Multi Currency
- Analytics Trackers
- Digital
- Social
- Editor
- Recently Viewed
- Related Products
- Static Content
- Email to friend
- Volume Pricing
- Braintree vzero
- Product Assembly
If you use any of those extensions please update them along with the Spree update.
Address Book support 🏠
Previously for multiple addresses support you had to use the Spree Address Book extension. We've decided that this was an inconsistency (user account already supported multiple credit cards) and moved this code into the core Spree and improved it.
Thanks to this signed in customers can manage multiple addresses in the Checkout and Account for both Shipping and Billing.
JSON-LD structured data support 🌐
To support schema.org we've replaced the old Microdata code with the new recommended JSON-LD format. This will make your store more future proof and improve SEO in the coming months.
Installation
Add Spree gems to Gemfile
gem 'spree', '~> 4.0'
gem 'spree_auth_devise', '~> 4.0'
gem 'spree_gateway', '~> 3.6'
Run bundle install
Use the install generators to set up Spree
rails g spree:install --user_class=Spree::User
rails g spree:auth:install
rails g spree_gateway:install
Upgrade
Official Spree 3.7 to 4.0 upgrade guide
Noteworthy changes
Please review each of the noteworthy changes to ensure your customizations or extensions are not affected. If you are affected by a change and have any suggestions please submit a PR to help the next person!
-
Added presence and uniqueness validation for
Country#iso
andCountry#iso3
attributes -
Added additional default zones (Asia, South America, Middle East)
-
Fixed potential XSS on Product Page
-
Added ability to set time parts of a promotion period
-
Use API v2 for country state and zip in the Checkout address form
-
Added id to currency & security card divs in Admin Panel General Settings for easier override
-
Added
.cache
class in Admin Panel General Settings for easier override -
Added
Order#valid_promotions
andOrder#valid_promotion_ids
methods -
Updated
factory_bot
to5.0
-
Updated
cancancan
to3.0
-
Updated
Capybara
to3.24
-
Updated
rspec-rails
to4.0
-
Updated
ransack
to3.2.0
-
Moved
ProductScopes
into a Concern -
Deprecated
TestingSupport::ControllerRequests
methods likespree_get
,spree_post
etc -
Removed deprecated
OrderContents
-
Removed deprecated
Address#iso_name
method -
Removed deprecated
Adjustment#open
andAdjustment#closed
scopes -
Removed deprecated
BaseHelper#variant_options
method -
Removed deprecated
Order#set_currency
method -
Removed deprecated
Order#register_line_item_comparison_hook
method -
Removed deprecated
Order#guest_token
method -
Removed deprecated
Address#same_as
method -
Removed deprecated hash case in
Order#create_line_items_from_params
-
Removed deprecated
Order#line_item_options_match
-
Removed deprecated
OrdersController#populate
andOrdersController#populate_redirect
actions -
Removed deprecated
RespondWith
module -
Replaced
Spree::ProductScopes
with a concern -
Replaced deprecated
chromedriver-helper
withwebdrivers
gem -
Replaced
ControllerRequests#spree_
methods with standard get/post/put/etc -
Dropped
acts-as-taggable-on
dependency and tag support. This will be later moved into an extension afteracts-as-taggable-on
will fully support Rails 6.0 -
Dropped
Paperclip
support -
Dropped
deface
dependency -
Dropped
versioncake
dependency -
Dropped
rspec-collection_matchers
dependency -
Dropped
rspec-its
dependency
Full Changelog
You can view the full changes using Github Compare.