-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(metrics): add FCP metric #4948
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.
LGTM
const Util = require('../report/v2/renderer/util.js'); | ||
|
||
// eslint-disable-next-line max-len | ||
const LEARN_MORE_LINK = 'https://developers.google.com/web/fundamentals/performance/user-centric-performance-metrics#first_paint_and_first_contentful_paint'; |
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.
I believe you can just inline this and max-len
will accept it since it has a url in it
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.
done
|
||
class FirstContentfulPaint extends Audit { | ||
/** | ||
* @return {!AuditMeta} |
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.
remove !
s
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.
done
/** | ||
* @param {!Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {!Promise<!AuditResult>} |
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.
LH.Artifacts
and Promise<LH.Audit.Product>
for future us :)
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.
done
*/ | ||
computeObservedMetric(data) { | ||
const {traceOfTab} = data; | ||
if (!traceOfTab) { |
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.
hmm, this is kind of unfortunate to check here, but it looks like at least tsc alerts you based on MetricComputationData
? Should we always require a trace for ComputedMetric? I assume you made traceOfTab
optional for a reason, though
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.
yeah I just split MetricComputationData into two so we don't have to do this 👍
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.
lgtm
progress on #4872