-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Feature] Interactivity APIAPI to add frontend interactivity to blocks.API to add frontend interactivity to blocks.[Type] ExperimentalExperimental feature or API.Experimental feature or API.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Description
- Part of Block API #41236.
This list of tasks is aimed at exposing publicly the minimal version of the Interactivity API that we are using privately for the Core blocks so people can start experimenting with it.
IMPORTANT
- We'll work on this in a separate
interactivity
branch. ⚠️ We won't merge any of this withtrunk
.- We'll wait until the WP 6.3 feature freeze to merge it.
Next
- Add the runtime to its own package (
@wordpress/interactivity
) - Build that package with Preact
- We should use our custom Webpack config.
- We probably don't need this for the
view.js
files.
- Expose the
store
as a global- We don't need to add the
DependencyExtractionWebpackPlugin
yet, we can doconst { store } = wp.interactivity
, butmaybe it works out of the box(it worked out of the box).
- We don't need to add the
- Delete the filter that adds defer to the scripts
- We can add
defer
again later.
- We can add
- Make the necessary changes to the blocks/behaviors, so they start using this version
- Move the
interactivity.js
files to simpleview.js
files?
- Move the
- Delete the private runtime
Once we finish this list of tasks, the interactivity
branch will be ready to be merged with trunk
and we can continue adding more features. But again, we'll wait until the 6.3 feature freeze to merge it.
Metadata
Metadata
Assignees
Labels
[Feature] Interactivity APIAPI to add frontend interactivity to blocks.API to add frontend interactivity to blocks.[Type] ExperimentalExperimental feature or API.Experimental feature or API.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.Tactical breakdown of efforts across the codebase and/or tied to Overview issues.