Skip to content

Conversation

chriskmnds
Copy link
Contributor

@chriskmnds chriskmnds commented Sep 27, 2023

Related to #78266
Takes over #80915

Proposed Changes

Converts the main package component plans-grid into an index of individual parts, exported and assembled at the consuming end. We effectively now export FeaturesGrid and ComparisonGrid separately, and a single gridPlans prop in place of gridPlansForFeauresGrid, etc.

Additional Notes

  • There is some repetition in the "wrappers" exported from the main index file, and that's intentional. All of that will gradually shrink to simply reflected imports as we clean up more dependencies i.e. there will be no need for these wrappers altogether.
  • The ComparisonGrid carries its title along, which is something incredibly small that we can handle in a follow-up.
  • A props refactor should also happen on top of this PR. A separate issue exists: Plans 2023: Revise and split the grid component props #82335
  • Some performance concerns are being handled in a separate PR. For the most part, things should be functioning reasonably.

Testing Instructions

  • Confirm /start and /plans/[ paid | free ] render as before
  • Confirm tailored flows (newsletter, wooexpress) work as before
  • Confirm plan-term toggle works correctly

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md 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)?

@github-actions
Copy link

github-actions bot commented Sep 27, 2023

@matticbot
Copy link
Contributor

matticbot commented Sep 27, 2023

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

Sections (~52 bytes removed 📉 [gzipped])

name                  parsed_size           gzip_size
update-design-flow         +765 B  (+0.1%)      -52 B  (-0.0%)
plugins                    +765 B  (+0.0%)      -52 B  (-0.0%)
plans                      +765 B  (+0.1%)      -52 B  (-0.0%)
link-in-bio-tld-flow       +765 B  (+0.0%)      -52 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 (~52 bytes removed 📉 [gzipped])

name                                             parsed_size           gzip_size
async-load-signup-steps-plans-theme-preselected       +765 B  (+0.2%)      -52 B  (-0.0%)
async-load-signup-steps-plans                         +765 B  (+0.2%)      -52 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.

@chriskmnds chriskmnds marked this pull request as ready for review September 27, 2023 13:41
@chriskmnds chriskmnds requested a review from a team as a code owner September 27, 2023 13:41
@chriskmnds chriskmnds requested a review from jeyip September 27, 2023 13:41
@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 Sep 27, 2023
@chriskmnds chriskmnds marked this pull request as draft September 27, 2023 13:45
@chriskmnds chriskmnds removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 27, 2023
Base automatically changed from update/plans-grid-2023-split-parts-folder-restructure to trunk September 28, 2023 05:46
@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 Sep 28, 2023
@chriskmnds chriskmnds force-pushed the update/plans-grid-2023-split-parts-take-2 branch from 2156557 to 213a9e4 Compare September 28, 2023 10:10
Comment on lines +29 to +39
/*
* TODO clk: On PlansGridProps:
* 1. These props need to be split into what's needed separately for the internal grids and what's needed for the exported wrappers.
* This is currently also used as the internal type for the FeaturesGrid (wrongly).
* - onUpgradeClick is only needed for the wrappers exported from here. Internally the grids take a transformed
* handleUpgradeClick/onUpgradeClick function (force renamed to handleUpgradeClick in FeaturesGrid)
* - allFeaturesList is only relevant for the ComparisonGrid
* - gridPlanForSpotlight is only relevant for the FeaturesGrid
* - etc.
* 2. Explicitly set optional props and default values. Only absolutely vital props should be required.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This we ought to address in a bit of immediate follow-up. We may consider splitting these props across several pieces, and updating the respective READMEs while at it, possibly:

  1. ContextProps (not exported) all the props that pertain to things added to the context
  2. SharedPlansGridProps (not exported) all the props that are shared between the FeaturesGrid and ComparisonGrid (et al)
  3. ComparisonGridProps
  4. FeaturesGridProps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a separate issue for this #82335

@chriskmnds chriskmnds marked this pull request as ready for review September 28, 2023 11:40
@chriskmnds
Copy link
Contributor Author

Some performance concerns are being handled in a separate PR. For the most part, things should be functioning reasonably.

Performance optimisations addressed in #82403

Copy link
Contributor

@southp southp left a comment

Choose a reason for hiding this comment

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

Following the test plan I previously wrote it all works as expected :) On top of that test plan, I've also tried out the storage add-on dropdown, term toggle, plan picker of the comparison grid, and the mobile resolutions. Oh my, we really should compile a QA guide or something 🙃

I do notice there are some things broken in the comparison grid in /plans, e.g. the styling of the Free plan is missing, the tooltips are flashing, "show features" requires 3 clicks to be expanded. However, those also happen in production so should be tracked and resolved separately from this 🚢

@chriskmnds
Copy link
Contributor Author

Thanks @southp .

I do notice there are some things broken in the comparison grid in /plans, e.g. the styling of the Free plan is missing, the tooltips are flashing, "show features" requires 3 clicks to be expanded. However, those also happen in production so should be tracked and resolved separately from this 🚢

I don't notice these in the live image 🤔

Do you mind confirming and we can create a few issues for them?

"show features" requires 3 clicks to be expanded.

This sounds pretty severe. Do you mean the "show all features" toggle in the mobile cards?

@chriskmnds chriskmnds merged commit 0331b7b into trunk Oct 4, 2023
@chriskmnds chriskmnds deleted the update/plans-grid-2023-split-parts-take-2 branch October 4, 2023 10:09
@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 Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants