Skip to content

Conversation

@sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Mar 27, 2025

Proposed Changes

CheckoutProvider does too much. Previous efforts have been made (#81796, #81793, #80529) to move toward making it just a wrapper for a series of other providers (perhaps eventually replacing it entirely?), but there's still state that it maintains.

This PR moves all the state having to do with the list of payment methods to a new provider, PaymentMethodProvider.

Testing Instructions

Automated tests should handle most things.

@sirbrillig sirbrillig self-assigned this Mar 27, 2025
@github-actions
Copy link

github-actions bot commented Mar 27, 2025

@matticbot
Copy link
Contributor

matticbot commented Mar 27, 2025

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

Sections (~89 bytes added 📈 [gzipped])

Details
name                               parsed_size           gzip_size
site-purchases                          +734 B  (+0.0%)      +89 B  (+0.0%)
purchases                               +734 B  (+0.0%)      +89 B  (+0.0%)
jetpack-cloud-partner-portal            +734 B  (+0.1%)      +89 B  (+0.0%)
checkout                                +734 B  (+0.0%)      +89 B  (+0.0%)
a8c-for-agencies-purchases              +734 B  (+0.1%)      +89 B  (+0.0%)
a8c-for-agencies-client                 +734 B  (+0.1%)      +89 B  (+0.0%)
plans                                   +629 B  (+0.0%)      +74 B  (+0.0%)
jetpack-connect                         +629 B  (+0.1%)      +74 B  (+0.0%)
jetpack-cloud-pricing                   +629 B  (+0.1%)      +74 B  (+0.0%)
jetpack-cloud-plugin-management         +629 B  (+0.0%)      +74 B  (+0.0%)
jetpack-cloud-manage-pricing            +629 B  (+0.2%)      +74 B  (+0.1%)
jetpack-cloud-features-comparison       +629 B  (+0.1%)      +74 B  (+0.0%)
jetpack-cloud-agency-dashboard          +629 B  (+0.1%)      +74 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 (~89 bytes added 📈 [gzipped])

Details
name                                                                              parsed_size           gzip_size
async-load-calypso-blocks-editor-checkout-modal                                        +734 B  (+0.1%)      +89 B  (+0.0%)
async-load-signup-steps-page-picker                                                    +629 B  (+0.2%)      +74 B  (+0.1%)
async-load-purchase-modal-wrapper                                                      +629 B  (+0.2%)      +74 B  (+0.1%)
async-load-my-sites-checkout-purchase-modal-is-eligible-for-one-click-checkou...       +629 B  (+0.2%)      +74 B  (+0.1%)
async-load-masterbar-cart-masterbar-cart-wrapper                                       +629 B  (+0.5%)      +74 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.

@matticbot
Copy link
Contributor

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

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

  • blaze-dashboard
  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/payment-method-provider on your sandbox.

@sirbrillig sirbrillig marked this pull request as ready for review March 27, 2025 19:57
@sirbrillig sirbrillig requested a review from a team as a code owner March 27, 2025 19:57
@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 Mar 27, 2025
@sirbrillig sirbrillig merged commit 6c3d34b into trunk Mar 28, 2025
15 checks passed
@sirbrillig sirbrillig deleted the add/payment-method-provider branch March 28, 2025 14:18
@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 28, 2025
sirbrillig added a commit that referenced this pull request Mar 28, 2025
…102074)

CheckoutProvider does too much. Previous efforts have been made (#81796, #81793, #80529, #101974) to move toward making it just a wrapper for a series of other providers (perhaps eventually replacing it entirely?), but there's still state that it maintains.

This PR moves all the state having to do with the list of payment processor functions to the PaymentMethodProvider, since payment processor functions are closely tied to payment method objects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants