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

Experiment: Replace style hooks coming from @wordpress/block-editor #9251

Merged
merged 20 commits into from
May 12, 2023

Conversation

mikejolley
Copy link
Member

@mikejolley mikejolley commented Apr 26, 2023

This PR Fixes #8071 by pulling in style functions from the @wordpress/block-editor package for use on our frontend. Style rules come from block attributes—we just need to translate them to CSS.

While this does duplicate methods from Gutenberg, it does:

The downside is maintaining the utils inherited from Gutenberg.

While working on this and cleaning up style usage, I came across 3 blocks which had defined frontend scripts that were not used/needed. These need testing also (in instructions below).

Fixes #8071

Other Checks

  • This PR adds/removes a feature flag & I've updated this doc.
  • This PR adds/removes an experimental interfaces and I've updated this doc.
  • I tagged two reviewers because this PR makes queries to the database or I think it might have some security impact.

Testing

Automated Tests

  • Changes in this PR are covered by Automated Tests.
    • Unit tests
    • E2E tests

User Facing Testing

  1. Smoke test product blocks that have global styles applied.
  2. Specifically test adding a Stock and a Attribute filter to the template, as well as modifying text color to ensure it still applies to the frontend.
  3. Do the same for the price filter block.
  4. Ensure at least one product block had custom spacing, color, and typography applied, and that change was both visible in the editor, and on the frontend after saving the template/post.
  • Do not include in the Testing Notes

WooCommerce Visibility

  • WooCommerce Core
  • Feature plugin
  • Experimental

Performance Impact

This will have a positive impact on the size of dependencies on the frontend.

Changelog

Removed the block-editor dependency on the frontend.

@mikejolley mikejolley added type: refactor The issue/PR is related to refactoring. focus: performance The issue/PR is related to performance. labels Apr 26, 2023
@mikejolley mikejolley self-assigned this Apr 26, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 26, 2023

The release ZIP for this PR is accessible via:

https://wcblocks.wpcomstaging.com/wp-content/uploads/woocommerce-gutenberg-products-block-9251.zip

Script Dependencies Report

The compare-assets action has detected some changed script dependencies between this branch and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Removed
reviews-frontend.js wc-settings, wp-a11y, wp-api-fetch, wp-compose, wp-element, wp-i18n, wp-is-shallow-equal, wp-polyfill ⚠️
active-filters-frontend.js wc-blocks-data-store, wc-price-format, wc-settings, wp-data, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
all-products-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-style-engine, wp-url, wp-warning, wp-wordcount ⚠️
cart-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-plugins, wp-polyfill, wp-primitives, wp-style-engine, wp-url, wp-warning, wp-wordcount ⚠️
checkout-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-plugins, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
filter-wrapper-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-price-format, wc-settings, wp-a11y, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-style-engine, wp-url, wp-warning ⚠️
mini-cart-frontend.js wp-polyfill ⚠️
rating-filter-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-url, wp-warning ⚠️
mini-cart-component-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-price-format, wc-settings, wp-a11y, wp-autop, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-style-engine, wp-url, wp-warning, wp-wordcount ⚠️

This comment was automatically generated by the ./github/compare-assets action.

TypeScript Errors Report

  • Files with errors: 466
  • Total errors: 2252

⚠️ ⚠️ This PR introduces new TS errors on 17 files:

assets/js/atomic/blocks/product-elements/image/block.tsx

assets/js/atomic/blocks/product-elements/price/block.tsx

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/sale-badge/block.tsx

assets/js/atomic/blocks/product-elements/sku/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.tsx

assets/js/atomic/blocks/product-elements/summary/block.tsx

assets/js/atomic/blocks/product-elements/title/block.tsx

assets/js/blocks/active-filters/block-wrapper.tsx

assets/js/blocks/attribute-filter/block-wrapper.tsx

assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/block.tsx

assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/block.tsx

assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-items-counter-block/block.tsx

assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/block.tsx

assets/js/blocks/price-filter/block-wrapper.tsx

assets/js/blocks/rating-filter/block-wrapper.tsx

assets/js/blocks/stock-filter/block-wrapper.tsx

