-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,6 +242,25 @@ const expectations = { | |
}, | ||
], | ||
}, | ||
ImageElements: { | ||
_includes: [{ | ||
src: 'http://localhost:10200/dobetterweb/lighthouse-1024x680.jpg?iar2', | ||
srcset: '', | ||
displayedWidth: 120, | ||
displayedHeight: 80, | ||
attributeWidth: '120', | ||
attributeHeight: '80', | ||
naturalDimensions: { | ||
width: 1024, | ||
height: 678, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. notice the image is called There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe reason will be displayed to describe this comment to others. Learn more. Yeah not suggesting we change it here, just wanted to confirm |
||
}, | ||
isCss: false, | ||
isPicture: false, | ||
isInShadowDOM: false, | ||
loading: 'lazy', | ||
fetchPriority: 'low', | ||
}], | ||
}, | ||
}, | ||
lhr: { | ||
requestedUrl: 'http://localhost:10200/dobetterweb/dbw_tester.html', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ function getLinkElementsInDOM() { | |
crossOrigin: link.crossOrigin, | ||
hrefRaw, | ||
source, | ||
fetchPriority: link.fetchPriority, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 - put into scope via stringification | ||
node: getNodeDetails(link), | ||
}); | ||
|
@@ -134,6 +135,7 @@ class LinkElements extends FRGatherer { | |
as: link.as || '', | ||
crossOrigin: getCrossoriginFromHeader(link.crossorigin), | ||
source: 'headers', | ||
fetchPriority: link.fetchpriority, | ||
node: null, | ||
}); | ||
} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Love 🔥 |
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 :)