iAPI: Update deprecated usage of data-wp-on-async#72445
Conversation
|
Size Change: 0 B Total Size: 2.18 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 2796eb4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18710443901
|
50495b4 to
f87a988
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
|
To backport this PR to 6.9, I plan to add |
|
@DAreRodz Thanks for the review! |
* iAPI: Update deprecated usage of data-wp-on-async in core blocks * WIP Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: DAreRodz <darerodz@git.wordpress.org>
|
The automatic backport to the See #72573 for more details. |
Part of #72413
What?
#72161 deprecates the
data-wp-on-asyncdirective and adds a warning message to replace it withdata-wp-on. This PR replaces thedata-wp-on-asyncdirective in the core blocks withdata-wp-on, wrapping actions inwithSyncEventwhere necessary.Why?
Otherwise, sites with SCRIPT_DEBUG enabled will get a browser warning. I think this should be fixed in the 6.9 cycle.
How?
As I understand it, if we don't access sync properties like
event.currentTargetor sync methods likeevent.preventDefault()orevent.stopPropagination, thenwithSyncEventis unnecessary.I added
withSyncEventonly to actions that access sync properties or methods.Note that this PR does not update the documentation, we should probably update the
wp-on-async,wp-on-async-windwetc. references and add a deprecation note.Testing Instructions
Except for the search block, all block iAPI functionality should be covered by e2e tests, but please test the following: