-
Notifications
You must be signed in to change notification settings - Fork 219
Ensure WooCommerce Core scripts are dequeued correctly #10624
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.42 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.
This tests ok, but it was a bit confusing initially while we are dequeueing scripts on a wp_enqueue_scripts
action, but I think I get it. Are we sure these are enqueued by woocommerce before we dequeue them here every time?
I'll approve as this tests ok and the scripts don't load, but just wanted to make sure I understand what's happening here properly and that there's not going to be any issues with trying to dequeue scripts before they are enqueued.
Good point, we could decrease the priority of this callback so it definitely runs after the core one, what do you think of that? |
9332a37
to
9ae6915
Compare
That sounds reasonable |
9ae6915
to
2752887
Compare
This PR has been marked as If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label. |
When rendering the Cart/Checkout blocks, we should dequeue the equivalent WC Core scripts. Previously we dequeued them directly during the
render
function of each block, however they are registered by WC Core after we dequeue them (so our dequeue has no effect). I believe this is because of recent changes to the Cart/Checkout templates however I'm not certain about that.When combined with #10619 this can close #9864
Other Checks
[type]
label or a[skip-changelog]
label.Testing
Automated Tests
User Facing Testing
Developer testing
wc-cart
is not loaded.wc-checkout
is not loaded.WooCommerce Visibility
Changelog