Repository navigation
Interactivity API for WordPress 7.2 #83078
Description
Overall Goal
Land an initial version of the data-wp-html directive and a reactive navigation lifecycle for the Interactivity API router in WordPress 7.2.
The data-wp-html directive will add a missing primitive: today there is no supported way to render markup from the store inside an interactive region and have the result reflected reactively. This initial version will ship a directive that renders only values explicitly trusted by application code through asDangerousHTML(), leaving sanitized plain strings for a later version. See #83076 for the full proposal.
The router work gives extenders a supported, reactive way to observe client-side navigations and know what initiated them, replacing the deprecated state.navigation.hasStarted/hasFinished pair. See #80960 for the proposal.
Scope for This Release
data-wp-html(v1): the directive andasDangerousHTML()(#83076). Sanitizing plain strings and hydrating directives inside inserted content are explicitly out of scope for this release.- Router navigation lifecycle:
state.navigatingandstate.initiatoron thecore/routerstore, plus theinitiatoroption fornavigate()(#80960).
Tasks
- Interactivity API: Add a
data-wp-htmldirective #83076 - Interactivity API: Fix late
data-wp-htmlvalues, throwing functions and directive conflicts #84652- Catch errors when
data-wp-htmlresolves to a function. - Define deterministic conflict rules for
data-wp-htmlcombined with other directives. - Keep server-rendered content intact when the trusted value arrives after hydration.
- Catch errors when
- Address
data-wp-htmlfollow-ups in the client:- Interactivity Router: Ignore router regions and attachTo targets inside data-wp-html content #84919
- Warn when
asDangerousHTML()receives a value read from context - add an ESLint rule that flags it.
- Implement
data-wp-htmldirective processor in the server - Interactivity API Router proposal: reactive state for the navigation lifecycle and its initiator #80960
- Interactivity API: Align directive name validation with WordPress Core #81023
- Interactivity API: Remove expired deprecated behaviors #84098
- Interactivity API: Optimize toVdom walk() #81699
Nice to Have
- Migrate the Query block's post-navigation focus logic onto the new router state (follow-up named in #80960).
Contributors
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields📋 Iteration/Tracking Issues
Activity
luisherranz commentedon Sep 22, 2026
I've opened a pull request that implements the API for the reactive navigation lifecycle proposed here.
nickchomey commentedon Sep 22, 2026
Can I ask why #81699 and #81249 are not being planned for inclusion in 7.2? They're relatively small changes that make a very meaningful difference in performance.
Likewise, #80021 helps simplify binding with input elements. It's a useful and easy thing to add to 7.2
And, as I mentioned in #83076, #81462 is somewhat of a superset of that functionality that would provide significantly more functionality that is desperately needed in the iAPI
I'd welcome any discussion related to these features that I worked very hard on for the benefit of all.
luisherranz commentedon Sep 23, 2026
Sure, we'll evaluate those as well. Thanks Nick!
(#81669 seems a wrong pr number, though)
nickchomey commentedon Sep 27, 2026
Ah, sorry. Was a typo. #81699
(i've fixed it above as well, just to prevent confusion if people click that before reading this comment)
luisherranz commentedon Oct 5, 2026
Merged the new navigation loading API:
DAreRodz commentedon Oct 5, 2026
Merged this PR that implements
data-wp-htmlin the iAPI runtime. Thanks @theaminulai!I left a list of follow-ups in the last review.
I also create a Trac ticket for the PHP part of this directive, and a PR draft for its implementation:
EDIT: I've updated the issue description to include the list of follow-ups and the PHP part.
luisherranz commentedon Oct 6, 2026
Merged this PR to remove some of the pending deprecations:
luisherranz commentedon Oct 13, 2026
Merged this PR to align directive name validation with WP Core:
DAreRodz commentedon Oct 15, 2026
I opened this PR that addresses some of the follow-ups required for
data-wp-html.data-wp-htmlvalues, throwing functions and directive conflicts #84652In particular, these are the fixes contained in the PR:
data-wp-htmlclears the content forundefinedandnull, and preserves SSRed markup for pending getters.data-wp-htlmis deactivated for elements withdata-wp-text,data-wp-eachanddata-wp-router-region.getEvaluatewith function values that throw, regarding scope restoration. This affecteddata-wp-htmland was fixed as well.luisherranz commentedon Oct 16, 2026
Opened a couple of extra fixes for
data-wp-html:The second one needs a WP Core companion.
DAreRodz commentedon Oct 16, 2026
Merged this PR that improves the performance of the internal
toVdom()function. Props to @nickchomey.nickchomey commentedon Oct 16, 2026
Is there any reason not to update preact, preact/signals and preact/signals-core to latest minor versions? Theyre a couple years out of date. I just rebased #79872 onto trunk and fixed some issues. All tests pass. We might even consider updating preact signals to v2.11.3 - i did so previously when i opened #79870 and tests passed as well.
nickchomey commentedon Oct 17, 2026
I've now merged trunk into all of my PRs. I dont expect the 4th one to be considered for 7.2, but it would be really fantastic if the other 3 could be. I'd really appreciate a review of them, and would be available to discuss any of it any time
#81462 - i cant express how desperately, urgently this is needed, because data-wp-html is, at best, a half-measure. We NEED to be able to dynamically insert html that contains iAPI directives
#80021 - helpful/nice to have
#81249 - would improve performance further
#82155 - would meaningfully improve ergonomics significantly, reduce amount of JS written and shipped, and is no longer a CSP risk
@elpuas here's some of the iAPi improvements that I mentioned at wordcamp last week, if you'd like to check them out and voice your support.