GoogleChrome / web-vitals

Essential metrics for a healthy site.
https://web.dev/vitals
Apache License 2.0
7.63k stars 418 forks source link

About PerformanceElementTiming API #557

Closed St2r closed 4 weeks ago

St2r commented 4 weeks ago

Thanks for your working on this awesome lib.

Will this lib supports the PerformanceElementTiming API, which means we can collect performance metrics of specific element with elementtiming tag very easily, just like LCP or FCP.

tunetheweb commented 4 weeks ago

Can you explain how you would like the library to support this API?

At the moment the library’s aim is to encapsulate the best practices for measuring the Web Vitals metrics.

Element Timing is a great API to capture specific elements but does not require any addition considerations. (save perhaps not to report it if page is hidden first which the library does for FCP, and LCP but only on a best efforts manner since there’s currently no reliably way to detect this).

St2r commented 4 weeks ago

Got it.

I saw that you guys designed a very robust logic for LCP and FCP, so I thought the ElementTimingAPI also need that, but as you said, for specific elements using the native API is enough.

Thank you for your patience.