lighthouse 10.0.2 → 10.1.0-dev.20230324
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/bin.js +1 -1
- package/cli/run.js +1 -1
- package/cli/test/smokehouse/config/exclusions.js +0 -2
- package/cli/test/smokehouse/lighthouse-runners/bundle.js +1 -1
- package/core/audits/audit.d.ts +6 -0
- package/core/audits/audit.js +16 -4
- package/core/audits/bootup-time.js +2 -3
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +4 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +8 -2
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +5 -0
- package/core/audits/byte-efficiency/legacy-javascript.js +42 -16
- package/core/audits/byte-efficiency/polyfill-graph-data.json +50 -50
- package/core/audits/byte-efficiency/total-byte-weight.js +1 -1
- package/core/audits/byte-efficiency/unminified-javascript.js +2 -1
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +2 -2
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +4 -0
- package/core/audits/dobetterweb/doctype.js +3 -2
- package/core/audits/long-tasks.js +2 -1
- package/core/audits/mainthread-work-breakdown.js +2 -1
- package/core/audits/network-rtt.js +1 -1
- package/core/audits/network-server-latency.js +2 -1
- package/core/audits/performance-budget.js +1 -1
- package/core/audits/prioritize-lcp-image.js +1 -1
- package/core/audits/seo/tap-targets.js +1 -1
- package/core/audits/third-party-summary.js +4 -1
- package/core/audits/timing-budget.js +2 -1
- package/core/audits/uses-rel-preconnect.js +1 -1
- package/core/audits/uses-rel-preload.js +1 -1
- package/core/audits/valid-source-maps.js +1 -1
- package/core/audits/work-during-interaction.js +1 -1
- package/core/computed/metrics/cumulative-layout-shift.d.ts +3 -3
- package/core/computed/metrics/cumulative-layout-shift.js +21 -9
- package/core/computed/unused-css.js +8 -7
- package/core/config/lr-mobile-config.js +0 -11
- package/core/gather/driver/prepare.js +15 -0
- package/core/gather/gatherers/image-elements.js +1 -0
- package/core/gather/gatherers/link-elements.js +2 -0
- package/core/lib/asset-saver.js +2 -12
- package/core/lib/i18n/i18n.d.ts +1 -1
- package/core/lib/i18n/i18n.js +1 -1
- package/core/lib/lighthouse-compatibility.js +17 -0
- package/core/lib/network-request.js +1 -1
- package/core/lib/page-functions.d.ts +17 -5
- package/core/lib/page-functions.js +41 -22
- package/core/lib/tracehouse/trace-processor.d.ts +8 -0
- package/core/lib/tracehouse/trace-processor.js +27 -6
- package/core/lib/url-utils.js +1 -1
- package/core/runner.js +1 -0
- package/dist/report/bundle.esm.js +258 -45
- package/dist/report/flow.js +18 -18
- package/dist/report/standalone.js +17 -17
- package/flow-report/src/i18n/i18n.d.ts +6 -0
- package/flow-report/src/summary/category.tsx +0 -1
- package/package.json +6 -7
- package/report/assets/styles.css +89 -5
- package/report/renderer/components.js +1 -1
- package/report/renderer/details-renderer.d.ts +26 -6
- package/report/renderer/details-renderer.js +144 -21
- package/report/renderer/performance-category-renderer.js +3 -3
- package/report/renderer/report-renderer.js +1 -0
- package/report/renderer/report-ui-features.js +18 -9
- package/report/renderer/report-utils.d.ts +13 -4
- package/report/renderer/report-utils.js +43 -11
- package/shared/localization/locales/ar-XB.json +1 -1
- package/shared/localization/locales/ar.json +1 -1
- package/shared/localization/locales/bg.json +1 -1
- package/shared/localization/locales/ca.json +1 -1
- package/shared/localization/locales/cs.json +1 -1
- package/shared/localization/locales/da.json +1 -1
- package/shared/localization/locales/de.json +1 -1
- package/shared/localization/locales/el.json +1 -1
- package/shared/localization/locales/en-GB.json +1 -1
- package/shared/localization/locales/en-US.json +11 -2
- package/shared/localization/locales/en-XA.json +1 -1
- package/shared/localization/locales/en-XL.json +11 -2
- package/shared/localization/locales/es-419.json +1 -1
- package/shared/localization/locales/es.json +1 -1
- package/shared/localization/locales/fi.json +1 -1
- package/shared/localization/locales/fil.json +1 -1
- package/shared/localization/locales/fr.json +1 -1
- package/shared/localization/locales/he.json +1 -1
- package/shared/localization/locales/hi.json +1 -1
- package/shared/localization/locales/hr.json +1 -1
- package/shared/localization/locales/hu.json +1 -1
- package/shared/localization/locales/id.json +1 -1
- package/shared/localization/locales/it.json +1 -1
- package/shared/localization/locales/ja.json +1 -1
- package/shared/localization/locales/ko.json +1 -1
- package/shared/localization/locales/lt.json +1 -1
- package/shared/localization/locales/lv.json +1 -1
- package/shared/localization/locales/nl.json +1 -1
- package/shared/localization/locales/no.json +1 -1
- package/shared/localization/locales/pl.json +1 -1
- package/shared/localization/locales/pt-PT.json +1 -1
- package/shared/localization/locales/pt.json +1 -1
- package/shared/localization/locales/ro.json +1 -1
- package/shared/localization/locales/ru.json +1 -1
- package/shared/localization/locales/sk.json +1 -1
- package/shared/localization/locales/sl.json +1 -1
- package/shared/localization/locales/sr-Latn.json +1 -1
- package/shared/localization/locales/sr.json +1 -1
- package/shared/localization/locales/sv.json +1 -1
- package/shared/localization/locales/ta.json +1 -1
- package/shared/localization/locales/te.json +1 -1
- package/shared/localization/locales/th.json +1 -1
- package/shared/localization/locales/tr.json +1 -1
- package/shared/localization/locales/uk.json +1 -1
- package/shared/localization/locales/vi.json +1 -1
- package/shared/localization/locales/zh-HK.json +1 -1
- package/shared/localization/locales/zh-TW.json +1 -1
- package/shared/localization/locales/zh.json +1 -1
- package/shared/tsconfig.json +1 -1
- package/shared/util.d.ts +6 -0
- package/shared/util.js +33 -0
- package/types/artifacts.d.ts +6 -1
- package/types/internal/node.d.ts +15 -2
- package/types/lhr/audit-details.d.ts +35 -11
package/types/internal/node.d.ts
CHANGED
|
@@ -35,9 +35,22 @@ declare global {
|
|
|
35
35
|
|
|
36
36
|
/** Injected into the page when the `--debug` flag is used. */
|
|
37
37
|
continueLighthouseRun(): void;
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
// `fetchPriority` not defined in tsc as of 4.9.4.
|
|
41
|
+
interface HTMLImageElement {
|
|
42
|
+
/**
|
|
43
|
+
* Sets the priority for fetches initiated by the element.
|
|
44
|
+
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-fetchpriority
|
|
45
|
+
*/
|
|
46
|
+
fetchPriority: string;
|
|
47
|
+
}
|
|
48
|
+
interface HTMLLinkElement {
|
|
49
|
+
/**
|
|
50
|
+
* Sets the priority for fetches initiated by the element.
|
|
51
|
+
* @see https://html.spec.whatwg.org/multipage/semantics.html#dom-link-fetchpriority
|
|
52
|
+
*/
|
|
53
|
+
fetchPriority: string;
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
56
|
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
import {IcuMessage} from './i18n.js';
|
|
8
8
|
import Treemap from './treemap.js';
|
|
9
9
|
|
|
10
|
+
/** Common properties for all details types. */
|
|
11
|
+
interface BaseDetails {
|
|
12
|
+
/** If present and audit is part of the performance category, audit is treated as an Opportunity. */
|
|
13
|
+
overallSavingsMs?: number;
|
|
14
|
+
/** Optional additional Opportunity information. */
|
|
15
|
+
overallSavingsBytes?: number;
|
|
16
|
+
/** Additional information, usually used for including debug or meta information in the LHR */
|
|
17
|
+
debugData?: Details.DebugData;
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
type Details =
|
|
11
21
|
Details.CriticalRequestChain |
|
|
12
22
|
Details.DebugData |
|
|
@@ -19,7 +29,7 @@ type Details =
|
|
|
19
29
|
|
|
20
30
|
// Details namespace.
|
|
21
31
|
declare module Details {
|
|
22
|
-
interface CriticalRequestChain {
|
|
32
|
+
interface CriticalRequestChain extends BaseDetails {
|
|
23
33
|
type: 'criticalrequestchain';
|
|
24
34
|
longestChain: {
|
|
25
35
|
duration: number;
|
|
@@ -42,7 +52,7 @@ declare module Details {
|
|
|
42
52
|
}
|
|
43
53
|
}
|
|
44
54
|
|
|
45
|
-
interface Filmstrip {
|
|
55
|
+
interface Filmstrip extends BaseDetails {
|
|
46
56
|
type: 'filmstrip';
|
|
47
57
|
scale: number;
|
|
48
58
|
items: {
|
|
@@ -55,23 +65,29 @@ declare module Details {
|
|
|
55
65
|
}[];
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
interface List {
|
|
68
|
+
interface List extends BaseDetails {
|
|
59
69
|
type: 'list';
|
|
60
70
|
// NOTE: any `Details` type *should* be usable in `items`, but check
|
|
61
71
|
// styles/report-ui-features are good before adding.
|
|
62
72
|
items: Array<Table | DebugData>;
|
|
63
73
|
}
|
|
64
74
|
|
|
65
|
-
interface Opportunity {
|
|
75
|
+
interface Opportunity extends BaseDetails {
|
|
66
76
|
type: 'opportunity';
|
|
67
|
-
overallSavingsMs: number;
|
|
68
|
-
overallSavingsBytes?: number;
|
|
69
77
|
headings: TableColumnHeading[];
|
|
70
78
|
items: OpportunityItem[];
|
|
71
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Columns to sort the items by, during grouping.
|
|
81
|
+
* If omitted, entity groups will be sorted by the audit ordering vs. the new totals.
|
|
82
|
+
*/
|
|
83
|
+
sortedBy?: Array<string>;
|
|
84
|
+
/** Will be true if the table is already grouped by entities. */
|
|
85
|
+
isEntityGrouped?: boolean;
|
|
86
|
+
/** Column keys to skip summing. If omitted, all column types supported are summed. */
|
|
87
|
+
skipSumming?: Array<string>;
|
|
72
88
|
}
|
|
73
89
|
|
|
74
|
-
interface Screenshot {
|
|
90
|
+
interface Screenshot extends BaseDetails {
|
|
75
91
|
type: 'screenshot';
|
|
76
92
|
timing: number;
|
|
77
93
|
timestamp: number;
|
|
@@ -87,7 +103,7 @@ declare module Details {
|
|
|
87
103
|
left: number;
|
|
88
104
|
}
|
|
89
105
|
|
|
90
|
-
interface Table {
|
|
106
|
+
interface Table extends BaseDetails {
|
|
91
107
|
type: 'table';
|
|
92
108
|
headings: TableColumnHeading[];
|
|
93
109
|
items: TableItem[];
|
|
@@ -95,7 +111,15 @@ declare module Details {
|
|
|
95
111
|
wastedMs?: number;
|
|
96
112
|
wastedBytes?: number;
|
|
97
113
|
};
|
|
98
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Columns to sort the items by, during grouping.
|
|
116
|
+
* If omitted, entity groups will be sorted by the audit ordering vs. the new totals.
|
|
117
|
+
*/
|
|
118
|
+
sortedBy?: Array<string>;
|
|
119
|
+
/** Will be true if the table is already grouped by entities. */
|
|
120
|
+
isEntityGrouped?: boolean;
|
|
121
|
+
/** Column keys to skip summing. If omitted, all column types supported are summed. */
|
|
122
|
+
skipSumming?: Array<string>;
|
|
99
123
|
}
|
|
100
124
|
|
|
101
125
|
/** A table item for rows that are nested within a top-level TableItem (row). */
|
|
@@ -113,7 +137,7 @@ declare module Details {
|
|
|
113
137
|
[p: string]: any;
|
|
114
138
|
}
|
|
115
139
|
|
|
116
|
-
interface TreemapData {
|
|
140
|
+
interface TreemapData extends BaseDetails {
|
|
117
141
|
type: 'treemap-data';
|
|
118
142
|
nodes: Treemap.Node[];
|
|
119
143
|
}
|