woocommerce / woocommerce-blocks

(Deprecated) This plugin has been merged into woocommerce/woocommerce
https://wordpress.org/plugins/woo-gutenberg-products-block/
GNU General Public License v3.0
406 stars 219 forks source link

Don't use `@wordpress/components` on the frontend #8452

Open kmanijak opened 1 year ago

kmanijak commented 1 year ago

There are two versions of a library used in the repo:

@wordpress-components - dedicated to use in the editor wordpress-components - dedicated to use in the frontend.

However, the library itself is not intended to be used in the frontend, hence the movement to remove such dependency.

The goal of this issue is to remove the frontend dependency on the library (so to get rid of wordpress-components) and allow to bump @wordpress-components.

Path Components PR Notes
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/grouped.tsx Placeholder https://github.com/woocommerce/woocommerce-blocks/pull/8438 Remove usage - unreachable code
assets/js/atomic/blocks/product-elements/add-to-cart/product-types/variable/variation-attributes/attribute-select-control.tsx SelectControl
assets/js/base/components/button/index.tsx Button
assets/js/base/components/cart-checkout/totals/shipping/shipping-rate-selector.tsx Notice
assets/js/base/components/combobox/index.tsx ComboboxControl
assets/js/base/components/drawer/index.tsx Modal #9345
assets/js/base/components/form-token-field/index.tsx FormTokenField
assets/js/blocks/attribute-filter/block.tsx Notice https://github.com/woocommerce/woocommerce-blocks/pull/8457 Move to Editor
assets/js/blocks/cart/inner-blocks/cart-express-payment-block/edit.tsx Placeholder, Button https://github.com/woocommerce/woocommerce-blocks/pull/8432 Replaced with @wordpress/components
assets/js/blocks/cart-checkout-shared/payment-methods/no-payment-methods/index.js Placeholder, Button, Notice
assets/js/blocks/checkout/inner-blocks/checkout-express-payment-block/edit.tsx Placeholder, Button https://github.com/woocommerce/woocommerce-blocks/pull/8432 Replaced with @wordpress/components
assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx experimentalRadio, \experimentalRadioGroup
assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx Notice
assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/no-shipping-placeholder/index.js Placeholder, Button https://github.com/woocommerce/woocommerce-blocks/pull/8463 Move to Editor
assets/js/blocks/rating-filter/block.tsx Notice https://github.com/woocommerce/woocommerce-blocks/pull/8444 Move the dependency to Editor
packages/checkout/index.js SlotFillProvider
packages/checkout/components/store-notice/index.tsx Notice
packages/checkout/components/store-notices-container/snackbar-notices.tsx SnackbarList
packages/checkout/components/store-notices-container/store-notices.tsx Notice
packages/checkout/slot/index.js createSlotFill, __experimentalUseSlot, useSlot

The remaining rows should be addressed as a whole. Here's the unfinished work: https://github.com/woocommerce/woocommerce-blocks/pull/8421

Aljullu commented 1 year ago

Heads-up about #8659, which is removing the Notice dependency from several blocks.