-
Notifications
You must be signed in to change notification settings - Fork 219
Document and update naming of Block Asset Handles #4324
Conversation
Size Change: +21 B (0%) Total Size: 988 kB
ℹ️ 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.
Works great and code changes look good. Nice cleanup! 👏
@mikejolley do you think this PR needs a dev note or something similar? My understanding is that it will impact any theme/plugin that relies on our script/style handles.
@Aljullu I'm uncertain — the scripts and styles we've changed are our own block handles (the external packages, price, and checkout, were not changed). Can you think of a use case where someone would use these handles? |
Yeah... I'm not sure. I'm thinking on a store that uses WooCommerce but none of WooCommerce Blocks, which might have unregistered our styles/scripts? Not sure if that's a case we need to account for, though, sounds very edge-case. Leaving the decision to you. |
Added a note 👍🏻 |
This PR establishes the pattern of naming block handles as
wc-{blockname}-block
, and other scripts aswc-blocks-{script}
to avoid conflicts.To help map handles -> built scripts I've also made script filenames match. I did not do this for the blocks themselves because it caused some breakage in Atomic Blocks and complicates how blocks are setup in webpack.
Closes #2660
How to test the changes in this Pull Request:
Dev Note
Some script handles have been changed in this version for consistency. It is unlikely that these handles are being used directly by 3rd parties because they are only used within the blocks, however for reference:
wc-block-vendors-style
->wc-blocks-vendors-style
wc-block-editor
->wc-blocks-editor-style
wc-block-style
->wc-blocks-style
wc-vendors
->wc-blocks-vendors
wc-shared-context
->wc-blocks-shared-context
wc-shared-hocs
->wc-blocks-shared-hocs
In addition, all block script handles now have the
-block
suffix.Changelog