-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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: collect fetchpriority for images and link rel preload #14925
Conversation
@@ -219,8 +219,7 @@ <h2 id="toppy" style="background-image:url('');">Do better web tester page</h2> | |||
<!-- FAIL(image-aspect-ratio): image is naturally 1024x680 --> | |||
<img src="lighthouse-1024x680.jpg?iar1" width="120" height="15"> | |||
<!-- PASS(image-aspect-ratio) --> | |||
<!-- FAIL(lcp-lazy-loaded) --> |
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.
old comment; this isn't the LCP and doesn't fail that audit :)
attributeHeight: '80', | ||
naturalDimensions: { | ||
width: 1024, | ||
height: 678, |
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.
notice the image is called lighthouse-1024x680.jpg
... :P
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.
So the file name is just misleading?
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.
So the file name is just misleading?
yes, but to be fair, it's copied from the byte-efficiency smoke test image of the same name, which is (we're now learning) also actually 1024x678, added wayyyy back in #1635
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 not suggesting we change it here, just wanted to confirm
attributeHeight: '80', | ||
naturalDimensions: { | ||
width: 1024, | ||
height: 678, |
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.
So the file name is just misleading?
@@ -70,6 +70,8 @@ function getLinkElementsInDOM() { | |||
crossOrigin: link.crossOrigin, | |||
hrefRaw, | |||
source, | |||
// @ts-expect-error - Not in tsc types yet. | |||
fetchPriority: link.fetchPriority, |
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.
Is it possible to add an internal type declaration for 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.
Is it possible to add an internal type declaration for this?
Yeah, it felt like overkill because it's part of the html spec and so it will eventually get rolled up into the tsc types, but OTOH @ts-expect-error
is pretty heavy handed. Added to the DOM types in the somewhat misleadingly named node.d.ts
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.
Love 🔥
To support #13738, gathers the
fetchpriority
hint in the ImageElements and LinkElements gatherers. Not used yet, but asserted in smoke tests.