-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PX: detect hero images #1171
PX: detect hero images #1171
Conversation
eae166f
to
2c09402
Compare
Hm. Looks like tests are non-deterministic as they depend on browser output. |
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.
Two little nits and as you already mentioned the the one test relies on browser output and thus fails.
* | ||
* @param {Object} pageData | ||
*/ | ||
const earlyIframes = (pageData, result) => { |
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 guess this should be called heroImages or something more descriptive.
result.warn({ | ||
title: 'Improve LCP by optimizing hero images', | ||
message: | ||
'Let AMP Caches and Optimizers optimize your hero images, but adding the `data-hero` attribute to images in your first viewport.', |
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.
*"by adding"
893d143
to
83352ae
Compare
Thanks for the review! Fixed the nits. |
..and suggest using data-hero attribute
83352ae
to
1376906
Compare
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
..and suggest using data-hero attribute