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

Only set wp-edit-post style dependency if it has already been enqueued #3898

Merged
merged 2 commits into from Mar 2, 2021

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Mar 1, 2021

Fixes #3626.

In #3219 we marked the Gutenberg post editor CSS as a dependency of our styles in the editor, that allowed us to print our styles after theirs to fix some specificity issues. That broken FSE, because the post editor CSS is not loaded when editing the templates.

This PR fixes that making so wp-edit-post is only marked as a dependency is it has already been enqueued.

How to test the changes in this Pull Request:

  1. Install a FSE compatible theme (ie, Armando).
  2. Enable Gutenberg and WooCommerce.
  3. Click on the Site Editor sidebar menu item.
  4. Verify the FSE page loads correctly.

Test for no regressions:

  1. Create a post or page and add some WC Blocks.
  2. Verify they look correct and styles loaded properly.
  3. Publish that post or page.
  4. In the frontend, verify blocks also look correct and styles loaded properly.

Changelog

Fix FSE not being visible when WC Blocks was enabled.

@Aljullu Aljullu self-assigned this Mar 1, 2021
@Aljullu Aljullu changed the title Only set wp-edit-post style dependency if it has alredy been enqueued Only set wp-edit-post style dependency if it has already been enqueued Mar 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2021

Remove fix to load our stylesheets after editor CSS. See ...

Remove fix to load our stylesheets after editor CSS. See #3068 for the rationale of this fix. It should be no longer github.com/WordPress/gutenberg/issues/20797).


https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/0937b9b65197acc8403c3ca19ece7accd3e7dedd/src/Assets.php#L79-L92

🚀 This comment was generated by the automations bot based on a todo comment in 0937b9b in #3898. cc @Aljullu

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2021

Size Change: 0 B

Total Size: 1.15 MB

ℹ️ View Unchanged
Filename Size Change
build/active-filters-frontend.js 8.38 kB 0 B
build/active-filters.js 8.5 kB 0 B
build/all-products-frontend.js 34.6 kB 0 B
build/all-products.js 36.4 kB 0 B
build/all-reviews.js 9.89 kB 0 B
build/atomic-block-components/add-to-cart--atomic-block-components/button.js 3.37 kB 0 B
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js 334 B 0 B
build/atomic-block-components/add-to-cart-frontend.js 9.19 kB 0 B
build/atomic-block-components/add-to-cart.js 7.68 kB 0 B
build/atomic-block-components/button-frontend.js 2.37 kB 0 B
build/atomic-block-components/button.js 839 B 0 B
build/atomic-block-components/category-list-frontend.js 469 B 0 B
build/atomic-block-components/category-list.js 476 B 0 B
build/atomic-block-components/image-frontend.js 1.77 kB 0 B
build/atomic-block-components/image.js 1.23 kB 0 B
build/atomic-block-components/price-frontend.js 1.94 kB 0 B
build/atomic-block-components/price.js 1.97 kB 0 B
build/atomic-block-components/rating-frontend.js 521 B 0 B
build/atomic-block-components/rating.js 526 B 0 B
build/atomic-block-components/sale-badge-frontend.js 861 B 0 B
build/atomic-block-components/sale-badge.js 871 B 0 B
build/atomic-block-components/sku-frontend.js 390 B 0 B
build/atomic-block-components/sku.js 394 B 0 B
build/atomic-block-components/stock-indicator-frontend.js 570 B 0 B
build/atomic-block-components/stock-indicator.js 573 B 0 B
build/atomic-block-components/summary-frontend.js 920 B 0 B
build/atomic-block-components/summary.js 925 B 0 B
build/atomic-block-components/tag-list-frontend.js 467 B 0 B
build/atomic-block-components/tag-list.js 473 B 0 B
build/atomic-block-components/title-frontend.js 1.35 kB 0 B
build/atomic-block-components/title.js 1.21 kB 0 B
build/attribute-filter-frontend.js 18.3 kB 0 B
build/attribute-filter.js 12.5 kB 0 B
build/blocks-checkout.js 16.7 kB 0 B
build/blocks.js 3.5 kB 0 B
build/cart-frontend.js 75.6 kB 0 B
build/cart.js 38.5 kB 0 B
build/checkout-frontend.js 80.3 kB 0 B
build/checkout.js 41.3 kB 0 B
build/editor-rtl.css 14.9 kB 0 B
build/editor.css 14.9 kB 0 B
build/featured-category.js 7.83 kB 0 B
build/featured-product.js 10.1 kB 0 B
build/handpicked-products.js 7.51 kB 0 B
build/price-filter-frontend.js 14.6 kB 0 B
build/price-filter.js 9.95 kB 0 B
build/price-format.js 1.37 kB 0 B
build/product-best-sellers.js 7.58 kB 0 B
build/product-categories.js 3.24 kB 0 B
build/product-category.js 8.53 kB 0 B
build/product-new.js 7.75 kB 0 B
build/product-on-sale.js 8.15 kB 0 B
build/product-search.js 3.58 kB 0 B
build/product-tag.js 6.58 kB 0 B
build/product-top-rated.js 7.72 kB 0 B
build/products-by-attribute.js 8.51 kB 0 B
build/reviews-by-category.js 12 kB 0 B
build/reviews-by-product.js 13.5 kB 0 B
build/reviews-frontend.js 9.58 kB 0 B
build/single-product-frontend.js 37.7 kB 0 B
build/single-product.js 10.3 kB 0 B
build/style-rtl.css 18.9 kB 0 B
build/style.css 18.9 kB 0 B
build/vendors--atomic-block-components/price-frontend.js 6.54 kB 0 B
build/vendors-style-rtl.css 1.05 kB 0 B
build/vendors-style.css 1.05 kB 0 B
build/vendors.js 418 kB 0 B
build/wc-blocks-data.js 7.2 kB 0 B
build/wc-blocks-middleware.js 1.11 kB 0 B
build/wc-blocks-registry.js 2.69 kB 0 B
build/wc-payment-method-bacs.js 820 B 0 B
build/wc-payment-method-cheque.js 816 B 0 B
build/wc-payment-method-cod.js 913 B 0 B
build/wc-payment-method-paypal.js 853 B 0 B
build/wc-payment-method-stripe.js 12.2 kB 0 B
build/wc-settings.js 2.43 kB 0 B
build/wc-shared-context.js 1.53 kB 0 B
build/wc-shared-hocs.js 1.71 kB 0 B

compressed-size-action

@Aljullu Aljullu requested a review from mikejolley March 1, 2021 15:50
@Aljullu Aljullu added status: needs review type: bug The issue/PR concerns a confirmed bug. labels Mar 1, 2021
@Aljullu Aljullu force-pushed the fix/3626-dont-load-edit-post-styles-in-fse branch from 0937b9b to 3559ab0 Compare March 1, 2021 15:51
@Aljullu Aljullu marked this pull request as ready for review March 1, 2021 15:52
@Aljullu Aljullu requested a review from a team as a code owner March 1, 2021 15:52
@Aljullu Aljullu removed the request for review from a team March 1, 2021 15:52
Copy link
Member

@mikejolley mikejolley left a comment

Choose a reason for hiding this comment

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

This fixes the issue it seems, but is broken until WordPress/gutenberg#29473 is merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full site editor renders blank page with WooCommerce activated
2 participants