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

Domain Site Redirect: Use shoppingCartManager to add products in SiteRedirectStep #50282

Merged
merged 7 commits into from
Feb 23, 2021

Conversation

sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Feb 19, 2021

Changes proposed in this Pull Request

As part of removing CartStore (see #24019), this PR replaces the code in SiteRedirectStep that adds a redirect product to the cart with functions from @automattic/shopping-cart.

site-redirect-step

Testing instructions

@matticbot
Copy link
Contributor

@sirbrillig sirbrillig self-assigned this Feb 19, 2021
@matticbot
Copy link
Contributor

matticbot commented Feb 19, 2021

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

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

name                   parsed_size           gzip_size
entry-main                  +105 B  (+0.0%)      +28 B  (+0.0%)
entry-login                 +105 B  (+0.0%)      +30 B  (+0.0%)
entry-gutenboarding         +105 B  (+0.0%)      +26 B  (+0.0%)
entry-domains-landing       +105 B  (+0.0%)      +35 B  (+0.0%)

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

Sections (~48 bytes removed 📉 [gzipped])

name      parsed_size           gzip_size
checkout       -145 B  (-0.0%)       +6 B  (+0.0%)
domains         -19 B  (-0.0%)      -54 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.

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.

@sirbrillig sirbrillig marked this pull request as ready for review February 19, 2021 17:45
@sirbrillig sirbrillig requested a review from a team as a code owner February 19, 2021 17:45
@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 19, 2021
@sirbrillig sirbrillig requested a review from a team February 19, 2021 17:45
@sirbrillig sirbrillig added [Estimate] 1 [Feature Group] Emails & Domains Features related to email integrations and domain management. labels Feb 19, 2021
@sirbrillig sirbrillig mentioned this pull request Feb 19, 2021
Copy link
Contributor

@klimeryk klimeryk left a comment

Choose a reason for hiding this comment

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

Tested and works - with the exception that there's a significant delay between clicking the "Add" button and anything happening. I know it's because of the async call to the shopping cart, etc., but to the user (or a CEO testing these flows... ;)), it could appear like you need to click a few times to get it to "work". Would it be possible to add a busy state to the button while we're waiting for the shopping cart to refresh/reload?

@sirbrillig
Copy link
Member Author

sirbrillig commented Feb 22, 2021

Good thinking. I added a busy state and disabled the button (I always forget that the former does not imply the latter). Updated the description to include a gif.

@sirbrillig
Copy link
Member Author

Failing tests seem to be unrelated.

@nbloomf
Copy link
Contributor

nbloomf commented Feb 23, 2021

Testing works as expected, and the busy/disabled button also works. Using the X to leave checkout goes back to the Site Redirect page.

@nbloomf nbloomf added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 23, 2021
@sirbrillig sirbrillig merged commit d43ffa7 into trunk Feb 23, 2021
@sirbrillig sirbrillig deleted the update/site-redirect-use-shopping-cart branch February 23, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Estimate] 1 [Feature Group] Emails & Domains Features related to email integrations and domain management.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants