Ensure that the view scripts of core blocks have the wp-interactivity dependency#54594
Merged
luisherranz merged 1 commit intotrunkfrom Sep 19, 2023
Merged
Conversation
This was referenced Sep 19, 2023
DAreRodz
approved these changes
Sep 19, 2023
Contributor
DAreRodz
left a comment
There was a problem hiding this comment.
I see everything is OK. 👌
Regarding the @since tags, I'm unsure if it's automated. There are other PRs specifying them as well.
Member
Author
Ok. Thanks, David. Let's merge this then, and we'll change it later if necessary. |
Contributor
tellthemachines
left a comment
There was a problem hiding this comment.
Thanks for the PR! Yeah, given this is a temporary arrangement, adding it in the blocks makes sense.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Ensure that the view scripts of core blocks have the
wp-interactivitydependency.Why?
Because in WordPress 6.4 the Interactivity API will be private and therefore we won't use the
DependencyExtractionPluginwith@wordpress/interactivityso we have to declare the dependencies manually somehow. See this WP Core PR:How?
By adding an action that ensures that the dependency is there. Those actions will be removed once they are no longer needed.
Testing Instructions
There's no easy way to test this in Gutenberg because here the dependency is already added. You can add a breakpoint and inspect the code to see that it works, or copy and paste it in WordPress Core.
By the way, do we have to populate the
@sincewith the correct WP version? Or is that automated?