comments-aggregator

@github-actions
Copy link
Contributor

github-actions bot commented Apr 26, 2023

Size Change: -32.6 kB (-3%)

Total Size: 1.08 MB

Filename Size Change
build/active-filters-frontend.js 8.56 kB +6 B (0%)
build/active-filters-wrapper--attribute-filter-wrapper--price-filter-wrapper--rating-filter-wrapper--stoc--78b62dd5-frontend.js 0 B -2.31 kB (removed) 🏆
build/active-filters-wrapper-frontend.js 7.62 kB +2.94 kB (+63%) 🆘
build/active-filters.js 7.47 kB -4 B (0%)
build/all-products-frontend.js 11.9 kB -203 B (-2%)
build/all-products.js 39.1 kB +50 B (0%)
build/all-reviews.js 7.77 kB +1 B (0%)
build/attribute-filter-frontend.js 0 B -23.2 kB (removed) 🏆
build/attribute-filter-wrapper--rating-filter-wrapper--stock-filter-wrapper-frontend.js 0 B -5.53 kB (removed) 🏆
build/attribute-filter-wrapper-frontend.js 4.29 kB -349 B (-8%)
build/attribute-filter.js 13.1 kB -120 B (-1%)
build/breadcrumbs.js 2.05 kB +2 B (0%)
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.39 kB +9 B (+1%)
build/cart-blocks/cart-cross-sells-products-frontend.js 3.73 kB -1.8 kB (-32%) 🎉
build/cart-blocks/cart-express-payment--checkout-blocks/express-payment-frontend.js 5.17 kB +3 B (0%)
build/cart-blocks/cart-express-payment-frontend.js 719 B +2 B (0%)
build/cart-blocks/cart-items-frontend.js 301 B -1 B (0%)
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.37 kB -16 B (0%)
build/cart-blocks/cart-line-items-frontend.js 1.06 kB -2 B (0%)
build/cart-blocks/cart-order-summary-frontend.js 1.28 kB +1 B (0%)
build/cart-blocks/cart-totals-frontend.js 308 B +1 B (0%)
build/cart-blocks/empty-cart-frontend.js 345 B -1 B (0%)
build/cart-blocks/filled-cart-frontend.js 656 B +2 B (0%)
build/cart-blocks/order-summary-coupon-form-frontend.js 1.63 kB +1 B (0%)
build/cart-blocks/order-summary-discount-frontend.js 2.12 kB -1 B (0%)
build/cart-blocks/order-summary-heading-frontend.js 333 B +1 B (0%)
build/cart-blocks/order-summary-shipping-frontend.js 17 kB +11 B (0%)
build/cart-blocks/order-summary-taxes-frontend.js 433 B -1 B (0%)
build/cart-blocks/proceed-to-checkout-frontend.js 1.38 kB +1 B (0%)
build/cart-frontend.js 29.7 kB +62 B (0%)
build/cart.js 44.9 kB +153 B (0%)
build/catalog-sorting.js 1.7 kB -1 B (0%)
build/checkout-blocks/actions-frontend.js 1.85 kB +2 B (0%)
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 4.73 kB +2 B (0%)
build/checkout-blocks/billing-address-frontend.js 1.19 kB +4 B (0%)
build/checkout-blocks/contact-information-frontend.js 2.05 kB +3 B (0%)
build/checkout-blocks/express-payment-frontend.js 1.14 kB +6 B (+1%)
build/checkout-blocks/fields-frontend.js 330 B -1 B (0%)
build/checkout-blocks/order-note-frontend.js 1.14 kB +5 B (0%)
build/checkout-blocks/order-summary-cart-items-frontend.js 3.69 kB -1 B (0%)
build/checkout-blocks/order-summary-coupon-form-frontend.js 1.79 kB +2 B (0%)
build/checkout-blocks/order-summary-discount-frontend.js 2.29 kB +1 B (0%)
build/checkout-blocks/order-summary-frontend.js 1.28 kB +2 B (0%)
build/checkout-blocks/order-summary-shipping-frontend.js 17.1 kB +24 B (0%)
build/checkout-blocks/order-summary-subtotal-frontend.js 274 B +1 B (0%)
build/checkout-blocks/order-summary-taxes-frontend.js 433 B -2 B (0%)
build/checkout-blocks/payment-frontend.js 8.27 kB -9 B (0%)
build/checkout-blocks/pickup-options-frontend.js 4.8 kB -6 B (0%)
build/checkout-blocks/shipping-address-frontend.js 1.17 kB +5 B (0%)
build/checkout-blocks/shipping-method-frontend.js 2.59 kB -3 B (0%)
build/checkout-blocks/shipping-methods-frontend.js 6.34 kB -4 B (0%)
build/checkout-blocks/terms-frontend.js 1.56 kB +6 B (0%)
build/checkout-blocks/totals-frontend.js 312 B +2 B (+1%)
build/checkout-frontend.js 31.3 kB +24 B (0%)
build/checkout.js 46.3 kB -4 B (0%)
build/customer-account.js 3.18 kB -3 B (0%)
build/featured-category.js 15 kB +564 B (+4%)
build/featured-product.js 15.2 kB +522 B (+4%)
build/filter-wrapper-frontend.js 14.2 kB +29 B (0%)
build/filter-wrapper.js 2.4 kB +1 B (0%)
build/handpicked-products.js 7.99 kB -9 B (0%)
build/legacy-template.js 6.33 kB +1 B (0%)
build/mini-cart-component-frontend.js 28.9 kB -108 B (0%)
build/mini-cart-contents-block/cart-button-frontend.js 1.97 kB +1.1 kB (+128%) 🆘
build/mini-cart-contents-block/checkout-button-frontend.js 1.97 kB +1.1 kB (+127%) 🆘
build/mini-cart-contents-block/filled-cart-frontend.js 266 B -2 B (-1%)
build/mini-cart-contents-block/footer-frontend.js 4.3 kB +1.06 kB (+33%) 🚨
build/mini-cart-contents-block/products-table-frontend.js 592 B +3 B (+1%)
build/mini-cart-contents-block/shopping-button-frontend.js 757 B -3 B (0%)
build/mini-cart-contents-block/title-frontend.js 1.91 kB +821 B (+76%) 🆘
build/mini-cart-contents-block/title-items-counter-frontend.js 1.61 kB +877 B (+120%) 🆘
build/mini-cart-contents-block/title-label-frontend.js 1.54 kB +877 B (+133%) 🆘
build/mini-cart-contents.js 17.9 kB +10 B (0%)
build/mini-cart-frontend.js 2.15 kB -4 B (0%)
build/mini-cart.js 4.2 kB -1 B (0%)
build/price-filter-frontend.js 0 B -14.5 kB (removed) 🏆
build/price-filter-wrapper-frontend.js 6.75 kB +971 B (+17%) ⚠️
build/price-filter.js 8.47 kB -2 B (0%)
build/product-add-to-cart--product-rating.js 0 B -151 B (removed) 🏆
build/product-add-to-cart-frontend.js 6.51 kB +12 B (0%)
build/product-add-to-cart.js 8.86 kB -16 B (0%)
build/product-button--product-image--product-price--product-rating--product-sale-badge--product-sku--prod--408017d2.js 0 B -262 B (removed) 🏆
build/product-button--product-image--product-price--product-rating--product-sale-badge--product-sku--prod--5bce0384.js 964 B +501 B (+108%) 🆘
build/product-button-frontend.js 2.65 kB +737 B (+38%) 🚨
build/product-button.js 4.01 kB -171 B (-4%)
build/product-category.js 9.35 kB -5 B (0%)
build/product-image-frontend.js 2.63 kB +795 B (+43%) 🚨
build/product-image.js 4.18 kB -132 B (-3%)
build/product-new.js 8.34 kB +1 B (0%)
build/product-on-sale.js 8.68 kB +1 B (0%)
build/product-price-frontend.js 203 B -1.97 kB (-91%) 🏆
build/product-price.js 1.68 kB -52 B (-3%)
build/product-rating-frontend.js 2.31 kB +861 B (+59%) 🆘
build/product-rating.js 999 B -39 B (-4%)
build/product-sale-badge-frontend.js 1.8 kB +829 B (+85%) 🆘
build/product-sale-badge.js 665 B -136 B (-17%) 👏
build/product-sku-frontend.js 1.84 kB +841 B (+84%) 🆘
build/product-sku.js 535 B -44 B (-8%)
build/product-stock-indicator-frontend.js 2.02 kB +838 B (+71%) 🆘
build/product-stock-indicator.js 731 B -40 B (-5%)
build/product-summary-frontend.js 2.19 kB +897 B (+69%) 🆘
build/product-summary.js 905 B -17 B (-2%)
build/product-tag.js 8.96 kB -9 B (0%)
build/product-title-frontend.js 2.22 kB +856 B (+63%) 🆘
build/product-title.js 3.7 kB -54 B (-1%)
build/product-top-rated.js 8.58 kB -1 B (0%)
build/products-by-attribute.js 9.7 kB -7 B (0%)
build/rating-filter-frontend.js 21.4 kB -130 B (-1%)
build/rating-filter-wrapper-frontend.js 6.21 kB +3.17 kB (+104%) 🆘
build/rating-filter.js 6.89 kB -126 B (-2%)
build/reviews-by-category.js 12.1 kB +1 B (0%)
build/reviews-by-product.js 13.2 kB +3 B (0%)
build/single-product.js 11.1 kB -33 B (0%)
build/stock-filter-frontend.js 0 B -21.8 kB (removed) 🏆
build/stock-filter-wrapper-frontend.js 2.98 kB -338 B (-10%) 👏
build/stock-filter.js 7.61 kB -124 B (-2%)
build/store-notices.js 1.69 kB +3 B (0%)
build/vendors--attribute-filter-wrapper--cart-blocks/order-summary-coupon-form--cart-blocks/order-summary--48e1e4bb-frontend.js 6.82 kB -3 B (0%)
build/vendors--attribute-filter-wrapper--cart-blocks/order-summary-shipping--checkout-blocks/billing-addr--d9f38f9d-frontend.js 4.21 kB +14 B (0%)
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--3c5fe802-frontend.js 5.26 kB +1 B (0%)
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.57 kB -1 B (0%)
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js 19.4 kB +12 B (0%)
build/vendors--checkout-blocks/shipping-method-frontend.js 12.5 kB +11 B (0%)
build/vendors--product-add-to-cart-frontend.js 7.26 kB +7 B (0%)
build/wc-blocks-vendors.js 65.2 kB +2 B (0%)
build/wc-blocks.js 2.63 kB +3 B (0%)
build/attribute-filter-wrapper--stock-filter-wrapper-frontend.js 4.05 kB +4.05 kB (new file) 🆕
build/cart-blocks/cart-cross-sells-products--product-price-frontend.js 2.94 kB +2.94 kB (new file) 🆕
build/product-add-to-cart--product-button--product-image--product-rating--product-title.js 151 B +151 B (new file) 🆕
build/vendors--attribute-filter-wrapper--stock-filter-wrapper-frontend.js 5.11 kB +5.11 kB (new file) 🆕
build/vendors--price-filter-wrapper-frontend.js 2.2 kB +2.2 kB (new file) 🆕
build/vendors--rating-filter-wrapper-frontend.js 5.11 kB +5.11 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
build/blocks-checkout.js 35.1 kB
build/cart-blocks/cart-cross-sells-frontend.js 253 B
build/cart-blocks/order-summary-fee-frontend.js 273 B
build/cart-blocks/order-summary-subtotal-frontend.js 273 B
build/checkout-blocks/order-summary-fee-frontend.js 275 B
build/general-style-rtl.css 1.31 kB
build/general-style.css 1.31 kB
build/mini-cart-contents-block/empty-cart-frontend.js 360 B
build/mini-cart-contents-block/items-frontend.js 237 B
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-image--product-price--product-rating--product-sale-bad--49d3ecb2.js 251 B
build/product-best-sellers.js 8.34 kB
build/product-categories.js 2.36 kB
build/product-query.js 11.6 kB
build/product-results-count.js 1.66 kB
build/product-search.js 2.63 kB
build/reviews-frontend.js 7.1 kB
build/vendors--checkout-blocks/pickup-options--checkout-blocks/shipping-methods-frontend.js 8.25 kB
build/wc-blocks-data.js 22.5 kB
build/wc-blocks-editor-style-rtl.css 5.93 kB
build/wc-blocks-editor-style.css 5.92 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-middleware.js 933 B
build/wc-blocks-registry.js 3.15 kB
build/wc-blocks-shared-context.js 1.52 kB
build/wc-blocks-shared-hocs.js 1.75 kB
build/wc-blocks-style-rtl.css 27.7 kB
build/wc-blocks-style.css 27.6 kB
build/wc-blocks-vendors-style-rtl.css 1.96 kB
build/wc-blocks-vendors-style.css 1.96 kB
build/wc-payment-method-bacs.js 816 B
build/wc-payment-method-cheque.js 811 B
build/wc-payment-method-cod.js 909 B
build/wc-payment-method-paypal.js 837 B
build/wc-settings.js 2.6 kB
build/wc-shipping-method-pickup-location.js 30.3 kB
build/woo-directives-runtime.js 2.73 kB
build/woo-directives-vendors.js 7.91 kB

