-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Editor Stats - Generalize block variation tracking. #53606
Block Editor Stats - Generalize block variation tracking. #53606
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
Awesome! This is a lot better!
Tests well for me! 🚢
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.
It's nice to see the API exposes a way to get the block variation properly. Thanks this improvement.
Note when this was released to |
|
||
return {}; | ||
return { | ||
variation_slug: select( 'core/blocks' ).getActiveBlockVariation( block.name, block.attributes ) |
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.
Is that something that depends on a specific Gutenberg version being available, perhaps?
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.
Yes, that's a relatively new feature in Gutenberg. Opening a PR to fix this.
Changes proposed in this Pull Request
getActiveBlockVariation
from the core blocks store. This will ensure our variation tracking is up to date with any changes to attribute schema, variation isActive functions, and as new blocks with variations are added to the library.variation_slug
will appear as a property for all block types, and will be populated asundefined
if no variation is active.Testing instructions
variation_slug
of the tracking event is populated with the same value as before.variation_slug
is populated with the same value as before.variation_slug
isundefined
.variation_slug
is "header".Related to #
#53410