-
Notifications
You must be signed in to change notification settings - Fork 219
Remove the “Products (Beta)” block from WP 6.0 or lower #8112
Conversation
Too many APIs which are required for the Products block experience are just plainly unavailable in versions lower than 6.0.
The release ZIP for this PR is accessible via:
|
TypeScript Errors ReportFiles with errors: 436
assets/js/atomic/blocks/product-elements/add-to-cart/edit.js
assets/js/atomic/blocks/product-elements/button/block.js assets/js/atomic/blocks/product-elements/button/edit.js assets/js/atomic/blocks/product-elements/button/index.js assets/js/atomic/blocks/product-elements/price/block.js assets/js/atomic/blocks/product-elements/price/edit.js assets/js/atomic/blocks/product-elements/rating/block.tsx assets/js/atomic/blocks/product-elements/rating/index.ts assets/js/atomic/blocks/product-elements/sale-badge/index.ts assets/js/atomic/blocks/product-elements/sku/index.ts assets/js/atomic/blocks/product-elements/stock-indicator/index.ts assets/js/base/components/block-error-boundary/index.tsx assets/js/base/components/cart-checkout/address-form/test/index.js assets/js/base/components/cart-checkout/totals/shipping/has-shipping-rate.js assets/js/base/components/cart-checkout/totals/shipping/shipping-rate-selector.js assets/js/base/components/radio-control-accordion/index.js assets/js/base/components/reviews/review-list-item/index.js assets/js/base/components/reviews/review-list/index.js assets/js/base/components/reviews/review-sort-select/index.js assets/js/base/components/sidebar-layout/main.js assets/js/base/components/sidebar-layout/sidebar-layout.js assets/js/base/components/sidebar-layout/sidebar.js assets/js/base/context/event-emit/test/emitters.js assets/js/base/context/hooks/cart/use-store-cart-coupons.ts assets/js/base/context/hooks/use-checkout-notices.js assets/js/base/context/providers/cart-checkout/checkout-processor.js assets/js/base/context/providers/container-width-context.js assets/js/base/context/providers/editor-context.js assets/js/base/context/providers/index.js assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js assets/js/base/utils/errors.js assets/js/base/utils/render-frontend.tsx assets/js/blocks-registry/block-components/test/index.js assets/js/blocks-registry/payment-methods/test/payment-method-config-helper.ts assets/js/blocks-registry/payment-methods/test/registry.ts assets/js/blocks/attribute-filter/test/block.tsx assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-error-boundary.js assets/js/blocks/cart-checkout-shared/use-view-switcher.tsx assets/js/blocks/cart/block.js assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx assets/js/blocks/cart/inner-blocks/cart-items-block/frontend.tsx assets/js/blocks/cart/inner-blocks/cart-totals-block/frontend.tsx assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/edit.tsx assets/js/blocks/cart/test/block.js assets/js/blocks/cart/test/slots.js assets/js/blocks/checkout/block.tsx assets/js/blocks/checkout/inner-blocks/checkout-actions-block/block.tsx assets/js/blocks/checkout/inner-blocks/checkout-fields-block/frontend.tsx assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/test/block.js assets/js/blocks/checkout/inner-blocks/checkout-terms-block/test/edit.js assets/js/blocks/checkout/inner-blocks/checkout-terms-block/test/frontend.js assets/js/blocks/checkout/inner-blocks/checkout-totals-block/frontend.tsx assets/js/blocks/filter-wrapper/index.tsx assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/block.tsx assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-shopping-button-block/edit.tsx assets/js/blocks/mini-cart/test/block.js assets/js/blocks/rating-filter/test/block.tsx assets/js/blocks/single-product/block.js assets/js/blocks/single-product/edit/index.js assets/js/blocks/single-product/edit/layout-editor.js assets/js/blocks/stock-filter/test/block.tsx assets/js/data/cart/controls.js assets/js/data/cart/test/resolvers.js assets/js/editor-components/edit-product-link/index.js assets/js/previews/cart.ts node_modules/@wordpress/element/node_modules/@types/react/index.d.ts packages/checkout/components/order-shipping-packages/index.js packages/checkout/components/store-notices-container/index.tsx packages/checkout/components/text-input/test/validated-text-input.tsx packages/prices/utils/price.ts |
Size Change: -49 B (0%) Total Size: 1.01 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is good and everything tests as described:
- Tested on v5.9.5 and confirmed Products (Beta) block was not available.
- Tested on v6.1.1 and confirmed Products (Beta) block was available.
LGTM! 🚀
* Empty commit for release pull request * Fix for Rating alignment when used in Products block and Classic Template (#8104) * Hide `core/no-results` as default in Product Query if WP <= 5.9 (#8082) `core/no-results` was not available until WP 6.0. * Update the readme * Add testing notes * Remove the “Products (Beta)” block from WP 6.0 or lower (#8112) * Remove the Products block from WP < 6.0 Too many APIs which are required for the Products block experience are just plainly unavailable in versions lower than 6.0. * Revert "Fix for Rating alignment when used in Products block and Classic Template (#8104)" This reverts commit 8af92ee. Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: kmanijak <karol.manijak@automattic.com> Co-authored-by: Lucio Giannotta <lucio.giannotta@a8c.com>
@sunyatasattva this PR should be merged (now, cherry-picked 🙃 ) into |
@Aljullu Well, I'm thinking whether this is necessary: we already do not support WP <= 5.9 in the feature plugin, right? I guess we should cherry pick it in until Core doesn't support WP <= 5.9 anymore and then remove the fallback code to clean things up. What do you think? Or would you like to include this guard for WP <= 5.9 indefinitely? |
WC core will keep supporting WP 5.9 and 6.0 for several versions until WP 6.2 and 6.3 are released, which will happen in some months. Until then, we need to have this guard to avoid the Products block surfacing in WC core, because the code we have in WC Blocks ends up in WC core as-is. That's why I think we should have this guard in Once WC core removes support for WP 5.9 and 6.0, we will be able to remove the guard, but not before. Does it make sense? |
Yes, sorry, that is what I meant. I was thinking out loud, and thought it'd be nice to remove it once support is officially dropped from Core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rat 4 real
@jakerocksfour I'm not sure I understand. Do you have any feedback regarding this PR? We're always eager to hear more! |
WordPress 6.0 lacks several APIs that we used to make the Products (Beta) work. We tried to add a patchy compatibility, but it's messy and plainly not possible to hide the correct settings. So we decided (p1672851818395389-slack-C02UBB1EPEF) that it'd be better to just remove it from those versions.
Also, since #8104 applies only to the Products block, this PR reverts that fix.
Fixes #8069
Testing
User Facing Testing
WooCommerce Visibility
Performance Impact
Changelog