lighthouse 13.5.0-dev.20261020 → 13.5.0-dev.20261021
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.d.ts +2 -2
- package/cli/bin.js +5 -4
- package/cli/cli-flags.d.ts +16 -1
- package/cli/cli-flags.js +51 -0
- package/cli/run.d.ts +5 -5
- package/cli/run.js +97 -47
- package/core/audits/baseline.d.ts +3 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +2 -2
- package/core/computed/lcp-image-record.d.ts +2 -23
- package/core/computed/lcp-image-record.js +3 -67
- package/core/computed/lcp-network-record.d.ts +24 -0
- package/core/computed/lcp-network-record.js +74 -0
- package/core/computed/metrics/lcp-breakdown.js +2 -2
- package/core/config/config-helpers.d.ts +5 -0
- package/core/config/config-helpers.js +6 -24
- package/core/lib/baseline/web-features-data.json +14 -1
- package/dist/report/bundle.esm.js +2 -2
- package/dist/report/flow.js +13 -13
- package/dist/report/standalone.js +2 -2
- package/flow-report/src/util.d.ts +1 -1
- package/package.json +36 -39
- package/readme.md +11 -17
- package/report/generator/file-namer.d.ts +1 -1
- package/report/generator/file-namer.js +4 -3
- package/report/renderer/performance-category-renderer.js +2 -1
- package/report/renderer/text-encoding.js +2 -2
- package/report/types/augment-dom.d.ts +4 -0
- package/types/externs.d.ts +4 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type GathererConstructor = typeof import("../gather/base-gatherer.js").default;
|
|
2
2
|
export type Audit = typeof import("../audits/audit.js")["Audit"];
|
|
3
3
|
export type Gatherer = InstanceType<GathererConstructor>;
|
|
4
|
+
/** @type {Map<string, Promise<any>>} */
|
|
5
|
+
export const bundledModules: Map<string, Promise<any>>;
|
|
4
6
|
/**
|
|
5
7
|
* // TODO(bckenny): could adopt "jsonified" type to ensure T will survive JSON
|
|
6
8
|
* round trip: https://github.com/Microsoft/TypeScript/issues/21838
|
|
@@ -33,6 +35,9 @@ export const mergeConfigFragment: LH.Config.Merge;
|
|
|
33
35
|
* @return {Array<T>}
|
|
34
36
|
*/
|
|
35
37
|
export function mergeConfigFragmentArrayByKey<T extends Record<string, any>>(baseArray: Array<T> | null | undefined, extensionArray: Array<T> | null | undefined, keyFn: (item: T) => string): Array<T>;
|
|
38
|
+
/** @typedef {typeof import('../gather/base-gatherer.js').default} GathererConstructor */
|
|
39
|
+
/** @typedef {typeof import('../audits/audit.js')['Audit']} Audit */
|
|
40
|
+
/** @typedef {InstanceType<GathererConstructor>} Gatherer */
|
|
36
41
|
/**
|
|
37
42
|
* If any items with identical `path` properties are found in the input array,
|
|
38
43
|
* merge their `options` properties into the first instance and then discard any
|
|
@@ -21,21 +21,6 @@ const require = createRequire(import.meta.url);
|
|
|
21
21
|
/** @typedef {typeof import('../audits/audit.js')['Audit']} Audit */
|
|
22
22
|
/** @typedef {InstanceType<GathererConstructor>} Gatherer */
|
|
23
23
|
|
|
24
|
-
function isBundledEnvironment() {
|
|
25
|
-
// If we're in DevTools or LightRider, we are definitely bundled.
|
|
26
|
-
// TODO: refactor and delete `global.isDevtools`.
|
|
27
|
-
if (global.isDevtools || global.isLightrider) return true;
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
// Not foolproof, but `lighthouse-logger` is a dependency of lighthouse that should always be resolvable.
|
|
31
|
-
// `require.resolve` will only throw in atypical/bundled environments.
|
|
32
|
-
require.resolve('lighthouse-logger');
|
|
33
|
-
return false;
|
|
34
|
-
} catch (err) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
24
|
/**
|
|
40
25
|
* If any items with identical `path` properties are found in the input array,
|
|
41
26
|
* merge their `options` properties into the first instance and then discard any
|
|
@@ -224,6 +209,8 @@ async function requireWrapper(requirePath) {
|
|
|
224
209
|
let module;
|
|
225
210
|
if (bundledModules.has(requirePath)) {
|
|
226
211
|
module = await bundledModules.get(requirePath);
|
|
212
|
+
} else if (bundledModules.size > 0) {
|
|
213
|
+
throw new Error(`Unable to locate module '${requirePath}' in bundled Lighthouse`);
|
|
227
214
|
} else if (requirePath.match(/\.(js|mjs|cjs)$/)) {
|
|
228
215
|
module = await import(requirePath);
|
|
229
216
|
} else {
|
|
@@ -283,18 +270,12 @@ function requireAudit(auditPath, coreAuditList, configDir) {
|
|
|
283
270
|
const coreAudit = coreAuditList.find(a => a === auditPathJs);
|
|
284
271
|
let requirePath = `../audits/${auditPath}`;
|
|
285
272
|
if (!coreAudit) {
|
|
286
|
-
if (
|
|
273
|
+
if (bundledModules.has(auditPath)) {
|
|
287
274
|
// This is for plugin bundling.
|
|
288
275
|
requirePath = auditPath;
|
|
289
276
|
} else {
|
|
290
277
|
// Otherwise, attempt to find it elsewhere. This throws if not found.
|
|
291
|
-
|
|
292
|
-
if (isBundledEnvironment()) {
|
|
293
|
-
// Use a relative path so bundler can easily expose it.
|
|
294
|
-
requirePath = path.relative(import.meta.dirname, absolutePath);
|
|
295
|
-
} else {
|
|
296
|
-
requirePath = absolutePath;
|
|
297
|
-
}
|
|
278
|
+
requirePath = resolveModulePath(auditPath, configDir, 'audit');
|
|
298
279
|
}
|
|
299
280
|
}
|
|
300
281
|
|
|
@@ -372,7 +353,7 @@ async function mergePlugins(config, configDir, flags) {
|
|
|
372
353
|
validation.assertValidPluginName(config, pluginName);
|
|
373
354
|
|
|
374
355
|
// In bundled contexts, `resolveModulePath` will fail, so use the raw pluginName directly.
|
|
375
|
-
const pluginPath =
|
|
356
|
+
const pluginPath = bundledModules.has(pluginName) ?
|
|
376
357
|
pluginName :
|
|
377
358
|
resolveModulePath(pluginName, configDir, 'plugin');
|
|
378
359
|
const rawPluginJson = await requireWrapper(pluginPath);
|
|
@@ -604,6 +585,7 @@ function deepCloneConfigJson(json) {
|
|
|
604
585
|
}
|
|
605
586
|
|
|
606
587
|
export {
|
|
588
|
+
bundledModules,
|
|
607
589
|
deepClone,
|
|
608
590
|
deepCloneConfigJson,
|
|
609
591
|
mergeConfigFragment,
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
"font-face": "2016-09-20",
|
|
205
205
|
"font-family": "2015-07-29",
|
|
206
206
|
"font-family-system": "2021-09-07",
|
|
207
|
-
"font-feature-settings": "
|
|
207
|
+
"font-feature-settings": "2016-03-21",
|
|
208
208
|
"font-kerning": "2020-01-15",
|
|
209
209
|
"font-loading": "2020-01-15",
|
|
210
210
|
"font-optical-sizing": "2020-03-24",
|
|
@@ -645,6 +645,7 @@
|
|
|
645
645
|
"word-break": "2015-09-30",
|
|
646
646
|
"word-spacing": "2015-07-29",
|
|
647
647
|
"writing-mode": "2017-03-27",
|
|
648
|
+
"x-frame-options": "2015-07-29",
|
|
648
649
|
"xhr": "2015-07-29",
|
|
649
650
|
"xml-serializer": "2015-07-29",
|
|
650
651
|
"xpath": "2015-07-29",
|
|
@@ -657,6 +658,7 @@
|
|
|
657
658
|
"align-content-block": "2024-04-16",
|
|
658
659
|
"alpha": "2026-09-14",
|
|
659
660
|
"alt-text-generated-content": "2024-07-09",
|
|
661
|
+
"animations-css-animation-accessors": "2026-09-14",
|
|
660
662
|
"arianotify": "2026-09-14",
|
|
661
663
|
"async-clipboard": "2024-06-11",
|
|
662
664
|
"async-iterable-streams": "2026-09-14",
|
|
@@ -726,6 +728,7 @@
|
|
|
726
728
|
"request-video-frame-callback": "2024-10-29",
|
|
727
729
|
"requestclose": "2025-05-27",
|
|
728
730
|
"resizable-buffers": "2024-07-09",
|
|
731
|
+
"revert-rule": "2026-09-14",
|
|
729
732
|
"rex": "2026-01-13",
|
|
730
733
|
"ric": "2026-01-13",
|
|
731
734
|
"round-mod-rem": "2024-05-17",
|
|
@@ -856,6 +859,7 @@
|
|
|
856
859
|
"cross-document-view-transitions",
|
|
857
860
|
"cross-fade",
|
|
858
861
|
"css-modules",
|
|
862
|
+
"css-object-model-csspseudoelement",
|
|
859
863
|
"css-object-model-discouraged",
|
|
860
864
|
"css-typed-om",
|
|
861
865
|
"cursor",
|
|
@@ -975,7 +979,9 @@
|
|
|
975
979
|
"inverted-colors",
|
|
976
980
|
"is-error",
|
|
977
981
|
"is-input-pending",
|
|
982
|
+
"iterator-includes",
|
|
978
983
|
"iterator-join",
|
|
984
|
+
"iterator-zip-zipkeyed",
|
|
979
985
|
"jpegxl",
|
|
980
986
|
"justify-self-block",
|
|
981
987
|
"keyboard-lock",
|
|
@@ -1076,6 +1082,7 @@
|
|
|
1076
1082
|
"reporting-permissions-policy-violations",
|
|
1077
1083
|
"requestidlecallback",
|
|
1078
1084
|
"resize",
|
|
1085
|
+
"retriable-module-loading",
|
|
1079
1086
|
"rhythmic-sizing",
|
|
1080
1087
|
"ruby-overhang",
|
|
1081
1088
|
"sanitizer",
|
|
@@ -1084,6 +1091,7 @@
|
|
|
1084
1091
|
"scoped-custom-element-registries",
|
|
1085
1092
|
"screen-capture",
|
|
1086
1093
|
"screen-orientation-lock",
|
|
1094
|
+
"scroll-axis-lock",
|
|
1087
1095
|
"scroll-buttons",
|
|
1088
1096
|
"scroll-driven-animations",
|
|
1089
1097
|
"scroll-initial-target",
|
|
@@ -1093,6 +1101,7 @@
|
|
|
1093
1101
|
"scroll-promises",
|
|
1094
1102
|
"scroll-snap-events",
|
|
1095
1103
|
"scroll-target-group",
|
|
1104
|
+
"scroll-triggered-animations",
|
|
1096
1105
|
"secure-payment-confirmation",
|
|
1097
1106
|
"selection",
|
|
1098
1107
|
"serial",
|
|
@@ -1116,6 +1125,7 @@
|
|
|
1116
1125
|
"spelling-grammar-error",
|
|
1117
1126
|
"storage-buckets",
|
|
1118
1127
|
"stretch",
|
|
1128
|
+
"string-substr",
|
|
1119
1129
|
"string-trim-leftright",
|
|
1120
1130
|
"style-query-range-syntax",
|
|
1121
1131
|
"summarizer",
|
|
@@ -1124,6 +1134,7 @@
|
|
|
1124
1134
|
"svg-discouraged",
|
|
1125
1135
|
"switch-control",
|
|
1126
1136
|
"symbols-function",
|
|
1137
|
+
"system-color-accentcolor",
|
|
1127
1138
|
"table-discouraged",
|
|
1128
1139
|
"target-within",
|
|
1129
1140
|
"template-for",
|
|
@@ -1132,6 +1143,7 @@
|
|
|
1132
1143
|
"text-box",
|
|
1133
1144
|
"text-decoration-line-blink",
|
|
1134
1145
|
"text-decoration-selection",
|
|
1146
|
+
"text-decoration-skip-spaces",
|
|
1135
1147
|
"text-fit",
|
|
1136
1148
|
"text-justify",
|
|
1137
1149
|
"text-modules",
|
|
@@ -1198,6 +1210,7 @@
|
|
|
1198
1210
|
"webxr-layers",
|
|
1199
1211
|
"webxr-lighting-estimation",
|
|
1200
1212
|
"wheel-events",
|
|
1213
|
+
"wheel-events-momentum",
|
|
1201
1214
|
"widows-orphans",
|
|
1202
1215
|
"window-controls-overlay",
|
|
1203
1216
|
"window-drag",
|