-
Notifications
You must be signed in to change notification settings - Fork 7
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 a ‘needs improvement’ threshold for core web vitals; improve icons. #2
Add a ‘needs improvement’ threshold for core web vitals; improve icons. #2
Conversation
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.
One tiny nit. Thanks so much @adamsilverstein, I'm happy to 🚢 after a tiny adjustment. :)
src/web-vitals.js
Outdated
@@ -8,15 +8,16 @@ const METRIC_CONFIG = new Map([ | |||
[ | |||
'CLS', | |||
{ | |||
threshold: 0.1, | |||
goodThreshold: 0.1, | |||
needsImprovementThreshold: 0.25, |
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.
Tiny nit here: what do you think of having a threshold
property instead of these two.
{
thresholds: {
good: '',
needsImprovement: '',
poor: ''
}
}
I think I'd like to avoid of having them all in the root object level. :)
Great suggestion, I will adjust the PR to make it so. |
@stefanjudis in Please note there is no |
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.
That looks good to me. Thanks a bunch @adamsilverstein.
I'm gonna merge have a final look and will release a minor version. :)
And |
Core web vitals CLS, FID and LCP define both a "good" threshold and a "needs improvement" threshold (see web.dev). This PR seeks to recognize those thresholds and display a 'warning' icon when a metric needs improvement.
I left the green checkmark for good, added a yellow warning for needs improvement and changed the is-poor icon to a red X.
Looks something like this: