-
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
deps: update to typescript 4.1.2 #11690
Changes from 1 commit
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 |
---|---|---|
|
@@ -76,7 +76,6 @@ function getHTMLImages(allElements) { | |
cssComputedPosition: getPosition(element, computedStyle), | ||
isCss: false, | ||
isPicture, | ||
// @ts-expect-error: loading attribute not yet added to HTMLImageElement definition. | ||
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. 🎉 |
||
loading: element.loading, | ||
resourceSize: 0, // this will get overwritten below | ||
usesObjectFit: ['cover', 'contain', 'scale-down', 'none'].includes( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,11 +143,12 @@ class Simulator { | |
|
||
/** | ||
* @param {Node} node | ||
* @return {NodeTimingIntermediate} | ||
* @return {Required<NodeTimingIntermediate>} | ||
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 this can be improved, filed #11692 for myself 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. thank you @patrickhulce! |
||
*/ | ||
_getTimingData(node) { | ||
const timingData = this._nodeTimings.get(node); | ||
if (!timingData) throw new Error(`Unable to get timing data for node ${node.id}`); | ||
// @ts-expect-error - Allow consumers to assume all values are defined. | ||
return timingData; | ||
} | ||
|
||
|
@@ -405,7 +406,8 @@ class Simulator { | |
_computeFinalNodeTimings() { | ||
/** @type {Array<[Node, LH.Gatherer.Simulation.NodeTiming]>} */ | ||
const nodeTimingEntries = []; | ||
for (const [node, timing] of this._nodeTimings) { | ||
for (const node of this._nodeTimings.keys()) { | ||
const timing = this._getTimingData(node); | ||
nodeTimingEntries.push([node, { | ||
startTime: timing.startTime, | ||
endTime: timing.endTime, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ function processForProto(lhr) { | |
|
||
// Drop the i18n icuMessagePaths. Painful in proto, and low priority to expose currently. | ||
if (reportJson.i18n && reportJson.i18n.icuMessagePaths) { | ||
// @ts-expect-error | ||
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. why this? should we set it to undefined or do we need to update the type to allow it to be undefined to reflect reality? 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. done. And now I realize the #10148 wouldn't work for PSI LHRs until we fix this :( |
||
delete reportJson.i18n.icuMessagePaths; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ class Util { | |
// into 'debugdata' (LHR ≥5.0). | ||
// @ts-expect-error tsc rightly flags that these values shouldn't occur. | ||
if (audit.details.type === undefined || audit.details.type === 'diagnostic') { | ||
// @ts-expect-error | ||
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. this one makes less sense to me than the one immediately above it, what's the reason? 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.
it's because the conditional above only lets in |
||
audit.details.type = 'debugdata'; | ||
} | ||
|
||
|
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.
come to think of it, why do we do this at all? can
onload
oronerror
ever refire after it's been fired before and removed from the DOM?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.
it helps me sleep at night
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.
also I'm wondering if this holds a reference to itself, so GC would never delete the element ...
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.
not since IE8 :)
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dd361842(v=vs.85)