-
Notifications
You must be signed in to change notification settings - Fork 4.6k
iAPI: Update deprecated usage of data-wp-on-async #72445
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
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codewise looks good. I also tested it, and it works as expected. Thanks, @t-hamano!
|
@DAreRodz Thanks for the review! |
* iAPI: Update deprecated usage of data-wp-on-async in core blocks * WIP Co-authored-by: t-hamano <[email protected]> Co-authored-by: DAreRodz <[email protected]>
|
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: