-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage add-ons v2: Expose the extended storage add-ons behind the feature flag. #97794
base: trunk
Are you sure you want to change the base?
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~1784 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~312 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested that the additional storage add-ons are displayed correctly when the flag is enabled. However, I was not able to add the 350GB addon to the cart. All other storage options worked.
Kapture.2024-12-30.at.16.00.32.mp4
featureSlugs: null, | ||
icon: spaceUpgradeIcon, | ||
quantity: 150, | ||
name: i18n.translate( '150 GB Storage' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I know that 100 GB Storage
and 50 GB Storage
are already translated, but I am wondering if changing the string to i18n.translate( '%d GB Storage', [ 150 ] )
could result in fewer strings to be translated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. I've added it here: 6e34a48. For 100G and 50G, I can update them later when everything is translated :)
@@ -1,17 +1,35 @@ | |||
export const STORAGE_LIMIT = 203; | |||
export const STORAGE_LIMIT = 403; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain this change? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the client side filter used here: https://github.com/Automattic/wp-calypso/blob/trunk/packages/data-stores/src/add-ons/hooks/use-available-storage-add-ons.ts#L19. From what I recall, that 3 was from when the Free plan had 3GB of storage. More details can be found here: fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Snqzva%2Qcyhtvaf%2Sjcpbz%2Qovyyvat%2Sqrsnhyg%2Qfubccvat%2Qpneg%2Qinyvqngbe.cuc%3Se%3Qn9n7n897%232327-og
While I'm thinking it's worth confirming whether it is needed from the client side, I choose to keep it for now.
Does that make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Going by my naive logic, when the max addon size was 100GB, the storage limit was 203. So if we increase the max addon size to 350GB, should it be 453 instead?
@aneeshd16 Thanks for the review 🙇🏼 Re:
I've confirmed that it is part of the same known issue as I described in the PR description:
I will open a follow-up backend PR for fixing it later. |
const isWithinStorageLimit = STORAGE_LIMIT >= currentMaxStorage - existingAddOnStorage + quantity; | ||
|
||
return existingAddOnStorage < quantity && quantity <= availableStorageUpgrade; | ||
return existingAddOnStorage < quantity && isWithinStorageLimit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this in my first pass - is there a way to test this change?
Rewriting the existing code, it should be:
const isWithinStorageLimit = STORAGE_LIMIT >= currentMaxStorage + quantity;
I do not understand why we subtract existingAddOnStorage
here. 🤔
@@ -1,17 +1,35 @@ | |||
export const STORAGE_LIMIT = 203; | |||
export const STORAGE_LIMIT = 403; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Going by my naive logic, when the max addon size was 100GB, the storage limit was 203. So if we increase the max addon size to 350GB, should it be 453 instead?
Related to #97221
Proposed Changes
This PR exposes the extended storage add-ons to the client side behind the feature flag,
upgrades/storage-add-on-v2
. The flag will be enabled by default in the development environment./add-ons
with the feature flag on:/plans
with the feature flag on:Caution:
Why are these changes being made?
For establishing the foundation of exposing the extended storage add-ons, i.e. 150G, 200G, 250G, 300G and 350G. It is feature-gated for now so we will be able to continuously deploy improvements without disturbing the production experience.
Testing Instructions
/add-ons
or the storage dropdown in/plans
.?flags=upgrades/storage-add-on-v2
, the extended storage add-ons should be available in/add-ons
and the storage dropdown in/plans
.Pre-merge Checklist