Skip to content

Expose the minimal Interactivity API in a public package #50866

@luisherranz

Description

@luisherranz

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 with trunk.
  • 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 do const { store } = wp.interactivity, but maybe it works out of the box (it worked out of the box).
  • Delete the filter that adds defer to the scripts
    • We can add defer again later.
  • Make the necessary changes to the blocks/behaviors, so they start using this version
    • Move the interactivity.js files to simple view.js files?
  • 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

No one assigned

    Labels

    [Feature] Interactivity APIAPI to add frontend interactivity to blocks.[Type] ExperimentalExperimental feature or API.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions