lighthouse 9.5.0-dev.20230129 → 9.5.0-dev.20230131
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/core/audits/byte-efficiency/offscreen-images.js +1 -1
- package/core/audits/critical-request-chains.d.ts +6 -6
- package/core/audits/critical-request-chains.js +15 -15
- package/core/audits/dobetterweb/doctype.js +4 -4
- package/core/audits/font-display.js +1 -1
- package/core/audits/network-requests.js +4 -4
- package/core/audits/redirects.js +2 -1
- package/core/audits/uses-rel-preconnect.js +5 -4
- package/core/computed/entity-classification.js +2 -1
- package/core/computed/resource-summary.js +2 -1
- package/core/gather/driver/network-monitor.js +2 -2
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +4 -4
- package/core/lib/bf-cache-strings.js +1 -1
- package/core/lib/dependency-graph/network-node.js +2 -2
- package/core/lib/dependency-graph/simulator/network-analyzer.js +8 -6
- package/core/lib/lighthouse-compatibility.d.ts +8 -0
- package/core/lib/lighthouse-compatibility.js +139 -0
- package/core/lib/navigation-error.js +3 -1
- package/core/lib/network-recorder.js +1 -1
- package/core/lib/network-request.d.ts +7 -7
- package/core/lib/network-request.js +26 -27
- package/dist/report/bundle.esm.js +138 -120
- package/dist/report/flow.js +18 -12
- package/dist/report/standalone.js +9 -3
- package/package.json +1 -1
- package/report/assets/styles.css +1 -1
- package/report/renderer/components.js +1 -1
- package/report/renderer/i18n-formatter.js +1 -1
- package/report/renderer/report-utils.d.ts +2 -2
- package/report/renderer/report-utils.js +7 -122
- package/report/test/renderer/report-utils-test.js +0 -170
- package/report/tsconfig.json +1 -0
- package/shared/localization/locales/en-US.json +3 -3
- package/shared/localization/locales/en-XL.json +3 -3
- package/tsconfig.json +1 -0
|
@@ -94,176 +94,6 @@ describe('util helpers', () => {
|
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
describe('#prepareReportResult', () => {
|
|
97
|
-
describe('backward compatibility', () => {
|
|
98
|
-
it('corrects underscored `notApplicable` scoreDisplayMode', () => {
|
|
99
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
100
|
-
|
|
101
|
-
// Avoid injecting entity names into audits that would would
|
|
102
|
-
// make the diff at the end of this test difficult.
|
|
103
|
-
delete clonedSampleResult.entities;
|
|
104
|
-
|
|
105
|
-
let notApplicableCount = 0;
|
|
106
|
-
Object.values(clonedSampleResult.audits).forEach(audit => {
|
|
107
|
-
if (audit.scoreDisplayMode === 'notApplicable') {
|
|
108
|
-
notApplicableCount++;
|
|
109
|
-
audit.scoreDisplayMode = 'not_applicable';
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
assert.ok(notApplicableCount > 20); // Make sure something's being tested.
|
|
114
|
-
|
|
115
|
-
// Original audit results should be restored.
|
|
116
|
-
const preparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
117
|
-
|
|
118
|
-
assert.deepStrictEqual(preparedResult.audits, sampleResult.audits);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('corrects undefined auditDetails.type to `debugdata`', () => {
|
|
122
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
123
|
-
|
|
124
|
-
// Avoid injecting entity names into audits that would would
|
|
125
|
-
// make the diff at the end of this test difficult.
|
|
126
|
-
delete clonedSampleResult.entities;
|
|
127
|
-
|
|
128
|
-
// Delete debugdata details types.
|
|
129
|
-
let undefinedCount = 0;
|
|
130
|
-
for (const audit of Object.values(clonedSampleResult.audits)) {
|
|
131
|
-
if (audit.details && audit.details.type === 'debugdata') {
|
|
132
|
-
undefinedCount++;
|
|
133
|
-
delete audit.details.type;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
assert.ok(undefinedCount > 4); // Make sure something's being tested.
|
|
137
|
-
assert.notDeepStrictEqual(clonedSampleResult.audits, sampleResult.audits);
|
|
138
|
-
|
|
139
|
-
// Original audit results should be restored.
|
|
140
|
-
const preparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
141
|
-
assert.deepStrictEqual(preparedResult.audits, sampleResult.audits);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('corrects `diagnostic` auditDetails.type to `debugdata`', () => {
|
|
145
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
146
|
-
|
|
147
|
-
// Avoid injecting entity names into audits that would would
|
|
148
|
-
// make the diff at the end of this test difficult.
|
|
149
|
-
delete clonedSampleResult.entities;
|
|
150
|
-
|
|
151
|
-
// Change debugdata details types.
|
|
152
|
-
let diagnosticCount = 0;
|
|
153
|
-
for (const audit of Object.values(clonedSampleResult.audits)) {
|
|
154
|
-
if (audit.details && audit.details.type === 'debugdata') {
|
|
155
|
-
diagnosticCount++;
|
|
156
|
-
audit.details.type = 'diagnostic';
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
assert.ok(diagnosticCount > 4); // Make sure something's being tested.
|
|
160
|
-
assert.notDeepStrictEqual(clonedSampleResult.audits, sampleResult.audits);
|
|
161
|
-
|
|
162
|
-
// Original audit results should be restored.
|
|
163
|
-
const preparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
164
|
-
assert.deepStrictEqual(preparedResult.audits, sampleResult.audits);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('corrects screenshots in the `filmstrip` auditDetails.type', () => {
|
|
168
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
169
|
-
|
|
170
|
-
// Avoid injecting entity names into audits that would would
|
|
171
|
-
// make the diff at the end of this test difficult.
|
|
172
|
-
delete clonedSampleResult.entities;
|
|
173
|
-
|
|
174
|
-
// Strip filmstrip screenshots of data URL prefix.
|
|
175
|
-
let filmstripCount = 0;
|
|
176
|
-
for (const audit of Object.values(clonedSampleResult.audits)) {
|
|
177
|
-
if (audit.details && audit.details.type === 'filmstrip') {
|
|
178
|
-
filmstripCount++;
|
|
179
|
-
for (const screenshot of audit.details.items) {
|
|
180
|
-
screenshot.data = screenshot.data.slice('data:image/jpeg;base64,'.length);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
assert.ok(filmstripCount > 0); // Make sure something's being tested.
|
|
185
|
-
assert.notDeepStrictEqual(clonedSampleResult.audits, sampleResult.audits);
|
|
186
|
-
|
|
187
|
-
// Original audit results should be restored.
|
|
188
|
-
const preparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
189
|
-
assert.deepStrictEqual(preparedResult.audits, sampleResult.audits);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
it('moves full-page-screenshot audit', () => {
|
|
193
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
194
|
-
|
|
195
|
-
clonedSampleResult.audits['full-page-screenshot'] = {
|
|
196
|
-
details: {
|
|
197
|
-
type: 'full-page-screenshot',
|
|
198
|
-
...sampleResult.fullPageScreenshot,
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
delete clonedSampleResult.fullPageScreenshot;
|
|
202
|
-
// Avoid injecting entity names into audits that would would
|
|
203
|
-
// make the diff at the end of this test difficult.
|
|
204
|
-
delete clonedSampleResult.entities;
|
|
205
|
-
|
|
206
|
-
assert.ok(clonedSampleResult.audits['full-page-screenshot'].details.nodes); // Make sure something's being tested.
|
|
207
|
-
assert.notDeepStrictEqual(clonedSampleResult.audits, sampleResult.audits);
|
|
208
|
-
|
|
209
|
-
// Original audit results should be restored.
|
|
210
|
-
const preparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
211
|
-
assert.deepStrictEqual(preparedResult.audits, sampleResult.audits);
|
|
212
|
-
assert.deepStrictEqual(preparedResult.fullPageScreenshot, sampleResult.fullPageScreenshot);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('corrects performance category without hidden group', () => {
|
|
216
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
217
|
-
|
|
218
|
-
clonedSampleResult.lighthouseVersion = '8.6.0';
|
|
219
|
-
delete clonedSampleResult.categoryGroups['hidden'];
|
|
220
|
-
for (const auditRef of clonedSampleResult.categories['performance'].auditRefs) {
|
|
221
|
-
if (auditRef.group === 'hidden') {
|
|
222
|
-
delete auditRef.group;
|
|
223
|
-
} else if (!auditRef.group) {
|
|
224
|
-
auditRef.group = 'diagnostics';
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
assert.notDeepStrictEqual(clonedSampleResult.categories, sampleResult.categories);
|
|
228
|
-
assert.notDeepStrictEqual(clonedSampleResult.categoryGroups, sampleResult.categoryGroups);
|
|
229
|
-
|
|
230
|
-
// Original audit results should be restored.
|
|
231
|
-
const clonedPreparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
232
|
-
const preparedResult = ReportUtils.prepareReportResult(sampleResult);
|
|
233
|
-
assert.deepStrictEqual(clonedPreparedResult.categories, preparedResult.categories);
|
|
234
|
-
assert.deepStrictEqual(clonedPreparedResult.categoryGroups, preparedResult.categoryGroups);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it('converts old opportunity table column headings to consolidated table headings', () => {
|
|
238
|
-
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
239
|
-
|
|
240
|
-
// Avoid injecting entity names into audits that would would
|
|
241
|
-
// make the diff at the end of this test difficult.
|
|
242
|
-
delete clonedSampleResult.entities;
|
|
243
|
-
|
|
244
|
-
const auditsWithTableDetails = Object.values(clonedSampleResult.audits)
|
|
245
|
-
.filter(audit => audit.details?.type === 'table');
|
|
246
|
-
assert.notEqual(auditsWithTableDetails.length, 0);
|
|
247
|
-
for (const audit of auditsWithTableDetails) {
|
|
248
|
-
for (const heading of audit.details.headings) {
|
|
249
|
-
heading.itemType = heading.valueType;
|
|
250
|
-
heading.text = heading.label;
|
|
251
|
-
delete heading.valueType;
|
|
252
|
-
delete heading.label;
|
|
253
|
-
|
|
254
|
-
if (heading.subItemsHeading) {
|
|
255
|
-
heading.subItemsHeading.itemType = heading.subItemsHeading.valueType;
|
|
256
|
-
// @ts-expect-error
|
|
257
|
-
delete heading.subItemsHeading.valueType;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
const preparedResult = ReportUtils.prepareReportResult(clonedSampleResult);
|
|
263
|
-
assert.deepStrictEqual(sampleResult.audits, preparedResult.audits);
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
|
|
267
97
|
it('appends stack pack descriptions to auditRefs', () => {
|
|
268
98
|
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
269
99
|
const iconDataURL = 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E';
|
package/report/tsconfig.json
CHANGED
|
@@ -663,7 +663,7 @@
|
|
|
663
663
|
"message": "Doctype name must be the string `html`"
|
|
664
664
|
},
|
|
665
665
|
"core/audits/dobetterweb/doctype.js | explanationLimitedQuirks": {
|
|
666
|
-
"message": "Document contains a doctype that triggers limited-quirks-mode"
|
|
666
|
+
"message": "Document contains a `doctype` that triggers `limited-quirks-mode`"
|
|
667
667
|
},
|
|
668
668
|
"core/audits/dobetterweb/doctype.js | explanationNoDoctype": {
|
|
669
669
|
"message": "Document must contain a doctype"
|
|
@@ -675,7 +675,7 @@
|
|
|
675
675
|
"message": "Expected systemId to be an empty string"
|
|
676
676
|
},
|
|
677
677
|
"core/audits/dobetterweb/doctype.js | explanationWrongDoctype": {
|
|
678
|
-
"message": "Document contains a doctype that triggers quirks-mode"
|
|
678
|
+
"message": "Document contains a `doctype` that triggers `quirks-mode`"
|
|
679
679
|
},
|
|
680
680
|
"core/audits/dobetterweb/doctype.js | failureTitle": {
|
|
681
681
|
"message": "Page lacks the HTML doctype, thus triggering quirks-mode"
|
|
@@ -1869,7 +1869,7 @@
|
|
|
1869
1869
|
"message": "Ineligible APIs were used."
|
|
1870
1870
|
},
|
|
1871
1871
|
"core/lib/bf-cache-strings.js | injectedJavascript": {
|
|
1872
|
-
"message": "
|
|
1872
|
+
"message": "Pages that JavaScript is injected into by extensions are not currently eligible for back/forward cache."
|
|
1873
1873
|
},
|
|
1874
1874
|
"core/lib/bf-cache-strings.js | injectedStyleSheet": {
|
|
1875
1875
|
"message": "Pages that StyleSheet is injected into by extensions are not currently eligible for back/forward cache."
|
|
@@ -663,7 +663,7 @@
|
|
|
663
663
|
"message": "D̂óĉt́ŷṕê ńâḿê ḿûśt̂ b́ê t́ĥé ŝt́r̂ín̂ǵ `html`"
|
|
664
664
|
},
|
|
665
665
|
"core/audits/dobetterweb/doctype.js | explanationLimitedQuirks": {
|
|
666
|
-
"message": "D̂óĉúm̂én̂t́ ĉón̂t́âín̂ś â
|
|
666
|
+
"message": "D̂óĉúm̂én̂t́ ĉón̂t́âín̂ś â `doctype` t́ĥát̂ t́r̂íĝǵêŕŝ `limited-quirks-mode`"
|
|
667
667
|
},
|
|
668
668
|
"core/audits/dobetterweb/doctype.js | explanationNoDoctype": {
|
|
669
669
|
"message": "D̂óĉúm̂én̂t́ m̂úŝt́ ĉón̂t́âín̂ á d̂óĉt́ŷṕê"
|
|
@@ -675,7 +675,7 @@
|
|
|
675
675
|
"message": "Êx́p̂éĉt́êd́ ŝýŝt́êḿÎd́ t̂ó b̂é âń êḿp̂t́ŷ śt̂ŕîńĝ"
|
|
676
676
|
},
|
|
677
677
|
"core/audits/dobetterweb/doctype.js | explanationWrongDoctype": {
|
|
678
|
-
"message": "D̂óĉúm̂én̂t́ ĉón̂t́âín̂ś â
|
|
678
|
+
"message": "D̂óĉúm̂én̂t́ ĉón̂t́âín̂ś â `doctype` t́ĥát̂ t́r̂íĝǵêŕŝ `quirks-mode`"
|
|
679
679
|
},
|
|
680
680
|
"core/audits/dobetterweb/doctype.js | failureTitle": {
|
|
681
681
|
"message": "P̂áĝé l̂áĉḱŝ t́ĥé ĤT́M̂Ĺ d̂óĉt́ŷṕê, t́ĥúŝ t́r̂íĝǵêŕîńĝ q́ûír̂ḱŝ-ḿôd́ê"
|
|
@@ -1869,7 +1869,7 @@
|
|
|
1869
1869
|
"message": "Îńêĺîǵîb́l̂é ÂṔÎś ŵér̂é ûśêd́."
|
|
1870
1870
|
},
|
|
1871
1871
|
"core/lib/bf-cache-strings.js | injectedJavascript": {
|
|
1872
|
-
"message": "
|
|
1872
|
+
"message": "P̂áĝéŝ t́ĥát̂ J́âv́âŚĉŕîṕt̂ íŝ ín̂j́êćt̂éd̂ ín̂t́ô b́ŷ éx̂t́êńŝíôńŝ ár̂é n̂ót̂ ćûŕr̂én̂t́l̂ý êĺîǵîb́l̂é f̂ór̂ b́âćk̂/f́ôŕŵár̂d́ ĉáĉh́ê."
|
|
1873
1873
|
},
|
|
1874
1874
|
"core/lib/bf-cache-strings.js | injectedStyleSheet": {
|
|
1875
1875
|
"message": "P̂áĝéŝ t́ĥát̂ Śt̂ýl̂éŜh́êét̂ íŝ ín̂j́êćt̂éd̂ ín̂t́ô b́ŷ éx̂t́êńŝíôńŝ ár̂é n̂ót̂ ćûŕr̂én̂t́l̂ý êĺîǵîb́l̂é f̂ór̂ b́âćk̂/f́ôŕŵár̂d́ ĉáĉh́ê."
|
package/tsconfig.json
CHANGED
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"core/test/lib/i18n/i18n-test.js",
|
|
78
78
|
"core/test/lib/icons-test.js",
|
|
79
79
|
"core/test/lib/lh-element-test.js",
|
|
80
|
+
"core/test/lib/lighthouse-compatibility-test.js",
|
|
80
81
|
"core/test/lib/manifest-parser-test.js",
|
|
81
82
|
"core/test/lib/median-run-test.js",
|
|
82
83
|
"core/test/lib/minification-estimator-test.js",
|