Joan León PRO
⚡️ Web Performance Consultant | Speaker | Staff Frontend Engineer at @AdevintaSpain | @GoogleDevExpert in #WebPerf | @cloudinary Ambassador
Real network & browser conditions
Mimics defined network & browser conditions
Requires JavaScript installation
No installation required
Large sample size (up to 100%)
Limited URLs
Geographic spread
Limited test locations
Only measure your own site
Compare any sites (including competitors)
Correlation with other metrics (bounce rate)
Detailed analysis & visuals
Always on monitoring
Scheduled testing (can miss intermittent issues)
Real device diversity (OS, browsers, screen sizes)
Limited device configurations
Captures actual user journeys
Pre-defined test paths
FID/INP
import WebVitalsReporter from '@s-ui/react-web-vitals'
export default function App() {
const handleReport = metric => {
console.log(metric) // do something
}
return (
<WebVitalsReporter onReport={handleReport}>
<main />
</WebVitalsReporter>
)
}
<script>
(function () {
var script = document.createElement('script');
script.src = 'https://unpkg.com/web-vitals@3/dist/web-vitals.iife.js';
script.onload = function () {
// When loading `web-vitals` using a classic script, all the public
// methods can be found on the `webVitals` global namespace.
webVitals.onCLS(console.log);
webVitals.onFID(console.log);
webVitals.onLCP(console.log);
};
document.head.appendChild(script);
})();
</script>
lighthouse https://web.dev --view
By Joan León