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

Split Checkout form component into smaller files (II) #3106

Merged
merged 3 commits into from
Sep 7, 2020

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Sep 2, 2020

This is a follow-up of #3062 and part of the fixes I will add for #2319.

How to test the changes in this Pull Request:

Do some smoke testing of the Checkout block:

  • create a new page and add the Checkout block, change some attributes in the sidebar and verify changes take place
  • verify the Checkout block works in the frontend: try changing your address, picking a different shipping and payment method, etc.
  • verify you can make a purchase

@Aljullu Aljullu added status: needs review type: refactor The issue/PR is related to refactoring. skip-changelog PRs that you don't want to appear in the changelog. block: checkout Issues related to the checkout block. labels Sep 2, 2020
@Aljullu Aljullu added this to the 3.4.0 milestone Sep 2, 2020
@Aljullu Aljullu requested a review from a team as a code owner September 2, 2020 11:04
@Aljullu Aljullu self-assigned this Sep 2, 2020
@Aljullu Aljullu requested review from senadir and removed request for a team September 2, 2020 11:04
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2020

Size Change: +597 B (0%)

Total Size: 1.11 MB

Filename Size Change
build/active-filters-frontend.js 8.79 kB +4 B (0%)
build/active-filters.js 8.85 kB +3 B (0%)
build/all-products-frontend.js 31.2 kB +6 B (0%)
build/all-products.js 35.7 kB -11 B (0%)
build/all-reviews.js 9.79 kB -1 B
build/atomic-block-components/add-to-cart-frontend.js 8.89 kB +3 B (0%)
build/atomic-block-components/add-to-cart.js 7.46 kB -1 B
build/atomic-block-components/add-to-cart~atomic-block-components/button.js 3.16 kB -1 B
build/atomic-block-components/button-frontend.js 2.02 kB -2 B (0%)
build/atomic-block-components/button.js 836 B +1 B
build/atomic-block-components/category-list-frontend.js 470 B +1 B
build/atomic-block-components/image.js 1.15 kB +1 B
build/atomic-block-components/price-frontend.js 2.1 kB -1 B
build/atomic-block-components/price.js 2.13 kB -1 B
build/atomic-block-components/rating-frontend.js 522 B -2 B (0%)
build/atomic-block-components/rating.js 525 B -2 B (0%)
build/atomic-block-components/sku-frontend.js 388 B -1 B
build/atomic-block-components/stock-indicator.js 572 B +1 B
build/atomic-block-components/summary.js 924 B -1 B
build/atomic-block-components/tag-list-frontend.js 467 B +1 B
build/atomic-block-components/title-frontend.js 1.23 kB -2 B (0%)
build/atomic-block-components/title.js 1.06 kB +1 B
build/attribute-filter-frontend.js 18.1 kB +1 B
build/attribute-filter.js 12.4 kB +3 B (0%)
build/blocks.js 3.54 kB -2 B (0%)
build/cart-frontend.js 69 kB -9 B (0%)
build/cart.js 37.4 kB +5 B (0%)
build/checkout-frontend.js 84.5 kB +317 B (0%)
build/checkout.js 41 kB +263 B (0%)
build/featured-category.js 7.72 kB +3 B (0%)
build/featured-product.js 9.97 kB +3 B (0%)
build/handpicked-products.js 7.37 kB -1 B
build/price-filter-frontend.js 14.4 kB +4 B (0%)
build/price-filter.js 10.3 kB +4 B (0%)
build/product-categories.js 3.23 kB +1 B
build/product-category.js 8.37 kB -4 B (0%)
build/product-new.js 7.6 kB +1 B
build/product-tag.js 6.52 kB -1 B
build/product-top-rated.js 7.57 kB +1 B
build/products-by-attribute.js 8.32 kB +2 B (0%)
build/reviews-by-product.js 13.4 kB +12 B (0%)
build/reviews-frontend.js 9.37 kB +2 B (0%)
build/single-product.js 10.1 kB +4 B (0%)
build/vendors.js 416 kB -8 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/atomic-block-components/add-to-cart~atomic-block-components/image~atomic-block-components/title.js 335 B 0 B
build/atomic-block-components/category-list.js 475 B 0 B
build/atomic-block-components/image-frontend.js 1.71 kB 0 B
build/atomic-block-components/sale-badge-frontend.js 863 B 0 B
build/atomic-block-components/sale-badge.js 865 B 0 B
build/atomic-block-components/sku.js 394 B 0 B
build/atomic-block-components/stock-indicator-frontend.js 568 B 0 B
build/atomic-block-components/summary-frontend.js 918 B 0 B
build/atomic-block-components/tag-list.js 472 B 0 B
build/editor-rtl.css 13.9 kB 0 B
build/editor.css 13.9 kB 0 B
build/product-best-sellers.js 7.44 kB 0 B
build/product-on-sale.js 7.99 kB 0 B
build/product-search.js 3.56 kB 0 B
build/reviews-by-category.js 11.8 kB 0 B
build/single-product-frontend.js 34 kB 0 B
build/style-rtl.css 18 kB 0 B
build/style.css 18 kB 0 B
build/vendors-style-rtl.css 1.03 kB 0 B
build/vendors-style.css 1.03 kB 0 B
build/vendors~atomic-block-components/price-frontend.js 5.65 kB 0 B
build/wc-blocks-data.js 7.09 kB 0 B
build/wc-blocks-middleware.js 931 B 0 B
build/wc-blocks-registry.js 2.28 kB 0 B
build/wc-payment-method-bacs.js 790 B 0 B
build/wc-payment-method-cheque.js 787 B 0 B
build/wc-payment-method-cod.js 875 B 0 B
build/wc-payment-method-paypal.js 831 B 0 B
build/wc-payment-method-stripe.js 11.9 kB 0 B
build/wc-settings.js 2.33 kB 0 B
build/wc-shared-context.js 1.53 kB 0 B
build/wc-shared-hocs.js 1.66 kB 0 B

compressed-size-action

Comment on lines +64 to +73
addressFieldsConfig={ addressFieldsConfig }
billingFields={ billingFields }
defaultAddressFields={ defaultAddressFields }
requirePhoneField={ requirePhoneField }
setPhone={ setPhone }
setShippingAsBilling={ setShippingAsBilling }
setShippingFields={ setShippingFields }
shippingAsBilling={ shippingAsBilling }
shippingFields={ shippingFields }
showPhoneField={ showPhoneField }
Copy link
Member

Choose a reason for hiding this comment

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

I feel like we're passing too many props to each component, maybe we can move the hook to inside ShippingFieldsStep and BillingFieldsStep, this is unrelated to this PR, just an idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found some weird behavior when calling useCheckoutAddress() from ShippingFieldsStep and BillingFieldsStep separately, that's why I moved it one level up so the hook is shared by both components. I will proceed merging as-is, we can investigate it further in the future.

@Aljullu Aljullu merged commit 9ac1768 into main Sep 7, 2020
@Aljullu Aljullu deleted the fix/split-checkout-block-ii branch September 7, 2020 15:43
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. type: refactor The issue/PR is related to refactoring.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants