Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

WIP - Checkout i2 Feature Branch Tracking #4268

Merged
merged 100 commits into from
Jul 22, 2021
Merged

Conversation

mikejolley
Copy link
Member

@mikejolley mikejolley commented May 25, 2021

We'd like to merge the new Checkout i2 block into trunk flagged "experimental" to avoid this PR getting much larger now that many of the features are implemented. The block itself is not yet complete.

You can scan over the Checkout i2 block files if you wish, but as it's incomplete, focussing on the non-Checkout i2 block changes would be best when reviewing, since those parts can impact other blocks.

Closes #4444

This is a summary of changes outside of the Checkout i2 block that should be reviewed:

  • Store API - API level support for shipping phone in addition to billing phone. Both can be sent via the API, and both will be stored to meta data. The different values will not be visible in admin until core support is added.
  • blocks-registry - This is consumed by Checkout i2 to register (experiential) blocks for insertion into checkout areas. It's the extensibility interface. This should not impact other blocks, and this has test coverage.
  • icons - Additions for i2, and tweaks to existing icons to match.
  • ExternalLinkCard - Editor component used by i2 to link to WordPress admin pages.
  • Transforms - There is a new transform added to the old checkout to migration that is only present in experimental builds.
  • withScrollToTop HOC - Converted to a functional component to avoid Typescript errors.
  • CustomerDataContext - Moved some methods to this context so they are available outside of component state.
  • useCheckoutAddress - Support for shipping/billing phone
  • ShippingRatesControl - Avoid slot fill when previewing, because the slot fill is only available on the frontend.

Testing

  1. Smoke test current checkout - check for regressions, paying attention that phone field still saves after placing an order, and shipping rates are displayed correctly.
  2. Do a non-dev build and confirm Checkout i2 is not available.
  3. Do a dev build and confirm Checkout i2 is available.
  4. Try a transform between Checkout -> Checkout i2.
  5. Trigger an error on the old checkout - ensure it scrolls to the error notice (to test withScrollToTop).

@github-actions
Copy link
Contributor

github-actions bot commented May 25, 2021

Size Change: +102 kB (+11%) ⚠️

Total Size: 1.06 MB

Filename Size Change
build/active-filters-frontend.js 8.27 kB -8 B (0%)
build/active-filters.js 7.84 kB +2 B (0%)
build/all-products-frontend.js 23 kB +57 B (0%)
build/all-products.js 37.3 kB -241 B (-1%)
build/all-reviews.js 9.6 kB -9 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js 2.57 kB +4 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/button.js 1.82 kB -1 B (0%)
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js 334 B +1 B (0%)
build/atomic-block-components/add-to-cart-frontend.js 8.65 kB -4 B (0%)
build/atomic-block-components/add-to-cart.js 7.73 kB +9 B (0%)
build/atomic-block-components/button-frontend.js 1.74 kB +1 B (0%)
build/atomic-block-components/button.js 875 B +2 B (0%)
build/atomic-block-components/category-list-frontend.js 468 B -1 B (0%)
build/atomic-block-components/category-list.js 476 B -1 B (0%)
build/atomic-block-components/image-frontend.js 1.88 kB +8 B (0%)
build/atomic-block-components/image.js 1.35 kB +3 B (0%)
build/atomic-block-components/price-frontend.js 2.09 kB -1 B (0%)
build/atomic-block-components/price.js 2.11 kB -2 B (0%)
build/atomic-block-components/rating-frontend.js 561 B -1 B (0%)
build/atomic-block-components/sale-badge-frontend.js 857 B +1 B (0%)
build/atomic-block-components/sale-badge.js 867 B -1 B (0%)
build/atomic-block-components/sku.js 392 B -1 B (0%)
build/atomic-block-components/stock-indicator-frontend.js 609 B -1 B (0%)
build/atomic-block-components/stock-indicator.js 612 B +1 B (0%)
build/atomic-block-components/summary-frontend.js 907 B +1 B (0%)
build/atomic-block-components/tag-list-frontend.js 466 B +1 B (0%)
build/atomic-block-components/tag-list.js 470 B -1 B (0%)
build/atomic-block-components/title.js 1.29 kB +2 B (0%)
build/attribute-filter-frontend.js 17.9 kB -1 B (0%)
build/attribute-filter.js 11.9 kB +167 B (+1%)
build/blocks-checkout.js 21.2 kB +981 B (+5%) 🔍
build/cart-frontend.js 77.8 kB -532 B (-1%)
build/cart.js 45.6 kB -167 B (0%)
build/checkout-frontend.js 82 kB -591 B (-1%)
build/checkout.js 48.5 kB +400 B (+1%)
build/featured-category.js 7.4 kB +10 B (0%)
build/featured-product.js 9.55 kB +13 B (0%)
build/handpicked-products.js 6.56 kB +2 B (0%)
build/price-filter-frontend.js 14.3 kB -50 B (0%)
build/price-filter.js 9.59 kB +19 B (0%)
build/price-format.js 1.37 kB -1 B (0%)
build/product-best-sellers.js 6.73 kB +2 B (0%)
build/product-categories.js 3.38 kB -6 B (0%)
build/product-category.js 7.59 kB +1 B (0%)
build/product-new.js 6.89 kB +4 B (0%)
build/product-on-sale.js 7.23 kB -3 B (0%)
build/product-search.js 2.68 kB +2 B (0%)
build/product-tag.js 6.7 kB +9 B (0%)
build/product-top-rated.js 6.85 kB +3 B (0%)
build/products-by-attribute.js 7.82 kB +5 B (0%)
build/reviews-by-category.js 11.6 kB -2 B (0%)
build/reviews-by-product.js 13.1 kB +26 B (0%)
build/reviews-frontend.js 9.22 kB -3 B (0%)
build/single-product-frontend.js 25.7 kB +37 B (0%)
build/single-product.js 9.84 kB -23 B (0%)
build/vendors--atomic-block-components/price-frontend.js 5.71 kB +1 B (0%)
build/wc-blocks-data.js 10.8 kB -9 B (0%)
build/wc-blocks-editor-style-rtl.css 15.4 kB +453 B (+3%)
build/wc-blocks-editor-style.css 15.4 kB +453 B (+3%)
build/wc-blocks-middleware.js 1.48 kB -1 B (0%)
build/wc-blocks-registry.js 2.74 kB -9 B (0%)
build/wc-blocks-shared-hocs.js 1.75 kB +2 B (0%)
build/wc-blocks-style-rtl.css 19.7 kB +440 B (+2%)
build/wc-blocks-style.css 19.7 kB +451 B (+2%)
build/wc-blocks-vendors.js 235 kB -58 B (0%)
build/wc-settings.js 2.92 kB -9 B (0%)
build/checkout-blocks/sample.js 174 B +174 B (new file) 🆕
build/checkout-i2-frontend.js 51.7 kB +51.7 kB (new file) 🆕
build/checkout-i2.js 48.4 kB +48.4 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
build/atomic-block-components/rating.js 568 B
build/atomic-block-components/sku-frontend.js 388 B
build/atomic-block-components/summary.js 912 B
build/atomic-block-components/title-frontend.js 1.43 kB
build/wc-blocks-google-analytics.js 1.99 kB
build/wc-blocks-shared-context.js 1.54 kB
build/wc-blocks-vendors-style-rtl.css 1.05 kB
build/wc-blocks-vendors-style.css 1.05 kB
build/wc-blocks.js 3.51 kB
build/wc-payment-method-bacs.js 812 B
build/wc-payment-method-cheque.js 807 B
build/wc-payment-method-cod.js 903 B
build/wc-payment-method-paypal.js 844 B
build/wc-payment-method-stripe.js 12.3 kB

compressed-size-action

@mikejolley mikejolley force-pushed the feature/checkout-i2 branch from 60e5232 to c0251f7 Compare June 4, 2021 11:16
@mikejolley mikejolley force-pushed the feature/checkout-i2 branch 2 times, most recently from e4414a0 to 869172c Compare July 8, 2021 15:08
@mikejolley mikejolley mentioned this pull request Jul 12, 2021
2 tasks
@mikejolley mikejolley force-pushed the feature/checkout-i2 branch from 754e2a5 to 08d27d8 Compare July 15, 2021 14:51
@mikejolley mikejolley added skip-changelog PRs that you don't want to appear in the changelog. status: needs review block: checkout Issues related to the checkout block. labels Jul 20, 2021
@mikejolley mikejolley self-assigned this Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 20, 2021
@github-actions
Copy link
Contributor

Remove custom shipping_phone handling (requires WC 5.6+)

Remove custom shipping_phone handling (requires WC 5.6+)


https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/e62c42b6858e26e9e7685c4666ca795e311e79f8/src/StoreApi/Routes/CartUpdateCustomer.php#L123-L132

🚀 This comment was generated by the automations bot based on a todo comment in e62c42b in #4268. cc @mikejolley

@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@woocommerce woocommerce deleted a comment from github-actions bot Jul 21, 2021
@github-actions
Copy link
Contributor

Disable custom locking support if native support is detec...

Disable custom locking support if native support is detected.


https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/a3c4fb01f88f308b263f5e99df0cb76c4abc84c9/assets/js/blocks/cart-checkout/checkout-i2/hacks.ts#L85-L97

🚀 This comment was generated by the automations bot based on a todo comment in a3c4fb0 in #4268. cc @mikejolley

Copy link
Contributor

@nerrad nerrad left a comment

Choose a reason for hiding this comment

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

Thanks for handling the feedback Mike (especially around the concerns for dangerouslySetInnerHTML usage)! I still have a question around the potential (that I see) for the registered blocks array in a checkout area to be mutated. I'm okay with it being handled in a followup if you agree something should be done.

Also, there's an open question I asked in my previous review that I don't see an answer for:

I am wondering, with the pending L2->L0 policy change (likely merged this week), should we gate checkout and cart blocks availability to a hard WordPress 5.8 requirement?

The above could be done in a followup too.

With that in mind I'm pre-approving on the assumption my concerns will either be addressed in followups or in this PR before merge.

@mikejolley
Copy link
Member Author

I am wondering, with the pending L2->L0 policy change (likely merged this week), should we gate checkout and cart blocks availability to a hard WordPress 5.8 requirement?

I think we'll need to discuss this and work in a follow-up. My concern is that this check would be shifting as new versions are released, and it might make more sense to do detection higher up rather than on a per-block basis. For example, having a version check in the isExperimentalBuild function so that experimental functionality requires L0.

@mikejolley
Copy link
Member Author

Merging 🥳

@nerrad
Copy link
Contributor

nerrad commented Jul 22, 2021

I think we'll need to discuss this and work in a follow-up.

Yup I'm fine with a followup!

My concern is that this check would be shifting as new versions are released, and it might make more sense to do detection higher up rather than on a per-block basis. For example, having a version check in the isExperimentalBuild function so that experimental functionality requires L0.

Right that makes sense while something is still behind the experimental flag. As soon as it is surfaced in the plugin though I think we'll want to gate C&C blocks to the WP version supported at the time of release. Mostly because I'm expecting we will probably be surfacing to new WooCommerce users in Woo Core while Woo Core still has L2 support outside the range of what the blocks will require. But that's also something we could also plan for when we come to it I suppose.

My primary concern is that we whenever this is surfaced to feature plugin users we have some way of indicating what is the minimum version this will require to help inform the approach we take when we plan for surfacing in WooCommerce core.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: checkout Issues related to the checkout block. skip-changelog PRs that you don't want to appear in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkout i2: Prepare Feature Branch for Merge (with experimental flag)
4 participants