lighthouse 12.4.0-dev.20250227 → 12.4.0-dev.20250228

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.
Files changed (63) hide show
  1. package/core/audits/insights/{long-critical-network-tree-insight.d.ts → duplicate-javascript-insight.d.ts} +3 -3
  2. package/core/audits/insights/duplicate-javascript-insight.js +54 -0
  3. package/core/audits/insights/insight-audit.js +6 -3
  4. package/core/audits/insights/network-dependency-tree-insight.d.ts +11 -0
  5. package/core/audits/insights/{long-critical-network-tree-insight.js → network-dependency-tree-insight.js} +6 -6
  6. package/core/computed/js-bundles.d.ts +1 -1
  7. package/core/computed/module-duplication.d.ts +1 -1
  8. package/core/computed/trace-engine-result.js +4 -0
  9. package/core/config/default-config.js +4 -2
  10. package/core/lib/bf-cache-strings.d.ts +0 -122
  11. package/core/lib/bf-cache-strings.js +1 -2
  12. package/core/lib/deprecation-description.js +2 -1
  13. package/core/lib/trace-engine.d.ts +0 -1
  14. package/core/lib/trace-engine.js +0 -2
  15. package/package.json +2 -2
  16. package/shared/localization/locales/ar-XB.json +538 -520
  17. package/shared/localization/locales/ar.json +538 -520
  18. package/shared/localization/locales/bg.json +681 -663
  19. package/shared/localization/locales/ca.json +674 -656
  20. package/shared/localization/locales/cs.json +674 -656
  21. package/shared/localization/locales/da.json +673 -655
  22. package/shared/localization/locales/de.json +538 -520
  23. package/shared/localization/locales/el.json +676 -658
  24. package/shared/localization/locales/en-GB.json +676 -658
  25. package/shared/localization/locales/en-US.json +573 -558
  26. package/shared/localization/locales/en-XA.json +0 -507
  27. package/shared/localization/locales/en-XL.json +573 -558
  28. package/shared/localization/locales/es-419.json +677 -659
  29. package/shared/localization/locales/es.json +538 -520
  30. package/shared/localization/locales/fi.json +673 -655
  31. package/shared/localization/locales/fil.json +677 -659
  32. package/shared/localization/locales/fr.json +674 -656
  33. package/shared/localization/locales/he.json +536 -521
  34. package/shared/localization/locales/hi.json +538 -520
  35. package/shared/localization/locales/hr.json +676 -658
  36. package/shared/localization/locales/hu.json +673 -655
  37. package/shared/localization/locales/id.json +674 -656
  38. package/shared/localization/locales/it.json +678 -660
  39. package/shared/localization/locales/ja.json +675 -657
  40. package/shared/localization/locales/ko.json +684 -666
  41. package/shared/localization/locales/lt.json +681 -663
  42. package/shared/localization/locales/lv.json +538 -520
  43. package/shared/localization/locales/nl.json +673 -655
  44. package/shared/localization/locales/no.json +675 -657
  45. package/shared/localization/locales/pl.json +673 -655
  46. package/shared/localization/locales/pt-PT.json +542 -524
  47. package/shared/localization/locales/pt.json +541 -523
  48. package/shared/localization/locales/ro.json +673 -655
  49. package/shared/localization/locales/ru.json +683 -668
  50. package/shared/localization/locales/sk.json +673 -655
  51. package/shared/localization/locales/sl.json +673 -655
  52. package/shared/localization/locales/sr-Latn.json +673 -655
  53. package/shared/localization/locales/sr.json +673 -655
  54. package/shared/localization/locales/sv.json +684 -666
  55. package/shared/localization/locales/ta.json +684 -669
  56. package/shared/localization/locales/te.json +538 -520
  57. package/shared/localization/locales/th.json +538 -520
  58. package/shared/localization/locales/tr.json +674 -656
  59. package/shared/localization/locales/uk.json +538 -520
  60. package/shared/localization/locales/vi.json +678 -660
  61. package/shared/localization/locales/zh-HK.json +673 -655
  62. package/shared/localization/locales/zh-TW.json +538 -520
  63. package/shared/localization/locales/zh.json +674 -656
@@ -1,5 +1,5 @@
1
- export default LongCriticalNetworkTreeInsight;
2
- declare class LongCriticalNetworkTreeInsight extends Audit {
1
+ export default DuplicateJavaScriptInsight;
2
+ declare class DuplicateJavaScriptInsight extends Audit {
3
3
  /**
4
4
  * @param {LH.Artifacts} artifacts
5
5
  * @param {LH.Audit.Context} context
@@ -8,4 +8,4 @@ declare class LongCriticalNetworkTreeInsight extends Audit {
8
8
  static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): Promise<LH.Audit.Product>;
9
9
  }
10
10
  import { Audit } from '../audit.js';
11
- //# sourceMappingURL=long-critical-network-tree-insight.d.ts.map
11
+ //# sourceMappingURL=duplicate-javascript-insight.d.ts.map
@@ -0,0 +1,54 @@
1
+ /* eslint-disable no-unused-vars */ // TODO: remove once implemented.
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2025 Google LLC
6
+ * SPDX-License-Identifier: Apache-2.0
7
+ */
8
+
9
+ import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/DuplicateJavaScript.js';
10
+
11
+ import {Audit} from '../audit.js';
12
+ import * as i18n from '../../lib/i18n/i18n.js';
13
+ import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js';
14
+
15
+ // eslint-disable-next-line max-len
16
+ const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/DuplicateJavaScript.js', UIStrings);
17
+
18
+ class DuplicateJavaScriptInsight extends Audit {
19
+ /**
20
+ * @return {LH.Audit.Meta}
21
+ */
22
+ static get meta() {
23
+ return {
24
+ id: 'duplicate-javascript-insight',
25
+ title: str_(UIStrings.title),
26
+ failureTitle: str_(UIStrings.title),
27
+ description: str_(UIStrings.description),
28
+ guidanceLevel: 3, // TODO: confirm/change.
29
+ requiredArtifacts: ['traces', 'TraceElements'],
30
+ };
31
+ }
32
+
33
+ /**
34
+ * @param {LH.Artifacts} artifacts
35
+ * @param {LH.Audit.Context} context
36
+ * @return {Promise<LH.Audit.Product>}
37
+ */
38
+ static async audit(artifacts, context) {
39
+ // TODO: implement.
40
+ return adaptInsightToAuditProduct(artifacts, context, 'DuplicateJavaScript', (insight) => {
41
+ /** @type {LH.Audit.Details.Table['headings']} */
42
+ const headings = [
43
+ /* eslint-disable max-len */
44
+ /* eslint-enable max-len */
45
+ ];
46
+ /** @type {LH.Audit.Details.Table['items']} */
47
+ const items = [
48
+ ];
49
+ return Audit.makeTableDetails(headings, items);
50
+ });
51
+ }
52
+ }
53
+
54
+ export default DuplicateJavaScriptInsight;
@@ -71,11 +71,14 @@ async function adaptInsightToAuditProduct(artifacts, context, insightName, creat
71
71
  metricSavings = {...metricSavings, LCP: /** @type {any} */ (0)};
72
72
  }
73
73
 
74
- let score = insight.shouldShow ? 0 : 1;
75
- // TODO: change insight model to denote passing/failing/informative. Until then... hack it.
76
- if (insightName === 'LCPPhases') {
74
+ let score = 1;
75
+ if (insight.state === 'fail') {
76
+ score = 0;
77
+ } else if (insightName === 'LCPPhases') {
78
+ // TODO: change these insights to denote passing/failing/informative. Until then... hack it.
77
79
  score = metricSavings?.LCP ?? 0 >= 1000 ? 0 : 1;
78
80
  } else if (insightName === 'InteractionToNextPaint') {
81
+ // TODO: change these insights to denote passing/failing/informative. Until then... hack it.
79
82
  score = metricSavings?.INP ?? 0 >= 500 ? 0 : 1;
80
83
  }
81
84
 
@@ -0,0 +1,11 @@
1
+ export default NetworkDependencyTreeInsight;
2
+ declare class NetworkDependencyTreeInsight extends Audit {
3
+ /**
4
+ * @param {LH.Artifacts} artifacts
5
+ * @param {LH.Audit.Context} context
6
+ * @return {Promise<LH.Audit.Product>}
7
+ */
8
+ static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): Promise<LH.Audit.Product>;
9
+ }
10
+ import { Audit } from '../audit.js';
11
+ //# sourceMappingURL=network-dependency-tree-insight.d.ts.map
@@ -6,22 +6,22 @@
6
6
  * SPDX-License-Identifier: Apache-2.0
7
7
  */
8
8
 
9
- import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/LongCriticalNetworkTree.js';
9
+ import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/NetworkDependencyTree.js';
10
10
 
11
11
  import {Audit} from '../audit.js';
12
12
  import * as i18n from '../../lib/i18n/i18n.js';
13
13
  import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js';
14
14
 
15
15
  // eslint-disable-next-line max-len
16
- const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/LongCriticalNetworkTree.js', UIStrings);
16
+ const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/NetworkDependencyTree.js', UIStrings);
17
17
 
18
- class LongCriticalNetworkTreeInsight extends Audit {
18
+ class NetworkDependencyTreeInsight extends Audit {
19
19
  /**
20
20
  * @return {LH.Audit.Meta}
21
21
  */
22
22
  static get meta() {
23
23
  return {
24
- id: 'long-critical-network-tree-insight',
24
+ id: 'network-dependency-tree-insight',
25
25
  title: str_(UIStrings.title),
26
26
  failureTitle: str_(UIStrings.title),
27
27
  description: str_(UIStrings.description),
@@ -38,7 +38,7 @@ class LongCriticalNetworkTreeInsight extends Audit {
38
38
  */
39
39
  static async audit(artifacts, context) {
40
40
  // TODO: implement.
41
- return adaptInsightToAuditProduct(artifacts, context, 'LongCriticalNetworkTree', (insight) => {
41
+ return adaptInsightToAuditProduct(artifacts, context, 'NetworkDependencyTree', (insight) => {
42
42
  /** @type {LH.Audit.Details.Table['headings']} */
43
43
  const headings = [
44
44
  ];
@@ -50,4 +50,4 @@ class LongCriticalNetworkTreeInsight extends Audit {
50
50
  }
51
51
  }
52
52
 
53
- export default LongCriticalNetworkTreeInsight;
53
+ export default NetworkDependencyTreeInsight;
@@ -1,6 +1,6 @@
1
1
  export { JSBundlesComputed as JSBundles };
2
2
  declare const JSBundlesComputed: typeof JSBundles & {
3
- request: (dependencies: Pick<import("../index.js").Artifacts, "SourceMaps" | "Scripts">, context: LH.Artifacts.ComputedContext) => ReturnType<typeof JSBundles.compute_>;
3
+ request: (dependencies: Pick<import("../index.js").Artifacts, "Scripts" | "SourceMaps">, context: LH.Artifacts.ComputedContext) => ReturnType<typeof JSBundles.compute_>;
4
4
  };
5
5
  declare class JSBundles {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  export { ModuleDuplicationComputed as ModuleDuplication };
2
2
  declare const ModuleDuplicationComputed: typeof ModuleDuplication & {
3
- request: (dependencies: Pick<import("../index.js").Artifacts, "SourceMaps" | "Scripts">, context: LH.Artifacts.ComputedContext) => ReturnType<typeof ModuleDuplication.compute_>;
3
+ request: (dependencies: Pick<import("../index.js").Artifacts, "Scripts" | "SourceMaps">, context: LH.Artifacts.ComputedContext) => ReturnType<typeof ModuleDuplication.compute_>;
4
4
  };
5
5
  declare class ModuleDuplication {
6
6
  /**
@@ -108,6 +108,10 @@ class TraceEngineResult {
108
108
  // @ts-expect-error
109
109
  values[key] = value.__i18nBytes;
110
110
  // TODO: use an actual byte formatter. Right now, this shows the exact number of bytes.
111
+ } else if (value && typeof value === 'object' && 'i18nId' in value) {
112
+ // TODO: add support for str_ values to be IcuMessage.
113
+ // @ts-expect-error
114
+ values[key] = str_(value.i18nId, value.values).formattedDefault;
111
115
  }
112
116
  }
113
117
  }
@@ -312,13 +312,14 @@ const defaultConfig = {
312
312
  'insights/cls-culprits-insight',
313
313
  'insights/document-latency-insight',
314
314
  'insights/dom-size-insight',
315
+ 'insights/duplicate-javascript-insight',
315
316
  'insights/font-display-insight',
316
317
  'insights/forced-reflow-insight',
317
318
  'insights/image-delivery-insight',
318
319
  'insights/interaction-to-next-paint-insight',
319
320
  'insights/lcp-discovery-insight',
320
321
  'insights/lcp-phases-insight',
321
- 'insights/long-critical-network-tree-insight',
322
+ 'insights/network-dependency-tree-insight',
322
323
  'insights/render-blocking-insight',
323
324
  'insights/slow-css-selector-insight',
324
325
  'insights/third-parties-insight',
@@ -410,13 +411,14 @@ const defaultConfig = {
410
411
  {id: 'cls-culprits-insight', weight: 0, group: 'insights'},
411
412
  {id: 'document-latency-insight', weight: 0, group: 'insights'},
412
413
  {id: 'dom-size-insight', weight: 0, group: 'insights'},
414
+ {id: 'duplicate-javascript-insight', weight: 0, group: 'insights'},
413
415
  {id: 'font-display-insight', weight: 0, group: 'insights'},
414
416
  {id: 'forced-reflow-insight', weight: 0, group: 'insights'},
415
417
  {id: 'image-delivery-insight', weight: 0, group: 'insights'},
416
418
  {id: 'interaction-to-next-paint-insight', weight: 0, group: 'insights'},
417
419
  {id: 'lcp-discovery-insight', weight: 0, group: 'insights'},
418
420
  {id: 'lcp-phases-insight', weight: 0, group: 'insights'},
419
- {id: 'long-critical-network-tree-insight', weight: 0, group: 'insights'},
421
+ {id: 'network-dependency-tree-insight', weight: 0, group: 'insights'},
420
422
  {id: 'render-blocking-insight', weight: 0, group: 'insights'},
421
423
  {id: 'slow-css-selector-insight', weight: 0, group: 'insights'},
422
424
  {id: 'third-parties-insight', weight: 0, group: 'insights'},
@@ -2,126 +2,4 @@
2
2
  export const NotRestoredReasonDescription: Record<string, {
3
3
  name: LH.IcuMessage | string;
4
4
  } | undefined>;
5
- export namespace UIStrings {
6
- let notMainFrame: string;
7
- let backForwardCacheDisabled: string;
8
- let relatedActiveContentsExist: string;
9
- let HTTPStatusNotOK: string;
10
- let schemeNotHTTPOrHTTPS: string;
11
- let loading: string;
12
- let wasGrantedMediaAccess: string;
13
- let HTTPMethodNotGET: string;
14
- let subframeIsNavigating: string;
15
- let timeout: string;
16
- let cacheLimit: string;
17
- let JavaScriptExecution: string;
18
- let rendererProcessKilled: string;
19
- let rendererProcessCrashed: string;
20
- let grantedMediaStreamAccess: string;
21
- let cacheFlushed: string;
22
- let serviceWorkerVersionActivation: string;
23
- let sessionRestored: string;
24
- let serviceWorkerPostMessage: string;
25
- let enteredBackForwardCacheBeforeServiceWorkerHostAdded: string;
26
- let serviceWorkerClaim: string;
27
- let haveInnerContents: string;
28
- let timeoutPuttingInCache: string;
29
- let backForwardCacheDisabledByLowMemory: string;
30
- let backForwardCacheDisabledByCommandLine: string;
31
- let networkRequestDatapipeDrainedAsBytesConsumer: string;
32
- let networkRequestRedirected: string;
33
- let networkRequestTimeout: string;
34
- let networkExceedsBufferLimit: string;
35
- let navigationCancelledWhileRestoring: string;
36
- let backForwardCacheDisabledForPrerender: string;
37
- let userAgentOverrideDiffers: string;
38
- let foregroundCacheLimit: string;
39
- let backForwardCacheDisabledForDelegate: string;
40
- let unloadHandlerExistsInMainFrame: string;
41
- let unloadHandlerExistsInSubFrame: string;
42
- let serviceWorkerUnregistration: string;
43
- let noResponseHead: string;
44
- let cacheControlNoStore: string;
45
- let ineligibleAPI: string;
46
- let internalError: string;
47
- let webSocket: string;
48
- let webTransport: string;
49
- let webRTC: string;
50
- let mainResourceHasCacheControlNoStore: string;
51
- let mainResourceHasCacheControlNoCache: string;
52
- let subresourceHasCacheControlNoStore: string;
53
- let subresourceHasCacheControlNoCache: string;
54
- let containsPlugins: string;
55
- let documentLoaded: string;
56
- let dedicatedWorkerOrWorklet: string;
57
- let outstandingNetworkRequestOthers: string;
58
- let outstandingIndexedDBTransaction: string;
59
- let requestedNotificationsPermission: string;
60
- let requestedMIDIPermission: string;
61
- let requestedAudioCapturePermission: string;
62
- let requestedVideoCapturePermission: string;
63
- let requestedBackForwardCacheBlockedSensors: string;
64
- let requestedBackgroundWorkPermission: string;
65
- let broadcastChannel: string;
66
- let indexedDBConnection: string;
67
- let webXR: string;
68
- let sharedWorker: string;
69
- let webLocks: string;
70
- let webHID: string;
71
- let webShare: string;
72
- let requestedStorageAccessGrant: string;
73
- let webNfc: string;
74
- let outstandingNetworkRequestFetch: string;
75
- let outstandingNetworkRequestXHR: string;
76
- let appBanner: string;
77
- let printing: string;
78
- let webDatabase: string;
79
- let pictureInPicture: string;
80
- let speechRecognizer: string;
81
- let idleManager: string;
82
- let paymentManager: string;
83
- let speechSynthesis: string;
84
- let keyboardLock: string;
85
- let webOTPService: string;
86
- let outstandingNetworkRequestDirectSocket: string;
87
- let injectedJavascript: string;
88
- let injectedStyleSheet: string;
89
- let contentDiscarded: string;
90
- let contentSecurityHandler: string;
91
- let contentWebAuthenticationAPI: string;
92
- let contentFileChooser: string;
93
- let contentSerial: string;
94
- let contentFileSystemAccess: string;
95
- let contentMediaDevicesDispatcherHost: string;
96
- let contentWebBluetooth: string;
97
- let contentWebUSB: string;
98
- let contentMediaSession: string;
99
- let contentMediaSessionService: string;
100
- let contentMediaPlay: string;
101
- let contentScreenReader: string;
102
- let embedderPopupBlockerTabHelper: string;
103
- let embedderSafeBrowsingTriggeredPopupBlocker: string;
104
- let embedderSafeBrowsingThreatDetails: string;
105
- let embedderAppBannerManager: string;
106
- let embedderDomDistillerViewerSource: string;
107
- let embedderDomDistillerSelfDeletingRequestDelegate: string;
108
- let embedderOomInterventionTabHelper: string;
109
- let embedderOfflinePage: string;
110
- let embedderChromePasswordManagerClientBindCredentialManager: string;
111
- let embedderPermissionRequestManager: string;
112
- let embedderModalDialog: string;
113
- let embedderExtensions: string;
114
- let embedderExtensionMessaging: string;
115
- let embedderExtensionMessagingForOpenPort: string;
116
- let embedderExtensionSentMessageToCachedFrame: string;
117
- let errorDocument: string;
118
- let fencedFramesEmbedder: string;
119
- let keepaliveRequest: string;
120
- let jsNetworkRequestReceivedCacheControlNoStoreResource: string;
121
- let indexedDBEvent: string;
122
- let cookieDisabled: string;
123
- let webRTCSticky: string;
124
- let webTransportSticky: string;
125
- let webSocketSticky: string;
126
- }
127
5
  //# sourceMappingURL=bf-cache-strings.d.ts.map
@@ -544,7 +544,7 @@ const UIStrings = {
544
544
 
545
545
  };
546
546
 
547
- const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
547
+ const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/panels/application/components/BackForwardCacheStrings.js', UIStrings);
548
548
 
549
549
 
550
550
  /** @type {Record<string, {name: LH.IcuMessage|string} | undefined>} */
@@ -707,5 +707,4 @@ const NotRestoredReasonDescription = {
707
707
 
708
708
  export {
709
709
  NotRestoredReasonDescription,
710
- UIStrings,
711
710
  };
@@ -25,7 +25,8 @@ const UIStrings = {
25
25
  };
26
26
 
27
27
  const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
28
- const deprecationsStr_ = i18n.createIcuMessageFn(import.meta.url, DeprecationUIStrings);
28
+ const deprecationsStr_ = i18n.createIcuMessageFn(
29
+ 'node_modules/@paulirish/trace_engine/generated/Deprecation.js', DeprecationUIStrings);
29
30
 
30
31
  /**
31
32
  * @param {LH.Crdp.Audits.DeprecationIssueDetails} issueDetails
@@ -6,7 +6,6 @@ export type SaneSyntheticLayoutShift = SyntheticLayoutShift & {
6
6
  };
7
7
  export const TraceProcessor: typeof TraceEngine.Processor.TraceProcessor;
8
8
  export const TraceHandlers: typeof TraceEngine.Handlers.ModelHandlers;
9
- export const RootCauses: typeof TraceEngine.RootCauses.RootCauses.RootCauses;
10
9
  export const Insights: typeof TraceEngine.Insights;
11
10
  import * as TraceEngine from '@paulirish/trace_engine';
12
11
  //# sourceMappingURL=trace-engine.d.ts.map
@@ -9,12 +9,10 @@ polyfillDOMRect();
9
9
 
10
10
  const TraceProcessor = TraceEngine.Processor.TraceProcessor;
11
11
  const TraceHandlers = TraceEngine.Handlers.ModelHandlers;
12
- const RootCauses = TraceEngine.RootCauses.RootCauses.RootCauses;
13
12
  const Insights = TraceEngine.Insights;
14
13
 
15
14
  export {
16
15
  TraceProcessor,
17
16
  TraceHandlers,
18
- RootCauses,
19
17
  Insights,
20
18
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "12.4.0-dev.20250227",
4
+ "version": "12.4.0-dev.20250228",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {
@@ -183,7 +183,7 @@
183
183
  "webtreemap-cdt": "^3.2.1"
184
184
  },
185
185
  "dependencies": {
186
- "@paulirish/trace_engine": "0.0.44",
186
+ "@paulirish/trace_engine": "0.0.46",
187
187
  "@sentry/node": "^7.0.0",
188
188
  "axe-core": "^4.10.2",
189
189
  "chrome-launcher": "^1.1.2",