-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Epic: Interactivity API - public 1.0 version #56803
Comments
The directive processing of only interactive blocks is ready for review. I will add more tests during this week. |
Related to the server-side directive processing and the above PR #56302, are there any plans to provide an API function that is decoupled from blocks? I think there are many use-cases (primarily classic "hard-coded" HTML in core, plugins, and themes) that could use the Interactivity API. If such use-cases could then call a simple function to process the directives on the HTML string, that would be really helpful. Potentially the function |
@felixarntz yeah, we're still trying different things here. To be honest, I'm not very happy with the current approach. And as you say, it's quite coupled with blocks. I think we can simplify it to process only on the "root interactive blocks" and try to encapsulate everything in a single function. Maybe something like this that also classic themes could use: $html = do_interactivity( $html ); To do so, we need to get rid of all the things that depend on knowing which part of the HTML belongs to which block during the processing (like private stores), but I think it's doable and it will simplify things. What do you think? |
Thanks @luisherranz, that sounds like a good plan to me. I have to admit, my understanding of private stores is quite limited still. But what you're saying sounds solid as far as I can assess. Regarding a function name, I'd prefer to do away with the "do" prefix. While it's sort of common for some WP processing functions, I think it's also somewhat legacy. I would find something like |
Haha, sure. That's because I was thinking about |
Added a PR to render the root interactive blocks in Server Directives Processing. Ready to review! |
I created a PR to implement the |
The PR with |
Created two PRs that remove directives that are not being used:
I labeled them as breaking changes, in case some external developers have been using them. |
The |
I've opened a new PR to move all the logic related to the ARIA live region and the loading bar from the Query block to the Interactivity Router. Ready for review. |
Can someone please clarify what is the name of the function for a default store in PHP? In previous release was Can we please specify this in docs as well? |
@Tropicalista: yes, we've renamed the function. I'll make a PR to update the docs once GB 17.6 is released with the final name. Please follow the changelog and breaking changes discussion to get the latest updates on how the API evolves. |
I have opened a draft PR to fix the initial page cache in the |
I opened a PR that adds a server processor for |
Small update.
Remaining tasks:
|
Added a PR with some small changes in comments. And refactors to TS. |
I've created a PR to make all core block stores private. It includes a bugfix that solves a problem with the async initialization of private stores. |
I've opened a PR to support |
Here, a draft PR that implements global configs in the JS runtime: It also gets rid of the EDIT: the PR is ready for review now. |
I have updated the task list to mark "Populate |
This PR limits the exposed API from |
I opened a PR to remove the |
Regarding one meta aspect of how we communicate this functionality more broadly, I think Interactivity API is ok as the technical aspect for developers, but when we talk broadly about what it does I think we should refer to it as Interactions. Interactions is the feature, and it's powered by this new developer API. So similar to |
This would need careful consideration, for sure. Having 2 names for the same functionality can also make things less clear in some cases. There is currently this issue with people referring to the "WordPress Block Editor" as "The Gutenberg Editor". Maybe `interactivity API -> interactivity"? Just a thought. |
Added a PR to fix directives not being processed if the HTML contained a SVG or a MATH. |
Now that we are past the Beta 1 cut off point I'm removing this tracking issue from the 6.5 Project board. From now on the board should only contain individual bugs that we want to still fix before 6.5 gets released. |
Should we also close the issue an open separate issues for remaining tasks so those applicable can be put on the 6.5 board and tackled before 6.5 Beta 3 scheduled for Tuesday next week? |
I will miss this tracking issue 😅, but yep, I will do that. |
In More core blocks and new
store()
API, we first worked on preparing Core blocks for WP 6.4, including the new enhanced pagination of the Query block, and after the release of WP 6.4, we also worked on the migration of the newstore()
API.For this iteration of the Interactivity API, we want to focus on the preparation of a 1.0 version that can be released publicly in WordPress Core and serve as the base for future enhancements.
We also want to consolidate here the work of the Tracking Issue: Server Directive Processing to keep all the implementation work under the same issue, but we will keep tracking the documentation-related tasks in the Documentation Tracking Issue.
Tasks
This is the list of initial tasks, although we will edit this post as we progress and discover other things that we need to do.
wp-run
directivewp-run
directive anduseInit
&useWatch
hooks #57805useInit
anduseWatch
hookswp-run
directive anduseInit
&useWatch
hooks #57805data-wp-on-window
anddata-wp-on-document
directiveswp-data-on-window
andwp-data-on-document
directives #57931navigation-link
directivewp-slot
andwp-fill
directives if we don't finally need themdata-wp-slot
anddata-wp-fill
#57854data-wp-text
, only stringswp-text
#57879state
and renameprops
toattributes
ingetElement()
#57974state
and renameprops
toattributes
ingetElement()
#57974role
logic in our codebasepreact
,@preact/signals
anddeepsignal
dependencies #57891withScope
and add support for async functions (generators)withScope()
and allow to use it with asynchronous operations. #58013wp-each
wp-each
directive #57859wp-context
suffixdata-wp-interactive="namespace"
data-wp-interactive
#58743@wordpress/interactivity
exportswp-body
directivedata-wp-body
#58835wp_store
aswp_initial_state
wp_initial_state()
#57556navigate()
issues related to initial state merges #57134core/router
store and move thenavigate
andprefecth
actions there@wordpress/interactivity-router
module #57924core/router
store in@wordpress/interactivity/router
@wordpress/interactivity-router
module #57924data-wp-navigation-id
todata-wp-router-region
data-wp-navigation-id
withdata-wp-router-region
#58191state.url
in thecore/router
storePopulatestate.url
from the servercore/router
store in JS.config['core/router'].regionNavigation = false
data-wp-key
to the page numbersdata-wp-key
to pagination numbers if enhanced pagination is enabled #58189clientNavigation
andinteractive
to block supports metadata.block supports
forclientNavigation
andinteractive
properties onblock.json
schema. #58132render_callback
and usewp_scripts_get_suffix
data-wp-interactive='{ "namespace": "..." }'
wp_initial_state()
#57556wp_initial_state()
#57556wp_interactivity_process_directives()
wp-each
data-wp-each
#58498data-wp-context
on PHPThe text was updated successfully, but these errors were encountered: