Skip to content
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: Move useStorageAddOns logic selection in pricing meta hook #96800

Open
wants to merge 24 commits into
base: trunk
Choose a base branch
from

Conversation

jeyip
Copy link
Contributor

@jeyip jeyip commented Nov 26, 2024

Related to #96520 (comment)

Proposed Changes

  • Query AddOns.useStorageAddOns hook internally within UsePricingMetaForGridPlans hook
  • Replace storageAddOns param in UsePricingMetaForGridPlans hook with reflectStorageSelectionInPlanPrices
  • Fix any associated tests

Why are these changes being made?

  • TBD

Testing Instructions

  • Visit /start/plans
  • Select different storage add-on options for annual Business and Ecommerce plans
  • Verify that the header pricing and billing timeframe update accordingly
  • Repeat for the logged in plans page
  • Go to /plans/:site?flags=plans/term-savings-price-display and /start/plans?flags=plans/term-savings-price-display
  • Ensure that when storage add-ons are selected for business or ecommerce annual plans, the header price doesn't change
  • Smoke test several other instances where the usePricingMetaForGridPlans is used

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@jeyip jeyip requested review from a team as code owners November 26, 2024 23:29
@jeyip jeyip requested a review from chriskmnds November 26, 2024 23:29
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 26, 2024
Copy link

github-actions bot commented Nov 26, 2024

Link to live branch is being generated...
Please wait a few minutes and refresh this page.

@jeyip jeyip changed the base branch from trunk to update/term-savings-pricing-to-ignore-storage-addon-selections November 26, 2024 23:29
@jeyip jeyip self-assigned this Nov 27, 2024
@jeyip jeyip force-pushed the update/term-savings-pricing-to-ignore-storage-addon-selections branch from a182e23 to 5d964b7 Compare November 27, 2024 03:10
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from fc40618 to 8b6d87e Compare November 27, 2024 03:10
@jeyip jeyip marked this pull request as draft November 27, 2024 07:18
@jeyip jeyip force-pushed the update/term-savings-pricing-to-ignore-storage-addon-selections branch from 5d964b7 to ce1f94a Compare December 1, 2024 09:56
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from 29359ce to 93c1053 Compare December 1, 2024 09:57
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from 286c4ab to 03833bd Compare December 2, 2024 00:50
@matticbot
Copy link
Contributor

matticbot commented Dec 2, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • command-palette-wp-admin
  • help-center
  • notifications
  • odyssey-stats
  • whats-new

To test WordPress.com changes, run install-plugin.sh $pluginSlug refactor/storage-add-on-selection-in-pricing-meta-hook on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Dec 2, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~11 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-stepper              +1530 B  (+0.1%)      +11 B  (+0.0%)
entry-main                 +1206 B  (+0.1%)       -6 B  (-0.0%)
entry-subscriptions          -90 B  (-0.0%)      -27 B  (-0.0%)
entry-login                  -90 B  (-0.0%)      -27 B  (-0.0%)
entry-domains-landing        -90 B  (-0.0%)      -27 B  (-0.0%)
entry-browsehappy            -90 B  (-0.0%)      -27 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~31943 bytes removed 📉 [gzipped])

