-
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
Plans (Storage): Separate plan features from add-ons, holistically. Additional refactors #91937
Plans (Storage): Separate plan features from add-ons, holistically. Additional refactors #91937
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
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 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~75 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~71 bytes removed 📉 [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 (~78 bytes removed 📉 [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. |
@southp @jeyip I think this goes back to early discussions about the storage dropdown. It's definitely been touched on in #79041, but I can't find a clear reference. As of these changes, and a couple of follow-ups, the distinction between storage as plan feature and storage as add-on/upgrade should be fairly discrete. This is essentially the outcome from this layer of refactors (quoting from description):
|
Hey @chriskmnds! Pretty busy today but will make sure to take a look at this tomorrow morning 👍 |
1f92a86
to
dc27ff3
Compare
Thanks @jeyip . If I can get a bit of help with testing, then that would be really helpful. It's obviously quite prone to conflicts with 20+ file changes. I'm building on top of this more refactors 😬 |
Hey Christos! Thanks for the patience and apologies for the delay. I'll be testing this after dinner tonight 🙂 |
TestingRequirementsTesting with Calypso live. For each of the flows listed below:
Browsers
Notes
|
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.
Started code reviewing but running out of steam tonight. Will continue reviewing first thing tomorrow.
dc27ff3
to
e1ece11
Compare
Thank you @jeyip ! I really appreciate your insightful testing, always 😊
Thanks. It was missing a check on "available storage add-ons", so it was rendering the dropdown irrespective of purchased/not-purchased (and getting messed up too). It should be fixed in the last updates. Also extracted a Edit: well actually, moving the hook and plan eligibility to |
Confirmed that the bug is fixed :D
I'll keep an eye out for this refactor and retest when completed. I was really excited when I saw the logic moved into there 😆 It feels way more intuitive, but I understand why we need to move it back. |
@@ -673,14 +670,7 @@ const getPlanFreeDetails = (): IncompleteWPcomPlan => ( { | |||
FEATURE_SITE_ACTIVITY_LOG_JP, | |||
FEATURE_SHARES_SOCIAL_MEDIA_JP, | |||
], | |||
get2023PricingGridSignupStorageOptions: () => { |
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.
Non-blocking / no response needed
:
Thanks for slowly disentangling the storage add-on from the concept of features 🎉
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.
There are quite a large volume of changes 😆
I did my best to go through the files and understand the intention behind each of your updates. I didn't see anything concerning. In fact, more than anything, the changes bring lots of clarity to the structure and organization of storage add-ons as they relate to the plans grid.
- Thoughtful renaming of the dropdown 👍
- Happy to see the removal of tangled storage add-on references and features from within the
plans-list
, thestorage-feature
component, scss file, etc.
Things feel way more straightforward, and I'm excited to see this in production. Besides updating the location of the use-available-storage-add-ons
hook, not sure if you have anything else planned for this PR, but the code looks great to me.
…ocs/clarifications & todo added
Thanks @jeyip ! We can actually keep the (keeping you happy 😃 ) |
…dditional refactors (#91937)
Related to #
Proposed Changes
The main change here revolves around separating the storage associated with a plan as a feature (which equates to the default storage the plan comes with), and the upgrade/add-on that may be available for purchase.
We previously intermingled these concepts at the data layer, defining the
StorageOption
property (now removed) on the plan definitions that included both (storage feature and storage add-ons).The other changes involve a bit of cleanup:
useAvailableStorageAddOns
)In follow-up PRs, we will separate these concepts even further, and rework the add-ons' logic to provide an indexed structure via add-on slugs (hence stop referencing storage add-on slugs in their
featureSlugs
properties).Why are these changes being made?
Main motivation:
The storage add-ons are really a platform/UI concern, not a plan property. The only related property that a plan can/should have is (1) the default storage that it comes with and (2) any upper limit on the amount of storage it could expand on. The UI can then serve products for that difference in 50GB, or 100GB, or 99GB, or any other increment or variable amount it desires. In principle/theory, this would be the more flexible approach, while keeping the data layer closer to definition - and further from client features.
Testing Instructions
/start/plans
/plans/[ site ]
is upgradeable with storage once (upgrade , then revisit/plans
- it should show the upgraded volume along with additional cost)/start/business/?storage=50gb-storage-add-on
Pre-merge Checklist