Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Changed Alba dependency to version 4 (#15028)

Damian Legawiec4bb58ba4bf07
diff --git a/docs/developer/upgrades/5.6-to-6.0.mdx b/docs/developer/upgrades/5.6-to-6.0.mdx
index 03167eeb44..9acee42903 100644
--- a/docs/developer/upgrades/5.6-to-6.0.mdx
+++ b/docs/developer/upgrades/5.6-to-6.0.mdx
@@ -968,6 +968,7 @@ Other changes that come with it:
- **The mailer view helpers are removed.** `Spree::MailHelper` (`name_for`), `Spree::BaseHelper` (`spree_storefront_resource_url`), `Spree::FulfillmentHelper` and `Spree::DigitalAssetHelper` are gone, and so are `spree_image_tag` and `spree_asset_aspect_ratio` from `Spree::ImagesHelper` (`spree_image_url` stays). Templates get the same values as serializer fields, such as `order.customer_name` and `item.url`.
- **Every email has a plain-text part**, generated from the HTML. Seven emails that had none now have one.
- **Alba moved into `spree_core`**, with its configuration, so core's staff emails render in installations without `spree_api`.
+- **Alba 4 is required.** It removes APIs that Alba 3 had deprecated. If your own serializers override `attributes` to filter fields, override `select` instead. Overrides of `converter` or `collection_converter` are no longer called: declare each output key as an `attribute` instead. Replace `Alba.resource_with` with `Alba.resource_for`, and `Alba.enable_inference!` with `Alba.inflector=`. See the [Alba changelog](https://github.com/okuramasafumi/alba/blob/main/CHANGELOG.md).
- **Your own mailers keep working.** A mailer that inherits `Spree::BaseMailer` and calls `mail` with its own ERB views is wrapped in the new email layout, and the `spree/shared/mailer_hero` and `mailer_button` partials remain for its views. See [Your own mailers](/developer/customization/emails#your-own-mailers).
## Money
diff --git a/spree/core/spree_core.gemspec b/spree/core/spree_core.gemspec
index fb825e3aa7..6198998701 100644
--- a/spree/core/spree_core.gemspec
+++ b/spree/core/spree_core.gemspec
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
s.add_dependency 'acts_as_list', '>= 0.8'
- s.add_dependency 'alba', '~> 3.0'
+ s.add_dependency 'alba', '~> 4.0'
s.add_dependency 'acts-as-taggable-on'
s.add_dependency 'awesome_nested_set', '~> 3.3', '>= 3.3.1'
s.add_dependency 'cancancan', '~> 3.2'