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

Improve how assets are enqueued #9354

Closed
gigitux opened this issue May 4, 2023 · 0 comments
Closed

Improve how assets are enqueued #9354

gigitux opened this issue May 4, 2023 · 0 comments
Assignees
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: cooldown Things that are queued for a cooldown period (assists with planning). type: refactor The issue/PR is related to refactoring.

Comments

@gigitux
Copy link
Contributor

gigitux commented May 4, 2023

To fix #9331, we did a dirty patch to change how assets are enqueued on the Site Editor (#9332).

We have to revisit the entire process to be sure that the assets are enqueued in the right way and only when they are necessary.

To understand why this if/else statement exists you can reproduce the issues quickly by doing the following:

  1. Replace the if/else statement with just add_action( 'enqueue_block_editor_assets', array( $this, 'register_data_script' ) );
  2. Go to Pages > All Pages and see the console error: Payment gateway with handle 'wc-payment-method-cod' has been deactivated in Cart and Checkout blocks because its dependency 'wc-settings' is not registered. Read the docs about registering assets for payment methods: . This error fails the E2E tests
  3. Now replace the if/else statement with just add_action( 'init', array( $this, 'register_data_script' ) );
  4. Load the Single Product block template and see no assets loading.
@gigitux gigitux added the type: cooldown Things that are queued for a cooldown period (assists with planning). label May 4, 2023
@tjcafferkey tjcafferkey added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: refactor The issue/PR is related to refactoring. labels May 4, 2023
@tjcafferkey tjcafferkey self-assigned this May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: cooldown Things that are queued for a cooldown period (assists with planning). type: refactor The issue/PR is related to refactoring.
Projects
None yet
Development

No branches or pull requests

3 participants