lighthouse 12.8.2-dev.20251005 → 12.8.2-dev.20251006
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/test/smokehouse/config/exclusions.js +0 -2
- package/core/audits/audit.js +0 -1
- package/core/audits/insights/cls-culprits-insight.js +1 -1
- package/core/audits/insights/dom-size-insight.js +6 -6
- package/core/audits/redirects.js +1 -0
- package/core/audits/server-response-time.d.ts +0 -5
- package/core/audits/server-response-time.js +12 -26
- package/core/computed/metrics/lcp-breakdown.js +1 -0
- package/core/config/default-config.js +20 -63
- package/core/config/experimental-config.js +1 -26
- package/core/config/filters.js +6 -9
- package/core/config/lr-desktop-config.js +0 -1
- package/core/config/lr-mobile-config.js +0 -1
- package/core/gather/gatherers/trace-elements.js +1 -0
- package/core/lib/proto-preprocessor.js +5 -22
- package/dist/report/bundle.esm.js +10 -49
- package/dist/report/flow.js +12 -51
- package/dist/report/standalone.js +11 -50
- package/flow-report/src/i18n/i18n.d.ts +4 -6
- package/package.json +3 -3
- package/report/assets/styles.css +0 -39
- package/report/renderer/api.js +0 -1
- package/report/renderer/category-renderer.js +6 -0
- package/report/renderer/components.js +1 -1
- package/report/renderer/dom.d.ts +0 -13
- package/report/renderer/dom.js +0 -38
- package/report/renderer/performance-category-renderer.d.ts +0 -26
- package/report/renderer/performance-category-renderer.js +10 -142
- package/report/renderer/report-ui-features.d.ts +0 -1
- package/report/renderer/report-ui-features.js +3 -13
- package/report/renderer/report-utils.d.ts +2 -3
- package/report/renderer/report-utils.js +4 -6
- package/report/types/report-renderer.d.ts +0 -6
- package/shared/localization/locales/ar-XB.json +0 -330
- package/shared/localization/locales/ar.json +0 -330
- package/shared/localization/locales/bg.json +0 -330
- package/shared/localization/locales/ca.json +0 -330
- package/shared/localization/locales/cs.json +0 -330
- package/shared/localization/locales/da.json +0 -330
- package/shared/localization/locales/de.json +0 -330
- package/shared/localization/locales/el.json +0 -330
- package/shared/localization/locales/en-GB.json +0 -330
- package/shared/localization/locales/en-US.json +26 -275
- package/shared/localization/locales/en-XA.json +0 -330
- package/shared/localization/locales/en-XL.json +26 -275
- package/shared/localization/locales/es-419.json +0 -330
- package/shared/localization/locales/es.json +0 -330
- package/shared/localization/locales/fi.json +0 -330
- package/shared/localization/locales/fil.json +0 -330
- package/shared/localization/locales/fr.json +0 -330
- package/shared/localization/locales/he.json +0 -330
- package/shared/localization/locales/hi.json +0 -330
- package/shared/localization/locales/hr.json +0 -330
- package/shared/localization/locales/hu.json +0 -330
- package/shared/localization/locales/id.json +0 -330
- package/shared/localization/locales/it.json +0 -330
- package/shared/localization/locales/ja.json +0 -330
- package/shared/localization/locales/ko.json +0 -330
- package/shared/localization/locales/lt.json +0 -330
- package/shared/localization/locales/lv.json +0 -330
- package/shared/localization/locales/nl.json +0 -330
- package/shared/localization/locales/no.json +0 -330
- package/shared/localization/locales/pl.json +0 -330
- package/shared/localization/locales/pt-PT.json +0 -330
- package/shared/localization/locales/pt.json +0 -330
- package/shared/localization/locales/ro.json +0 -330
- package/shared/localization/locales/ru.json +0 -330
- package/shared/localization/locales/sk.json +0 -330
- package/shared/localization/locales/sl.json +0 -330
- package/shared/localization/locales/sr-Latn.json +0 -330
- package/shared/localization/locales/sr.json +0 -330
- package/shared/localization/locales/sv.json +0 -330
- package/shared/localization/locales/ta.json +0 -330
- package/shared/localization/locales/te.json +0 -330
- package/shared/localization/locales/th.json +0 -330
- package/shared/localization/locales/tr.json +0 -330
- package/shared/localization/locales/uk.json +0 -330
- package/shared/localization/locales/vi.json +0 -330
- package/shared/localization/locales/zh-HK.json +0 -330
- package/shared/localization/locales/zh-TW.json +0 -330
- package/shared/localization/locales/zh.json +0 -330
- package/types/artifacts.d.ts +1 -0
- package/types/audit.d.ts +1 -1
- package/types/lhr/settings.d.ts +1 -1
- package/core/audits/byte-efficiency/duplicated-javascript.d.ts +0 -45
- package/core/audits/byte-efficiency/duplicated-javascript.js +0 -223
- package/core/audits/byte-efficiency/efficient-animated-content.d.ts +0 -22
- package/core/audits/byte-efficiency/efficient-animated-content.js +0 -93
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +0 -28
- package/core/audits/byte-efficiency/legacy-javascript.js +0 -144
- package/core/audits/byte-efficiency/modern-image-formats.d.ts +0 -38
- package/core/audits/byte-efficiency/modern-image-formats.js +0 -187
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +0 -53
- package/core/audits/byte-efficiency/render-blocking-resources.js +0 -312
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +0 -59
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +0 -293
- package/core/audits/byte-efficiency/uses-optimized-images.d.ts +0 -33
- package/core/audits/byte-efficiency/uses-optimized-images.js +0 -146
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +0 -16
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +0 -106
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +0 -44
- package/core/audits/byte-efficiency/uses-responsive-images.js +0 -202
- package/core/audits/byte-efficiency/uses-text-compression.d.ts +0 -14
- package/core/audits/byte-efficiency/uses-text-compression.js +0 -108
- package/core/audits/critical-request-chains.d.ts +0 -44
- package/core/audits/critical-request-chains.js +0 -221
- package/core/audits/dobetterweb/dom-size.d.ts +0 -32
- package/core/audits/dobetterweb/dom-size.js +0 -182
- package/core/audits/dobetterweb/uses-http2.d.ts +0 -72
- package/core/audits/dobetterweb/uses-http2.js +0 -276
- package/core/audits/font-display.d.ts +0 -32
- package/core/audits/font-display.js +0 -195
- package/core/audits/largest-contentful-paint-element.d.ts +0 -34
- package/core/audits/largest-contentful-paint-element.js +0 -181
- package/core/audits/lcp-lazy-loaded.d.ts +0 -22
- package/core/audits/lcp-lazy-loaded.js +0 -115
- package/core/audits/prioritize-lcp-image.d.ts +0 -74
- package/core/audits/prioritize-lcp-image.js +0 -297
- package/core/audits/third-party-summary.d.ts +0 -78
- package/core/audits/third-party-summary.js +0 -236
- package/core/audits/uses-rel-preconnect.d.ts +0 -37
- package/core/audits/uses-rel-preconnect.js +0 -286
- package/core/audits/viewport.d.ts +0 -17
- package/core/audits/viewport.js +0 -87
- package/core/audits/work-during-interaction.d.ts +0 -81
- package/core/audits/work-during-interaction.js +0 -287
|
@@ -36,8 +36,6 @@ const exclusions = {
|
|
|
36
36
|
for (const array of Object.values(exclusions)) {
|
|
37
37
|
// https://github.com/GoogleChrome/lighthouse/issues/14271
|
|
38
38
|
array.push('lantern-idle-callback-short');
|
|
39
|
-
// https://github.com/GoogleChrome/lighthouse/issues/16597
|
|
40
|
-
array.push('csp-block-all');
|
|
41
39
|
// glitch is gone.
|
|
42
40
|
array.push('issues-mixed-content');
|
|
43
41
|
// works most of the time, but since it uses a live site it can be flaky
|
package/core/audits/audit.js
CHANGED
|
@@ -38,7 +38,7 @@ class CLSCulpritsInsight extends Audit {
|
|
|
38
38
|
description: insightStr_(InsightUIStrings.description),
|
|
39
39
|
guidanceLevel: 3,
|
|
40
40
|
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
41
|
-
replacesAudits: ['layout-shifts'
|
|
41
|
+
replacesAudits: ['layout-shifts'],
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -59,21 +59,21 @@ class DOMSizeInsight extends Audit {
|
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
statistic: str_(UIStrings.
|
|
63
|
-
node: makeNodeItemForNodeId(artifacts.TraceElements,
|
|
62
|
+
statistic: str_(UIStrings.maxDOMDepth),
|
|
63
|
+
node: makeNodeItemForNodeId(artifacts.TraceElements, maxDepth.nodeId),
|
|
64
64
|
value: {
|
|
65
65
|
type: 'numeric',
|
|
66
66
|
granularity: 1,
|
|
67
|
-
value:
|
|
67
|
+
value: maxDepth.depth,
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
statistic: str_(UIStrings.
|
|
72
|
-
node: makeNodeItemForNodeId(artifacts.TraceElements,
|
|
71
|
+
statistic: str_(UIStrings.maxChildren),
|
|
72
|
+
node: makeNodeItemForNodeId(artifacts.TraceElements, maxChildren.nodeId),
|
|
73
73
|
value: {
|
|
74
74
|
type: 'numeric',
|
|
75
75
|
granularity: 1,
|
|
76
|
-
value:
|
|
76
|
+
value: maxChildren.numChildren,
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
];
|
package/core/audits/redirects.js
CHANGED
|
@@ -89,6 +89,7 @@ class Redirects extends Audit {
|
|
|
89
89
|
const gatherContext = artifacts.GatherContext;
|
|
90
90
|
const {URL, SourceMaps} = artifacts;
|
|
91
91
|
|
|
92
|
+
// TODO(v13): use trace processor / network tree insight.
|
|
92
93
|
const processedTrace = await ProcessedTrace.request(trace, context);
|
|
93
94
|
const networkRecords = await NetworkRecords.request(devtoolsLog, context);
|
|
94
95
|
const documentRequests = Redirects.getDocumentRequestChain(networkRecords, processedTrace);
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export default ServerResponseTime;
|
|
2
2
|
declare class ServerResponseTime extends Audit {
|
|
3
|
-
/**
|
|
4
|
-
* @param {LH.Artifacts.NetworkRequest} record
|
|
5
|
-
* @return {number|null}
|
|
6
|
-
*/
|
|
7
|
-
static calculateResponseTime(record: LH.Artifacts.NetworkRequest): number | null;
|
|
8
3
|
/**
|
|
9
4
|
* @param {LH.Artifacts} artifacts
|
|
10
5
|
* @param {LH.Audit.Context} context
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Audit} from './audit.js';
|
|
8
8
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
|
-
import {
|
|
9
|
+
import {NavigationInsights} from '../computed/navigation-insights.js';
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
12
12
|
/** Title of a diagnostic audit that provides detail on how long it took from starting a request to when the server started responding. This descriptive title is shown to users when the amount is acceptable and no user action is required. */
|
|
@@ -21,9 +21,6 @@ const UIStrings = {
|
|
|
21
21
|
|
|
22
22
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
23
23
|
|
|
24
|
-
// Due to the way that DevTools throttling works we cannot see if server response took less than ~570ms.
|
|
25
|
-
// We set our failure threshold to 600ms to avoid those false positives but we want devs to shoot for 100ms.
|
|
26
|
-
const TOO_SLOW_THRESHOLD_MS = 600;
|
|
27
24
|
const TARGET_MS = 100;
|
|
28
25
|
|
|
29
26
|
class ServerResponseTime extends Audit {
|
|
@@ -38,41 +35,30 @@ class ServerResponseTime extends Audit {
|
|
|
38
35
|
description: str_(UIStrings.description),
|
|
39
36
|
supportedModes: ['navigation'],
|
|
40
37
|
guidanceLevel: 1,
|
|
41
|
-
requiredArtifacts: ['
|
|
38
|
+
requiredArtifacts: ['Trace', 'SourceMaps'],
|
|
42
39
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
43
40
|
};
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
/**
|
|
47
|
-
* @param {LH.Artifacts.NetworkRequest} record
|
|
48
|
-
* @return {number|null}
|
|
49
|
-
*/
|
|
50
|
-
static calculateResponseTime(record) {
|
|
51
|
-
// Lightrider does not have timings for sendEnd, but we do have this timing which should be
|
|
52
|
-
// close to the response time.
|
|
53
|
-
if (global.isLightrider && record.lrStatistics) return record.lrStatistics.requestMs;
|
|
54
|
-
|
|
55
|
-
if (!record.timing) return null;
|
|
56
|
-
return record.timing.receiveHeadersStart - record.timing.sendEnd;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
43
|
/**
|
|
60
44
|
* @param {LH.Artifacts} artifacts
|
|
61
45
|
* @param {LH.Audit.Context} context
|
|
62
46
|
* @return {Promise<LH.Audit.Product>}
|
|
63
47
|
*/
|
|
64
48
|
static async audit(artifacts, context) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
49
|
+
const settings = context.settings;
|
|
50
|
+
const trace = artifacts.Trace;
|
|
51
|
+
const SourceMaps = artifacts.SourceMaps;
|
|
52
|
+
const navInsights = await NavigationInsights.request({trace, settings, SourceMaps}, context);
|
|
53
|
+
const responseTime = navInsights.model.DocumentLatency.data?.serverResponseTime;
|
|
54
|
+
const url = navInsights.model.DocumentLatency.data?.documentRequest?.args.data.url;
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
if (responseTime === null) {
|
|
56
|
+
if (responseTime === undefined || !url) {
|
|
72
57
|
throw new Error('no timing found for main resource');
|
|
73
58
|
}
|
|
74
59
|
|
|
75
|
-
const passed =
|
|
60
|
+
const passed =
|
|
61
|
+
Boolean(navInsights.model.DocumentLatency.data?.checklist.serverResponseIsFast.value);
|
|
76
62
|
const displayValue = str_(UIStrings.displayValue, {timeInMs: responseTime});
|
|
77
63
|
|
|
78
64
|
/** @type {LH.Audit.Details.Opportunity['headings']} */
|
|
@@ -84,7 +70,7 @@ class ServerResponseTime extends Audit {
|
|
|
84
70
|
const overallSavingsMs = Math.max(responseTime - TARGET_MS, 0);
|
|
85
71
|
const details = Audit.makeOpportunityDetails(
|
|
86
72
|
headings,
|
|
87
|
-
[{url
|
|
73
|
+
[{url, responseTime}],
|
|
88
74
|
{overallSavingsMs}
|
|
89
75
|
);
|
|
90
76
|
|
|
@@ -11,6 +11,7 @@ import {ProcessedNavigation} from '../processed-navigation.js';
|
|
|
11
11
|
import {TimeToFirstByte} from './time-to-first-byte.js';
|
|
12
12
|
import {LCPImageRecord} from '../lcp-image-record.js';
|
|
13
13
|
|
|
14
|
+
// TODO(v13): should use LCPBreakdown insight
|
|
14
15
|
class LCPBreakdown {
|
|
15
16
|
/**
|
|
16
17
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
@@ -147,7 +147,6 @@ const defaultConfig = {
|
|
|
147
147
|
audits: [
|
|
148
148
|
'is-on-https',
|
|
149
149
|
'redirects-http',
|
|
150
|
-
'viewport',
|
|
151
150
|
'metrics/first-contentful-paint',
|
|
152
151
|
'metrics/largest-contentful-paint',
|
|
153
152
|
'metrics/first-meaningful-paint',
|
|
@@ -162,7 +161,6 @@ const defaultConfig = {
|
|
|
162
161
|
'server-response-time',
|
|
163
162
|
'metrics/interactive',
|
|
164
163
|
'user-timings',
|
|
165
|
-
'critical-request-chains',
|
|
166
164
|
'redirects',
|
|
167
165
|
'image-aspect-ratio',
|
|
168
166
|
'image-size-responsive',
|
|
@@ -170,8 +168,6 @@ const defaultConfig = {
|
|
|
170
168
|
'third-party-cookies',
|
|
171
169
|
'mainthread-work-breakdown',
|
|
172
170
|
'bootup-time',
|
|
173
|
-
'uses-rel-preconnect',
|
|
174
|
-
'font-display',
|
|
175
171
|
'diagnostics',
|
|
176
172
|
'network-requests',
|
|
177
173
|
'network-rtt',
|
|
@@ -179,15 +175,11 @@ const defaultConfig = {
|
|
|
179
175
|
'main-thread-tasks',
|
|
180
176
|
'metrics',
|
|
181
177
|
'resource-summary',
|
|
182
|
-
'third-party-summary',
|
|
183
|
-
'largest-contentful-paint-element',
|
|
184
|
-
'lcp-lazy-loaded',
|
|
185
178
|
'layout-shifts',
|
|
186
179
|
'long-tasks',
|
|
187
180
|
'non-composited-animations',
|
|
188
181
|
'unsized-images',
|
|
189
182
|
'valid-source-maps',
|
|
190
|
-
'prioritize-lcp-image',
|
|
191
183
|
'csp-xss',
|
|
192
184
|
'has-hsts',
|
|
193
185
|
'origin-isolation',
|
|
@@ -267,32 +259,20 @@ const defaultConfig = {
|
|
|
267
259
|
'accessibility/manual/offscreen-content-hidden',
|
|
268
260
|
'accessibility/manual/use-landmarks',
|
|
269
261
|
'accessibility/manual/visual-order-follows-dom',
|
|
270
|
-
'byte-efficiency/uses-long-cache-ttl',
|
|
271
262
|
'byte-efficiency/total-byte-weight',
|
|
272
263
|
'byte-efficiency/offscreen-images',
|
|
273
|
-
'byte-efficiency/render-blocking-resources',
|
|
274
264
|
'byte-efficiency/unminified-css',
|
|
275
265
|
'byte-efficiency/unminified-javascript',
|
|
276
266
|
'byte-efficiency/unused-css-rules',
|
|
277
267
|
'byte-efficiency/unused-javascript',
|
|
278
|
-
'byte-efficiency/modern-image-formats',
|
|
279
|
-
'byte-efficiency/uses-optimized-images',
|
|
280
|
-
'byte-efficiency/uses-text-compression',
|
|
281
|
-
'byte-efficiency/uses-responsive-images',
|
|
282
|
-
'byte-efficiency/efficient-animated-content',
|
|
283
|
-
'byte-efficiency/duplicated-javascript',
|
|
284
|
-
'byte-efficiency/legacy-javascript',
|
|
285
|
-
'byte-efficiency/uses-responsive-images-snapshot',
|
|
286
268
|
'dobetterweb/doctype',
|
|
287
269
|
'dobetterweb/charset',
|
|
288
|
-
'dobetterweb/dom-size',
|
|
289
270
|
'dobetterweb/geolocation-on-start',
|
|
290
271
|
'dobetterweb/inspector-issues',
|
|
291
272
|
'dobetterweb/no-document-write',
|
|
292
273
|
'dobetterweb/js-libraries',
|
|
293
274
|
'dobetterweb/notification-on-start',
|
|
294
275
|
'dobetterweb/paste-preventing-inputs',
|
|
295
|
-
'dobetterweb/uses-http2',
|
|
296
276
|
'dobetterweb/uses-passive-event-listeners',
|
|
297
277
|
'seo/meta-description',
|
|
298
278
|
'seo/http-status-code',
|
|
@@ -303,7 +283,6 @@ const defaultConfig = {
|
|
|
303
283
|
'seo/hreflang',
|
|
304
284
|
'seo/canonical',
|
|
305
285
|
'seo/manual/structured-data',
|
|
306
|
-
'work-during-interaction',
|
|
307
286
|
'bf-cache',
|
|
308
287
|
'insights/cache-insight',
|
|
309
288
|
'insights/cls-culprits-insight',
|
|
@@ -407,67 +386,43 @@ const defaultConfig = {
|
|
|
407
386
|
{id: 'interaction-to-next-paint', weight: 0, group: 'metrics', acronym: 'INP'},
|
|
408
387
|
|
|
409
388
|
// Insight audits.
|
|
410
|
-
{id: 'cache-insight', weight: 0, group: '
|
|
411
|
-
{id: 'cls-culprits-insight', weight: 0, group: '
|
|
412
|
-
{id: 'document-latency-insight', weight: 0, group: '
|
|
413
|
-
{id: 'dom-size-insight', weight: 0, group: '
|
|
414
|
-
{id: 'duplicated-javascript-insight', weight: 0, group: '
|
|
415
|
-
{id: 'font-display-insight', weight: 0, group: '
|
|
416
|
-
{id: 'forced-reflow-insight', weight: 0, group: '
|
|
417
|
-
{id: 'image-delivery-insight', weight: 0, group: '
|
|
418
|
-
{id: 'inp-breakdown-insight', weight: 0, group: '
|
|
419
|
-
{id: 'lcp-breakdown-insight', weight: 0, group: '
|
|
420
|
-
{id: 'lcp-discovery-insight', weight: 0, group: '
|
|
421
|
-
{id: 'legacy-javascript-insight', weight: 0, group: '
|
|
422
|
-
{id: 'modern-http-insight', weight: 0, group: '
|
|
423
|
-
{id: 'network-dependency-tree-insight', weight: 0, group: '
|
|
424
|
-
{id: 'render-blocking-insight', weight: 0, group: '
|
|
425
|
-
{id: 'third-parties-insight', weight: 0, group: '
|
|
426
|
-
{id: 'viewport-insight', weight: 0, group: '
|
|
389
|
+
{id: 'cache-insight', weight: 0, group: 'insights'},
|
|
390
|
+
{id: 'cls-culprits-insight', weight: 0, group: 'insights'},
|
|
391
|
+
{id: 'document-latency-insight', weight: 0, group: 'insights'},
|
|
392
|
+
{id: 'dom-size-insight', weight: 0, group: 'insights'},
|
|
393
|
+
{id: 'duplicated-javascript-insight', weight: 0, group: 'insights'},
|
|
394
|
+
{id: 'font-display-insight', weight: 0, group: 'insights'},
|
|
395
|
+
{id: 'forced-reflow-insight', weight: 0, group: 'insights'},
|
|
396
|
+
{id: 'image-delivery-insight', weight: 0, group: 'insights'},
|
|
397
|
+
{id: 'inp-breakdown-insight', weight: 0, group: 'insights'},
|
|
398
|
+
{id: 'lcp-breakdown-insight', weight: 0, group: 'insights'},
|
|
399
|
+
{id: 'lcp-discovery-insight', weight: 0, group: 'insights'},
|
|
400
|
+
{id: 'legacy-javascript-insight', weight: 0, group: 'insights'},
|
|
401
|
+
{id: 'modern-http-insight', weight: 0, group: 'insights'},
|
|
402
|
+
{id: 'network-dependency-tree-insight', weight: 0, group: 'insights'},
|
|
403
|
+
{id: 'render-blocking-insight', weight: 0, group: 'insights'},
|
|
404
|
+
{id: 'third-parties-insight', weight: 0, group: 'insights'},
|
|
405
|
+
{id: 'viewport-insight', weight: 0, group: 'insights'},
|
|
427
406
|
|
|
428
407
|
// These are our "invisible" metrics. Not displayed, but still in the LHR.
|
|
429
408
|
{id: 'interactive', weight: 0, group: 'hidden', acronym: 'TTI'},
|
|
430
409
|
{id: 'max-potential-fid', weight: 0, group: 'hidden'},
|
|
431
410
|
{id: 'first-meaningful-paint', weight: 0, acronym: 'FMP', group: 'hidden'},
|
|
432
411
|
|
|
433
|
-
{id: 'render-blocking-resources', weight: 0, group: 'diagnostics'},
|
|
434
|
-
{id: 'uses-responsive-images', weight: 0, group: 'diagnostics'},
|
|
435
412
|
{id: 'offscreen-images', weight: 0, group: 'diagnostics'},
|
|
436
413
|
{id: 'unminified-css', weight: 0, group: 'diagnostics'},
|
|
437
414
|
{id: 'unminified-javascript', weight: 0, group: 'diagnostics'},
|
|
438
415
|
{id: 'unused-css-rules', weight: 0, group: 'diagnostics'},
|
|
439
416
|
{id: 'unused-javascript', weight: 0, group: 'diagnostics'},
|
|
440
|
-
{id: 'uses-optimized-images', weight: 0, group: 'diagnostics'},
|
|
441
|
-
{id: 'modern-image-formats', weight: 0, group: 'diagnostics'},
|
|
442
|
-
{id: 'uses-text-compression', weight: 0, group: 'diagnostics'},
|
|
443
|
-
{id: 'uses-rel-preconnect', weight: 0, group: 'diagnostics'},
|
|
444
|
-
{id: 'server-response-time', weight: 0, group: 'diagnostics'},
|
|
445
|
-
{id: 'redirects', weight: 0, group: 'diagnostics'},
|
|
446
|
-
{id: 'uses-http2', weight: 0, group: 'diagnostics'},
|
|
447
|
-
{id: 'efficient-animated-content', weight: 0, group: 'diagnostics'},
|
|
448
|
-
{id: 'duplicated-javascript', weight: 0, group: 'diagnostics'},
|
|
449
|
-
{id: 'legacy-javascript', weight: 0, group: 'diagnostics'},
|
|
450
|
-
{id: 'prioritize-lcp-image', weight: 0, group: 'diagnostics'},
|
|
451
417
|
{id: 'total-byte-weight', weight: 0, group: 'diagnostics'},
|
|
452
|
-
{id: 'uses-long-cache-ttl', weight: 0, group: 'diagnostics'},
|
|
453
|
-
{id: 'dom-size', weight: 0, group: 'diagnostics'},
|
|
454
|
-
{id: 'critical-request-chains', weight: 0, group: 'diagnostics'},
|
|
455
418
|
{id: 'user-timings', weight: 0, group: 'diagnostics'},
|
|
456
419
|
{id: 'bootup-time', weight: 0, group: 'diagnostics'},
|
|
457
420
|
{id: 'mainthread-work-breakdown', weight: 0, group: 'diagnostics'},
|
|
458
|
-
{id: 'font-display', weight: 0, group: 'diagnostics'},
|
|
459
|
-
{id: 'third-party-summary', weight: 0, group: 'diagnostics'},
|
|
460
|
-
{id: 'largest-contentful-paint-element', weight: 0, group: 'diagnostics'},
|
|
461
|
-
{id: 'lcp-lazy-loaded', weight: 0, group: 'diagnostics'},
|
|
462
|
-
{id: 'layout-shifts', weight: 0, group: 'diagnostics'},
|
|
463
421
|
{id: 'uses-passive-event-listeners', weight: 0, group: 'diagnostics'},
|
|
464
422
|
{id: 'no-document-write', weight: 0, group: 'diagnostics'},
|
|
465
423
|
{id: 'long-tasks', weight: 0, group: 'diagnostics'},
|
|
466
424
|
{id: 'non-composited-animations', weight: 0, group: 'diagnostics'},
|
|
467
425
|
{id: 'unsized-images', weight: 0, group: 'diagnostics'},
|
|
468
|
-
{id: 'viewport', weight: 0, group: 'diagnostics'},
|
|
469
|
-
{id: 'uses-responsive-images-snapshot', weight: 0, group: 'diagnostics'},
|
|
470
|
-
{id: 'work-during-interaction', weight: 0, group: 'diagnostics'},
|
|
471
426
|
{id: 'bf-cache', weight: 0, group: 'diagnostics'},
|
|
472
427
|
|
|
473
428
|
// Audits past this point contain useful data but are not displayed with other audits.
|
|
@@ -481,6 +436,9 @@ const defaultConfig = {
|
|
|
481
436
|
{id: 'final-screenshot', weight: 0, group: 'hidden'},
|
|
482
437
|
{id: 'script-treemap-data', weight: 0, group: 'hidden'},
|
|
483
438
|
{id: 'resource-summary', weight: 0, group: 'hidden'},
|
|
439
|
+
{id: 'redirects', weight: 0, group: 'hidden'},
|
|
440
|
+
{id: 'server-response-time', weight: 0, group: 'hidden'},
|
|
441
|
+
{id: 'layout-shifts', weight: 0, group: 'hidden'},
|
|
484
442
|
],
|
|
485
443
|
},
|
|
486
444
|
'accessibility': {
|
|
@@ -610,7 +568,6 @@ const defaultConfig = {
|
|
|
610
568
|
{id: 'paste-preventing-inputs', weight: 3, group: 'best-practices-ux'},
|
|
611
569
|
{id: 'image-aspect-ratio', weight: 1, group: 'best-practices-ux'},
|
|
612
570
|
{id: 'image-size-responsive', weight: 1, group: 'best-practices-ux'},
|
|
613
|
-
{id: 'viewport', weight: 1, group: 'best-practices-ux'},
|
|
614
571
|
// Browser Compatibility
|
|
615
572
|
{id: 'doctype', weight: 1, group: 'best-practices-browser-compat'},
|
|
616
573
|
{id: 'charset', weight: 1, group: 'best-practices-browser-compat'},
|
|
@@ -16,32 +16,7 @@ const config = {
|
|
|
16
16
|
'autocomplete',
|
|
17
17
|
],
|
|
18
18
|
categories: {
|
|
19
|
-
// @ts-
|
|
20
|
-
// config is awkward - easier to omit the property here. Will defer to default config.
|
|
21
|
-
'performance': {
|
|
22
|
-
auditRefs: [
|
|
23
|
-
// TODO: Remove this when insights aren't hidden by default
|
|
24
|
-
// Insight audits.
|
|
25
|
-
{id: 'cache-insight', weight: 0, group: 'insights'},
|
|
26
|
-
{id: 'cls-culprits-insight', weight: 0, group: 'insights'},
|
|
27
|
-
{id: 'document-latency-insight', weight: 0, group: 'insights'},
|
|
28
|
-
{id: 'dom-size-insight', weight: 0, group: 'insights'},
|
|
29
|
-
{id: 'duplicated-javascript-insight', weight: 0, group: 'insights'},
|
|
30
|
-
{id: 'font-display-insight', weight: 0, group: 'insights'},
|
|
31
|
-
{id: 'forced-reflow-insight', weight: 0, group: 'insights'},
|
|
32
|
-
{id: 'image-delivery-insight', weight: 0, group: 'insights'},
|
|
33
|
-
{id: 'inp-breakdown-insight', weight: 0, group: 'insights'},
|
|
34
|
-
{id: 'lcp-breakdown-insight', weight: 0, group: 'insights'},
|
|
35
|
-
{id: 'lcp-discovery-insight', weight: 0, group: 'insights'},
|
|
36
|
-
{id: 'legacy-javascript-insight', weight: 0, group: 'insights'},
|
|
37
|
-
{id: 'modern-http-insight', weight: 0, group: 'insights'},
|
|
38
|
-
{id: 'network-dependency-tree-insight', weight: 0, group: 'insights'},
|
|
39
|
-
{id: 'render-blocking-insight', weight: 0, group: 'insights'},
|
|
40
|
-
{id: 'third-parties-insight', weight: 0, group: 'insights'},
|
|
41
|
-
{id: 'viewport-insight', weight: 0, group: 'insights'},
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
// @ts-ignore: `title` is required in CategoryJson. setting to the same value as the default
|
|
19
|
+
// @ts-expect-error: `title` is required in CategoryJson. setting to the same value as the default
|
|
45
20
|
// config is awkward - easier to omit the property here. Will defer to default config.
|
|
46
21
|
'best-practices': {
|
|
47
22
|
auditRefs: [
|
package/core/config/filters.js
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import log from 'lighthouse-logger';
|
|
8
|
-
|
|
9
7
|
import {Audit} from '../audits/audit.js';
|
|
10
8
|
|
|
11
9
|
/** @type {Record<keyof LH.BaseArtifacts, string>} */
|
|
@@ -176,20 +174,19 @@ function filterCategoriesByExplicitFilters(categories, onlyCategories) {
|
|
|
176
174
|
}
|
|
177
175
|
|
|
178
176
|
/**
|
|
179
|
-
*
|
|
177
|
+
* Throw an error if any specified onlyCategory is not a known category that can
|
|
180
178
|
* be included.
|
|
181
179
|
*
|
|
182
180
|
* @param {LH.Config.ResolvedConfig['categories']} allCategories
|
|
183
181
|
* @param {string[] | null} onlyCategories
|
|
184
182
|
* @return {void}
|
|
185
183
|
*/
|
|
186
|
-
function
|
|
184
|
+
function errorOnUnknownOnlyCategories(allCategories, onlyCategories) {
|
|
187
185
|
if (!onlyCategories) return;
|
|
188
186
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
187
|
+
const unknown = onlyCategories.filter(c => !allCategories?.[c]);
|
|
188
|
+
if (unknown.length) {
|
|
189
|
+
throw new Error(`unrecognized category in 'onlyCategories': ${unknown.join(', ')}`);
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
192
|
|
|
@@ -271,7 +268,7 @@ function filterConfigByExplicitFilters(resolvedConfig, filters) {
|
|
|
271
268
|
throw new Error(`onlyCategories cannot be an empty array.`);
|
|
272
269
|
}
|
|
273
270
|
|
|
274
|
-
|
|
271
|
+
errorOnUnknownOnlyCategories(resolvedConfig.categories, onlyCategories);
|
|
275
272
|
|
|
276
273
|
let baseAuditIds = getAuditIdsInCategories(resolvedConfig.categories, undefined);
|
|
277
274
|
if (onlyCategories) {
|
|
@@ -18,7 +18,6 @@ const config = {
|
|
|
18
18
|
emulatedUserAgent: constants.userAgents.desktop,
|
|
19
19
|
skipAudits: [
|
|
20
20
|
// Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539
|
|
21
|
-
'uses-http2',
|
|
22
21
|
'modern-http-insight',
|
|
23
22
|
// There are always bf-cache failures when testing in headless. Reenable when headless can give us realistic bf-cache insights.
|
|
24
23
|
'bf-cache',
|
|
@@ -17,7 +17,6 @@ const config = {
|
|
|
17
17
|
},
|
|
18
18
|
skipAudits: [
|
|
19
19
|
// Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539
|
|
20
|
-
'uses-http2',
|
|
21
20
|
'modern-http-insight',
|
|
22
21
|
// There are always bf-cache failures when testing in headless. Reenable when headless can give us realistic bf-cache insights.
|
|
23
22
|
'bf-cache',
|
|
@@ -378,6 +378,7 @@ class TraceElements extends BaseGatherer {
|
|
|
378
378
|
const animatedElementData = await this.getAnimatedElements(mainThreadEvents);
|
|
379
379
|
const responsivenessElementData = await TraceElements.getResponsivenessElement(trace, context);
|
|
380
380
|
|
|
381
|
+
// TODO(v13): remove unnecessary entries.
|
|
381
382
|
/** @type {Map<string, TraceElementData[]>} */
|
|
382
383
|
const backendNodeDataMap = new Map([
|
|
383
384
|
['trace-engine', traceEngineData],
|
|
@@ -22,29 +22,12 @@ function processForProto(lhr) {
|
|
|
22
22
|
/** @type {LH.Result} */
|
|
23
23
|
const reportJson = JSON.parse(JSON.stringify(lhr));
|
|
24
24
|
|
|
25
|
-
//
|
|
26
|
-
// Note: This is not strictly required for conversion if protobuf parsing is set to
|
|
27
|
-
// 'ignore unknown fields' in the language of conversion.
|
|
25
|
+
// Drop these fields as we've omitted them from the proto for simplicity
|
|
28
26
|
if (reportJson.configSettings) {
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
onlyCategories,
|
|
34
|
-
channel,
|
|
35
|
-
throttling,
|
|
36
|
-
screenEmulation,
|
|
37
|
-
throttlingMethod} = reportJson.configSettings;
|
|
38
|
-
|
|
39
|
-
// @ts-expect-error - intentionally only a subset of settings.
|
|
40
|
-
reportJson.configSettings = {
|
|
41
|
-
formFactor,
|
|
42
|
-
locale,
|
|
43
|
-
onlyCategories,
|
|
44
|
-
channel,
|
|
45
|
-
throttling,
|
|
46
|
-
screenEmulation,
|
|
47
|
-
throttlingMethod};
|
|
27
|
+
// @ts-expect-error Removing non-optional field.
|
|
28
|
+
delete reportJson.configSettings.auditMode;
|
|
29
|
+
// @ts-expect-error Removing non-optional field.
|
|
30
|
+
delete reportJson.configSettings.gatherMode;
|
|
48
31
|
}
|
|
49
32
|
|
|
50
33
|
// Remove runtimeError if it is NO_ERROR
|