lighthouse 12.4.0-dev.20250313 → 12.4.0-dev.20250314
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.
|
@@ -24,8 +24,9 @@ declare class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
24
24
|
/**
|
|
25
25
|
* @param {string?} object
|
|
26
26
|
* @param {string} property
|
|
27
|
+
* @param {string} coreJs3Module
|
|
27
28
|
*/
|
|
28
|
-
static buildPolyfillExpression(object: string | null, property: string): string;
|
|
29
|
+
static buildPolyfillExpression(object: string | null, property: string, coreJs3Module: string): string;
|
|
29
30
|
static getPolyfillModuleData(): import("../../scripts/legacy-javascript/create-polyfill-module-data.js").PolyfillModuleData;
|
|
30
31
|
static getCoreJsPolyfillData(): {
|
|
31
32
|
name: string;
|
|
@@ -134,8 +134,9 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
134
134
|
/**
|
|
135
135
|
* @param {string?} object
|
|
136
136
|
* @param {string} property
|
|
137
|
+
* @param {string} coreJs3Module
|
|
137
138
|
*/
|
|
138
|
-
static buildPolyfillExpression(object, property) {
|
|
139
|
+
static buildPolyfillExpression(object, property, coreJs3Module) {
|
|
139
140
|
const qt = (/** @type {string} */ token) =>
|
|
140
141
|
`['"]${token}['"]`; // don't worry about matching string delims
|
|
141
142
|
|
|
@@ -187,6 +188,10 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
187
188
|
// expression += `|collection\\(${qt(property)},`;
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
// Un-minified code may have module names.
|
|
192
|
+
// core-js/modules/es.object.is-frozen
|
|
193
|
+
expression += `|core-js/modules/${coreJs3Module}(?:\\.js)?"`;
|
|
194
|
+
|
|
190
195
|
return expression;
|
|
191
196
|
}
|
|
192
197
|
|
|
@@ -210,13 +215,13 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
210
215
|
/** @type {Pattern[]} */
|
|
211
216
|
const patterns = [];
|
|
212
217
|
|
|
213
|
-
for (const {name} of this.getCoreJsPolyfillData()) {
|
|
218
|
+
for (const {name, coreJs3Module} of this.getCoreJsPolyfillData()) {
|
|
214
219
|
const parts = name.split('.');
|
|
215
220
|
const object = parts.length > 1 ? parts.slice(0, parts.length - 1).join('.') : null;
|
|
216
221
|
const property = parts[parts.length - 1];
|
|
217
222
|
patterns.push({
|
|
218
223
|
name,
|
|
219
|
-
expression: this.buildPolyfillExpression(object, property),
|
|
224
|
+
expression: this.buildPolyfillExpression(object, property, coreJs3Module),
|
|
220
225
|
});
|
|
221
226
|
}
|
|
222
227
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"moduleSizes": [26070, 498, 282, 294, 281, 467, 161, 236, 229, 765, 546, 339, 1608, 723, 729, 1545, 438, 214, 657, 111, 759, 537, 209, 281, 685, 217, 757, 631, 293, 182, 475, 79, 407, 140, 366, 792, 269, 222, 158, 280, 188, 137, 158, 105, 189, 543, 160, 742, 1436, 88, 904, 146, 314, 375, 183, 1083, 195, 503, 269, 208, 334, 350, 460, 568, 229, 1155, 334, 266, 30, 120, 309, 370, 358, 1952, 1638, 304, 153, 274, 1288, 192, 543, 74, 144, 137, 33, 336, 457, 2122, 535, 711, 1323, 117, 1961, 244, 557, 318, 119, 124, 108, 144, 96, 133, 441, 210, 1627, 1956, 693, 1426, 863, 637, 301, 51, 708, 583, 119, 600, 221, 370, 728, 1085, 552, 629, 125, 1746, 97, 441, 543, 2756, 371, 447, 548, 243, 266, 217, 99, 440, 183, 546, 137, 464, 207, 983, 171, 992, 503, 237, 382, 249, 675, 402, 254, 223, 164, 214, 191, 831, 218, 202, 232, 124, 249, 160, 251, 217, 717, 78, 561, 1627, 256, 386, 225, 432, 499, 394, 364, 445, 634, 667, 177, 346, 470, 663, 142, 588, 414, 617, 1559, 380, 2520, 1040, 417, 289, 238, 220, 214, 303, 163, 141, 510, 397, 137, 137, 133, 133, 390, 266, 137, 183, 215, 191, 485, 328, 575, 799, 533, 148, 215, 589, 589, 130, 362, 562, 471, 179, 186, 1266, 1456, 521, 1536, 427, 444, 406, 912, 150, 283, 144, 485, 470, 1787, 205, 1268, 796, 658, 306, 3751, 321, 331, 814, 146, 2328, 1226, 922, 237, 206, 198, 250, 283,
|
|
2
|
+
"moduleSizes": [26070, 498, 282, 294, 281, 467, 161, 236, 229, 765, 546, 339, 1608, 723, 729, 1545, 438, 214, 657, 111, 759, 537, 209, 281, 685, 217, 757, 631, 293, 182, 475, 79, 407, 140, 366, 792, 269, 222, 158, 280, 188, 137, 158, 105, 189, 543, 160, 742, 1436, 88, 904, 146, 314, 375, 183, 1083, 195, 503, 269, 208, 334, 350, 460, 568, 229, 1155, 334, 266, 30, 120, 309, 370, 358, 1952, 1638, 304, 153, 274, 1288, 192, 543, 74, 144, 137, 33, 336, 457, 2122, 535, 711, 1323, 117, 1961, 244, 557, 318, 119, 124, 108, 144, 96, 133, 441, 210, 1627, 1956, 693, 1426, 863, 637, 301, 51, 708, 583, 119, 600, 221, 370, 728, 1085, 552, 629, 125, 1746, 97, 441, 543, 2756, 371, 447, 548, 243, 266, 217, 99, 440, 183, 546, 137, 464, 207, 983, 171, 992, 503, 237, 382, 249, 675, 402, 254, 223, 164, 214, 191, 831, 218, 202, 232, 124, 249, 160, 251, 217, 717, 78, 561, 1627, 256, 386, 225, 432, 499, 394, 364, 445, 634, 667, 177, 346, 470, 663, 142, 588, 414, 617, 1559, 380, 2520, 1040, 417, 289, 238, 220, 214, 303, 163, 141, 510, 397, 137, 137, 133, 133, 390, 266, 137, 183, 215, 191, 485, 328, 575, 799, 533, 148, 215, 589, 589, 130, 362, 562, 471, 179, 186, 1266, 1456, 521, 1536, 427, 444, 406, 912, 150, 283, 144, 485, 470, 1787, 205, 1268, 796, 658, 306, 3751, 321, 331, 814, 146, 2328, 1226, 922, 237, 206, 198, 250, 283, 60, 3000],
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"Array.prototype.at": [0, 5, 69, 105, 106, 116, 166
|
|
4
|
+
"Array.prototype.at": [0, 5, 69, 105, 106, 116, 166],
|
|
5
5
|
"Array.prototype.concat": [0, 16, 21, 22, 26, 34, 40, 76, 78, 157, 167],
|
|
6
6
|
"Array.prototype.copyWithin": [0, 5, 9, 37, 69, 105, 106, 116, 168],
|
|
7
7
|
"Array.prototype.every": [0, 15, 17, 21, 22, 26, 53, 59, 76, 78, 157, 169],
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"Array.prototype.filter": [0, 15, 16, 21, 22, 26, 53, 59, 76, 78, 157, 171],
|
|
10
10
|
"Array.prototype.find": [0, 5, 15, 21, 22, 26, 53, 59, 69, 76, 78, 105, 106, 116, 157, 175],
|
|
11
11
|
"Array.prototype.findIndex": [0, 5, 15, 21, 22, 26, 53, 59, 69, 76, 78, 105, 106, 116, 157, 172],
|
|
12
|
-
"Array.prototype.findLast": [0, 5, 14, 53, 59, 69, 105, 106, 116, 174
|
|
13
|
-
"Array.prototype.findLastIndex": [0, 5, 14, 53, 59, 69, 105, 106, 116, 173
|
|
12
|
+
"Array.prototype.findLast": [0, 5, 14, 53, 59, 69, 105, 106, 116, 174],
|
|
13
|
+
"Array.prototype.findLastIndex": [0, 5, 14, 53, 59, 69, 105, 106, 116, 173],
|
|
14
14
|
"Array.prototype.flat": [0, 21, 22, 26, 40, 50, 53, 59, 76, 78, 157, 177],
|
|
15
15
|
"Array.prototype.flatMap": [0, 21, 22, 26, 40, 50, 53, 59, 76, 78, 157, 176],
|
|
16
16
|
"Array.prototype.forEach": [0, 11, 15, 17, 21, 22, 26, 53, 59, 76, 78, 157, 178],
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"Object.getOwnPropertyDescriptor": [0, 212],
|
|
51
51
|
"Object.getOwnPropertyDescriptors": [0, 34, 213],
|
|
52
52
|
"Object.getPrototypeOf": [0, 29, 112, 214],
|
|
53
|
-
"Object.hasOwn": [0, 215
|
|
53
|
+
"Object.hasOwn": [0, 215],
|
|
54
54
|
"Object.is": [0, 134, 219],
|
|
55
55
|
"Object.isExtensible": [0, 8, 113, 216],
|
|
56
56
|
"Object.isFrozen": [0, 8, 217],
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"Object.seal": [0, 8, 19, 51, 73, 109, 113, 222],
|
|
61
61
|
"Object.setPrototypeOf": [0, 4, 58, 83, 118, 223],
|
|
62
62
|
"Object.values": [0, 29, 112, 116, 119, 224],
|
|
63
|
-
"Promise.any": [0, 24, 26, 47, 53, 59, 62, 63, 75, 87, 88, 102, 122, 123, 124, 125, 157, 226
|
|
63
|
+
"Promise.any": [0, 24, 26, 47, 53, 59, 62, 63, 75, 87, 88, 102, 122, 123, 124, 125, 157, 226],
|
|
64
64
|
"Reflect.apply": [0, 52, 227],
|
|
65
65
|
"Reflect.construct": [0, 3, 19, 26, 52, 55, 69, 78, 105, 106, 116, 157, 228],
|
|
66
66
|
"Reflect.deleteProperty": [0, 229],
|
|
@@ -77,20 +77,20 @@
|
|
|
77
77
|
"String.prototype.endsWith": [0, 26, 28, 59, 85, 103, 157, 158, 240],
|
|
78
78
|
"String.fromCodePoint": [0, 241],
|
|
79
79
|
"String.prototype.includes": [0, 26, 28, 85, 103, 157, 158, 242],
|
|
80
|
-
"String.prototype.matchAll": [0, 3, 6, 26, 29, 31, 59, 69, 78, 85, 89, 90, 105, 106, 112, 116, 126, 127, 128, 129, 130, 131, 132, 135, 139, 141, 157, 158, 244
|
|
80
|
+
"String.prototype.matchAll": [0, 3, 6, 26, 29, 31, 59, 69, 78, 85, 89, 90, 105, 106, 112, 116, 126, 127, 128, 129, 130, 131, 132, 135, 139, 141, 157, 158, 244],
|
|
81
81
|
"String.prototype.padEnd": [0, 26, 142, 143, 144, 157, 158, 245],
|
|
82
82
|
"String.prototype.padStart": [0, 26, 142, 143, 144, 157, 158, 246],
|
|
83
83
|
"String.raw": [0, 26, 157, 158, 247],
|
|
84
84
|
"String.prototype.repeat": [0, 26, 144, 157, 158, 248],
|
|
85
|
-
"String.prototype.replaceAll": [0, 26, 65, 85, 128, 129, 157, 158, 249
|
|
85
|
+
"String.prototype.replaceAll": [0, 26, 65, 85, 128, 129, 157, 158, 249],
|
|
86
86
|
"String.prototype.startsWith": [0, 26, 28, 59, 85, 103, 157, 158, 250],
|
|
87
87
|
"String.prototype.substr": [0, 26, 157, 158, 251],
|
|
88
88
|
"String.prototype.trim": [0, 26, 146, 148, 157, 158, 165, 256],
|
|
89
89
|
"String.prototype.trimEnd": [0, 26, 145, 146, 148, 157, 158, 165, 252, 254],
|
|
90
90
|
"String.prototype.trimStart": [0, 26, 146, 147, 148, 157, 158, 165, 253, 255],
|
|
91
91
|
"String.prototype.link": [0, 26, 30, 140, 157, 158, 243],
|
|
92
|
-
"Promise.allSettled": [0, 24, 26, 47, 53, 59, 62, 63, 75, 87, 88, 102, 122, 123, 124, 125, 157, 225,
|
|
93
|
-
"focus-visible": [
|
|
92
|
+
"Promise.allSettled": [0, 24, 26, 47, 53, 59, 62, 63, 75, 87, 88, 102, 122, 123, 124, 125, 157, 225, 257],
|
|
93
|
+
"focus-visible": [258]
|
|
94
94
|
},
|
|
95
|
-
"maxSize":
|
|
95
|
+
"maxSize": 159437
|
|
96
96
|
}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
{
|
|
15
15
|
"name": "Array.prototype.at",
|
|
16
16
|
"modules": [
|
|
17
|
-
"es.array.at"
|
|
17
|
+
"es.array.at",
|
|
18
|
+
"esnext.array.at"
|
|
18
19
|
],
|
|
19
20
|
"corejs": true
|
|
20
21
|
},
|
|
@@ -70,14 +71,16 @@
|
|
|
70
71
|
{
|
|
71
72
|
"name": "Array.prototype.findLast",
|
|
72
73
|
"modules": [
|
|
73
|
-
"es.array.find-last"
|
|
74
|
+
"es.array.find-last",
|
|
75
|
+
"esnext.array.find-last"
|
|
74
76
|
],
|
|
75
77
|
"corejs": true
|
|
76
78
|
},
|
|
77
79
|
{
|
|
78
80
|
"name": "Array.prototype.findLastIndex",
|
|
79
81
|
"modules": [
|
|
80
|
-
"es.array.find-last-index"
|
|
82
|
+
"es.array.find-last-index",
|
|
83
|
+
"esnext.array.find-last-index"
|
|
81
84
|
],
|
|
82
85
|
"corejs": true
|
|
83
86
|
},
|
|
@@ -357,7 +360,8 @@
|
|
|
357
360
|
{
|
|
358
361
|
"name": "Object.hasOwn",
|
|
359
362
|
"modules": [
|
|
360
|
-
"es.object.has-own"
|
|
363
|
+
"es.object.has-own",
|
|
364
|
+
"esnext.object.has-own"
|
|
361
365
|
],
|
|
362
366
|
"corejs": true
|
|
363
367
|
},
|
|
@@ -427,7 +431,8 @@
|
|
|
427
431
|
{
|
|
428
432
|
"name": "Promise.any",
|
|
429
433
|
"modules": [
|
|
430
|
-
"es.promise.any"
|
|
434
|
+
"es.promise.any",
|
|
435
|
+
"esnext.promise.any"
|
|
431
436
|
],
|
|
432
437
|
"corejs": true
|
|
433
438
|
},
|
|
@@ -546,7 +551,8 @@
|
|
|
546
551
|
{
|
|
547
552
|
"name": "String.prototype.matchAll",
|
|
548
553
|
"modules": [
|
|
549
|
-
"es.string.match-all"
|
|
554
|
+
"es.string.match-all",
|
|
555
|
+
"esnext.string.match-all"
|
|
550
556
|
],
|
|
551
557
|
"corejs": true
|
|
552
558
|
},
|
|
@@ -581,7 +587,8 @@
|
|
|
581
587
|
{
|
|
582
588
|
"name": "String.prototype.replaceAll",
|
|
583
589
|
"modules": [
|
|
584
|
-
"es.string.replace-all"
|
|
590
|
+
"es.string.replace-all",
|
|
591
|
+
"esnext.string.replace-all"
|
|
585
592
|
],
|
|
586
593
|
"corejs": true
|
|
587
594
|
},
|
|
@@ -627,60 +634,11 @@
|
|
|
627
634
|
],
|
|
628
635
|
"corejs": true
|
|
629
636
|
},
|
|
630
|
-
{
|
|
631
|
-
"name": "Array.prototype.at",
|
|
632
|
-
"modules": [
|
|
633
|
-
"esnext.array.at"
|
|
634
|
-
],
|
|
635
|
-
"corejs": true
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
"name": "Array.prototype.findLast",
|
|
639
|
-
"modules": [
|
|
640
|
-
"esnext.array.find-last"
|
|
641
|
-
],
|
|
642
|
-
"corejs": true
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
"name": "Array.prototype.findLastIndex",
|
|
646
|
-
"modules": [
|
|
647
|
-
"esnext.array.find-last-index"
|
|
648
|
-
],
|
|
649
|
-
"corejs": true
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
"name": "Object.hasOwn",
|
|
653
|
-
"modules": [
|
|
654
|
-
"esnext.object.has-own"
|
|
655
|
-
],
|
|
656
|
-
"corejs": true
|
|
657
|
-
},
|
|
658
637
|
{
|
|
659
638
|
"name": "Promise.allSettled",
|
|
660
639
|
"modules": [
|
|
661
640
|
"esnext.promise.all-settled"
|
|
662
641
|
],
|
|
663
642
|
"corejs": true
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
"name": "Promise.any",
|
|
667
|
-
"modules": [
|
|
668
|
-
"esnext.promise.any"
|
|
669
|
-
],
|
|
670
|
-
"corejs": true
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
"name": "String.prototype.matchAll",
|
|
674
|
-
"modules": [
|
|
675
|
-
"esnext.string.match-all"
|
|
676
|
-
],
|
|
677
|
-
"corejs": true
|
|
678
|
-
},
|
|
679
|
-
{
|
|
680
|
-
"name": "String.prototype.replaceAll",
|
|
681
|
-
"modules": [
|
|
682
|
-
"esnext.string.replace-all"
|
|
683
|
-
],
|
|
684
|
-
"corejs": true
|
|
685
643
|
}
|
|
686
644
|
]
|
package/package.json
CHANGED