Repository navigation
[WP 7.2] Interactivity Router: Ignore router regions and attachTo targets inside data-wp-html content (#84919) - #86059
Conversation
…de data-wp-html content (#84919) * Interactivity API: Expose parseDirectiveName() to internal consumers * Interactivity Router: Ignore router regions and attachTo targets inside data-wp-html content * Interactivity Router: Document data-wp-html content and unusable attachTo targets * Interactivity Router: Add the PR number to the changelog entries under Unreleased * Interactivity Router: Tighten docs, comments and changelog entries - Shorten the changelog entries to the length of earlier ones, split the router entry into the two fixes it describes, and drop the stray period before the PR link. - README: move the data-wp-html paragraph after the example it was separating from its explanation, fix "An element is not usable when the selector matches nothing", and state the initial-page attachTo exception once instead of inside the first bullet. - Guide: define "data-wp-html element" by linking to the conflict rules instead of restating them, and remove repeated sentences. - Directive reference: link from "Inert content" to the router docs. - Comments: make the parseDirectiveName() and closestHtmlDirectiveElement() docblocks precise, drop an unrelated privateApis() docblock, and reword cryptic comments. * Interactivity Router: Make the data-wp-html region tests independent of order The runtime logs each warning once per module, so the tests restoring a region that carries data-wp-html emitted the conflict warning only when they ran before the test expecting it. CI runs tests shuffled, and both failed. Check Back in the test that expects the warning instead. --------- Co-authored-by: luisherranz <luisherranz@gmail.com> (cherry picked from commit 00c4190)
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +258 B (0%) Total Size: 9.05 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Backspace in
|
What?
Backport of #84919 to
wp/7.2. The automatic cherry-pick failed: #84919 (comment)How?
git cherry-pick -x 00c4190baf8be6dd19e75906a3a617129c935f1eontowp/7.2. Only theCHANGELOG.mdfiles of@wordpress/interactivityand@wordpress/interactivity-routerconflicted, because on trunk their Unreleased sections also list entries from #85930, which isn't onwp/7.2. I kept only the #84919 entries. All the code, test and docs changes apply cleanly.Testing Instructions
npm run test:unit:vitest -- packages/interactivity packages/interactivity-router(passes locally: 25 files, 584 tests).npm run test:e2e -- test/e2e/specs/interactivity/router-html-regions.spec.ts test/e2e/specs/interactivity/router-regions.spec.tsSee #84919 for the full description and manual testing steps.
Testing Instructions for Keyboard
Not applicable: no UI changes.
Use of AI Tools
The cherry-pick and conflict resolution were done with an AI agent and reviewed by @luisherranz.