-
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
Add User Timings for the Interactivity API #60522
Add User Timings for the Interactivity API #60522
Conversation
This PR is ready for testing, I am leaving it in the draft state for now until the DevTools extension API lands (without having to set a flag). |
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
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. |
Is anything needed code wise here to indicate this is an experimental feature? Should I add inline comments indicating that? |
|
OK, thanks for the tips. I will test out the |
Yes, it never executes in core when using |
@gziolo when I tried adding both conditionals:
I got linting errors:
So in 9e37958 I wrapped the SCRIPT_DEBUG in the IS_GUTENBERG_PLUGIN conditional. We can probably remove the inner conditional once this API becomes stable. |
That’s totally fine 👍 |
@adamsilverstein, this PR's been marked as "Needs Dev Note". Could you help write one? 🙏 cc: @fabiankaegy |
@DAreRodz Looks like this actually is Gutenberg only and not in 6.7. So we don't need one after all |
What?
Add performance marks to DevTools to assist with performance analysis.
Note: Debug code should be placed behind a build flag so that it can be excluded from production builds.
Why?
Screenshots
Screenshot showing various Interactivity API event timings - note that I added a random delay in the callback time to make the bars more visible here.
Testing Instructions
Note: testing currently requires Chrome Canary. To enable the User Timings API, in Dev Tools Settings -> Experiments - enable Performance User Timings.