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

Woo Store: Remove LabelSettings and dependencies #50491

Merged
merged 9 commits into from
Mar 2, 2021

Conversation

sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Feb 25, 2021

Changes proposed in this Pull Request

This removes LabelSettings from the Woo Store code (which has been disabled).

By so doing, it also allows us to remove AddCardDialog, which allows removing PaymentMethodForm, CreditCardFormFields, and PaymentCountrySelect as none of these are used anywhere else. PaymentCountrySelect is the last place to use the code from lib/cart/actions which will also allow us to remove the CartStore in the near future (see #24019).

If there's some desire to have label settings continue to work on the Woo Store, we could put a link from there to the wp-admin version, but I'm not sure it's necessary.

Fixes #48421
Fixes #48966
Related to #49433

Testing instructions

  • Verify that the page where LabelSettings is being removed from cannot be accessed. This is at Store > Settings > Shipping as described here.
  • Verify that none of the removed components are being used anywhere else.

@sirbrillig sirbrillig requested a review from a team as a code owner February 25, 2021 18:31
@matticbot
Copy link
Contributor

@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 Feb 25, 2021
@sirbrillig sirbrillig self-assigned this Feb 25, 2021
@sirbrillig sirbrillig requested review from mattsherman and a team February 25, 2021 18:32
@sirbrillig sirbrillig mentioned this pull request Feb 25, 2021
@sirbrillig sirbrillig changed the title Woo: Remove LabelSettings and dependencies Woo Store: Remove LabelSettings and dependencies Feb 25, 2021
@matticbot
Copy link
Contributor

matticbot commented Feb 25, 2021

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

App Entrypoints (~323 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-main                 -1212 B  (-0.1%)     -320 B  (-0.1%)
entry-domains-landing       -412 B  (-0.1%)     -121 B  (-0.1%)
entry-login                 -375 B  (-0.0%)     -104 B  (-0.0%)
entry-gutenboarding         -375 B  (-0.0%)     -111 B  (-0.0%)

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

Sections (~12067 bytes removed 📉 [gzipped])

name                      parsed_size           gzip_size
woocommerce                 -192755 B  (-8.2%)   -52769 B  (-8.2%)
site-purchases                -1562 B  (-0.1%)     -765 B  (-0.2%)
purchases                     -1562 B  (-0.1%)     -277 B  (-0.1%)
checkout                      -1347 B  (-0.1%)     +569 B  (+0.2%)
domains                        -452 B  (-0.0%)     +681 B  (+0.2%)
settings-writing               -341 B  (-0.1%)    -1142 B  (-0.7%)
stats                          -232 B  (-0.0%)    -1585 B  (-1.0%)
plugins                        -220 B  (-0.0%)     -706 B  (-0.4%)
settings                       -195 B  (-0.0%)      -37 B  (-0.0%)
media                          -159 B  (-0.0%)     -667 B  (-0.5%)
gutenberg-editor               -133 B  (-0.0%)      -30 B  (-0.0%)
devdocs                        -108 B  (-0.1%)      -38 B  (-0.1%)
site-blocks                    +103 B  (+0.0%)       +9 B  (+0.0%)
privacy                        +103 B  (+0.0%)       +9 B  (+0.0%)
notification-settings          +103 B  (+0.0%)       +9 B  (+0.0%)
me                             +103 B  (+0.0%)      +12 B  (+0.0%)
happychat                      +103 B  (+0.0%)       +7 B  (+0.0%)
account                        -103 B  (-0.0%)      -22 B  (-0.0%)
google-my-business              +97 B  (+0.0%)     +439 B  (+0.5%)
security                        -86 B  (-0.0%)      +19 B  (+0.0%)
home                            -79 B  (-0.0%)       +5 B  (+0.0%)
signup                          -71 B  (-0.0%)      -28 B  (-0.0%)
woocommerce-installation        -37 B  (-0.0%)     -102 B  (-0.2%)
settings-security               -37 B  (-0.0%)       -9 B  (-0.0%)
settings-performance            -37 B  (-0.0%)      -76 B  (-0.1%)
settings-jetpack                -37 B  (-0.0%)       -9 B  (-0.0%)
scan                            -37 B  (-0.0%)       -9 B  (-0.0%)
purchase-product                -37 B  (-0.0%)      -11 B  (-0.0%)
plans                           -37 B  (-0.0%)       +5 B  (+0.0%)
jetpack-connect                 -37 B  (-0.0%)      -26 B  (-0.0%)
jetpack-cloud-settings          -37 B  (-0.0%)       -9 B  (-0.0%)
jetpack-cloud-pricing           -37 B  (-0.0%)      -11 B  (-0.0%)
incoming-redirect               -37 B  (-0.5%)      -10 B  (-0.3%)
help                            -37 B  (-0.0%)       -9 B  (-0.0%)
export                          -37 B  (-0.0%)      -10 B  (-0.0%)
email                           -37 B  (-0.0%)      -10 B  (-0.0%)
concierge                       -37 B  (-0.0%)      -10 B  (-0.0%)
backup                          -37 B  (-0.0%)       -9 B  (-0.0%)
activity                        -37 B  (-0.0%)      -11 B  (-0.0%)
posts-custom                    +24 B  (+0.0%)      -85 B  (-0.1%)
posts                           +24 B  (+0.0%)      -85 B  (-0.1%)
marketing                       -13 B  (-0.0%)     +138 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 (~549 bytes removed 📉 [gzipped])

name                                                       parsed_size           gzip_size
async-load-calypso-blocks-editor-checkout-modal                -1319 B  (-0.1%)     -295 B  (-0.1%)
async-load-design-blocks                                        -264 B  (-0.0%)     -752 B  (-0.1%)
async-load-calypso-post-editor-media-modal                       -79 B  (-0.0%)     -388 B  (-0.4%)
async-load-calypso-post-editor-editor-media-modal                -79 B  (-0.0%)     -433 B  (-0.4%)
async-load-calypso-extensions-woocommerce-app-store-stats        -49 B  (-0.1%)     -173 B  (-1.2%)
async-load-signup-steps-user                                     -37 B  (-0.0%)      -23 B  (-0.1%)
async-load-signup-steps-rewind-form-creds                        -37 B  (-0.1%)       -9 B  (-0.1%)
async-load-signup-steps-plans-atomic-store                       -37 B  (-0.0%)      -11 B  (-0.0%)
async-load-signup-steps-plans                                    -37 B  (-0.0%)      -11 B  (-0.0%)
async-load-signup-steps-domains                                  -37 B  (-0.0%)     +163 B  (+0.2%)
async-load-signup-steps-creds-permission                         -37 B  (-0.1%)       -9 B  (-0.1%)
async-load-signup-steps-creds-confirm                            -37 B  (-0.1%)       -9 B  (-0.1%)
async-load-signup-steps-clone-credentials                        -37 B  (-0.1%)       -9 B  (-0.0%)
async-load-calypso-my-sites-sidebar-unified                      -37 B  (-0.0%)       -8 B  (-0.0%)
async-load-calypso-my-sites-sidebar                              -37 B  (-0.0%)       -8 B  (-0.0%)
async-load-calypso-layout-nps-survey-notice                      -37 B  (-0.1%)      -10 B  (-0.1%)
async-load-calypso-components-jetpack-sidebar                    -37 B  (-0.0%)       -8 B  (-0.0%)
async-load-calypso-blocks-inline-help                            -32 B  (-0.0%)      -12 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.

@mattsherman
Copy link
Contributor

Thanks for pinging me on this @sirbrillig -- I'll take a look at this today.

Copy link
Contributor

@nbloomf nbloomf left a comment

Choose a reason for hiding this comment

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

I'm not comfortable reviewing the WC-related functionality, but I did check that none of this code is used elsewhere. There may be some still-used stuff that can be moved elsewhere after this cleanup but that can happen later.

Copy link
Contributor

@mattsherman mattsherman left a comment

Choose a reason for hiding this comment

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

I did not exhaustively verify that the remove components are not used anywhere, but I did verify that you can no longer access the page in the WooCommerce extension that was using LabelSettings. We'd have some issues if we were to disable the feature flag removing Store, but there are no plans to do that and we are starting the work of removing that feature flag so that there is no way to re-enable Store.

So, I think that is is okay to merge this PR.

Nice cleanup!

@sirbrillig sirbrillig force-pushed the remove/payment-method-form branch from 3b9bbc2 to 6178d6c Compare March 2, 2021 20:09
@sirbrillig sirbrillig merged commit ae96e10 into trunk Mar 2, 2021
@sirbrillig sirbrillig deleted the remove/payment-method-form branch March 2, 2021 20:29
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 2, 2021
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.

Billing: Replace PaymentMethodForm Remove inline Woo shipping labels payment management if it is unused
4 participants