WordPress/gutenberg

Tracking Issue: Expose the full Interactivity API in `@wordpress/interactivity`

luisherranz opened this issue ยท 13 comments

In Expose the minimal Interactivity API in a public package, we exposed publicly the private and minimal version of the Interactivity API that we were using to test the Core blocks.

This new list of tasks is aimed to complete the Interactivity API publicly testable version, so it's the same full version as the one used in the block interactivity experiments repository (but without client-side navigation yet, which we'll add in a second phase).

Please, refer to the new Docs Tracking Issue to keep track of the documentation efforts.

Tasks

  • Add the full Interactivity API runtime (but removing the client-side navigation)
    • Add missing directives: #51194
    • Add missing e2e tests: #52952
    • Add missing JSDocs to the code: #52469
  • Add first docs and structure (as markdown files in Gutenberg for now): #52462
  • Add server-side rendering: #51229
    • Add the wp_store function: #51191
  • Add defer again to all the interactive blocks (and runtime): #52536

Discarded

  • Add wp-html (decide final name and research security issues).

I'm working on the wp_store function. I'll open a PR tomorrow.

There you go:


I'll start migrating the SSRing next. I'll update the Tracking Issue with more detailed tasks for that.

I recently created a draft PR with the branch where I started working on porting the entire Interactivity API runtime (without CSN).

So far, I moved the missing directives and all the e2e tests unrelated to the client-side navigation feature. I had to refactor the tests a little bit, and I'm not yet convinced with the current arrangement.

I think we can get rid of our fixture to serve local HTML files and use a custom plugin with compiled view.js files. There are some examples of plugins used for e2e tests in /packages/e2e-tests/plugins.

Also, I'm not compiling any js file yet, and I had to expose preact, preact/hooks and deepsignal from the runtime, as some test implementations were using them.

I'll start migrating the SSRing next.

There you go:

I'll update the Tracking Issue with more detailed tasks for that.

I don't think it's necessary anymore as I did all the tasks in that PR.

Surficing this comment here. I will work on a PR to do the syntax changes from WordPress/block-interactivity-experiments#239.

Also, I added a task to the list to work on wp-html at a later point.

Done:


Let's try this order:

  1. Merge the syntax changes.
  2. Merge trunk with interactivity
  3. Merge the server-side rendering.

Ok, those are merged and I also merged trunk.

I just merged the PR that adds the missing directives and the e2e tests we had in the block-interactivity-experiments repository. Those tests have been adapted to follow the same format used in Gutenberg.

I created a small PR to improve security on the store serialization. It's ready for review.

An update on the progress of these tasks, and other related Interactivity API improvements:

  • @westonruter opened a PR that adds the defer strategy to all the frontend block scripts, including the Interactivity API ones: #52536
  • @DAreRodz and I improved the logic of the priority levels: #52323
  • @juanmaguitar created the first version of the Interactivity API Readme: #52104
  • @juanmaguitar added the docs folder and some initial texts, including a Getting Started guide: #52462
  • @juanmaguitar added an interactive block template for @wordpress/create-block: #52612
  • @ryanwelcher added some refinements to the interactive block template for @wordpress/create-block: #52801
  • @DAreRodz added JSDoc coverage of the public APIs: #52469
  • @DAreRodz after moving all the e2e tests from the old repo to Gutenberg (#51194), he started working to add the missing e2e tests and increase our test coverage
  • @c4rl0sbr4v0 and I added the runtime logic of the wp-style directive: #52645
  • I changed the way we identify blocks without parent blocks because it was messing up with a CSS hash: #52557

So this is almost ready to go. I think we can consider it completed as soon as David publishes his e2e PR, we merge the JSDocs one, and Weston's defer PR is merged.

After that, we'll think about the next milestones and we'll publish a new Tracking Issue.

@DAreRodz opened a draft PR for the last task, add missing e2e tests:

An update on the progress of these tasks, and other related Interactivity API improvements:

  • @westonruter merged his PR to add the defer strategy to all the frontend block scripts, including the Interactivity API ones: #52536
  • @juanmaguitar opened and merged a PR to add the first docs for the API: #52948
  • I opened and merged a PR to remove wp-show from the runtime until we finally figure out how it should behave: #53240
  • @DAreRodz opened a PR to add the missing e2e tests and increase our test coverage: #52952
  • @c4rl0sbr4v0 opened and merged a PR to add support for underscores and leading dashes in the suffix part of the directive: #53337

Apart from that, @juanmaguitar opened a new Docs Tracking Issue to coordinate the documentation efforts, so I won't report documentation updates here anymore. Please subscribe to that Tracking Issue to keep track of that progress.

Everything here is finished, including:

I've opened a new Tracking Issue with a new set of improvements to the Interactivity API.

Please, subscribe to the new one if you want to keep updated!