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

Use IE11 friendly code for Dashicon component replacement. #2708

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

nerrad
Copy link
Contributor

@nerrad nerrad commented Jun 12, 2020

Fixes: #2703

In #2664 I implemented some code that would swap out the @woocommerce/components/Dashicon component with a patched fix to reduce our bundle sizes. However, I didn't realize in the process this broke things for IE11 (any frontend client side code importing from @wordpress/components directly - All Products, Filter Blocks, Cart and Checkout etc).

When the NormalModuleReplacementPlugin is used in webpack, the code replacing modules is not transpiled through babel (at least from what I can see). Ideally, we'd figure out how to fix that (and I did take a bit of time to try unsuccessfully) but the simpler fix for now is to just use IE11 friendly code in the script.

@Aljullu, ordinarily I wouldn't consider this patch release worthy and would just wait until our next scheduled release, but because the 2.7 branch is going in WC core and 2.8.0 would be past the code freeze date, I think it's better to get this into 2.7.1 so there are no regressions for users of the All Products or Filter blocks on IE11 (even though I think the IE11 experience is super poor!).

To test

This affects All Products, Filter Blocks and Cart and Checkout blocks.

  • Verify nothing is broken in up to date browsers (Firefox, Safari, Chrome). Simply loading the blocks should suffice. You can repeat the checks in Ignore dashicons imports #2664.
  • Verify IE11 no longer has errors for any of the blocks.

There also should be no significant change in bundlesize (which the GitHub action should report on in this pull).

@nerrad nerrad added the type: bug The issue/PR concerns a confirmed bug. label Jun 12, 2020
@nerrad nerrad added this to the 2.7.1 milestone Jun 12, 2020
@nerrad nerrad requested a review from a team as a code owner June 12, 2020 18:15
@nerrad nerrad self-assigned this Jun 12, 2020
@nerrad nerrad requested review from Aljullu and removed request for a team June 12, 2020 18:15
@github-actions
Copy link
Contributor

Size Change: -81 B (0%)

Total Size: 1.57 MB

Filename Size Change
build/all-products-frontend.js 38.9 kB -7 B (0%)
build/all-products.js 21.7 kB -8 B (0%)
build/cart-frontend.js 63.6 kB -12 B (0%)
build/cart.js 33 kB -11 B (0%)
build/checkout-frontend.js 80.2 kB -14 B (0%)
build/checkout.js 38.5 kB -11 B (0%)
build/single-product-frontend.js 41.7 kB -9 B (0%)
build/single-product.js 15.6 kB -9 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/active-filters-frontend.js 7.21 kB 0 B
build/active-filters.js 7.94 kB 0 B
build/all-reviews-legacy.js 9.24 kB 0 B
build/all-reviews.js 9.54 kB 0 B
build/attribute-filter-frontend.js 16.7 kB 0 B
build/attribute-filter.js 11.5 kB 0 B
build/block-error-boundary-legacy.js 775 B 0 B
build/block-error-boundary.js 774 B 0 B
build/blocks-legacy.js 2.92 kB 0 B
build/blocks.js 2.92 kB 0 B
build/custom-select-control-style-legacy.js 782 B 0 B
build/custom-select-control-style.js 782 B 0 B
build/editor-legacy-rtl.css 12.5 kB 0 B
build/editor-legacy.css 12.5 kB 0 B
build/editor-rtl.css 13.5 kB 0 B
build/editor.css 13.5 kB 0 B
build/featured-category-legacy.js 7.27 kB 0 B
build/featured-category.js 7.59 kB 0 B
build/featured-product-legacy.js 9.51 kB 0 B
build/featured-product.js 9.83 kB 0 B
build/handpicked-products-legacy.js 6.91 kB 0 B
build/handpicked-products.js 7.24 kB 0 B
build/price-filter-frontend.js 14.1 kB 0 B
build/price-filter.js 10 kB 0 B
build/product-best-sellers-legacy.js 6.99 kB 0 B
build/product-best-sellers.js 7.3 kB 0 B
build/product-categories-legacy.js 3.22 kB 0 B
build/product-categories.js 3.21 kB 0 B
build/product-category-legacy.js 7.91 kB 0 B
build/product-category.js 8.25 kB 0 B
build/product-list-style-legacy.js 774 B 0 B
build/product-new-legacy.js 7.15 kB 0 B
build/product-new.js 7.47 kB 0 B
build/product-on-sale-legacy.js 7.52 kB 0 B
build/product-on-sale.js 7.87 kB 0 B
build/product-search-legacy.js 3.14 kB 0 B
build/product-search.js 3.43 kB 0 B
build/product-tag-legacy.js 6.08 kB 0 B
build/product-tag.js 6.39 kB 0 B
build/product-top-rated-legacy.js 7.12 kB 0 B
build/product-top-rated.js 7.44 kB 0 B
build/products-by-attribute-legacy.js 7.88 kB 0 B
build/products-by-attribute.js 8.19 kB 0 B
build/reviews-by-category-legacy.js 11.2 kB 0 B
build/reviews-by-category.js 11.6 kB 0 B
build/reviews-by-product-legacy.js 12.7 kB 0 B
build/reviews-by-product.js 13.1 kB 0 B
build/reviews-frontend-legacy.js 8.08 kB 0 B
build/reviews-frontend.js 8.93 kB 0 B
build/snackbar-notice-style-legacy.js 778 B 0 B
build/snackbar-notice-style.js 779 B 0 B
build/spinner-style-legacy.js 772 B 0 B
build/spinner-style.js 772 B 0 B
build/style-legacy-rtl.css 5.5 kB 0 B
build/style-legacy.css 5.5 kB 0 B
build/style-rtl.css 17.3 kB 0 B
build/style.css 17.3 kB 0 B
build/vendors-legacy.js 366 kB 0 B
build/vendors-style-legacy-rtl.css 1.03 kB 0 B
build/vendors-style-legacy.css 1.03 kB 0 B
build/vendors-style-legacy.js 103 B 0 B
build/vendors-style-rtl.css 1.03 kB 0 B
build/vendors-style.css 1.03 kB 0 B
build/vendors-style.js 102 B 0 B
build/vendors.js 414 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 1.79 kB 0 B
build/wc-payment-method-cheque.js 794 B 0 B
build/wc-payment-method-paypal.js 830 B 0 B
build/wc-payment-method-stripe.js 11.9 kB 0 B
build/wc-settings.js 2.14 kB 0 B
build/wc-shared-context.js 1.51 kB 0 B

compressed-size-action

@nerrad nerrad added the status: blocker Used on issues or pulls that block work from being released. label Jun 12, 2020
Copy link
Member

@senadir senadir left a comment

Choose a reason for hiding this comment

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

While I didn’t test yet, I can confirm this code is indeed IE11 friendly.

@nerrad nerrad merged commit 4e99455 into master Jun 12, 2020
@nerrad nerrad deleted the fix/dashicon-injection-for-ie11 branch June 12, 2020 19:58
@Aljullu Aljullu added the release: cherry-pick Cherry picked into the relevant release branch. label Jun 16, 2020
Aljullu pushed a commit that referenced this pull request Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release: cherry-pick Cherry picked into the relevant release branch. status: blocker Used on issues or pulls that block work from being released. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cart and Checkout blocks are broken in IE11
4 participants