name                        parsed_size           gzip_size
domains                        +12435 B  (+0.6%)    +3996 B  (+0.7%)
site-purchases                 +12416 B  (+0.8%)    +3869 B  (+0.9%)
purchases                      +12416 B  (+0.6%)    +3869 B  (+0.6%)
posts-custom                   +12342 B  (+1.8%)    +3344 B  (+1.6%)
posts                          +12342 B  (+1.8%)    +3344 B  (+1.6%)
migrate                        +12239 B  (+3.4%)    +3474 B  (+3.2%)
import-hosted-site-flow        +12201 B  (+1.5%)    +3471 B  (+1.4%)
stats                          +12131 B  (+1.1%)    +3860 B  (+1.2%)
theme                          +11564 B  (+1.5%)    +3287 B  (+1.4%)
checkout                       +10868 B  (+0.6%)    +1971 B  (+0.4%)
site-overview                    +686 B  (+0.0%)     +413 B  (+0.1%)
hosting                          +686 B  (+0.0%)     +393 B  (+0.1%)
plans                            +587 B  (+0.0%)     +331 B  (+0.1%)
update-design-flow               +529 B  (+0.0%)     +394 B  (+0.1%)
link-in-bio-tld-flow             +524 B  (+0.0%)     +538 B  (+0.1%)
plugins                          +462 B  (+0.0%)     +361 B  (+0.0%)
jetpack-app                      +448 B  (+0.1%)      -70 B  (-0.1%)
marketplace                      +198 B  (+0.0%)     +730 B  (+0.2%)
signup                           -120 B  (-0.0%)       -8 B  (-0.0%)
with-theme-assembler-flow        +108 B  (+0.1%)       +8 B  (+0.1%)
update-options-flow              +108 B  (+0.2%)       +9 B  (+0.1%)
trial-wooexpress-flow            +108 B  (+0.2%)       +8 B  (+0.1%)
tailored-ecommerce-flow          +108 B  (+0.2%)       +8 B  (+0.1%)
site-setup-wg                    +108 B  (+0.1%)       +9 B  (+0.0%)
site-setup-flow                  +108 B  (+0.1%)       +9 B  (+0.0%)
site-migration-flow              +108 B  (+0.1%)       +9 B  (+0.1%)
readymade-template-flow          +108 B  (+0.1%)       +8 B  (+0.0%)
migration-signup                 +108 B  (+0.2%)       +8 B  (+0.1%)
migration-flow                   +108 B  (+0.1%)       +9 B  (+0.1%)
import-flow                      +108 B  (+0.2%)       +7 B  (+0.1%)
hosted-site-migration-flow       +108 B  (+0.1%)       +9 B  (+0.1%)
free-post-setup-flow             +108 B  (+0.2%)       +9 B  (+0.1%)
entrepreneur-flow                +108 B  (+0.1%)       +7 B  (+0.0%)
assembler-first-flow             +108 B  (+0.1%)       +9 B  (+0.1%)
ai-assembler-flow                +108 B  (+0.1%)       +8 B  (+0.1%)
devdocs                           +78 B  (+0.0%)      +32 B  (+0.1%)
themes                            -30 B  (-0.0%)     -324 B  (-0.1%)

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 (~3197 bytes removed 📉 [gzipped])

name                                                 parsed_size           gzip_size
async-load-design-blocks                                +11534 B  (+0.5%)    +3200 B  (+0.5%)
async-load-signup-steps-plans-theme-preselected           +448 B  (+0.1%)      -70 B  (-0.1%)
async-load-signup-steps-plans                             +448 B  (+0.1%)      -70 B  (-0.1%)
async-load-signup-steps-theme-selection                    -30 B  (-0.0%)     -161 B  (-0.1%)
async-load-calypso-components-web-preview-component        +13 B  (+0.0%)      -17 B  (-0.0%)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@jeyip jeyip marked this pull request as ready for review December 2, 2024 01:16
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch 2 times, most recently from 08923dc to 570dd3b Compare December 2, 2024 18:47
@jeyip jeyip force-pushed the update/term-savings-pricing-to-ignore-storage-addon-selections branch from 4e4bd2f to 9598f54 Compare December 2, 2024 18:59
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from 570dd3b to f04f685 Compare December 2, 2024 19:00
@@ -49,7 +49,6 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > =
coupon: undefined,
planSlugs: [ visiblePlan ],
siteId: site.ID,
storageAddOns: null,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE:

Since the default value of reflectStorageSelectionInPlanPrices in the usePricingMetaForGridPlans hook is false, explicitly setting a falsey value is no longer necessary. It might, however, still be worthwhile to encourage this if we want other developers to be aware of the reflectStorageSelectionInPlanPrices flag.

I'm inclined to remove the param, if folks feel otherwise I'm happy to add back an explicit reflectStorageSelectionInPlanPrices: false argument.

@jeyip jeyip force-pushed the update/term-savings-pricing-to-ignore-storage-addon-selections branch from ab98e6b to ac2b991 Compare December 5, 2024 20:01
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from e064cfa to 18e4c82 Compare December 6, 2024 00:56
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from 18e4c82 to d182f3f Compare December 6, 2024 00:58
@jeyip jeyip force-pushed the refactor/storage-add-on-selection-in-pricing-meta-hook branch from 175c9ae to 0939ee5 Compare December 6, 2024 01:09
@jeyip jeyip removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 6, 2024
@jeyip jeyip force-pushed the update/term-savings-pricing-to-ignore-storage-addon-selections branch from 82f95b3 to acd3c2d Compare December 13, 2024 20:39
Base automatically changed from update/term-savings-pricing-to-ignore-storage-addon-selections to trunk December 14, 2024 07:14
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Multi-year Plans by Default Experiment [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants