Skip to content

Commit d021dca

Browse files
Upgrade instructions for v3.3
We're now going to host the upgrade instructions for new Solidus releases in our guides. We start with v3.3.
1 parent 48a859b commit d021dca

File tree

5 files changed

+171
-0
lines changed

5 files changed

+171
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Upgrading Solidus",
3+
"position": 7,
4+
"collapsible": false,
5+
"collapsed": false
6+
}

docs/upgrading-solidus/v3.3.mdx

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
import PRLink from '@site/src/theme/PRLink';
6+
7+
# Solidus v3.3 (2022-01-15)
8+
9+
New year, new Solidus release! This time, we acknowledge our [new policy around Ruby & Rails support](https://solidus.io/release_policy/). It also comes with new features, bug fixes, as well as some deprecations that will be removed in the next major release. Take the time to upgrade. We've committed with the community to release more often, so keeping up to date will help you when Solidus v4.0 is out, which will happen sooner than later.
10+
11+
Before getting hands-on, please review our generic [upgrade guides](/getting-started/upgrading-solidus.mdx). You can also check the complete [Changelog](https://github.com/solidusio/solidus/blob/v3.3/CHANGELOG.md) in our repository.
12+
13+
## <PRLink description="Added support for Ruby v3.2" number="4817" />
14+
15+
Solidus v3.3 comes with support for the recently released v3.2 of Ruby. You can safely upgrade to it without Solidus getting in your way.
16+
17+
## <PRLink description="Removed support for Ruby v2.5" number="4845" />
18+
19+
With v3.3, Solidus performs a long-due cleanup of its codebase, removing support for EOL's Ruby versions v2.5 & v2.6. If you're on Solidus v3.2 and you want to upgrade to v3.3:
20+
21+
- Update your Solidus v3.2 store to Ruby v2.6.
22+
- Update your Solidus v3.2 store to Ruby v2.7.
23+
- Update your Solidus v3.2 store to v3.3.
24+
25+
## <PRLink description="Removed support for Ruby v2.6" number="4848" />
26+
27+
Solidus v3.3 no longer supports Ruby v2.6, which reached the EOL status. You'll need to:
28+
29+
- Update your Solidus v3.2 store to Ruby v2.7.
30+
- Update your Solidus v3.2 store to v3.3.
31+
32+
## <PRLink description="Removed support for Rails v5.2" number="4850" />
33+
34+
Rails v5.2 (EOL) support has been removed from Solidus v3.3:
35+
36+
- Update your Solidus v3.2 store to Rails v6.0.
37+
- Update your Solidus v3.2 store to v3.3.
38+
39+
## <PRLink description="Support for the new Colorado delivery fee" number="4491" />
40+
41+
We've updated our taxation system to support the new [Colorado retail delivery fee](https://tax.colorado.gov/retail-delivery-fee):
42+
43+
- Create a new `Spree::Zone` for the state of Colorado.
44+
- Create a new `Spree::TaxRate` within that zone, with:
45+
- The new `Spree::Calculator::FlatFee` as its base calculator.
46+
- An amount of 0.27$.
47+
- The new `Spree::TaxRate#level` enum to `:order`
48+
49+
We also provide a task to help with the process (it'll add the new tax to the default category if it exists):
50+
51+
```bash
52+
bundle exec rake taxes:colorado_delivery_fee
53+
```
54+
55+
## <PRLink description="Deprecated #redirect_back_or_default" number="4533" />
56+
57+
We've deprecated the `#redirect_back_or_default` method. Instead, you should use:
58+
59+
- [`#stored_spree_user_location_or`](https://www.rubydoc.info/github/plataformatec/devise/Devise/Controllers/StoreLocation) when using solidus_auth_devise.
60+
- [Rails' `#redirect_back`](https://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_back) method for Rails < v7.0.
61+
- [Rails' `#redirect_back_or_to`](https://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_back_or_to) method for Rails >= v7.0.
62+
63+
## <PRLink description="Version upgraded for packaged underscore.js" number="4660" />
64+
65+
We've upgraded the packaged version of [underscore.js](https://underscorejs.org/) from v1.8.3 to v1.13.6. In case you were using it, check compatibility.
66+
67+
## <PRLink description="Deprecated #mails_from preference" number="4712" />
68+
69+
We've deprecated the `#mails_from` preference, as it wasn't used in the Solidus codebase anymore. Make sure you aren't using it for anything else. Otherwise, the expected way to handle the default `From:` field for transactional emails is the `Spree::Store#mail_from_address` attribute.
70+
71+
## <PRLink description="Configurable promotion adjuster" number="4460" />
72+
73+
You can now change what the default promotion adjuster does. Configure the `Spree::Config.promotion_adjuster_class` preference with a class that takes the order on initialization and responds to the `#adjust!` method.
74+
75+
```ruby title="config/initializers/spree.rb"
76+
Spree.config do |config|
77+
# ...
78+
config.promotion_adjuster_class = 'MyStore::PromotionAdjuster'
79+
end
80+
```
81+
82+
```ruby title="app/models/my_store/promotion_adjuster.rb"
83+
module MyStore
84+
class PromotionAdjuster
85+
def initialize(order)
86+
@order = order
87+
end
88+
89+
def adjust!
90+
# ...
91+
end
92+
end
93+
end
94+
```
95+
96+
## <PRLink description="Configurable algorithm to prioritize store credits" number="4677" />
97+
98+
Before v3.3, store credits were always sorted by the priority of their type. Now you can change that behavior by configuring the `Spree::Config.store_credit_prioritizer_class` preference with a class that takes the store credits and the order on initialization and responds to the `#call` method.
99+
100+
```ruby title="config/initializers/spree.rb"
101+
Spree.config do |config|
102+
# ...
103+
config.store_credit_prioritizer_class = 'MyStore::StoreCreditPrioritizer'
104+
end
105+
```
106+
107+
```ruby title="app/models/my_store/store_credit_prioritizer.rb"
108+
module MyStore
109+
class StoreCreditPrioritizer
110+
def initialize(store_credits, order)
111+
@store_credits = store_credits
112+
@order = order
113+
end
114+
115+
def call
116+
# ...
117+
end
118+
end
119+
end
120+
```
121+
122+
## <PRLink description="Allow shipping category on variants" number="4739" />
123+
124+
It was already possible for a variant to have a different tax category than its product. Now, that's also true for the shipping category.
125+
126+
## <PRLink description="Default implementation for PaymentMethod#try_void" number="4843" />
127+
128+
When adding a new payment integration, it was required to implement the `PaymentMethod#try_void` method. However, it turned out that the logic was always very similar. We now provide a default implementation that would be enough in most situations.
129+
130+
## <PRLink description="Variant and product autocomplete functions flexibility with Ransack" number="4767" />
131+
132+
It's now possible to customize the autocompletion for variants and products on the backend via a callback returning a Ransack query. E.x.:
133+
134+
```javascript
135+
$('#product-dropdown').productAutocomplete({
136+
multiple: false,
137+
searchCallback: (searchString) => ({
138+
q: {
139+
name_cont: searchString,
140+
available_on_not_null: true
141+
})
142+
}
143+
})
144+
```

src/css/custom.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,14 @@
1919
--ifm-color-primary-lightest: #ffffff;
2020
--ifm-background-color: #242830;
2121
}
22+
23+
.pull_request {
24+
background: url('/static/img/pr.png') center left/1em no-repeat;
25+
display: inline-block;
26+
padding-left: 1.1em;
27+
}
28+
29+
h2 a.pull_request {
30+
color: #000;
31+
font-size: 90%;
32+
}

src/theme/PRLink.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
import PRIcon from '@site/static/img/pr.png';
3+
4+
export default function PRLink(props) {
5+
return (
6+
<a class="pull_request" href={ `https://github.com/solidusio/solidus/pull/${ props.number }` }>
7+
{ props.description }
8+
</a>
9+
);
10+
};

static/img/pr.png

7.57 KB
Loading

0 commit comments

Comments
 (0)