lighthouse 12.5.1 → 12.6.0
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/run.js +1 -1
- package/cli/test/smokehouse/config/exclusions.js +2 -0
- package/cli/test/smokehouse/lib/concurrent-mapper.d.ts +3 -3
- package/core/audits/audit.d.ts +1 -1
- package/core/audits/audit.js +3 -2
- package/core/audits/bootup-time.d.ts +1 -1
- package/core/audits/bootup-time.js +3 -3
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +1 -1
- package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
- package/core/audits/byte-efficiency/efficient-animated-content.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.js +2 -3
- package/core/audits/byte-efficiency/modern-image-formats.js +1 -1
- package/core/audits/byte-efficiency/offscreen-images.js +4 -4
- package/core/audits/byte-efficiency/render-blocking-resources.js +4 -4
- package/core/audits/byte-efficiency/total-byte-weight.d.ts +1 -1
- package/core/audits/byte-efficiency/total-byte-weight.js +2 -2
- package/core/audits/byte-efficiency/unminified-css.js +1 -1
- package/core/audits/byte-efficiency/unminified-javascript.js +1 -1
- package/core/audits/byte-efficiency/unused-css-rules.js +2 -2
- package/core/audits/byte-efficiency/unused-javascript.js +1 -1
- package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +1 -1
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +2 -2
- package/core/audits/byte-efficiency/uses-optimized-images.js +2 -2
- package/core/audits/byte-efficiency/uses-responsive-images.d.ts +1 -1
- package/core/audits/byte-efficiency/uses-responsive-images.js +1 -1
- package/core/audits/byte-efficiency/uses-text-compression.js +1 -1
- package/core/audits/clickjacking-mitigation.js +2 -2
- package/core/audits/critical-request-chains.js +3 -3
- package/core/audits/csp-xss.js +2 -2
- package/core/audits/diagnostics.js +3 -3
- package/core/audits/dobetterweb/charset.js +2 -2
- package/core/audits/dobetterweb/doctype.js +2 -2
- package/core/audits/dobetterweb/dom-size.d.ts +1 -1
- package/core/audits/dobetterweb/dom-size.js +3 -3
- package/core/audits/dobetterweb/uses-http2.js +2 -2
- package/core/audits/final-screenshot.js +2 -2
- package/core/audits/font-display.js +2 -2
- package/core/audits/has-hsts.js +2 -2
- package/core/audits/image-size-responsive.d.ts +3 -2
- package/core/audits/image-size-responsive.js +30 -4
- package/core/audits/insights/{use-cache-insight.d.ts → cache-insight.d.ts} +3 -3
- package/core/audits/insights/{use-cache-insight.js → cache-insight.js} +15 -13
- package/core/audits/insights/cls-culprits-insight.js +3 -3
- package/core/audits/insights/document-latency-insight.js +1 -1
- package/core/audits/insights/dom-size-insight.js +1 -1
- package/core/audits/insights/duplicated-javascript-insight.d.ts +13 -0
- package/core/audits/insights/duplicated-javascript-insight.js +36 -9
- package/core/audits/insights/font-display-insight.js +1 -1
- package/core/audits/insights/forced-reflow-insight.js +1 -1
- package/core/audits/insights/image-delivery-insight.js +1 -1
- package/core/audits/insights/insight-audit.d.ts +11 -9
- package/core/audits/insights/insight-audit.js +37 -35
- package/core/audits/insights/interaction-to-next-paint-insight.js +3 -6
- package/core/audits/insights/lcp-discovery-insight.js +6 -3
- package/core/audits/insights/lcp-phases-insight.js +3 -6
- package/core/audits/insights/legacy-javascript-insight.d.ts +23 -0
- package/core/audits/insights/legacy-javascript-insight.js +101 -0
- package/core/audits/insights/modern-http-insight.d.ts +11 -0
- package/core/audits/insights/modern-http-insight.js +53 -0
- package/core/audits/insights/network-dependency-tree-insight.d.ts +5 -0
- package/core/audits/insights/network-dependency-tree-insight.js +35 -13
- package/core/audits/insights/render-blocking-insight.js +1 -1
- package/core/audits/insights/slow-css-selector-insight.js +3 -1
- package/core/audits/insights/third-parties-insight.d.ts +3 -3
- package/core/audits/insights/third-parties-insight.js +28 -23
- package/core/audits/insights/viewport-insight.js +1 -1
- package/core/audits/is-on-https.js +2 -2
- package/core/audits/largest-contentful-paint-element.js +3 -3
- package/core/audits/layout-shifts.js +4 -4
- package/core/audits/lcp-lazy-loaded.js +1 -1
- package/core/audits/long-tasks.d.ts +1 -1
- package/core/audits/long-tasks.js +3 -3
- package/core/audits/main-thread-tasks.js +2 -2
- package/core/audits/mainthread-work-breakdown.d.ts +1 -1
- package/core/audits/mainthread-work-breakdown.js +2 -2
- package/core/audits/manual/manual-audit.d.ts +1 -1
- package/core/audits/metrics/cumulative-layout-shift.d.ts +1 -1
- package/core/audits/metrics/cumulative-layout-shift.js +2 -2
- package/core/audits/metrics/first-contentful-paint.js +3 -3
- package/core/audits/metrics/first-meaningful-paint.js +1 -1
- package/core/audits/metrics/interaction-to-next-paint.d.ts +1 -1
- package/core/audits/metrics/interaction-to-next-paint.js +2 -2
- package/core/audits/metrics/interactive.js +3 -3
- package/core/audits/metrics/largest-contentful-paint.js +3 -3
- package/core/audits/metrics/max-potential-fid.d.ts +1 -1
- package/core/audits/metrics/max-potential-fid.js +3 -3
- package/core/audits/metrics/speed-index.js +3 -3
- package/core/audits/metrics/total-blocking-time.js +3 -3
- package/core/audits/metrics.js +3 -3
- package/core/audits/network-requests.js +2 -2
- package/core/audits/network-rtt.js +2 -2
- package/core/audits/network-server-latency.js +2 -2
- package/core/audits/origin-isolation.js +2 -2
- package/core/audits/predictive-perf.js +3 -3
- package/core/audits/preload-fonts.js +2 -2
- package/core/audits/prioritize-lcp-image.js +3 -3
- package/core/audits/redirects.js +3 -3
- package/core/audits/resource-summary.js +2 -2
- package/core/audits/screenshot-thumbnails.js +2 -2
- package/core/audits/script-treemap-data.js +32 -2
- package/core/audits/seo/canonical.js +2 -2
- package/core/audits/seo/http-status-code.js +2 -2
- package/core/audits/seo/is-crawlable.js +2 -2
- package/core/audits/server-response-time.js +2 -2
- package/core/audits/third-party-cookies.js +1 -1
- package/core/audits/third-party-facades.js +2 -2
- package/core/audits/third-party-summary.js +2 -2
- package/core/audits/user-timings.d.ts +1 -1
- package/core/audits/user-timings.js +2 -2
- package/core/audits/uses-rel-preconnect.js +3 -3
- package/core/audits/uses-rel-preload.js +3 -3
- package/core/audits/valid-source-maps.js +2 -2
- package/core/audits/work-during-interaction.js +3 -3
- package/core/computed/critical-request-chains.d.ts +1 -1
- package/core/computed/document-urls.d.ts +4 -1
- package/core/computed/entity-classification.d.ts +1 -1
- package/core/computed/image-records.d.ts +1 -1
- package/core/computed/js-bundles.d.ts +1 -1
- package/core/computed/lcp-image-record.d.ts +1 -1
- package/core/computed/load-simulator.d.ts +1 -1
- package/core/computed/main-resource.d.ts +1 -1
- package/core/computed/main-thread-tasks.d.ts +1 -1
- package/core/computed/metrics/cumulative-layout-shift.d.ts +10 -1
- package/core/computed/metrics/first-contentful-paint-all-frames.d.ts +1 -1
- package/core/computed/metrics/first-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/interactive.d.ts +1 -1
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/lantern-interactive.d.ts +1 -1
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +1 -1
- package/core/computed/metrics/lantern-speed-index.d.ts +1 -1
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +1 -1
- package/core/computed/metrics/largest-contentful-paint-all-frames.d.ts +1 -1
- package/core/computed/metrics/largest-contentful-paint.d.ts +1 -1
- package/core/computed/metrics/lcp-breakdown.d.ts +5 -1
- package/core/computed/metrics/max-potential-fid.d.ts +1 -1
- package/core/computed/metrics/responsiveness.d.ts +1 -1
- package/core/computed/metrics/speed-index.d.ts +1 -1
- package/core/computed/metrics/time-to-first-byte.d.ts +1 -1
- package/core/computed/metrics/timing-summary.d.ts +4 -1
- package/core/computed/metrics/total-blocking-time.d.ts +1 -1
- package/core/computed/module-duplication.d.ts +5 -1
- package/core/computed/navigation-insights.d.ts +1 -1
- package/core/computed/network-analysis.d.ts +1 -1
- package/core/computed/network-records.d.ts +1 -1
- package/core/computed/page-dependency-graph.d.ts +1 -1
- package/core/computed/processed-navigation.d.ts +1 -1
- package/core/computed/processed-trace.d.ts +1 -1
- package/core/computed/resource-summary.d.ts +1 -1
- package/core/computed/screenshots.d.ts +4 -1
- package/core/computed/speedline.d.ts +1 -1
- package/core/computed/tbt-impact-tasks.d.ts +1 -1
- package/core/computed/trace-engine-result.d.ts +1 -1
- package/core/computed/unused-css.d.ts +1 -1
- package/core/computed/unused-javascript-summary.d.ts +1 -1
- package/core/computed/user-timings.d.ts +1 -1
- package/core/computed/viewport-meta.d.ts +1 -1
- package/core/config/default-config.js +11 -6
- package/core/config/experimental-config.js +3 -2
- package/core/gather/driver/network-monitor.d.ts +1 -1
- package/core/gather/driver/network.d.ts +1 -1
- package/core/gather/driver.d.ts +1 -1
- package/core/gather/gatherers/devtools-log.d.ts +1 -1
- package/core/gather/gatherers/dobetterweb/optimized-images.js +3 -10
- package/core/gather/gatherers/trace-elements.d.ts +3 -4
- package/core/gather/gatherers/trace-elements.js +6 -8
- package/core/gather/gatherers/trace.js +0 -3
- package/core/gather/navigation-runner.d.ts +1 -1
- package/core/gather/snapshot-runner.d.ts +1 -1
- package/core/gather/timespan-runner.d.ts +1 -1
- package/core/index.d.ts +6 -6
- package/core/lib/asset-saver.d.ts +1 -1
- package/core/lib/asset-saver.js +1 -1
- package/core/lib/bf-cache-strings.js +2 -0
- package/core/lib/deprecations-strings.d.ts +71 -76
- package/core/lib/deprecations-strings.js +22 -25
- package/core/lib/i18n/README.md +1 -1
- package/core/lib/i18n/i18n.d.ts +1 -1
- package/core/lib/i18n/i18n.js +4 -4
- package/core/lib/legacy-javascript/legacy-javascript.js +4 -11
- package/core/lib/legacy-javascript/package.json +14 -0
- package/core/lib/page-functions.d.ts +1 -1
- package/core/lib/stack-packs.js +1 -1
- package/core/lib/tracehouse/cpu-profile-model.d.ts +1 -1
- package/core/lib/tracehouse/main-thread-tasks.d.ts +3 -3
- package/core/lib/tracehouse/main-thread-tasks.js +8 -0
- package/core/lib/tracehouse/trace-processor.d.ts +1 -1
- package/core/lib/traces/metric-trace-events.d.ts +2 -2
- package/core/runner.js +2 -1
- package/core/scoring.d.ts +539 -3
- package/core/user-flow.d.ts +6 -6
- package/dist/report/bundle.esm.js +89 -19
- package/dist/report/flow.js +92 -22
- package/dist/report/standalone.js +89 -19
- package/flow-report/src/i18n/i18n.d.ts +6 -2
- package/package.json +17 -16
- package/readme.md +1 -1
- package/report/README.md +1 -1
- package/report/assets/styles.css +76 -9
- package/report/assets/templates.html +3 -1
- package/report/clients/standalone.js +6 -4
- package/report/renderer/category-renderer.d.ts +2 -2
- package/report/renderer/components.js +3 -9
- package/report/renderer/crc-details-renderer.d.ts +13 -31
- package/report/renderer/crc-details-renderer.js +49 -47
- package/report/renderer/details-renderer.d.ts +1 -1
- package/report/renderer/details-renderer.js +6 -0
- package/report/renderer/dom.js +7 -0
- package/report/renderer/features-util.d.ts +1 -1
- package/report/renderer/performance-category-renderer.d.ts +28 -2
- package/report/renderer/performance-category-renderer.js +121 -3
- package/report/renderer/report-utils.d.ts +3 -1
- package/report/renderer/report-utils.js +11 -4
- package/report/renderer/topbar-features.js +1 -9
- package/shared/localization/format.d.ts +1 -1
- package/shared/localization/locales/ar-XB.json +66 -6
- package/shared/localization/locales/ar.json +66 -6
- package/shared/localization/locales/bg.json +66 -6
- package/shared/localization/locales/ca.json +66 -6
- package/shared/localization/locales/cs.json +66 -6
- package/shared/localization/locales/da.json +66 -6
- package/shared/localization/locales/de.json +66 -6
- package/shared/localization/locales/el.json +66 -6
- package/shared/localization/locales/en-GB.json +66 -6
- package/shared/localization/locales/en-US.json +87 -36
- package/shared/localization/locales/en-XA.json +0 -6
- package/shared/localization/locales/en-XL.json +87 -36
- package/shared/localization/locales/es-419.json +66 -6
- package/shared/localization/locales/es.json +67 -7
- package/shared/localization/locales/fi.json +66 -6
- package/shared/localization/locales/fil.json +66 -6
- package/shared/localization/locales/fr.json +66 -6
- package/shared/localization/locales/he.json +66 -6
- package/shared/localization/locales/hi.json +66 -6
- package/shared/localization/locales/hr.json +66 -6
- package/shared/localization/locales/hu.json +66 -6
- package/shared/localization/locales/id.json +66 -6
- package/shared/localization/locales/it.json +67 -7
- package/shared/localization/locales/ja.json +66 -6
- package/shared/localization/locales/ko.json +66 -6
- package/shared/localization/locales/lt.json +66 -6
- package/shared/localization/locales/lv.json +66 -6
- package/shared/localization/locales/nl.json +66 -6
- package/shared/localization/locales/no.json +66 -6
- package/shared/localization/locales/pl.json +66 -6
- package/shared/localization/locales/pt-PT.json +66 -6
- package/shared/localization/locales/pt.json +67 -7
- package/shared/localization/locales/ro.json +66 -6
- package/shared/localization/locales/ru.json +66 -6
- package/shared/localization/locales/sk.json +66 -6
- package/shared/localization/locales/sl.json +66 -6
- package/shared/localization/locales/sr-Latn.json +66 -6
- package/shared/localization/locales/sr.json +66 -6
- package/shared/localization/locales/sv.json +66 -6
- package/shared/localization/locales/ta.json +69 -9
- package/shared/localization/locales/te.json +66 -6
- package/shared/localization/locales/th.json +66 -6
- package/shared/localization/locales/tr.json +66 -6
- package/shared/localization/locales/uk.json +66 -6
- package/shared/localization/locales/vi.json +66 -6
- package/shared/localization/locales/zh-HK.json +67 -7
- package/shared/localization/locales/zh-TW.json +67 -7
- package/shared/localization/locales/zh.json +66 -6
- package/tsconfig-base.json +1 -1
- package/tsconfig.json +1 -0
- package/types/artifacts.d.ts +0 -2
- package/types/internal/node.d.ts +0 -16
- package/types/lhr/audit-details.d.ts +33 -1
- package/types/lhr/treemap.d.ts +5 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/LegacyJavaScript.js';
|
|
8
|
+
|
|
9
|
+
import {Audit} from '../audit.js';
|
|
10
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
11
|
+
import {JSBundles} from '../../computed/js-bundles.js';
|
|
12
|
+
import {adaptInsightToAuditProduct} from './insight-audit.js';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line max-len
|
|
15
|
+
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/LegacyJavaScript.js', UIStrings);
|
|
16
|
+
|
|
17
|
+
/** @typedef {LH.Audit.Details.TableItem & {subItems: {type: 'subitems', items: SubItem[]}}} Item */
|
|
18
|
+
/** @typedef {{signal: string, location: LH.Audit.Details.SourceLocationValue}} SubItem */
|
|
19
|
+
|
|
20
|
+
class LegacyJavaScriptInsight extends Audit {
|
|
21
|
+
/**
|
|
22
|
+
* @return {LH.Audit.Meta}
|
|
23
|
+
*/
|
|
24
|
+
static get meta() {
|
|
25
|
+
return {
|
|
26
|
+
id: 'legacy-javascript-insight',
|
|
27
|
+
title: str_(UIStrings.title),
|
|
28
|
+
failureTitle: str_(UIStrings.title),
|
|
29
|
+
description: str_(UIStrings.description),
|
|
30
|
+
guidanceLevel: 2,
|
|
31
|
+
requiredArtifacts: ['Trace', 'Scripts', 'SourceMaps'],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {LH.Artifacts} artifacts
|
|
37
|
+
* @param {LH.Audit.Context} context
|
|
38
|
+
* @return {Promise<LH.Audit.Product>}
|
|
39
|
+
*/
|
|
40
|
+
static async audit(artifacts, context) {
|
|
41
|
+
const bundles = await JSBundles.request(artifacts, context);
|
|
42
|
+
|
|
43
|
+
return adaptInsightToAuditProduct(artifacts, context, 'LegacyJavaScript', (insight) => {
|
|
44
|
+
/** @type {LH.Audit.Details.Table['headings']} */
|
|
45
|
+
const headings = [
|
|
46
|
+
/* eslint-disable max-len */
|
|
47
|
+
{key: 'url', valueType: 'url', subItemsHeading: {key: 'location', valueType: 'source-location'}, label: str_(i18n.UIStrings.columnURL)},
|
|
48
|
+
{key: null, valueType: 'code', subItemsHeading: {key: 'signal'}, label: ''},
|
|
49
|
+
{key: 'wastedBytes', valueType: 'bytes', label: str_(UIStrings.columnWastedBytes)},
|
|
50
|
+
/* eslint-enable max-len */
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
/** @type {Item[]} */
|
|
54
|
+
const items = [];
|
|
55
|
+
|
|
56
|
+
for (const [script, result] of insight.legacyJavaScriptResults) {
|
|
57
|
+
const bundle = bundles.find(bundle => bundle.script.scriptId === script.scriptId);
|
|
58
|
+
|
|
59
|
+
/** @type {Item} */
|
|
60
|
+
const item = {
|
|
61
|
+
url: script.url ?? '',
|
|
62
|
+
wastedBytes: result.estimatedByteSavings,
|
|
63
|
+
subItems: {
|
|
64
|
+
type: 'subitems',
|
|
65
|
+
items: [],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
for (const match of result.matches) {
|
|
70
|
+
const {name, line, column} = match;
|
|
71
|
+
/** @type {SubItem} */
|
|
72
|
+
const subItem = {
|
|
73
|
+
signal: name,
|
|
74
|
+
location: Audit.makeSourceLocation(script.url ?? '', line, column, bundle),
|
|
75
|
+
};
|
|
76
|
+
item.subItems.items.push(subItem);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
items.push(item);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// TODO: add this warning to the insight.
|
|
83
|
+
// for (const bundle of bundles) {
|
|
84
|
+
// if (classifiedEntities.isFirstParty(bundle.script.url)) {
|
|
85
|
+
// if (bundle.rawMap.sources.some(s => s.match(/node_modules\/core-js\/modules\/es[67]/))) {
|
|
86
|
+
// if (!insight.warnings) {
|
|
87
|
+
// insight.warnings = [];
|
|
88
|
+
// }
|
|
89
|
+
|
|
90
|
+
// insight.warnings.push(str_(UIStrings.detectedCoreJs2Warning));
|
|
91
|
+
// break;
|
|
92
|
+
// }
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
return Audit.makeTableDetails(headings, items);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default LegacyJavaScriptInsight;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default ModernHTTPInsight;
|
|
2
|
+
declare class ModernHTTPInsight extends Audit {
|
|
3
|
+
/**
|
|
4
|
+
* @param {LH.Artifacts} artifacts
|
|
5
|
+
* @param {LH.Audit.Context} context
|
|
6
|
+
* @return {Promise<LH.Audit.Product>}
|
|
7
|
+
*/
|
|
8
|
+
static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): Promise<LH.Audit.Product>;
|
|
9
|
+
}
|
|
10
|
+
import { Audit } from '../audit.js';
|
|
11
|
+
//# sourceMappingURL=modern-http-insight.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/ModernHTTP.js';
|
|
8
|
+
|
|
9
|
+
import {Audit} from '../audit.js';
|
|
10
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
11
|
+
import {adaptInsightToAuditProduct} from './insight-audit.js';
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line max-len
|
|
14
|
+
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/ModernHTTP.js', UIStrings);
|
|
15
|
+
|
|
16
|
+
class ModernHTTPInsight extends Audit {
|
|
17
|
+
/**
|
|
18
|
+
* @return {LH.Audit.Meta}
|
|
19
|
+
*/
|
|
20
|
+
static get meta() {
|
|
21
|
+
return {
|
|
22
|
+
id: 'modern-http-insight',
|
|
23
|
+
title: str_(UIStrings.title),
|
|
24
|
+
failureTitle: str_(UIStrings.title),
|
|
25
|
+
description: str_(UIStrings.description),
|
|
26
|
+
guidanceLevel: 3,
|
|
27
|
+
requiredArtifacts: ['Trace', 'SourceMaps'],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {LH.Artifacts} artifacts
|
|
33
|
+
* @param {LH.Audit.Context} context
|
|
34
|
+
* @return {Promise<LH.Audit.Product>}
|
|
35
|
+
*/
|
|
36
|
+
static async audit(artifacts, context) {
|
|
37
|
+
return adaptInsightToAuditProduct(artifacts, context, 'ModernHTTP', (insight) => {
|
|
38
|
+
/** @type {LH.Audit.Details.Table['headings']} */
|
|
39
|
+
const headings = [
|
|
40
|
+
/* eslint-disable max-len */
|
|
41
|
+
{key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
|
|
42
|
+
{key: 'protocol', valueType: 'text', label: str_(UIStrings.protocol)},
|
|
43
|
+
/* eslint-enable max-len */
|
|
44
|
+
];
|
|
45
|
+
/** @type {LH.Audit.Details.Table['items']} */
|
|
46
|
+
const items =
|
|
47
|
+
insight.requests.map(r => ({url: r.args.data.url, protocol: r.args.data.protocol}));
|
|
48
|
+
return Audit.makeTableDetails(headings, items);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default ModernHTTPInsight;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export default NetworkDependencyTreeInsight;
|
|
2
2
|
declare class NetworkDependencyTreeInsight extends Audit {
|
|
3
|
+
/**
|
|
4
|
+
* @param {import('@paulirish/trace_engine').Insights.Models.NetworkDependencyTree.CriticalRequestNode[]} nodes
|
|
5
|
+
* @return {LH.Audit.Details.NetworkNode}
|
|
6
|
+
*/
|
|
7
|
+
static traceEngineNodesToDetailsNodes(nodes: import("@paulirish/trace_engine").Insights.Models.NetworkDependencyTree.CriticalRequestNode[]): LH.Audit.Details.NetworkNode;
|
|
3
8
|
/**
|
|
4
9
|
* @param {LH.Artifacts} artifacts
|
|
5
10
|
* @param {LH.Audit.Context} context
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-unused-vars */ // TODO: remove once implemented.
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* @license
|
|
5
3
|
* Copyright 2025 Google LLC
|
|
@@ -10,7 +8,7 @@ import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/NetworkDe
|
|
|
10
8
|
|
|
11
9
|
import {Audit} from '../audit.js';
|
|
12
10
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
13
|
-
import {adaptInsightToAuditProduct
|
|
11
|
+
import {adaptInsightToAuditProduct} from './insight-audit.js';
|
|
14
12
|
|
|
15
13
|
// eslint-disable-next-line max-len
|
|
16
14
|
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/NetworkDependencyTree.js', UIStrings);
|
|
@@ -25,27 +23,51 @@ class NetworkDependencyTreeInsight extends Audit {
|
|
|
25
23
|
title: str_(UIStrings.title),
|
|
26
24
|
failureTitle: str_(UIStrings.title),
|
|
27
25
|
description: str_(UIStrings.description),
|
|
28
|
-
guidanceLevel:
|
|
29
|
-
requiredArtifacts: ['
|
|
26
|
+
guidanceLevel: 1,
|
|
27
|
+
requiredArtifacts: ['Trace', 'SourceMaps'],
|
|
30
28
|
replacesAudits: ['critical-request-chains'],
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
31
|
|
|
32
|
+
/**
|
|
33
|
+
* @param {import('@paulirish/trace_engine').Insights.Models.NetworkDependencyTree.CriticalRequestNode[]} nodes
|
|
34
|
+
* @return {LH.Audit.Details.NetworkNode}
|
|
35
|
+
*/
|
|
36
|
+
static traceEngineNodesToDetailsNodes(nodes) {
|
|
37
|
+
/** @type {LH.Audit.Details.NetworkNode} */
|
|
38
|
+
const simpleRequestNode = {};
|
|
39
|
+
|
|
40
|
+
for (const node of nodes) {
|
|
41
|
+
const {request} = node;
|
|
42
|
+
|
|
43
|
+
simpleRequestNode[request.args.data.requestId] = {
|
|
44
|
+
url: request.args.data.url,
|
|
45
|
+
navStartToEndTime: Math.round(node.timeFromInitialRequest / 1000),
|
|
46
|
+
transferSize: request.args.data.encodedDataLength,
|
|
47
|
+
isLongest: node.isLongest,
|
|
48
|
+
children: this.traceEngineNodesToDetailsNodes(node.children),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return simpleRequestNode;
|
|
53
|
+
}
|
|
54
|
+
|
|
34
55
|
/**
|
|
35
56
|
* @param {LH.Artifacts} artifacts
|
|
36
57
|
* @param {LH.Audit.Context} context
|
|
37
58
|
* @return {Promise<LH.Audit.Product>}
|
|
38
59
|
*/
|
|
39
60
|
static async audit(artifacts, context) {
|
|
40
|
-
// TODO: implement.
|
|
41
61
|
return adaptInsightToAuditProduct(artifacts, context, 'NetworkDependencyTree', (insight) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
const chains = this.traceEngineNodesToDetailsNodes(insight.rootNodes);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
type: 'network-tree',
|
|
66
|
+
chains,
|
|
67
|
+
longestChain: {
|
|
68
|
+
duration: Math.round(insight.maxTime / 1000),
|
|
69
|
+
},
|
|
70
|
+
};
|
|
49
71
|
});
|
|
50
72
|
}
|
|
51
73
|
}
|
|
@@ -24,7 +24,7 @@ class RenderBlockingInsight extends Audit {
|
|
|
24
24
|
failureTitle: str_(UIStrings.title),
|
|
25
25
|
description: str_(UIStrings.description),
|
|
26
26
|
guidanceLevel: 3,
|
|
27
|
-
requiredArtifacts: ['
|
|
27
|
+
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
28
28
|
replacesAudits: ['render-blocking-resources'],
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */ // TODO: remove once implemented.
|
|
2
2
|
|
|
3
|
+
// TODO: currently disabled via core/scripts/generate-insight-audits.js. Ignore for now.
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* @license
|
|
5
7
|
* Copyright 2025 Google LLC
|
|
@@ -26,7 +28,7 @@ class SlowCSSSelectorInsight extends Audit {
|
|
|
26
28
|
failureTitle: str_(UIStrings.title),
|
|
27
29
|
description: str_(UIStrings.description),
|
|
28
30
|
guidanceLevel: 3,
|
|
29
|
-
requiredArtifacts: ['
|
|
31
|
+
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -13,10 +13,10 @@ export type URLSummary = {
|
|
|
13
13
|
declare class ThirdPartiesInsight extends Audit {
|
|
14
14
|
/**
|
|
15
15
|
* @param {LH.Artifacts.Entity} entity
|
|
16
|
-
* @param {import('@paulirish/trace_engine/models/trace/
|
|
17
|
-
* @return {
|
|
16
|
+
* @param {import('@paulirish/trace_engine/models/trace/extras/ThirdParties.js').URLSummary[]} urlSummaries
|
|
17
|
+
* @return {URLSummary[]}
|
|
18
18
|
*/
|
|
19
|
-
static makeSubItems(entity: LH.Artifacts.Entity,
|
|
19
|
+
static makeSubItems(entity: LH.Artifacts.Entity, urlSummaries: import("@paulirish/trace_engine/models/trace/extras/ThirdParties.js").URLSummary[]): URLSummary[];
|
|
20
20
|
/**
|
|
21
21
|
* @param {LH.Artifacts} artifacts
|
|
22
22
|
* @param {LH.Audit.Context} context
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/ThirdParties.js';
|
|
8
|
+
import {summarizeByURL} from '@paulirish/trace_engine/models/trace/extras/ThirdParties.js';
|
|
8
9
|
|
|
9
10
|
import {Audit} from '../audit.js';
|
|
10
11
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
@@ -31,24 +32,23 @@ class ThirdPartiesInsight extends Audit {
|
|
|
31
32
|
failureTitle: str_(UIStrings.title),
|
|
32
33
|
description: str_(UIStrings.description),
|
|
33
34
|
guidanceLevel: 3,
|
|
34
|
-
requiredArtifacts: ['
|
|
35
|
+
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
35
36
|
replacesAudits: ['third-party-summary'],
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* @param {LH.Artifacts.Entity} entity
|
|
41
|
-
* @param {import('@paulirish/trace_engine/models/trace/
|
|
42
|
-
* @return {
|
|
42
|
+
* @param {import('@paulirish/trace_engine/models/trace/extras/ThirdParties.js').URLSummary[]} urlSummaries
|
|
43
|
+
* @return {URLSummary[]}
|
|
43
44
|
*/
|
|
44
|
-
static makeSubItems(entity,
|
|
45
|
-
|
|
46
|
-
return
|
|
47
|
-
.map(
|
|
48
|
-
url,
|
|
49
|
-
mainThreadTime:
|
|
50
|
-
transferSize:
|
|
51
|
-
...insight.summaryByUrl.get(url),
|
|
45
|
+
static makeSubItems(entity, urlSummaries) {
|
|
46
|
+
urlSummaries = urlSummaries.filter(s => s.entity === entity);
|
|
47
|
+
return urlSummaries.filter(s => s.entity === entity)
|
|
48
|
+
.map(s => ({
|
|
49
|
+
url: s.url,
|
|
50
|
+
mainThreadTime: s.mainThreadTime,
|
|
51
|
+
transferSize: s.transferSize,
|
|
52
52
|
}))
|
|
53
53
|
// Sort by main thread time first, then transfer size to break ties.
|
|
54
54
|
.sort((a, b) => (b.mainThreadTime - a.mainThreadTime) || (b.transferSize - a.transferSize));
|
|
@@ -60,9 +60,12 @@ class ThirdPartiesInsight extends Audit {
|
|
|
60
60
|
* @return {Promise<LH.Audit.Product>}
|
|
61
61
|
*/
|
|
62
62
|
static async audit(artifacts, context) {
|
|
63
|
-
return adaptInsightToAuditProduct(artifacts, context, 'ThirdParties', (insight) => {
|
|
64
|
-
const
|
|
65
|
-
|
|
63
|
+
return adaptInsightToAuditProduct(artifacts, context, 'ThirdParties', (insight, extras) => {
|
|
64
|
+
const urlSummaries = summarizeByURL(extras.parsedTrace, extras.insights.bounds);
|
|
65
|
+
|
|
66
|
+
const thirdPartySummaries = insight.entitySummaries
|
|
67
|
+
.filter(summary => summary.entity !== insight.firstPartyEntity || null)
|
|
68
|
+
.sort((a, b) => b.mainThreadTime - a.mainThreadTime);
|
|
66
69
|
|
|
67
70
|
/** @type {LH.Audit.Details.Table['headings']} */
|
|
68
71
|
const headings = [
|
|
@@ -73,15 +76,17 @@ class ThirdPartiesInsight extends Audit {
|
|
|
73
76
|
/* eslint-enable max-len */
|
|
74
77
|
];
|
|
75
78
|
/** @type {LH.Audit.Details.Table['items']} */
|
|
76
|
-
const items =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
const items = thirdPartySummaries.map((summary) => {
|
|
80
|
+
return {
|
|
81
|
+
entity: summary.entity.name,
|
|
82
|
+
mainThreadTime: summary.mainThreadTime,
|
|
83
|
+
transferSize: summary.transferSize,
|
|
84
|
+
subItems: {
|
|
85
|
+
type: /** @type {const} */ ('subitems'),
|
|
86
|
+
items: ThirdPartiesInsight.makeSubItems(summary.entity, urlSummaries),
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
});
|
|
85
90
|
return Audit.makeTableDetails(headings, items, {isEntityGrouped: true});
|
|
86
91
|
});
|
|
87
92
|
}
|
|
@@ -24,7 +24,7 @@ class ViewportInsight extends Audit {
|
|
|
24
24
|
failureTitle: str_(UIStrings.title),
|
|
25
25
|
description: str_(UIStrings.description),
|
|
26
26
|
guidanceLevel: 3,
|
|
27
|
-
requiredArtifacts: ['
|
|
27
|
+
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
28
28
|
replacesAudits: ['viewport'],
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -61,7 +61,7 @@ class HTTPS extends Audit {
|
|
|
61
61
|
title: str_(UIStrings.title),
|
|
62
62
|
failureTitle: str_(UIStrings.failureTitle),
|
|
63
63
|
description: str_(UIStrings.description),
|
|
64
|
-
requiredArtifacts: ['
|
|
64
|
+
requiredArtifacts: ['DevtoolsLog', 'InspectorIssues'],
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -71,7 +71,7 @@ class HTTPS extends Audit {
|
|
|
71
71
|
* @return {Promise<LH.Audit.Product>}
|
|
72
72
|
*/
|
|
73
73
|
static async audit(artifacts, context) {
|
|
74
|
-
const devtoolsLogs = artifacts.
|
|
74
|
+
const devtoolsLogs = artifacts.DevtoolsLog;
|
|
75
75
|
const networkRecords = await NetworkRecords.request(devtoolsLogs, context);
|
|
76
76
|
const insecureURLs = networkRecords
|
|
77
77
|
.filter(record => !NetworkRequest.isSecureRequest(record))
|
|
@@ -50,7 +50,7 @@ class LargestContentfulPaintElement extends Audit {
|
|
|
50
50
|
guidanceLevel: 1,
|
|
51
51
|
supportedModes: ['navigation'],
|
|
52
52
|
requiredArtifacts:
|
|
53
|
-
['
|
|
53
|
+
['Trace', 'TraceElements', 'DevtoolsLog', 'GatherContext', 'settings', 'URL',
|
|
54
54
|
'SourceMaps'],
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -120,8 +120,8 @@ class LargestContentfulPaintElement extends Audit {
|
|
|
120
120
|
* @return {Promise<LH.Audit.Product>}
|
|
121
121
|
*/
|
|
122
122
|
static async audit(artifacts, context) {
|
|
123
|
-
const trace = artifacts.
|
|
124
|
-
const devtoolsLog = artifacts.
|
|
123
|
+
const trace = artifacts.Trace;
|
|
124
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
125
125
|
const gatherContext = artifacts.GatherContext;
|
|
126
126
|
const metricComputationData = {
|
|
127
127
|
trace, devtoolsLog, gatherContext,
|
|
@@ -47,7 +47,7 @@ class LayoutShifts extends Audit {
|
|
|
47
47
|
description: str_(UIStrings.description),
|
|
48
48
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
49
49
|
guidanceLevel: 2,
|
|
50
|
-
requiredArtifacts: ['
|
|
50
|
+
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -58,7 +58,7 @@ class LayoutShifts extends Audit {
|
|
|
58
58
|
*/
|
|
59
59
|
static async audit(artifacts, context) {
|
|
60
60
|
const settings = context.settings;
|
|
61
|
-
const trace = artifacts.
|
|
61
|
+
const trace = artifacts.Trace;
|
|
62
62
|
const SourceMaps = artifacts.SourceMaps;
|
|
63
63
|
const traceEngineResult =
|
|
64
64
|
await TraceEngineResult.request({trace, settings, SourceMaps}, context);
|
|
@@ -97,9 +97,9 @@ class LayoutShifts extends Audit {
|
|
|
97
97
|
/** @type {SubItem[]} */
|
|
98
98
|
const subItems = [];
|
|
99
99
|
if (rootCauses) {
|
|
100
|
-
for (const
|
|
100
|
+
for (const unsizedImage of rootCauses.unsizedImages) {
|
|
101
101
|
const element = artifacts.TraceElements.find(
|
|
102
|
-
t => t.traceEventType === 'trace-engine' && t.nodeId === backendNodeId);
|
|
102
|
+
t => t.traceEventType === 'trace-engine' && t.nodeId === unsizedImage.backendNodeId);
|
|
103
103
|
subItems.push({
|
|
104
104
|
extra: element ? Audit.makeNodeItem(element.node) : undefined,
|
|
105
105
|
cause: str_(UIStrings.rootCauseUnsizedMedia),
|
|
@@ -36,7 +36,7 @@ class LargestContentfulPaintLazyLoaded extends Audit {
|
|
|
36
36
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
37
37
|
guidanceLevel: 3,
|
|
38
38
|
requiredArtifacts: ['TraceElements', 'ViewportDimensions', 'ImageElements',
|
|
39
|
-
'
|
|
39
|
+
'Trace', 'DevtoolsLog', 'GatherContext', 'URL', 'SourceMaps'],
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -29,7 +29,7 @@ declare class LongTasks extends Audit {
|
|
|
29
29
|
* @param {Map<TaskGroupIds, number>} [timeByTaskGroup]
|
|
30
30
|
* @return {{startTime: number, duration: number, timeByTaskGroup: Map<TaskGroupIds, number>}}
|
|
31
31
|
*/
|
|
32
|
-
static getTimingBreakdown(task: LH.Artifacts.TaskNode, taskTimingsByEvent: Map<Lantern.Types.TraceEvent, LH.Gatherer.Simulation.NodeTiming> | undefined, timeByTaskGroup?: Map<
|
|
32
|
+
static getTimingBreakdown(task: LH.Artifacts.TaskNode, taskTimingsByEvent: Map<Lantern.Types.TraceEvent, LH.Gatherer.Simulation.NodeTiming> | undefined, timeByTaskGroup?: Map<TaskGroupIds, number>): {
|
|
33
33
|
startTime: number;
|
|
34
34
|
duration: number;
|
|
35
35
|
timeByTaskGroup: Map<TaskGroupIds, number>;
|
|
@@ -68,7 +68,7 @@ class LongTasks extends Audit {
|
|
|
68
68
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
69
69
|
title: str_(UIStrings.title),
|
|
70
70
|
description: str_(UIStrings.description),
|
|
71
|
-
requiredArtifacts: ['
|
|
71
|
+
requiredArtifacts: ['Trace', 'DevtoolsLog', 'URL', 'GatherContext', 'SourceMaps'],
|
|
72
72
|
guidanceLevel: 1,
|
|
73
73
|
};
|
|
74
74
|
}
|
|
@@ -177,9 +177,9 @@ class LongTasks extends Audit {
|
|
|
177
177
|
static async audit(artifacts, context) {
|
|
178
178
|
const settings = context.settings || {};
|
|
179
179
|
const {URL, SourceMaps} = artifacts;
|
|
180
|
-
const trace = artifacts.
|
|
180
|
+
const trace = artifacts.Trace;
|
|
181
181
|
const tasks = await MainThreadTasks.request(trace, context);
|
|
182
|
-
const devtoolsLog = artifacts.
|
|
182
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
183
183
|
const networkRecords = await NetworkRecords.request(devtoolsLog, context);
|
|
184
184
|
|
|
185
185
|
const metricComputationData = Audit.makeMetricComputationDataInput(artifacts, context);
|
|
@@ -17,7 +17,7 @@ class MainThreadTasks extends Audit {
|
|
|
17
17
|
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
|
|
18
18
|
title: 'Tasks',
|
|
19
19
|
description: 'Lists the toplevel main thread tasks that executed during page load.',
|
|
20
|
-
requiredArtifacts: ['
|
|
20
|
+
requiredArtifacts: ['Trace'],
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ class MainThreadTasks extends Audit {
|
|
|
27
27
|
* @return {Promise<LH.Audit.Product>}
|
|
28
28
|
*/
|
|
29
29
|
static async audit(artifacts, context) {
|
|
30
|
-
const trace = artifacts.
|
|
30
|
+
const trace = artifacts.Trace;
|
|
31
31
|
const tasks = await MainThreadTasksComputed.request(trace, context);
|
|
32
32
|
|
|
33
33
|
const results = tasks
|
|
@@ -5,7 +5,7 @@ declare class MainThreadWorkBreakdown extends Audit {
|
|
|
5
5
|
/**
|
|
6
6
|
* @return {LH.Audit.ScoreOptions}
|
|
7
7
|
*/
|
|
8
|
-
static get defaultOptions():
|
|
8
|
+
static get defaultOptions(): LH.Audit.ScoreOptions;
|
|
9
9
|
/**
|
|
10
10
|
* @param {LH.Artifacts.TaskNode[]} tasks
|
|
11
11
|
* @return {Map<TaskGroupIds, number>}
|
|
@@ -46,7 +46,7 @@ class MainThreadWorkBreakdown extends Audit {
|
|
|
46
46
|
description: str_(UIStrings.description),
|
|
47
47
|
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS,
|
|
48
48
|
guidanceLevel: 1,
|
|
49
|
-
requiredArtifacts: ['
|
|
49
|
+
requiredArtifacts: ['Trace', 'DevtoolsLog', 'URL', 'GatherContext', 'SourceMaps'],
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -84,7 +84,7 @@ class MainThreadWorkBreakdown extends Audit {
|
|
|
84
84
|
*/
|
|
85
85
|
static async audit(artifacts, context) {
|
|
86
86
|
const settings = context.settings || {};
|
|
87
|
-
const trace = artifacts.
|
|
87
|
+
const trace = artifacts.Trace;
|
|
88
88
|
|
|
89
89
|
let tbtSavings = 0;
|
|
90
90
|
try {
|
|
@@ -3,7 +3,7 @@ declare class ManualAudit extends Audit {
|
|
|
3
3
|
/**
|
|
4
4
|
* @return {Pick<LH.Audit.Meta, 'scoreDisplayMode'|'requiredArtifacts'>}
|
|
5
5
|
*/
|
|
6
|
-
static get partialMeta(): Pick<
|
|
6
|
+
static get partialMeta(): Pick<LH.Audit.Meta, "scoreDisplayMode" | "requiredArtifacts">;
|
|
7
7
|
/**
|
|
8
8
|
* @return {LH.Audit.Product}
|
|
9
9
|
*/
|
|
@@ -6,7 +6,7 @@ declare class CumulativeLayoutShift extends Audit {
|
|
|
6
6
|
/**
|
|
7
7
|
* @return {LH.Audit.ScoreOptions}
|
|
8
8
|
*/
|
|
9
|
-
static get defaultOptions():
|
|
9
|
+
static get defaultOptions(): LH.Audit.ScoreOptions;
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts} artifacts
|
|
12
12
|
* @param {LH.Audit.Context} context
|
|
@@ -30,7 +30,7 @@ class CumulativeLayoutShift extends Audit {
|
|
|
30
30
|
title: str_(i18n.UIStrings.cumulativeLayoutShiftMetric),
|
|
31
31
|
description: str_(UIStrings.description),
|
|
32
32
|
scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,
|
|
33
|
-
requiredArtifacts: ['
|
|
33
|
+
requiredArtifacts: ['Trace'],
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -53,7 +53,7 @@ class CumulativeLayoutShift extends Audit {
|
|
|
53
53
|
* @return {Promise<LH.Audit.Product>}
|
|
54
54
|
*/
|
|
55
55
|
static async audit(artifacts, context) {
|
|
56
|
-
const trace = artifacts.
|
|
56
|
+
const trace = artifacts.Trace;
|
|
57
57
|
|
|
58
58
|
// impactByNodeId is unused but we don't want it on debug data
|
|
59
59
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -27,7 +27,7 @@ class FirstContentfulPaint extends Audit {
|
|
|
27
27
|
description: str_(UIStrings.description),
|
|
28
28
|
scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,
|
|
29
29
|
supportedModes: ['navigation'],
|
|
30
|
-
requiredArtifacts: ['
|
|
30
|
+
requiredArtifacts: ['Trace', 'DevtoolsLog', 'GatherContext', 'URL', 'SourceMaps'],
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -61,8 +61,8 @@ class FirstContentfulPaint extends Audit {
|
|
|
61
61
|
* @return {Promise<LH.Audit.Product>}
|
|
62
62
|
*/
|
|
63
63
|
static async audit(artifacts, context) {
|
|
64
|
-
const trace = artifacts.
|
|
65
|
-
const devtoolsLog = artifacts.
|
|
64
|
+
const trace = artifacts.Trace;
|
|
65
|
+
const devtoolsLog = artifacts.DevtoolsLog;
|
|
66
66
|
const gatherContext = artifacts.GatherContext;
|
|
67
67
|
const metricComputationData = {trace, devtoolsLog, gatherContext,
|
|
68
68
|
settings: context.settings, URL: artifacts.URL,
|
|
@@ -28,7 +28,7 @@ class FirstMeaningfulPaint extends Audit {
|
|
|
28
28
|
description: str_(UIStrings.description),
|
|
29
29
|
scoreDisplayMode: Audit.SCORING_MODES.NUMERIC,
|
|
30
30
|
supportedModes: ['navigation'],
|
|
31
|
-
requiredArtifacts: ['
|
|
31
|
+
requiredArtifacts: ['Trace', 'DevtoolsLog', 'GatherContext', 'URL'],
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -6,7 +6,7 @@ declare class InteractionToNextPaint extends Audit {
|
|
|
6
6
|
/**
|
|
7
7
|
* @return {LH.Audit.ScoreOptions}
|
|
8
8
|
*/
|
|
9
|
-
static get defaultOptions():
|
|
9
|
+
static get defaultOptions(): LH.Audit.ScoreOptions;
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts} artifacts
|
|
12
12
|
* @param {LH.Audit.Context} context
|