compressed-size-action

@mikejolley
Copy link
Member Author

Looks like it didn't remove all dependencies in the report, but I don't see them in my local build. Will investigate, should this be the approach we want to take.

Copy link
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

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

The code LGTM and it works!

The downside is maintaining the utils inherited from Gutenberg.

This is my concern too. If some logic will change in the future on Gutenberg/WordPress side, we have to update the logic too :/

assets/js/base/utils/get-inline-styles.ts Show resolved Hide resolved
@mikejolley mikejolley force-pushed the experiment/replace-block-editor-methods branch from a21bfad to 128a8a9 Compare May 2, 2023 12:13
@mikejolley
Copy link
Member Author

@nerrad I've hesitating pushing too hard because this is work that affects mostly FSE rather than Rubik, but it would be nice to resolve. I assume next steps are to get another review from a FSE team, and raise the issue upstream to make those hooks available. Is that correct?

@nerrad
Copy link
Contributor

nerrad commented May 4, 2023

Yes.

@mikejolley
Copy link
Member Author

Logged here: WordPress/gutenberg#50334

@mikejolley mikejolley force-pushed the experiment/replace-block-editor-methods branch from 112e1e1 to 8164c12 Compare May 4, 2023 14:31
@mikejolley mikejolley marked this pull request as ready for review May 4, 2023 14:45
@woocommercebot woocommercebot requested review from a team and opr and removed request for a team May 4, 2023 14:45
Copy link
Contributor

@opr opr left a comment

Choose a reason for hiding this comment

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

I tested this and it seems to be working fine, I played with a bunch of styling options on the products block and the filter blocks, it seems global styles are working fine for all of them.

I did not do a deep code review as I am very unfamiliar with this side of the project, but I looked at all files and didn't find anything that seems obviously problematic. Maybe one of the store editing teams could do a deeper review of the actual code?

Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

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

This is looking great, thanks for working on this, @mikejolley!

I left some inline comments in places where we can avoid spreading objects. It's a minor change but thought I would mention anyway because it keeps code simpler.

Besides that, the only regression I found is when changing the background color of the Product Title inner block in the All Products block:

trunk This branch
imatge imatge

@mikejolley mikejolley force-pushed the experiment/replace-block-editor-methods branch from cd6add0 to cb108e6 Compare May 12, 2023 12:29
@mikejolley
Copy link
Member Author

Thanks for the reviews @opr @Aljullu @tjcafferkey — I've adjusted those spreads, fixed the missing styles in atomic blocks, and retested. Tests are green so merging!

@mikejolley mikejolley merged commit a992c64 into trunk May 12, 2023
@mikejolley mikejolley deleted the experiment/replace-block-editor-methods branch May 12, 2023 12:42
@mikejolley mikejolley added this to the 10.3.0 milestone May 22, 2023
@mikejolley mikejolley added the type: technical debt This issue/PR represents/solves the technical debt of the project. label May 22, 2023
Aljullu added a commit that referenced this pull request May 30, 2023
Aljullu added a commit that referenced this pull request May 30, 2023
@Aljullu Aljullu mentioned this pull request May 30, 2023
4 tasks
Aljullu added a commit that referenced this pull request May 30, 2023
Aljullu added a commit that referenced this pull request May 30, 2023
Aljullu added a commit that referenced this pull request May 30, 2023
Aljullu added a commit that referenced this pull request May 30, 2023
* Empty commit for release pull request

* Empty commit for release pull request

* Add 10.0.6 changelog

* Update versions to 10.0.6

* Fix Mini-Cart block check to see whether a script has already been enqueued (#9649)

* Add 10.0.6 testing steps

* Partially uplift #9251 to 10.0.x (#9654)

* Update testing ZIP

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
Aljullu added a commit that referenced this pull request May 31, 2023
Aljullu added a commit that referenced this pull request May 31, 2023
…#9251)

* Replace all style hooks with useStyleProps hook

* Remove border/color/spacing hooks

* Style Props Hook

* Make use of `change-case` package

* Tidy up block wrappers

* Attribute filter does not use frontend.ts nor styles within block

* Remove frontend from filter blocks and unused styleprops usage

* Tidy up variable names so its clearer attributes are not required specifically from blocks

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/block.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/attribute-filter/block-wrapper.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/active-filters/block-wrapper.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/block.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/rating-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/stock-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/price-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/block.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Simplify styleprop

* Styleprops simplify

* Fix withFeaturedItem styles

* Like the original hook, flatten props and combine with parsed styles

---------

Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Tom Cafferkey <[email protected]>
Aljullu added a commit that referenced this pull request May 31, 2023
…#9251)

* Replace all style hooks with useStyleProps hook

* Remove border/color/spacing hooks

* Style Props Hook

* Make use of `change-case` package

* Tidy up block wrappers

* Attribute filter does not use frontend.ts nor styles within block

* Remove frontend from filter blocks and unused styleprops usage

* Tidy up variable names so its clearer attributes are not required specifically from blocks

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/block.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/attribute-filter/block-wrapper.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/active-filters/block-wrapper.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/block.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/rating-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/stock-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/price-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/block.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Simplify styleprop

* Styleprops simplify

* Fix withFeaturedItem styles

* Like the original hook, flatten props and combine with parsed styles

---------

Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Tom Cafferkey <[email protected]>
Aljullu added a commit that referenced this pull request Jun 1, 2023
* Empty commit for release pull request

* Empty commit for release pull request

* Add 10.2.2 changelog

* Update versions to 10.2.2

* Fix Mini-Cart block check to see whether a script has already been enqueued (#9649)

* Experiment: Replace style hooks coming from `@wordpress/block-editor` (#9251)

* Replace all style hooks with useStyleProps hook

* Remove border/color/spacing hooks

* Style Props Hook

* Make use of `change-case` package

* Tidy up block wrappers

* Attribute filter does not use frontend.ts nor styles within block

* Remove frontend from filter blocks and unused styleprops usage

* Tidy up variable names so its clearer attributes are not required specifically from blocks

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-title-label-block/block.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/attribute-filter/block-wrapper.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/active-filters/block-wrapper.tsx

Co-authored-by: Albert Juhé Lluveras <[email protected]>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-checkout-button-block/block.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/rating-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/stock-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/price-filter/block-wrapper.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Update assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-cart-button-block/block.tsx

Co-authored-by: Tom Cafferkey <[email protected]>

* Simplify styleprop

* Styleprops simplify

* Fix withFeaturedItem styles

* Like the original hook, flatten props and combine with parsed styles

---------

Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Tom Cafferkey <[email protected]>

* Add 10.2.2 testing steps

* Fix colors not being applied to Mini-Cart Proceed to Checkout Button in the editor (#9661)

* Update 10.2.2 testing steps

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Mike Jolley <[email protected]>
Co-authored-by: Tom Cafferkey <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: performance The issue/PR is related to performance. type: refactor The issue/PR is related to refactoring. type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the dependency on block-editor from frontend blocks
6 participants