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
Interactivity API - Iteration for WP 6.6 #60219
Comments
@DAreRodz @gziolo What's the best path to consider additional workstreams for the Interactivity API for 6.6? Context is that @westonruter and myself have been exploring ideas to facilitate better INP performance centrally via the Interactivity API. For instance, we could automatically yield certain actions and callbacks to the main thread to reduce contention between multiple event listeners. We're close to formalizing our proposal in an issue, and it would be great to eventually include this effort here, if the team is on board. One of the changes we're proposing may require a BC break in the API which we could handle with a deprecation strategy, but it would also benefit from being implemented sooner than later, now that the API is still very new and not yet as widely adopted outside of core. |
Hey @felixarntz, thanks for raising this up! 😊 I'm unsure what would be the "best path" (maybe @gziolo could help), but as this tracking issue is meant to be flexible, I would be happy to include your work. Let's wait for the proposal to see if we can have it ready for WP 6.6 and how the mentioned breaking changes could impact the current API. |
That sounds excellent, @felixarntz. I'm looking forward to seeing the proposal. @DAreRodz, the |
The ability to use existing WordPress Scripts from Script Modules is one of the most impactful things we can work on for the Interactivity API. Anything built with the Interactivity API must be a script module, so although it's not strictly Interactivity API, resolving this ticket for script and module interoperability seems very important: https://core.trac.wordpress.org/ticket/60647 |
Second @sirreal calls for WordPress scripts. We use |
Is there any chance to get interactivity api outside of blocks? For example in custom php templates? |
@ermincelikovic While I believe it's not documented, it should already be possible. The main caveat is that by default custom PHP templates wouldn't be processed server-side, so you have to make sure the attributes that are dynamic via the Interactivity API are initialized with their correct value. As a proof of concept, I have been working on WordPress/wordpress-develop#5795 where I am using the Interactivity API for all dynamic functionality of the Twenty Twenty-One theme. Maybe that's helpful. |
You can process them using |
This looks great! EDIT: |
I've added the suggestions in Typescripting utils PR. Ready to be reviewed again. |
@ermincelikovic The |
I've added two PRs to the description above.
The first one could be considered a bug fix (I've added it under that category), and so be released in a minor WP release. |
The fix for I've also opened an issue to fix the same problem in |
In addition to #60035 I'd love to see some more useful debugging for the following areas:
Besides debugging here are some other things that I would love to see in the 6.6 cycle.
|
I've added WordPress/wordpress-develop#6394 for server-side derived state. It's ready for review. |
I've just added 3 items related to
I think there's a bug with the server processing of ignore directives I'm attempting to fix in WordPress/wordpress-develop#6405. I think that nodes with that attribute and their descendants should be ignored completely, no processing should happen on or under a node with Right now ignore directives are not handled on the server, so those nodes and their descendants are processed. I discovered that while working on tests for #60744. |
I've created this ticket to handle property access on PHP objects in interactivity state, only arrays are well handled at the moment: https://core.trac.wordpress.org/ticket/61039 |
I've created a PR to add a couple of warnings if Server Directives processing fails. |
Created a PR to handle multiple |
We completed everything for the first public release of the Interactivity API in WordPress 6.5. Now, during the next iteration―which is going to be shorter―, we aim to focus on improving the current API without releasing new features. This includes enhancing the developer experience (especially during debugging), better test coverage and code quality, as well as fixing any reported bugs.
Note that the list is expected to be modified. I've also added optional tasks we can work on if we find the time.
Tasks
data-wp-on
. #60661data-wp-on-window
ordata-wp-on-document
directive with the same event #60683data-wp-on-document
anddata-wp-on-window
. #61009preact/debug
whenWP_DEVELOPMENT_MODE
is enabled. #59829We need to locate which errors we need to inform about. Examples:
data-wp-ignore
directive@wordpress/interactivity-router
to TypeScriptdeepsignal
toVdom
, etc.)navigate()
Failure States #59856data-wp-show
directivewp_kses
function.- Update the query block to permit non-core interactive blocks #60006
The text was updated successfully, but these errors were encountered: