Skip to content
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

Expose the minimal Interactivity API in a public package #50866

Closed
6 tasks done
luisherranz opened this issue May 23, 2023 · 4 comments
Closed
6 tasks done

Expose the minimal Interactivity API in a public package #50866

luisherranz opened this issue May 23, 2023 · 4 comments
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Experimental Experimental feature or API. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@luisherranz
Copy link
Member

luisherranz commented May 23, 2023

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.

@luisherranz luisherranz added the [Feature] Interactivity API API to add frontend interactivity to blocks. label May 23, 2023
@DAreRodz
Copy link
Contributor

I'll start moving the runtime to @wordpress/interactivity. Once I have a PR, I'll continue with the following tasks in the same PR (if I feel it appropriate). 🧑‍💻

@DAreRodz
Copy link
Contributor

This is the PR I've created (currently a draft).

Development is progressing well, although I faced some issues I'd like to discuss. I posted a comment in the PR summarizing them.

@DAreRodz
Copy link
Contributor

All tasks are currently finished on #50906. ✅

I think we still have to write a proper README file, but other than that, I don't see any pending work.

The PR is still a draft. As we don't want to merge it yet, I don't know if it would be better to wait to set it as ready for review.

@luisherranz luisherranz added the [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. label May 29, 2023
@luisherranz
Copy link
Member Author

luisherranz commented May 29, 2023

Amazing work, David! 🎉

Closing this as finished, we'll keep working on the next steps on: #51056

@gziolo gziolo mentioned this issue Sep 5, 2023
69 tasks
@luisherranz luisherranz added the [Type] Experimental Experimental feature or API. label Sep 5, 2023
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] Experimental Experimental feature or API. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

2 participants