Skip to content

Ensure that the view scripts of core blocks have the wp-interactivity dependency#54594

Merged
luisherranz merged 1 commit intotrunkfrom
interactivity-api-ensure-the-interactivity-dependency
Sep 19, 2023
Merged

Ensure that the view scripts of core blocks have the wp-interactivity dependency#54594
luisherranz merged 1 commit intotrunkfrom
interactivity-api-ensure-the-interactivity-dependency

Conversation

@luisherranz
Copy link
Copy Markdown
Member

What?

Ensure that the view scripts of core blocks have the wp-interactivity dependency.

Why?

Because in WordPress 6.4 the Interactivity API will be private and therefore we won't use the DependencyExtractionPlugin with @wordpress/interactivity so 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 @since with the correct WP version? Or is that automated?

Copy link
Copy Markdown
Contributor

@DAreRodz DAreRodz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see everything is OK. 👌

Regarding the @since tags, I'm unsure if it's automated. There are other PRs specifying them as well.

@luisherranz
Copy link
Copy Markdown
Member Author

Regarding the @since tags, I'm unsure if it's automated. There are other PRs specifying them as well

Ok. Thanks, David. Let's merge this then, and we'll change it later if necessary.

@luisherranz luisherranz merged commit 90c49ff into trunk Sep 19, 2023
@luisherranz luisherranz deleted the interactivity-api-ensure-the-interactivity-dependency branch September 19, 2023 13:10
@github-actions github-actions bot added this to the Gutenberg 16.7 milestone Sep 19, 2023
Copy link
Copy Markdown
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Yeah, given this is a temporary arrangement, adding it in the blocks makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants