Skip to content

Conversation

@tyxla
Copy link
Member

@tyxla tyxla commented Mar 15, 2023

Proposed Changes

This PR migrates the WpcomPlansUI store to use createReduxStore() and register() instead of registerStore().

Part of #74399. A follow-up to #73890.

Testing Instructions

  • Verify /home/YOURSITE?domain=true where YOURSITE is a new simple site, still properly displays the domain upsell component, and that still works well:
    • You can still proceed to purchase your domain
    • You can still purchase the domain with a plan
    • You can still choose the Free plan, and purchase the domain separately.
  • Verify /plans still looks and works well.
  • Verify all checks are green.

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 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-ajp-p2)?

@tyxla tyxla added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Framework [Feature] Plans & Upgrades All of the plans on WordPress.com and flow for upgrading plans. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Data-Store labels Mar 15, 2023
@tyxla tyxla requested review from a team, chriskmnds, ddc22 and lupus2k March 15, 2023 12:55
@tyxla tyxla self-assigned this Mar 15, 2023
@matticbot
Copy link
Contributor

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

Sections (~53 bytes removed 📉 [gzipped])

Details
name   parsed_size           gzip_size
plans       -154 B  (-0.0%)      -53 B  (-0.0%)

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

Details
name                                                 parsed_size           gzip_size
async-load-calypso-my-sites-plan-features-2023-grid        -99 B  (-0.2%)      -30 B  (-0.2%)

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.

Copy link
Contributor

@noahtallen noahtallen left a comment

Choose a reason for hiding this comment

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

Tests well for me!

@tyxla tyxla merged commit 508df5d into trunk Mar 16, 2023
@tyxla tyxla deleted the refactor/wpcom-plans-ui-create-redux-store branch March 16, 2023 09:13
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 16, 2023
@chriskmnds
Copy link
Contributor

Thanks for making this refactor! So much better to just import and use these stores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Data-Store [Feature] Plans & Upgrades All of the plans on WordPress.com and flow for upgrading plans. Framework [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants