lighthouse 9.5.0-dev.20221018 → 9.5.0-dev.20221020
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/api.js +14 -10
- package/core/audits/accessibility/axe-audit.js +1 -1
- package/core/audits/accessibility/bypass.js +1 -0
- package/core/audits/accessibility/th-has-data-cells.js +1 -0
- package/core/audits/accessibility/video-caption.js +1 -0
- package/core/audits/autocomplete.js +3 -3
- package/core/audits/bootup-time.js +5 -5
- package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.js +1 -1
- package/core/audits/byte-efficiency/total-byte-weight.js +2 -2
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +3 -3
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +4 -4
- package/core/audits/csp-xss.js +3 -3
- package/core/audits/deprecations.js +2 -2
- package/core/audits/dobetterweb/dom-size.js +3 -3
- package/core/audits/dobetterweb/geolocation-on-start.js +1 -1
- package/core/audits/dobetterweb/inspector-issues.js +1 -1
- package/core/audits/dobetterweb/js-libraries.js +2 -2
- package/core/audits/dobetterweb/no-document-write.js +1 -1
- package/core/audits/dobetterweb/notification-on-start.js +1 -1
- package/core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +1 -1
- package/core/audits/dobetterweb/uses-http2.js +2 -2
- package/core/audits/dobetterweb/uses-passive-event-listeners.js +1 -1
- package/core/audits/errors-in-console.js +4 -2
- package/core/audits/font-display.js +2 -2
- package/core/audits/image-aspect-ratio.js +4 -4
- package/core/audits/image-size-responsive.js +5 -5
- package/core/audits/installable-manifest.js +1 -1
- package/core/audits/is-on-https.js +2 -2
- package/core/audits/largest-contentful-paint-element.js +1 -1
- package/core/audits/layout-shift-elements.js +3 -3
- package/core/audits/lcp-lazy-loaded.js +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.js +4 -2
- package/core/audits/network-requests.js +11 -11
- package/core/audits/network-rtt.js +2 -2
- package/core/audits/network-server-latency.js +3 -3
- package/core/audits/no-unload-listeners.js +1 -1
- package/core/audits/non-composited-animations.js +2 -2
- package/core/audits/performance-budget.js +5 -5
- package/core/audits/preload-fonts.js +1 -1
- package/core/audits/resource-summary.js +3 -3
- package/core/audits/seo/crawlable-anchors.js +2 -2
- package/core/audits/seo/font-size.js +4 -4
- package/core/audits/seo/hreflang.js +3 -3
- package/core/audits/seo/is-crawlable.js +1 -1
- package/core/audits/seo/link-text.js +2 -2
- package/core/audits/seo/plugins.js +1 -1
- package/core/audits/seo/robots-txt.js +3 -3
- package/core/audits/seo/tap-targets.js +3 -3
- package/core/audits/themed-omnibox.js +6 -14
- package/core/audits/third-party-facades.js +3 -3
- package/core/audits/third-party-summary.js +3 -3
- package/core/audits/timing-budget.js +3 -3
- package/core/audits/unsized-images.js +2 -2
- package/core/audits/user-timings.js +6 -6
- package/core/audits/valid-source-maps.js +3 -3
- package/core/audits/work-during-interaction.js +6 -6
- package/core/gather/navigation-runner.js +3 -3
- package/core/gather/snapshot-runner.js +4 -3
- package/core/gather/timespan-runner.js +4 -3
- package/core/index.js +1 -1
- package/core/legacy/config/config.js +0 -26
- package/core/lib/bfcache-strings.js +655 -0
- package/core/lib/deprecations-strings.js +3 -2
- package/core/lib/manifest-parser.js +0 -16
- package/core/user-flow.js +135 -77
- package/core/util.cjs +27 -0
- package/dist/report/bundle.esm.js +38 -73
- package/dist/report/flow.js +2 -2
- package/dist/report/standalone.js +2 -2
- package/package.json +2 -3
- package/report/renderer/details-renderer.js +12 -73
- package/report/renderer/util.js +27 -0
- package/report/test/generator/report-generator-test.js +1 -1
- package/report/test/renderer/category-renderer-test.js +1 -1
- package/report/test/renderer/details-renderer-test.js +38 -38
- package/report/test/renderer/util-test.js +25 -0
- package/shared/localization/locales/en-US.json +352 -1
- package/shared/localization/locales/en-XL.json +352 -1
- package/types/lhr/audit-details.d.ts +4 -34
- package/types/user-flow.d.ts +10 -3
|
@@ -57,9 +57,9 @@ describe('DetailsRenderer', () => {
|
|
|
57
57
|
const el = renderer.render({
|
|
58
58
|
type: 'table',
|
|
59
59
|
headings: [
|
|
60
|
-
{text: 'First', key: 'a',
|
|
61
|
-
{text: 'Second', key: 'b',
|
|
62
|
-
{text: 'Preview', key: 'c',
|
|
60
|
+
{text: 'First', key: 'a', valueType: 'text'},
|
|
61
|
+
{text: 'Second', key: 'b', valueType: 'text'},
|
|
62
|
+
{text: 'Preview', key: 'c', valueType: 'thumbnail'},
|
|
63
63
|
],
|
|
64
64
|
items: [
|
|
65
65
|
{
|
|
@@ -88,11 +88,11 @@ describe('DetailsRenderer', () => {
|
|
|
88
88
|
const el = renderer.render({
|
|
89
89
|
type: 'table',
|
|
90
90
|
headings: [
|
|
91
|
-
{text: '', key: 'bytes',
|
|
92
|
-
{text: '', key: 'numeric',
|
|
93
|
-
{text: '', key: 'ms',
|
|
91
|
+
{text: '', key: 'bytes', valueType: 'bytes'},
|
|
92
|
+
{text: '', key: 'numeric', valueType: 'numeric'},
|
|
93
|
+
{text: '', key: 'ms', valueType: 'ms'},
|
|
94
94
|
// Verify that 0 is ignored.
|
|
95
|
-
{text: '', key: 'ms',
|
|
95
|
+
{text: '', key: 'ms', valueType: 'ms', granularity: 0},
|
|
96
96
|
],
|
|
97
97
|
items: [
|
|
98
98
|
{
|
|
@@ -114,9 +114,9 @@ describe('DetailsRenderer', () => {
|
|
|
114
114
|
const el = renderer.render({
|
|
115
115
|
type: 'table',
|
|
116
116
|
headings: [
|
|
117
|
-
{text: '', key: 'bytes',
|
|
118
|
-
{text: '', key: 'numeric',
|
|
119
|
-
{text: '', key: 'ms',
|
|
117
|
+
{text: '', key: 'bytes', valueType: 'bytes', granularity: 0.01},
|
|
118
|
+
{text: '', key: 'numeric', valueType: 'numeric', granularity: 100},
|
|
119
|
+
{text: '', key: 'ms', valueType: 'ms', granularity: 1},
|
|
120
120
|
],
|
|
121
121
|
items: [
|
|
122
122
|
{
|
|
@@ -190,7 +190,7 @@ describe('DetailsRenderer', () => {
|
|
|
190
190
|
it('renders lists', () => {
|
|
191
191
|
const table = {
|
|
192
192
|
type: 'table',
|
|
193
|
-
headings: [{text: '', key: 'numeric',
|
|
193
|
+
headings: [{text: '', key: 'numeric', valueType: 'numeric'}],
|
|
194
194
|
items: [{numeric: 1234.567}],
|
|
195
195
|
};
|
|
196
196
|
|
|
@@ -264,7 +264,7 @@ describe('DetailsRenderer', () => {
|
|
|
264
264
|
it('renders text values', () => {
|
|
265
265
|
const details = {
|
|
266
266
|
type: 'table',
|
|
267
|
-
headings: [{key: 'content',
|
|
267
|
+
headings: [{key: 'content', valueType: 'text', label: 'Heading'}],
|
|
268
268
|
items: [{content: 'My text content'}],
|
|
269
269
|
};
|
|
270
270
|
|
|
@@ -277,7 +277,7 @@ describe('DetailsRenderer', () => {
|
|
|
277
277
|
it('renders not much if items are empty', () => {
|
|
278
278
|
const details = {
|
|
279
279
|
type: 'table',
|
|
280
|
-
headings: [{key: 'content',
|
|
280
|
+
headings: [{key: 'content', valueType: 'text', label: 'Heading'}],
|
|
281
281
|
items: [],
|
|
282
282
|
};
|
|
283
283
|
|
|
@@ -288,7 +288,7 @@ describe('DetailsRenderer', () => {
|
|
|
288
288
|
it('renders an empty cell if item is missing a property', () => {
|
|
289
289
|
const details = {
|
|
290
290
|
type: 'table',
|
|
291
|
-
headings: [{key: 'content',
|
|
291
|
+
headings: [{key: 'content', valueType: 'text', label: 'Heading'}],
|
|
292
292
|
items: [
|
|
293
293
|
{},
|
|
294
294
|
{content: undefined},
|
|
@@ -316,7 +316,7 @@ describe('DetailsRenderer', () => {
|
|
|
316
316
|
it('renders code values from a string', () => {
|
|
317
317
|
const details = {
|
|
318
318
|
type: 'table',
|
|
319
|
-
headings: [{key: 'content',
|
|
319
|
+
headings: [{key: 'content', valueType: 'code', label: 'Heading'}],
|
|
320
320
|
items: [{content: 'code snippet'}],
|
|
321
321
|
};
|
|
322
322
|
|
|
@@ -334,7 +334,7 @@ describe('DetailsRenderer', () => {
|
|
|
334
334
|
|
|
335
335
|
const details = {
|
|
336
336
|
type: 'table',
|
|
337
|
-
headings: [{key: 'content',
|
|
337
|
+
headings: [{key: 'content', valueType: 'code', label: 'Heading'}],
|
|
338
338
|
items: [{content: code}],
|
|
339
339
|
};
|
|
340
340
|
|
|
@@ -347,7 +347,7 @@ describe('DetailsRenderer', () => {
|
|
|
347
347
|
it('renders thumbnail values', () => {
|
|
348
348
|
const details = {
|
|
349
349
|
type: 'table',
|
|
350
|
-
headings: [{key: 'content',
|
|
350
|
+
headings: [{key: 'content', valueType: 'thumbnail', label: 'Heading'}],
|
|
351
351
|
items: [{content: 'http://example.com/my-image.jpg'}],
|
|
352
352
|
};
|
|
353
353
|
|
|
@@ -369,7 +369,7 @@ describe('DetailsRenderer', () => {
|
|
|
369
369
|
};
|
|
370
370
|
const details = {
|
|
371
371
|
type: 'table',
|
|
372
|
-
headings: [{key: 'content',
|
|
372
|
+
headings: [{key: 'content', valueType: 'link', label: 'Heading'}],
|
|
373
373
|
items: [{content: link}],
|
|
374
374
|
};
|
|
375
375
|
|
|
@@ -391,7 +391,7 @@ describe('DetailsRenderer', () => {
|
|
|
391
391
|
};
|
|
392
392
|
const details = {
|
|
393
393
|
type: 'table',
|
|
394
|
-
headings: [{key: 'content',
|
|
394
|
+
headings: [{key: 'content', valueType: 'link', label: 'Heading'}],
|
|
395
395
|
items: [{content: link}],
|
|
396
396
|
};
|
|
397
397
|
|
|
@@ -411,7 +411,7 @@ describe('DetailsRenderer', () => {
|
|
|
411
411
|
};
|
|
412
412
|
const details = {
|
|
413
413
|
type: 'table',
|
|
414
|
-
headings: [{key: 'content',
|
|
414
|
+
headings: [{key: 'content', valueType: 'link', label: 'Heading'}],
|
|
415
415
|
items: [{content: link}],
|
|
416
416
|
};
|
|
417
417
|
|
|
@@ -431,7 +431,7 @@ describe('DetailsRenderer', () => {
|
|
|
431
431
|
};
|
|
432
432
|
const details = {
|
|
433
433
|
type: 'table',
|
|
434
|
-
headings: [{key: 'content',
|
|
434
|
+
headings: [{key: 'content', valueType: 'node', label: 'Heading'}],
|
|
435
435
|
items: [{content: node}],
|
|
436
436
|
};
|
|
437
437
|
|
|
@@ -466,7 +466,7 @@ describe('DetailsRenderer', () => {
|
|
|
466
466
|
};
|
|
467
467
|
const details = {
|
|
468
468
|
type: 'table',
|
|
469
|
-
headings: [{key: 'content',
|
|
469
|
+
headings: [{key: 'content', valueType: 'node', label: 'Heading'}],
|
|
470
470
|
items: [{content: node}],
|
|
471
471
|
};
|
|
472
472
|
|
|
@@ -498,7 +498,7 @@ describe('DetailsRenderer', () => {
|
|
|
498
498
|
};
|
|
499
499
|
const details = {
|
|
500
500
|
type: 'table',
|
|
501
|
-
headings: [{key: 'content',
|
|
501
|
+
headings: [{key: 'content', valueType: 'node', label: 'Heading'}],
|
|
502
502
|
items: [{content: node}],
|
|
503
503
|
};
|
|
504
504
|
|
|
@@ -519,7 +519,7 @@ describe('DetailsRenderer', () => {
|
|
|
519
519
|
};
|
|
520
520
|
const details = {
|
|
521
521
|
type: 'table',
|
|
522
|
-
headings: [{key: 'content',
|
|
522
|
+
headings: [{key: 'content', valueType: 'source-location', label: 'Heading'}],
|
|
523
523
|
items: [{content: sourceLocation}],
|
|
524
524
|
};
|
|
525
525
|
|
|
@@ -549,7 +549,7 @@ describe('DetailsRenderer', () => {
|
|
|
549
549
|
};
|
|
550
550
|
const details = {
|
|
551
551
|
type: 'table',
|
|
552
|
-
headings: [{key: 'content',
|
|
552
|
+
headings: [{key: 'content', valueType: 'source-location', label: 'Heading'}],
|
|
553
553
|
items: [{content: sourceLocation}],
|
|
554
554
|
};
|
|
555
555
|
|
|
@@ -575,7 +575,7 @@ describe('DetailsRenderer', () => {
|
|
|
575
575
|
};
|
|
576
576
|
const details = {
|
|
577
577
|
type: 'table',
|
|
578
|
-
headings: [{key: 'content',
|
|
578
|
+
headings: [{key: 'content', valueType: 'source-location', label: 'Heading'}],
|
|
579
579
|
items: [{content: sourceLocation}],
|
|
580
580
|
};
|
|
581
581
|
|
|
@@ -600,7 +600,7 @@ describe('DetailsRenderer', () => {
|
|
|
600
600
|
};
|
|
601
601
|
const details = {
|
|
602
602
|
type: 'table',
|
|
603
|
-
headings: [{key: 'content',
|
|
603
|
+
headings: [{key: 'content', valueType: 'source-location', label: 'Heading'}],
|
|
604
604
|
items: [{content: sourceLocation}],
|
|
605
605
|
};
|
|
606
606
|
|
|
@@ -625,7 +625,7 @@ describe('DetailsRenderer', () => {
|
|
|
625
625
|
};
|
|
626
626
|
const details = {
|
|
627
627
|
type: 'table',
|
|
628
|
-
headings: [{key: 'content',
|
|
628
|
+
headings: [{key: 'content', valueType: 'source-location', label: 'Heading'}],
|
|
629
629
|
items: [{content: sourceLocation}],
|
|
630
630
|
};
|
|
631
631
|
|
|
@@ -646,7 +646,7 @@ describe('DetailsRenderer', () => {
|
|
|
646
646
|
|
|
647
647
|
const details = {
|
|
648
648
|
type: 'table',
|
|
649
|
-
headings: [{key: 'content',
|
|
649
|
+
headings: [{key: 'content', valueType: 'url', label: 'Heading'}],
|
|
650
650
|
items: [{content: urlText}],
|
|
651
651
|
};
|
|
652
652
|
|
|
@@ -673,7 +673,7 @@ describe('DetailsRenderer', () => {
|
|
|
673
673
|
|
|
674
674
|
const details = {
|
|
675
675
|
type: 'table',
|
|
676
|
-
headings: [{key: 'content',
|
|
676
|
+
headings: [{key: 'content', valueType: 'url', label: 'Heading'}],
|
|
677
677
|
items: [{content: url}],
|
|
678
678
|
overallSavingsMs: 100,
|
|
679
679
|
};
|
|
@@ -693,7 +693,7 @@ describe('DetailsRenderer', () => {
|
|
|
693
693
|
|
|
694
694
|
const details = {
|
|
695
695
|
type: 'table',
|
|
696
|
-
headings: [{key: 'content',
|
|
696
|
+
headings: [{key: 'content', valueType: 'url', label: 'Heading'}],
|
|
697
697
|
items: [{content: urlText}],
|
|
698
698
|
};
|
|
699
699
|
|
|
@@ -712,11 +712,11 @@ describe('DetailsRenderer', () => {
|
|
|
712
712
|
console.error = consoleError;
|
|
713
713
|
});
|
|
714
714
|
|
|
715
|
-
it('renders an unknown heading
|
|
715
|
+
it('renders an unknown heading valueType', () => {
|
|
716
716
|
// Disallowed by type system, but test that we get an error message out just in case.
|
|
717
717
|
const details = {
|
|
718
718
|
type: 'table',
|
|
719
|
-
headings: [{key: 'content',
|
|
719
|
+
headings: [{key: 'content', valueType: 'notRealValueType', label: 'Heading'}],
|
|
720
720
|
items: [{content: 'some string'}],
|
|
721
721
|
};
|
|
722
722
|
|
|
@@ -737,7 +737,7 @@ describe('DetailsRenderer', () => {
|
|
|
737
737
|
|
|
738
738
|
const details = {
|
|
739
739
|
type: 'table',
|
|
740
|
-
headings: [{key: 'content',
|
|
740
|
+
headings: [{key: 'content', valueType: 'url', label: 'Heading'}],
|
|
741
741
|
items: [{content: item}],
|
|
742
742
|
};
|
|
743
743
|
|
|
@@ -753,8 +753,8 @@ describe('DetailsRenderer', () => {
|
|
|
753
753
|
it('uses the item\'s type over the heading type', () => {
|
|
754
754
|
const details = {
|
|
755
755
|
type: 'table',
|
|
756
|
-
//
|
|
757
|
-
headings: [{key: 'content',
|
|
756
|
+
// valueType is overriden by code object
|
|
757
|
+
headings: [{key: 'content', valueType: 'url', label: 'Heading'}],
|
|
758
758
|
items: [
|
|
759
759
|
{content: {type: 'code', value: 'https://codeobject.com'}},
|
|
760
760
|
{content: 'https://example.com'},
|
|
@@ -790,7 +790,7 @@ describe('DetailsRenderer', () => {
|
|
|
790
790
|
const details = {
|
|
791
791
|
type: 'table',
|
|
792
792
|
headings: [
|
|
793
|
-
{key: 'url',
|
|
793
|
+
{key: 'url', valueType: 'url', subItemsHeading: {key: 'source', valueType: 'code'}},
|
|
794
794
|
],
|
|
795
795
|
items: [
|
|
796
796
|
{
|
|
@@ -832,7 +832,7 @@ describe('DetailsRenderer', () => {
|
|
|
832
832
|
it('renders, uses heading properties as fallback', () => {
|
|
833
833
|
const details = {
|
|
834
834
|
type: 'table',
|
|
835
|
-
headings: [{key: 'url',
|
|
835
|
+
headings: [{key: 'url', valueType: 'url', subItemsHeading: {key: 'source'}}],
|
|
836
836
|
items: [
|
|
837
837
|
{
|
|
838
838
|
url: 'https://www.example.com',
|
|
@@ -176,6 +176,31 @@ describe('util helpers', () => {
|
|
|
176
176
|
assert.deepStrictEqual(clonedPreparedResult.categories, preparedResult.categories);
|
|
177
177
|
assert.deepStrictEqual(clonedPreparedResult.categoryGroups, preparedResult.categoryGroups);
|
|
178
178
|
});
|
|
179
|
+
|
|
180
|
+
it('converts old opportunity table column headings to consolidated table headings', () => {
|
|
181
|
+
const clonedSampleResult = JSON.parse(JSON.stringify(sampleResult));
|
|
182
|
+
|
|
183
|
+
const auditsWithTableDetails = Object.values(clonedSampleResult.audits)
|
|
184
|
+
.filter(audit => audit.details?.type === 'table');
|
|
185
|
+
assert.notEqual(auditsWithTableDetails.length, 0);
|
|
186
|
+
for (const audit of auditsWithTableDetails) {
|
|
187
|
+
for (const heading of audit.details.headings) {
|
|
188
|
+
heading.itemType = heading.valueType;
|
|
189
|
+
heading.text = heading.label;
|
|
190
|
+
delete heading.valueType;
|
|
191
|
+
delete heading.label;
|
|
192
|
+
|
|
193
|
+
if (heading.subItemsHeading) {
|
|
194
|
+
heading.subItemsHeading.itemType = heading.subItemsHeading.valueType;
|
|
195
|
+
// @ts-expect-error
|
|
196
|
+
delete heading.subItemsHeading.valueType;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const preparedResult = Util.prepareReportResult(clonedSampleResult);
|
|
202
|
+
assert.deepStrictEqual(sampleResult.audits, preparedResult.audits);
|
|
203
|
+
});
|
|
179
204
|
});
|
|
180
205
|
|
|
181
206
|
it('appends stack pack descriptions to auditRefs', () => {
|