Skip to content

Commit c504039

Browse files
authored
v9.6.7 (#14346)
1 parent 86ee553 commit c504039

24 files changed

+257
-85
lines changed

changelog.md

+22-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
<a name="9.6.7"></a>
2+
# 9.6.7 (2022-09-01)
3+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.6...v9.6.7)
4+
5+
This is an npm-only release. We have no plans to release this specific version to DevTools or PSI, but the changes will be rolled up into the next release in those clients.
6+
7+
## Core
8+
9+
* core(trace-elements): include LCP type in artifact ([#14344](https://github.com/GoogleChrome/lighthouse/pull/14344))
10+
* core: add priority to network-requests debug audit ([#14340](https://github.com/GoogleChrome/lighthouse/pull/14340))
11+
112
<a name="9.6.6"></a>
213
# 9.6.6 (2022-08-16)
3-
[Full Changelog](https://github.com/compare/v9.6.5...v9.6.6)
14+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.5...v9.6.6)
415

516
We expect this release to ship in the DevTools of [Chrome 106](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
617

@@ -20,7 +31,7 @@ Thanks to our new contributor 👽🐷🐰🐯🐻!
2031

2132
<a name="9.6.5"></a>
2233
# 9.6.5 (2022-08-01)
23-
[Full Changelog](https://github.com/compare/v9.6.4...v9.6.5)
34+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.4...v9.6.5)
2435

2536
This is an npm-only release and affects only the raw JSON report. We have no plans to release this specific version to DevTools or PSI, but the changes will be rolled up into the next release in those clients.
2637

@@ -31,7 +42,7 @@ This is an npm-only release and affects only the raw JSON report. We have no pla
3142

3243
<a name="9.6.4"></a>
3344
# 9.6.4 (2022-07-26)
34-
[Full Changelog](https://github.com/compare/v9.6.3...v9.6.4)
45+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.3...v9.6.4)
3546

3647
We expect this release to ship in the DevTools of [Chrome 106](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
3748

@@ -49,7 +60,7 @@ We expect this release to ship in the DevTools of [Chrome 106](https://chromiumd
4960

5061
<a name="9.6.3"></a>
5162
# 9.6.3 (2022-06-28)
52-
[Full Changelog](https://github.com/compare/v9.6.2...v9.6.3)
63+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.2...v9.6.3)
5364

5465
This is an npm-only release and affects only the raw JSON report. We have no plans to release this specific version to DevTools or PSI, but the changes will be rolled up into the next release in those clients.
5566

@@ -60,7 +71,7 @@ This is an npm-only release and affects only the raw JSON report. We have no pla
6071

6172
<a name="9.6.2"></a>
6273
# 9.6.2 (2022-06-01)
63-
[Full Changelog](https://github.com/compare/v9.6.1...v9.6.2)
74+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.1...v9.6.2)
6475

6576
We expect this release to ship in the DevTools of [Chrome 104](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
6677

@@ -87,7 +98,7 @@ We expect this release to ship in the DevTools of [Chrome 104](https://chromiumd
8798

8899
<a name="9.6.1"></a>
89100
# 9.6.1 (2022-05-11)
90-
[Full Changelog](https://github.com/compare/v9.6.0...v9.6.1)
101+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.6.0...v9.6.1)
91102

92103
We expect this release to ship in the DevTools of [Chrome 103](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
93104

@@ -107,7 +118,7 @@ We expect this release to ship in the DevTools of [Chrome 103](https://chromiumd
107118

108119
<a name="9.6.0"></a>
109120
# 9.6.0 (2022-05-09)
110-
[Full Changelog](https://github.com/compare/v9.5.0...v9.6.0)
121+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.5.0...v9.6.0)
111122

112123
We expect this release to ship in the DevTools of [Chrome 103](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
113124

@@ -157,7 +168,7 @@ We expect this release to ship in the DevTools of [Chrome 103](https://chromiumd
157168

158169
<a name="9.5.0"></a>
159170
# 9.5.0 (2022-03-09)
160-
[Full Changelog](https://github.com/compare/v9.4.0...v9.5.0)
171+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.4.0...v9.5.0)
161172

162173
We expect this release to ship in the DevTools of [Chrome 101](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
163174

@@ -211,7 +222,7 @@ Thanks to our new contributor 👽🐷🐰🐯🐻!
211222

212223
<a name="9.4.0"></a>
213224
# 9.4.0 (2022-02-16)
214-
[Full Changelog](https://github.com/compare/v9.3.1...v9.4.0)
225+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.3.1...v9.4.0)
215226

216227
We expect this release to ship in the DevTools of [Chrome 100](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
217228

@@ -256,15 +267,15 @@ We expect this release to ship in the DevTools of [Chrome 100](https://chromiumd
256267

257268
<a name="9.3.1"></a>
258269
# 9.3.1 (2022-01-31)
259-
[Full Changelog](https://github.com/compare/v9.3.0...v9.3.1)
270+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.3.0...v9.3.1)
260271

261272
## Report
262273

263274
* disable fireworks with flag ([#13610](https://github.com/GoogleChrome/lighthouse/pull/13610))
264275

265276
<a name="9.3.0"></a>
266277
# 9.3.0 (2022-01-31)
267-
[Full Changelog](https://github.com/compare/v9.2.0...v9.3.0)
278+
[Full Changelog](https://github.com/GoogleChrome/lighthouse/compare/v9.2.0...v9.3.0)
268279

269280
We expect this release to ship in the DevTools of [Chrome 100](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
270281

docs/plugins.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ A Lighthouse plugin is just a node module with a name that starts with `lighthou
6060
"name": "lighthouse-plugin-cats",
6161
"main": "plugin.js",
6262
"peerDependencies": {
63-
"lighthouse": "^9.6.6"
63+
"lighthouse": "^9.6.7"
6464
},
6565
"devDependencies": {
66-
"lighthouse": "^9.6.6"
66+
"lighthouse": "^9.6.7"
6767
}
6868
}
6969
```

docs/recipes/custom-audit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"private": true,
44
"scripts": {},
55
"devDependencies": {
6-
"lighthouse": "^9.6.6"
6+
"lighthouse": "^9.6.7"
77
}
88
}

docs/recipes/gulp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"devDependencies": {
88
"gulp": "^3.9.1",
99
"gulp-connect": "^5.0.0",
10-
"lighthouse": "^9.6.6"
10+
"lighthouse": "^9.6.7"
1111
}
1212
}

docs/recipes/lighthouse-plugin-example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"main": "./plugin.js",
55
"peerDependencies": {
6-
"lighthouse": "^9.6.6"
6+
"lighthouse": "^9.6.7"
77
},
88
"devDependencies": {
99
"lighthouse": "^8.6.0"

lighthouse-cli/test/smokehouse/test-definitions/perf-trace-elements.js

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const expectations = {
7373
height: 318,
7474
},
7575
},
76+
type: 'image',
7677
},
7778
{
7879
traceEventType: 'layout-shift',

lighthouse-core/audits/lcp-lazy-loaded.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ class LargestContentfulPaintLazyLoaded extends Audit {
5050
* @return {LH.Audit.Product}
5151
*/
5252
static audit(artifacts) {
53-
const lcpElement = artifacts.TraceElements
54-
.find(element => element.traceEventType === 'largest-contentful-paint');
53+
const lcpElement = artifacts.TraceElements.find(element => {
54+
return element.traceEventType === 'largest-contentful-paint' && element.type === 'image';
55+
});
5556
const lcpElementImage = lcpElement ? artifacts.ImageElements.find(elem => {
5657
return elem.node.devtoolsNodePath === lcpElement.node.devtoolsNodePath;
5758
}) : undefined;
5859

5960

6061
if (!lcpElementImage ||
6162
!this.isImageInViewport(lcpElementImage, artifacts.ViewportDimensions)) {
62-
return {score: 1, notApplicable: true};
63+
return {score: null, notApplicable: true};
6364
}
6465

6566
/** @type {LH.Audit.Details.Table['headings']} */

lighthouse-core/audits/network-requests.js

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class NetworkRequests extends Audit {
7373
statusCode: record.statusCode,
7474
mimeType: record.mimeType,
7575
resourceType: record.resourceType,
76+
priority: record.priority,
7677
isLinkPreload,
7778
experimentalFromMainFrame,
7879
lrEndTimeDeltaMs: endTimeDeltaMs, // Only exists on Lightrider runs

lighthouse-core/audits/preload-lcp-image.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class PreloadLCPImageAudit extends Audit {
8888
/**
8989
* @param {LH.Artifacts.NetworkRequest} mainResource
9090
* @param {LH.Gatherer.Simulation.GraphNode} graph
91-
* @param {LH.Artifacts.TraceElement|undefined} lcpElement
91+
* @param {LH.Artifacts.TraceElement} lcpElement
9292
* @param {Array<LH.Artifacts.ImageElement>} imageElements
9393
* @return {{lcpNodeToPreload?: LH.Gatherer.Simulation.GraphNetworkNode, initiatorPath?: InitiatorPath}}
9494
*/
@@ -121,14 +121,14 @@ class PreloadLCPImageAudit extends Audit {
121121

122122
/**
123123
* Computes the estimated effect of preloading the LCP image.
124-
* @param {LH.Artifacts.TraceElement|undefined} lcpElement
124+
* @param {LH.Artifacts.TraceElement} lcpElement
125125
* @param {LH.Gatherer.Simulation.GraphNetworkNode|undefined} lcpNode
126126
* @param {LH.Gatherer.Simulation.GraphNode} graph
127127
* @param {LH.Gatherer.Simulation.Simulator} simulator
128128
* @return {{wastedMs: number, results: Array<{node: LH.Audit.Details.NodeValue, url: string, wastedMs: number}>}}
129129
*/
130130
static computeWasteWithGraph(lcpElement, lcpNode, graph, simulator) {
131-
if (!lcpElement || !lcpNode) {
131+
if (!lcpNode) {
132132
return {
133133
wastedMs: 0,
134134
results: [],
@@ -222,6 +222,10 @@ class PreloadLCPImageAudit extends Audit {
222222
const lcpElement = artifacts.TraceElements
223223
.find(element => element.traceEventType === 'largest-contentful-paint');
224224

225+
if (!lcpElement || lcpElement.type !== 'image') {
226+
return {score: null, notApplicable: true};
227+
}
228+
225229
const [mainResource, lanternLCP, simulator] = await Promise.all([
226230
MainResource.request({devtoolsLog, URL}, context),
227231
LanternLCP.request(metricData, context),

lighthouse-core/gather/gatherers/trace-elements.js

+32-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ProcessedNavigation = require('../../computed/processed-navigation.js');
2424
const LighthouseError = require('../../lib/lh-error.js');
2525
const ComputedResponsivenes = require('../../computed/metrics/responsiveness.js');
2626

27-
/** @typedef {{nodeId: number, score?: number, animations?: {name?: string, failureReasonsMask?: number, unsupportedProperties?: string[]}[]}} TraceElementData */
27+
/** @typedef {{nodeId: number, score?: number, animations?: {name?: string, failureReasonsMask?: number, unsupportedProperties?: string[]}[], type?: string}} TraceElementData */
2828

2929
/**
3030
* @this {HTMLElement}
@@ -213,6 +213,34 @@ class TraceElements extends FRGatherer {
213213
return animatedElementData;
214214
}
215215

216+
/**
217+
* @param {LH.Artifacts.ProcessedTrace} processedTrace
218+
* @param {LH.Gatherer.FRTransitionalContext} context
219+
* @return {Promise<{nodeId: number, type: string} | undefined>}
220+
*/
221+
static async getLcpElement(processedTrace, context) {
222+
let processedNavigation;
223+
try {
224+
processedNavigation = await ProcessedNavigation.request(processedTrace, context);
225+
} catch (err) {
226+
// If we were running in timespan mode and there was no paint, treat LCP as missing.
227+
if (context.gatherMode === 'timespan' && err.code === LighthouseError.errors.NO_FCP.code) {
228+
return;
229+
}
230+
231+
throw err;
232+
}
233+
234+
// These should exist, but trace types are loose.
235+
const lcpData = processedNavigation.largestContentfulPaintEvt?.args?.data;
236+
if (lcpData?.nodeId === undefined || !lcpData.type) return;
237+
238+
return {
239+
nodeId: lcpData.nodeId,
240+
type: lcpData.type,
241+
};
242+
}
243+
216244
/**
217245
* @param {LH.Gatherer.FRTransitionalContext} context
218246
*/
@@ -241,26 +269,16 @@ class TraceElements extends FRGatherer {
241269
}
242270

243271
const processedTrace = await ProcessedTrace.request(trace, context);
244-
const {largestContentfulPaintEvt} = await ProcessedNavigation
245-
.request(processedTrace, context)
246-
.catch(err => {
247-
// If we were running in timespan mode and there was no paint, treat LCP as missing.
248-
if (context.gatherMode === 'timespan' && err.code === LighthouseError.errors.NO_FCP.code) {
249-
return {largestContentfulPaintEvt: undefined};
250-
}
251-
252-
throw err;
253-
});
254272
const {mainThreadEvents} = processedTrace;
255273

256-
const lcpNodeId = largestContentfulPaintEvt?.args?.data?.nodeId;
274+
const lcpNodeData = await TraceElements.getLcpElement(processedTrace, context);
257275
const clsNodeData = TraceElements.getTopLayoutShiftElements(mainThreadEvents);
258276
const animatedElementData = await this.getAnimatedElements(mainThreadEvents);
259277
const responsivenessElementData = await TraceElements.getResponsivenessElement(trace, context);
260278

261279
/** @type {Map<string, TraceElementData[]>} */
262280
const backendNodeDataMap = new Map([
263-
['largest-contentful-paint', lcpNodeId ? [{nodeId: lcpNodeId}] : []],
281+
['largest-contentful-paint', lcpNodeData ? [lcpNodeData] : []],
264282
['layout-shift', clsNodeData],
265283
['animation', animatedElementData],
266284
['responsiveness', responsivenessElementData ? [responsivenessElementData] : []],
@@ -299,6 +317,7 @@ class TraceElements extends FRGatherer {
299317
score: backendNodeData[i].score,
300318
animations: backendNodeData[i].animations,
301319
nodeId: backendNodeId,
320+
type: backendNodeData[i].type,
302321
});
303322
}
304323
}

lighthouse-core/test/audits/largest-contentful-paint-element-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe('Performance: largest-contentful-paint-element audit', () => {
2020
nodeLabel: 'My Test Label',
2121
snippet: '<h1 class="test-class">',
2222
},
23+
type: 'text',
2324
}],
2425
};
2526

lighthouse-core/test/audits/lcp-lazy-loaded-test.js

+26-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('Performance: lcp-lazy-loaded audit', () => {
3434
TraceElements: [{
3535
traceEventType: 'largest-contentful-paint',
3636
node: SAMPLE_NODE,
37+
type: 'image',
3738
}],
3839
ImageElements: [
3940
generateImage('lazy', 0),
@@ -57,6 +58,7 @@ describe('Performance: lcp-lazy-loaded audit', () => {
5758
TraceElements: [{
5859
traceEventType: 'largest-contentful-paint',
5960
node: SAMPLE_NODE,
61+
type: 'image',
6062
}],
6163
ImageElements: [
6264
generateImage('eager', 0),
@@ -76,6 +78,7 @@ describe('Performance: lcp-lazy-loaded audit', () => {
7678
TraceElements: [{
7779
traceEventType: 'largest-contentful-paint',
7880
node: SAMPLE_NODE,
81+
type: 'image',
7982
}],
8083
ImageElements: [
8184
generateImage('lazy', 700),
@@ -96,7 +99,29 @@ describe('Performance: lcp-lazy-loaded audit', () => {
9699
};
97100

98101
const auditResult = await LargestContentfulPaintLazyLoaded.audit(artifacts);
99-
expect(auditResult.score).toEqual(1);
102+
expect(auditResult.score).toEqual(null);
100103
expect(auditResult.notApplicable).toEqual(true);
101104
});
105+
106+
it('is not applicable when LCP was text', async () => {
107+
const artifacts = {
108+
TraceElements: [{
109+
traceEventType: 'largest-contentful-paint',
110+
node: SAMPLE_NODE,
111+
type: 'text',
112+
}],
113+
ImageElements: [
114+
generateImage('lazy', 700),
115+
],
116+
ViewportDimensions: {
117+
innerHeight: 500,
118+
innerWidth: 300,
119+
},
120+
};
121+
const auditResult = await LargestContentfulPaintLazyLoaded.audit(artifacts);
122+
expect(auditResult).toEqual({
123+
score: null,
124+
notApplicable: true,
125+
});
126+
});
102127
});

lighthouse-core/test/audits/network-requests-test.js

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('Network requests audit', () => {
3636
statusCode: 200,
3737
mimeType: 'text/html',
3838
resourceType: 'Document',
39+
priority: 'VeryHigh',
3940
});
4041
expect(output.details.items[2]).toMatchObject({
4142
startTime: expect.toBeApproximately(711, 0),
@@ -46,6 +47,7 @@ describe('Network requests audit', () => {
4647
statusCode: 200,
4748
mimeType: 'image/png',
4849
resourceType: 'Image',
50+
priority: 'Low',
4951
});
5052
expect(output.details.items[5]).toMatchObject({
5153
startTime: expect.toBeApproximately(717, 0),
@@ -56,6 +58,7 @@ describe('Network requests audit', () => {
5658
statusCode: 200,
5759
mimeType: 'application/javascript',
5860
resourceType: 'Script',
61+
priority: 'Medium',
5962
});
6063

6164
expect(output.details.debugData).toStrictEqual({

0 commit comments

Comments
 (0)