lighthouse 12.4.0-dev.20250318 → 12.4.0-dev.20250320

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 (147) hide show
  1. package/core/audits/audit.js +3 -1
  2. package/core/audits/bootup-time.js +1 -1
  3. package/core/audits/byte-efficiency/efficient-animated-content.js +1 -1
  4. package/core/audits/byte-efficiency/modern-image-formats.js +1 -1
  5. package/core/audits/byte-efficiency/offscreen-images.js +4 -3
  6. package/core/audits/byte-efficiency/render-blocking-resources.js +5 -3
  7. package/core/audits/byte-efficiency/unminified-css.js +2 -1
  8. package/core/audits/byte-efficiency/unminified-javascript.js +2 -1
  9. package/core/audits/byte-efficiency/unused-css-rules.js +1 -1
  10. package/core/audits/byte-efficiency/unused-javascript.js +2 -2
  11. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +1 -1
  12. package/core/audits/byte-efficiency/uses-optimized-images.js +1 -1
  13. package/core/audits/byte-efficiency/uses-responsive-images.js +1 -1
  14. package/core/audits/byte-efficiency/uses-text-compression.js +2 -1
  15. package/core/audits/critical-request-chains.js +4 -3
  16. package/core/audits/dobetterweb/dom-size.js +1 -1
  17. package/core/audits/dobetterweb/uses-http2.js +1 -1
  18. package/core/audits/insights/cls-culprits-insight.js +1 -1
  19. package/core/audits/insights/document-latency-insight.js +1 -1
  20. package/core/audits/insights/dom-size-insight.js +1 -1
  21. package/core/audits/insights/duplicated-javascript-insight.d.ts +11 -0
  22. package/core/audits/insights/{duplicate-javascript-insight.js → duplicated-javascript-insight.js} +7 -7
  23. package/core/audits/insights/font-display-insight.js +1 -1
  24. package/core/audits/insights/forced-reflow-insight.d.ts +10 -0
  25. package/core/audits/insights/forced-reflow-insight.js +64 -12
  26. package/core/audits/insights/image-delivery-insight.js +1 -1
  27. package/core/audits/insights/insight-audit.js +2 -1
  28. package/core/audits/insights/interaction-to-next-paint-insight.js +1 -1
  29. package/core/audits/insights/lcp-discovery-insight.js +1 -1
  30. package/core/audits/insights/lcp-phases-insight.js +1 -1
  31. package/core/audits/insights/network-dependency-tree-insight.js +1 -1
  32. package/core/audits/insights/render-blocking-insight.js +1 -1
  33. package/core/audits/insights/slow-css-selector-insight.js +1 -1
  34. package/core/audits/insights/third-parties-insight.js +1 -1
  35. package/core/audits/insights/{duplicate-javascript-insight.d.ts → use-cache-insight.d.ts} +3 -3
  36. package/core/audits/insights/use-cache-insight.js +54 -0
  37. package/core/audits/insights/viewport-insight.js +1 -1
  38. package/core/audits/largest-contentful-paint-element.js +7 -3
  39. package/core/audits/layout-shifts.js +4 -2
  40. package/core/audits/lcp-lazy-loaded.js +1 -1
  41. package/core/audits/long-tasks.js +5 -4
  42. package/core/audits/mainthread-work-breakdown.js +1 -1
  43. package/core/audits/metrics/first-contentful-paint.js +4 -2
  44. package/core/audits/metrics/interactive.js +6 -3
  45. package/core/audits/metrics/largest-contentful-paint.js +7 -3
  46. package/core/audits/metrics/max-potential-fid.js +6 -3
  47. package/core/audits/metrics/speed-index.js +6 -3
  48. package/core/audits/metrics/total-blocking-time.js +6 -3
  49. package/core/audits/metrics.js +4 -3
  50. package/core/audits/predictive-perf.js +4 -3
  51. package/core/audits/prioritize-lcp-image.js +5 -3
  52. package/core/audits/redirects.js +4 -2
  53. package/core/audits/script-treemap-data.js +2 -2
  54. package/core/audits/third-party-facades.js +1 -1
  55. package/core/audits/third-party-summary.js +1 -1
  56. package/core/audits/uses-rel-preconnect.js +7 -5
  57. package/core/audits/uses-rel-preload.js +4 -3
  58. package/core/computed/computed-artifact.d.ts +5 -1
  59. package/core/computed/computed-artifact.js +23 -2
  60. package/core/computed/critical-request-chains.d.ts +3 -1
  61. package/core/computed/critical-request-chains.js +4 -4
  62. package/core/computed/metrics/first-contentful-paint-all-frames.js +1 -1
  63. package/core/computed/metrics/first-contentful-paint.js +1 -1
  64. package/core/computed/metrics/interactive.js +1 -1
  65. package/core/computed/metrics/lantern-first-contentful-paint.js +1 -1
  66. package/core/computed/metrics/lantern-interactive.js +1 -1
  67. package/core/computed/metrics/lantern-largest-contentful-paint.js +1 -1
  68. package/core/computed/metrics/lantern-max-potential-fid.js +1 -1
  69. package/core/computed/metrics/lantern-metric.js +1 -1
  70. package/core/computed/metrics/lantern-speed-index.js +1 -1
  71. package/core/computed/metrics/lantern-total-blocking-time.js +1 -1
  72. package/core/computed/metrics/largest-contentful-paint-all-frames.js +1 -1
  73. package/core/computed/metrics/largest-contentful-paint.js +1 -1
  74. package/core/computed/metrics/lcp-breakdown.js +1 -1
  75. package/core/computed/metrics/max-potential-fid.js +1 -1
  76. package/core/computed/metrics/metric.js +2 -0
  77. package/core/computed/metrics/speed-index.js +1 -1
  78. package/core/computed/metrics/time-to-first-byte.js +1 -1
  79. package/core/computed/metrics/timing-summary.d.ts +5 -2
  80. package/core/computed/metrics/timing-summary.js +8 -4
  81. package/core/computed/metrics/total-blocking-time.js +1 -1
  82. package/core/computed/navigation-insights.d.ts +3 -1
  83. package/core/computed/navigation-insights.js +6 -4
  84. package/core/computed/page-dependency-graph.d.ts +5 -3
  85. package/core/computed/page-dependency-graph.js +5 -4
  86. package/core/computed/tbt-impact-tasks.js +1 -1
  87. package/core/computed/trace-engine-result.d.ts +5 -2
  88. package/core/computed/trace-engine-result.js +18 -4
  89. package/core/computed/unused-javascript-summary.d.ts +2 -2
  90. package/core/computed/unused-javascript-summary.js +1 -1
  91. package/core/config/default-config.js +4 -2
  92. package/core/config/experimental-config.js +2 -1
  93. package/core/gather/gatherers/source-maps.d.ts +1 -0
  94. package/core/gather/gatherers/source-maps.js +3 -0
  95. package/core/gather/gatherers/trace-elements.d.ts +4 -4
  96. package/core/gather/gatherers/trace-elements.js +7 -4
  97. package/core/gather/gatherers/trace.js +5 -0
  98. package/package.json +2 -2
  99. package/shared/localization/locales/ar-XB.json +235 -1
  100. package/shared/localization/locales/ar.json +235 -7
  101. package/shared/localization/locales/bg.json +235 -7
  102. package/shared/localization/locales/ca.json +235 -7
  103. package/shared/localization/locales/cs.json +234 -6
  104. package/shared/localization/locales/da.json +236 -8
  105. package/shared/localization/locales/de.json +234 -6
  106. package/shared/localization/locales/el.json +235 -7
  107. package/shared/localization/locales/en-GB.json +235 -19
  108. package/shared/localization/locales/en-US.json +30 -3
  109. package/shared/localization/locales/en-XA.json +0 -6
  110. package/shared/localization/locales/en-XL.json +30 -3
  111. package/shared/localization/locales/es-419.json +235 -7
  112. package/shared/localization/locales/es.json +234 -6
  113. package/shared/localization/locales/fi.json +235 -7
  114. package/shared/localization/locales/fil.json +237 -3
  115. package/shared/localization/locales/fr.json +236 -8
  116. package/shared/localization/locales/he.json +234 -0
  117. package/shared/localization/locales/hi.json +236 -2
  118. package/shared/localization/locales/hr.json +235 -7
  119. package/shared/localization/locales/hu.json +235 -7
  120. package/shared/localization/locales/id.json +234 -0
  121. package/shared/localization/locales/it.json +238 -10
  122. package/shared/localization/locales/ja.json +234 -6
  123. package/shared/localization/locales/ko.json +235 -16
  124. package/shared/localization/locales/lt.json +235 -7
  125. package/shared/localization/locales/lv.json +236 -8
  126. package/shared/localization/locales/nl.json +235 -4
  127. package/shared/localization/locales/no.json +235 -7
  128. package/shared/localization/locales/pl.json +236 -8
  129. package/shared/localization/locales/pt-PT.json +235 -1
  130. package/shared/localization/locales/pt.json +235 -1
  131. package/shared/localization/locales/ro.json +234 -0
  132. package/shared/localization/locales/ru.json +235 -1
  133. package/shared/localization/locales/sk.json +235 -1
  134. package/shared/localization/locales/sl.json +236 -2
  135. package/shared/localization/locales/sr-Latn.json +235 -1
  136. package/shared/localization/locales/sr.json +235 -1
  137. package/shared/localization/locales/sv.json +235 -1
  138. package/shared/localization/locales/ta.json +235 -1
  139. package/shared/localization/locales/te.json +237 -3
  140. package/shared/localization/locales/th.json +235 -1
  141. package/shared/localization/locales/tr.json +236 -2
  142. package/shared/localization/locales/uk.json +235 -1
  143. package/shared/localization/locales/vi.json +236 -2
  144. package/shared/localization/locales/zh-HK.json +235 -1
  145. package/shared/localization/locales/zh-TW.json +236 -2
  146. package/shared/localization/locales/zh.json +234 -0
  147. package/types/artifacts.d.ts +2 -1
@@ -20,7 +20,7 @@ async function getComputationDataParamsFromDevtoolsLog(data, context) {
20
20
  throw new Error(`Lantern metrics can only be computed on navigations`);
21
21
  }
22
22
 
23
- const graph = await PageDependencyGraph.request(data, context);
23
+ const graph = await PageDependencyGraph.request({...data, fromTrace: false}, context);
24
24
  const processedNavigation = await ProcessedNavigation.request(data.trace, context);
25
25
  const simulator = data.simulator || (await LoadSimulator.request(data, context));
26
26
 
@@ -40,6 +40,6 @@ class LanternSpeedIndex extends Lantern.Metrics.SpeedIndex {
40
40
 
41
41
  const LanternSpeedIndexComputed = makeComputedArtifact(
42
42
  LanternSpeedIndex,
43
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
43
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
44
44
  );
45
45
  export {LanternSpeedIndexComputed as LanternSpeedIndex};
@@ -35,6 +35,6 @@ class LanternTotalBlockingTime extends Lantern.Metrics.TotalBlockingTime {
35
35
 
36
36
  const LanternTotalBlockingTimeComputed = makeComputedArtifact(
37
37
  LanternTotalBlockingTime,
38
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
38
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
39
39
  );
40
40
  export {LanternTotalBlockingTimeComputed as LanternTotalBlockingTime};
@@ -40,6 +40,6 @@ class LargestContentfulPaintAllFrames extends NavigationMetric {
40
40
 
41
41
  const LargestContentfulPaintAllFramesComputed = makeComputedArtifact(
42
42
  LargestContentfulPaintAllFrames,
43
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
43
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
44
44
  );
45
45
  export {LargestContentfulPaintAllFramesComputed as LargestContentfulPaintAllFrames};
@@ -47,6 +47,6 @@ class LargestContentfulPaint extends NavigationMetric {
47
47
 
48
48
  const LargestContentfulPaintComputed = makeComputedArtifact(
49
49
  LargestContentfulPaint,
50
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
50
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
51
51
  );
52
52
  export {LargestContentfulPaintComputed as LargestContentfulPaint};
@@ -52,7 +52,7 @@ class LCPBreakdown {
52
52
 
53
53
  const LCPBreakdownComputed = makeComputedArtifact(
54
54
  LCPBreakdown,
55
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
55
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
56
56
  );
57
57
  export {LCPBreakdownComputed as LCPBreakdown};
58
58
 
@@ -40,6 +40,6 @@ class MaxPotentialFID extends NavigationMetric {
40
40
 
41
41
  const MaxPotentialFIDComputed = makeComputedArtifact(
42
42
  MaxPotentialFID,
43
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
43
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
44
44
  );
45
45
  export {MaxPotentialFIDComputed as MaxPotentialFID};
@@ -34,6 +34,8 @@ class Metric {
34
34
  gatherContext: data.gatherContext,
35
35
  settings: data.settings,
36
36
  URL: data.URL,
37
+ SourceMaps: data.SourceMaps,
38
+ simulator: null,
37
39
  };
38
40
  }
39
41
 
@@ -35,6 +35,6 @@ class SpeedIndex extends NavigationMetric {
35
35
 
36
36
  const SpeedIndexComputed = makeComputedArtifact(
37
37
  SpeedIndex,
38
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
38
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
39
39
  );
40
40
  export {SpeedIndexComputed as SpeedIndex};
@@ -58,6 +58,6 @@ class TimeToFirstByte extends NavigationMetric {
58
58
 
59
59
  const TimeToFirstByteComputed = makeComputedArtifact(
60
60
  TimeToFirstByte,
61
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
61
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
62
62
  );
63
63
  export {TimeToFirstByteComputed as TimeToFirstByte};
@@ -6,6 +6,7 @@ declare const TimingSummaryComputed: typeof TimingSummary & {
6
6
  gatherContext: LH.Artifacts["GatherContext"];
7
7
  settings: LH.Util.ImmutableObject<LH.Config.Settings>;
8
8
  URL: LH.Artifacts["URL"];
9
+ SourceMaps: LH.Artifacts["SourceMaps"];
9
10
  }, context: LH.Artifacts.ComputedContext) => ReturnType<typeof TimingSummary.compute_>;
10
11
  };
11
12
  declare class TimingSummary {
@@ -15,15 +16,16 @@ declare class TimingSummary {
15
16
  * @param {LH.Artifacts['GatherContext']} gatherContext
16
17
  * @param {LH.Util.ImmutableObject<LH.Config.Settings>} settings
17
18
  * @param {LH.Artifacts['URL']} URL
19
+ * @param {LH.Artifacts['SourceMaps']} SourceMaps
18
20
  * @param {LH.Artifacts.ComputedContext} context
19
21
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
20
22
  */
21
- static summarize(trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts["GatherContext"], settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts["URL"], context: LH.Artifacts.ComputedContext): Promise<{
23
+ static summarize(trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts["GatherContext"], settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts["URL"], SourceMaps: LH.Artifacts["SourceMaps"], context: LH.Artifacts.ComputedContext): Promise<{
22
24
  metrics: LH.Artifacts.TimingSummary;
23
25
  debugInfo: Record<string, boolean>;
24
26
  }>;
25
27
  /**
26
- * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL']}} data
28
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps']}} data
27
29
  * @param {LH.Artifacts.ComputedContext} context
28
30
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
29
31
  */
@@ -33,6 +35,7 @@ declare class TimingSummary {
33
35
  gatherContext: LH.Artifacts["GatherContext"];
34
36
  settings: LH.Util.ImmutableObject<LH.Config.Settings>;
35
37
  URL: LH.Artifacts["URL"];
38
+ SourceMaps: LH.Artifacts["SourceMaps"];
36
39
  }, context: LH.Artifacts.ComputedContext): Promise<{
37
40
  metrics: LH.Artifacts.TimingSummary;
38
41
  debugInfo: Record<string, boolean>;
@@ -27,11 +27,14 @@ class TimingSummary {
27
27
  * @param {LH.Artifacts['GatherContext']} gatherContext
28
28
  * @param {LH.Util.ImmutableObject<LH.Config.Settings>} settings
29
29
  * @param {LH.Artifacts['URL']} URL
30
+ * @param {LH.Artifacts['SourceMaps']} SourceMaps
30
31
  * @param {LH.Artifacts.ComputedContext} context
31
32
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
32
33
  */
33
- static async summarize(trace, devtoolsLog, gatherContext, settings, URL, context) {
34
- const metricComputationData = {trace, devtoolsLog, gatherContext, settings, URL};
34
+ static async summarize(trace, devtoolsLog, gatherContext, settings, URL, SourceMaps, context) {
35
+ const metricComputationData =
36
+ {trace, devtoolsLog, gatherContext, settings, URL, SourceMaps, simulator: null};
37
+
35
38
  /**
36
39
  * @template TArtifacts
37
40
  * @template TReturn
@@ -135,7 +138,7 @@ class TimingSummary {
135
138
  return {metrics, debugInfo};
136
139
  }
137
140
  /**
138
- * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL']}} data
141
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps']}} data
139
142
  * @param {LH.Artifacts.ComputedContext} context
140
143
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
141
144
  */
@@ -146,6 +149,7 @@ class TimingSummary {
146
149
  data.gatherContext,
147
150
  data.settings,
148
151
  data.URL,
152
+ data.SourceMaps,
149
153
  context
150
154
  );
151
155
  }
@@ -153,6 +157,6 @@ class TimingSummary {
153
157
 
154
158
  const TimingSummaryComputed = makeComputedArtifact(
155
159
  TimingSummary,
156
- ['devtoolsLog', 'gatherContext', 'settings', 'trace', 'URL']
160
+ ['devtoolsLog', 'gatherContext', 'settings', 'trace', 'URL', 'SourceMaps']
157
161
  );
158
162
  export {TimingSummaryComputed as TimingSummary};
@@ -71,6 +71,6 @@ class TotalBlockingTime extends ComputedMetric {
71
71
 
72
72
  const TotalBlockingTimeComputed = makeComputedArtifact(
73
73
  TotalBlockingTime,
74
- ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
74
+ ['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
75
75
  );
76
76
  export {TotalBlockingTimeComputed as TotalBlockingTime};
@@ -3,6 +3,7 @@ declare const NavigationInsightsComputed: typeof NavigationInsights & {
3
3
  request: (dependencies: {
4
4
  trace: LH.Trace;
5
5
  settings: LH.Audit.Context["settings"];
6
+ SourceMaps: LH.Artifacts["SourceMaps"];
6
7
  }, context: LH.Artifacts.ComputedContext) => ReturnType<typeof NavigationInsights.compute_>;
7
8
  };
8
9
  /**
@@ -11,12 +12,13 @@ declare const NavigationInsightsComputed: typeof NavigationInsights & {
11
12
  */
12
13
  declare class NavigationInsights {
13
14
  /**
14
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
15
+ * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
15
16
  * @param {LH.Artifacts.ComputedContext} context
16
17
  */
17
18
  static compute_(data: {
18
19
  trace: LH.Trace;
19
20
  settings: LH.Audit.Context["settings"];
21
+ SourceMaps: LH.Artifacts["SourceMaps"];
20
22
  }, context: LH.Artifacts.ComputedContext): Promise<import("@paulirish/trace_engine/models/trace/insights/types.js").InsightSet>;
21
23
  }
22
24
  //# sourceMappingURL=navigation-insights.d.ts.map
@@ -14,13 +14,14 @@ import {TraceEngineResult} from './trace-engine-result.js';
14
14
  */
15
15
  class NavigationInsights {
16
16
  /**
17
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
17
+ * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
18
18
  * @param {LH.Artifacts.ComputedContext} context
19
19
  */
20
20
  static async compute_(data, context) {
21
- const {trace, settings} = data;
21
+ const {trace, settings, SourceMaps} = data;
22
22
  const processedTrace = await ProcessedTrace.request(trace, context);
23
- const traceEngineResult = await TraceEngineResult.request({trace, settings}, context);
23
+ const traceEngineResult =
24
+ await TraceEngineResult.request({trace, settings, SourceMaps}, context);
24
25
 
25
26
  const navigationId = processedTrace.timeOriginEvt.args.data?.navigationId;
26
27
  if (!navigationId) throw new Error('No navigationId found');
@@ -32,5 +33,6 @@ class NavigationInsights {
32
33
  }
33
34
  }
34
35
 
35
- const NavigationInsightsComputed = makeComputedArtifact(NavigationInsights, ['trace', 'settings']);
36
+ const NavigationInsightsComputed =
37
+ makeComputedArtifact(NavigationInsights, ['trace', 'settings', 'SourceMaps']);
36
38
  export {NavigationInsightsComputed as NavigationInsights};
@@ -5,12 +5,13 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
5
5
  devtoolsLog: LH.DevtoolsLog;
6
6
  settings: LH.Audit.Context["settings"];
7
7
  URL: LH.Artifacts["URL"];
8
- fromTrace?: boolean;
8
+ SourceMaps: LH.Artifacts["SourceMaps"];
9
+ fromTrace: boolean;
9
10
  }, context: LH.Artifacts.ComputedContext) => ReturnType<typeof PageDependencyGraph.compute_>;
10
11
  };
11
12
  declare class PageDependencyGraph {
12
13
  /**
13
- * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], fromTrace?: boolean}} data
14
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], fromTrace: boolean}} data
14
15
  * @param {LH.Artifacts.ComputedContext} context
15
16
  * @return {Promise<LH.Gatherer.Simulation.GraphNode>}
16
17
  */
@@ -19,7 +20,8 @@ declare class PageDependencyGraph {
19
20
  devtoolsLog: LH.DevtoolsLog;
20
21
  settings: LH.Audit.Context["settings"];
21
22
  URL: LH.Artifacts["URL"];
22
- fromTrace?: boolean;
23
+ SourceMaps: LH.Artifacts["SourceMaps"];
24
+ fromTrace: boolean;
23
25
  }, context: LH.Artifacts.ComputedContext): Promise<LH.Gatherer.Simulation.GraphNode>;
24
26
  }
25
27
  //# sourceMappingURL=page-dependency-graph.d.ts.map
@@ -13,19 +13,20 @@ import {TraceEngineResult} from './trace-engine-result.js';
13
13
 
14
14
  class PageDependencyGraph {
15
15
  /**
16
- * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], fromTrace?: boolean}} data
16
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], fromTrace: boolean}} data
17
17
  * @param {LH.Artifacts.ComputedContext} context
18
18
  * @return {Promise<LH.Gatherer.Simulation.GraphNode>}
19
19
  */
20
20
  static async compute_(data, context) {
21
- const {trace, settings, devtoolsLog, URL} = data;
21
+ const {trace, settings, devtoolsLog, URL, SourceMaps} = data;
22
22
  const [{mainThreadEvents}, networkRecords] = await Promise.all([
23
23
  ProcessedTrace.request(trace, context),
24
24
  NetworkRecords.request(devtoolsLog, context),
25
25
  ]);
26
26
 
27
27
  if (data.fromTrace) {
28
- const traceEngineResult = await TraceEngineResult.request({trace, settings}, context);
28
+ const traceEngineResult =
29
+ await TraceEngineResult.request({trace, settings, SourceMaps}, context);
29
30
  const traceEngineData = traceEngineResult.data;
30
31
  const requests =
31
32
  Lantern.TraceEngineComputationData.createNetworkRequests(trace, traceEngineData);
@@ -41,5 +42,5 @@ class PageDependencyGraph {
41
42
  }
42
43
 
43
44
  const PageDependencyGraphComputed = makeComputedArtifact(PageDependencyGraph,
44
- ['devtoolsLog', 'settings', 'trace', 'URL', 'fromTrace']);
45
+ ['devtoolsLog', 'settings', 'trace', 'URL', 'SourceMaps', 'fromTrace']);
45
46
  export {PageDependencyGraphComputed as PageDependencyGraph};
@@ -239,6 +239,6 @@ class TBTImpactTasks {
239
239
 
240
240
  const TBTImpactTasksComputed = makeComputedArtifact(
241
241
  TBTImpactTasks,
242
- ['trace', 'devtoolsLog', 'URL', 'gatherContext', 'settings', 'simulator']
242
+ ['trace', 'devtoolsLog', 'URL', 'SourceMaps', 'gatherContext', 'settings', 'simulator']
243
243
  );
244
244
  export {TBTImpactTasksComputed as TBTImpactTasks};
@@ -3,6 +3,7 @@ declare const TraceEngineResultComputed: typeof TraceEngineResult & {
3
3
  request: (dependencies: {
4
4
  trace: LH.Trace;
5
5
  settings: LH.Audit.Context["settings"];
6
+ SourceMaps: LH.Artifacts["SourceMaps"];
6
7
  }, context: LH.Artifacts.ComputedContext) => ReturnType<typeof TraceEngineResult.compute_>;
7
8
  };
8
9
  /**
@@ -12,9 +13,10 @@ declare class TraceEngineResult {
12
13
  /**
13
14
  * @param {LH.TraceEvent[]} traceEvents
14
15
  * @param {LH.Audit.Context['settings']} settings
16
+ * @param {LH.Artifacts['SourceMaps']} SourceMaps
15
17
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
16
18
  */
17
- static runTraceEngine(traceEvents: LH.TraceEvent[], settings: LH.Audit.Context["settings"]): Promise<LH.Artifacts.TraceEngineResult>;
19
+ static runTraceEngine(traceEvents: LH.TraceEvent[], settings: LH.Audit.Context["settings"], SourceMaps: LH.Artifacts["SourceMaps"]): Promise<LH.Artifacts.TraceEngineResult>;
18
20
  /**
19
21
  * Adapts the given DevTools function that returns a localized string to one
20
22
  * that returns a LH.IcuMessage.
@@ -47,13 +49,14 @@ declare class TraceEngineResult {
47
49
  */
48
50
  static localizeInsights(insightSets: import("@paulirish/trace_engine/models/trace/insights/types.js").TraceInsightSets): void;
49
51
  /**
50
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
52
+ * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
51
53
  * @param {LH.Artifacts.ComputedContext} context
52
54
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
53
55
  */
54
56
  static compute_(data: {
55
57
  trace: LH.Trace;
56
58
  settings: LH.Audit.Context["settings"];
59
+ SourceMaps: LH.Artifacts["SourceMaps"];
57
60
  }, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.TraceEngineResult>;
58
61
  }
59
62
  import * as LH from '../../types/lh.js';
@@ -11,6 +11,7 @@ import * as TraceEngine from '../lib/trace-engine.js';
11
11
  import {makeComputedArtifact} from './computed-artifact.js';
12
12
  import {CumulativeLayoutShift} from './metrics/cumulative-layout-shift.js';
13
13
  import {ProcessedTrace} from './processed-trace.js';
14
+ import SDK from '../lib/cdt/SDK.js';
14
15
  import * as LH from '../../types/lh.js';
15
16
 
16
17
  /**
@@ -20,9 +21,10 @@ class TraceEngineResult {
20
21
  /**
21
22
  * @param {LH.TraceEvent[]} traceEvents
22
23
  * @param {LH.Audit.Context['settings']} settings
24
+ * @param {LH.Artifacts['SourceMaps']} SourceMaps
23
25
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
24
26
  */
25
- static async runTraceEngine(traceEvents, settings) {
27
+ static async runTraceEngine(traceEvents, settings, SourceMaps) {
26
28
  const processor = new TraceEngine.TraceProcessor(TraceEngine.TraceHandlers);
27
29
 
28
30
  const lanternSettings = {};
@@ -47,6 +49,16 @@ class TraceEngineResult {
47
49
  },
48
50
  },
49
51
  lanternSettings,
52
+ async resolveSourceMap(params) {
53
+ const sourceMap = SourceMaps.find(sm => sm.scriptId === params.scriptId);
54
+ if (!sourceMap) {
55
+ return null;
56
+ }
57
+
58
+ const compiledUrl = sourceMap.scriptUrl || 'compiled.js';
59
+ const mapUrl = sourceMap.sourceMapUrl || 'compiled.js.map';
60
+ return new SDK.SourceMap(compiledUrl, mapUrl, sourceMap.map);
61
+ },
50
62
  });
51
63
  if (!processor.parsedTrace) throw new Error('No data');
52
64
  if (!processor.insights) throw new Error('No insights');
@@ -199,7 +211,7 @@ class TraceEngineResult {
199
211
  }
200
212
 
201
213
  /**
202
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
214
+ * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
203
215
  * @param {LH.Artifacts.ComputedContext} context
204
216
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
205
217
  */
@@ -229,10 +241,12 @@ class TraceEngineResult {
229
241
  }
230
242
  }
231
243
 
232
- const result = await TraceEngineResult.runTraceEngine(traceEvents, data.settings);
244
+ const result =
245
+ await TraceEngineResult.runTraceEngine(traceEvents, data.settings, data.SourceMaps);
233
246
  return result;
234
247
  }
235
248
  }
236
249
 
237
- const TraceEngineResultComputed = makeComputedArtifact(TraceEngineResult, ['trace', 'settings']);
250
+ const TraceEngineResultComputed =
251
+ makeComputedArtifact(TraceEngineResult, ['trace', 'settings', 'SourceMaps']);
238
252
  export {TraceEngineResultComputed as TraceEngineResult};
@@ -7,7 +7,7 @@ export type WasteData = {
7
7
  export type ComputeInput = {
8
8
  scriptId: string;
9
9
  scriptCoverage: Omit<LH.Crdp.Profiler.ScriptCoverage, "url">;
10
- bundle?: LH.Artifacts.Bundle | undefined;
10
+ bundle: LH.Artifacts.Bundle | null;
11
11
  };
12
12
  export type Summary = {
13
13
  scriptId: string;
@@ -32,7 +32,7 @@ declare const UnusedJavascriptSummaryComputed: typeof UnusedJavascriptSummary &
32
32
  * @typedef ComputeInput
33
33
  * @property {string} scriptId
34
34
  * @property {Omit<LH.Crdp.Profiler.ScriptCoverage, 'url'>} scriptCoverage
35
- * @property {LH.Artifacts.Bundle=} bundle
35
+ * @property {LH.Artifacts.Bundle|null} bundle
36
36
  */
37
37
  /**
38
38
  * @typedef Summary
@@ -16,7 +16,7 @@ import {makeComputedArtifact} from './computed-artifact.js';
16
16
  * @typedef ComputeInput
17
17
  * @property {string} scriptId
18
18
  * @property {Omit<LH.Crdp.Profiler.ScriptCoverage, 'url'>} scriptCoverage
19
- * @property {LH.Artifacts.Bundle=} bundle
19
+ * @property {LH.Artifacts.Bundle|null} bundle
20
20
  */
21
21
 
22
22
  /**
@@ -312,7 +312,7 @@ 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
+ 'insights/duplicated-javascript-insight',
316
316
  'insights/font-display-insight',
317
317
  'insights/forced-reflow-insight',
318
318
  'insights/image-delivery-insight',
@@ -323,6 +323,7 @@ const defaultConfig = {
323
323
  'insights/render-blocking-insight',
324
324
  'insights/slow-css-selector-insight',
325
325
  'insights/third-parties-insight',
326
+ 'insights/use-cache-insight',
326
327
  'insights/viewport-insight',
327
328
  ],
328
329
  groups: {
@@ -411,7 +412,7 @@ const defaultConfig = {
411
412
  {id: 'cls-culprits-insight', weight: 0, group: 'hidden'},
412
413
  {id: 'document-latency-insight', weight: 0, group: 'hidden'},
413
414
  {id: 'dom-size-insight', weight: 0, group: 'hidden'},
414
- {id: 'duplicate-javascript-insight', weight: 0, group: 'hidden'},
415
+ {id: 'duplicated-javascript-insight', weight: 0, group: 'hidden'},
415
416
  {id: 'font-display-insight', weight: 0, group: 'hidden'},
416
417
  {id: 'forced-reflow-insight', weight: 0, group: 'hidden'},
417
418
  {id: 'image-delivery-insight', weight: 0, group: 'hidden'},
@@ -422,6 +423,7 @@ const defaultConfig = {
422
423
  {id: 'render-blocking-insight', weight: 0, group: 'hidden'},
423
424
  {id: 'slow-css-selector-insight', weight: 0, group: 'hidden'},
424
425
  {id: 'third-parties-insight', weight: 0, group: 'hidden'},
426
+ {id: 'use-cache-insight', weight: 0, group: 'hidden'},
425
427
  {id: 'viewport-insight', weight: 0, group: 'hidden'},
426
428
 
427
429
  // These are our "invisible" metrics. Not displayed, but still in the LHR.
@@ -30,7 +30,7 @@ const config = {
30
30
  {id: 'cls-culprits-insight', weight: 0, group: 'insights'},
31
31
  {id: 'document-latency-insight', weight: 0, group: 'insights'},
32
32
  {id: 'dom-size-insight', weight: 0, group: 'insights'},
33
- {id: 'duplicate-javascript-insight', weight: 0, group: 'insights'},
33
+ {id: 'duplicated-javascript-insight', weight: 0, group: 'insights'},
34
34
  {id: 'font-display-insight', weight: 0, group: 'insights'},
35
35
  {id: 'forced-reflow-insight', weight: 0, group: 'insights'},
36
36
  {id: 'image-delivery-insight', weight: 0, group: 'insights'},
@@ -41,6 +41,7 @@ const config = {
41
41
  {id: 'render-blocking-insight', weight: 0, group: 'insights'},
42
42
  {id: 'slow-css-selector-insight', weight: 0, group: 'insights'},
43
43
  {id: 'third-parties-insight', weight: 0, group: 'insights'},
44
+ {id: 'use-cache-insight', weight: 0, group: 'insights'},
44
45
  {id: 'viewport-insight', weight: 0, group: 'insights'},
45
46
  ],
46
47
  },
@@ -3,6 +3,7 @@ export default SourceMaps;
3
3
  * @fileoverview Gets JavaScript source maps.
4
4
  */
5
5
  declare class SourceMaps extends BaseGatherer {
6
+ static symbol: symbol;
6
7
  /** @type {LH.Gatherer.GathererMeta<'Scripts'>} */
7
8
  meta: LH.Gatherer.GathererMeta<"Scripts">;
8
9
  /**
@@ -12,8 +12,11 @@ import Scripts from './scripts.js';
12
12
  * @fileoverview Gets JavaScript source maps.
13
13
  */
14
14
  class SourceMaps extends BaseGatherer {
15
+ static symbol = Symbol('SourceMaps');
16
+
15
17
  /** @type {LH.Gatherer.GathererMeta<'Scripts'>} */
16
18
  meta = {
19
+ symbol: SourceMaps.symbol,
17
20
  supportedModes: ['timespan', 'navigation'],
18
21
  dependencies: {Scripts: Scripts.symbol},
19
22
  };
@@ -56,8 +56,8 @@ declare class TraceElements extends BaseGatherer {
56
56
  nodeId: number;
57
57
  type: string;
58
58
  } | undefined>;
59
- /** @type {LH.Gatherer.GathererMeta<'Trace'>} */
60
- meta: LH.Gatherer.GathererMeta<"Trace">;
59
+ /** @type {LH.Gatherer.GathererMeta<'Trace'|'SourceMaps'>} */
60
+ meta: LH.Gatherer.GathererMeta<"Trace" | "SourceMaps">;
61
61
  /** @type {Map<string, string>} */
62
62
  animationIdToName: Map<string, string>;
63
63
  /** @param {LH.Crdp.Animation.AnimationStartedEvent} args */
@@ -82,10 +82,10 @@ declare class TraceElements extends BaseGatherer {
82
82
  */
83
83
  getNodeDetails(session: LH.Gatherer.ProtocolSession, backendNodeId: number): Promise<import("devtools-protocol").Protocol.Runtime.CallFunctionOnResponse | null>;
84
84
  /**
85
- * @param {LH.Gatherer.Context<'Trace'|'RootCauses'>} context
85
+ * @param {LH.Gatherer.Context<'Trace'|'RootCauses'|'SourceMaps'>} context
86
86
  * @return {Promise<LH.Artifacts.TraceElement[]>}
87
87
  */
88
- getArtifact(context: LH.Gatherer.Context<"Trace" | "RootCauses">): Promise<LH.Artifacts.TraceElement[]>;
88
+ getArtifact(context: LH.Gatherer.Context<"Trace" | "RootCauses" | "SourceMaps">): Promise<LH.Artifacts.TraceElement[]>;
89
89
  }
90
90
  import BaseGatherer from '../base-gatherer.js';
91
91
  //# sourceMappingURL=trace-elements.d.ts.map
@@ -24,6 +24,7 @@ import {Responsiveness} from '../../computed/metrics/responsiveness.js';
24
24
  import {CumulativeLayoutShift} from '../../computed/metrics/cumulative-layout-shift.js';
25
25
  import {ExecutionContext} from '../driver/execution-context.js';
26
26
  import {TraceEngineResult} from '../../computed/trace-engine-result.js';
27
+ import SourceMaps from './source-maps.js';
27
28
 
28
29
  /** @typedef {{nodeId: number, animations?: {name?: string, failureReasonsMask?: number, unsupportedProperties?: string[]}[], type?: string}} TraceElementData */
29
30
 
@@ -45,10 +46,10 @@ function getNodeDetailsData() {
45
46
  /* c8 ignore stop */
46
47
 
47
48
  class TraceElements extends BaseGatherer {
48
- /** @type {LH.Gatherer.GathererMeta<'Trace'>} */
49
+ /** @type {LH.Gatherer.GathererMeta<'Trace'|'SourceMaps'>} */
49
50
  meta = {
50
51
  supportedModes: ['timespan', 'navigation'],
51
- dependencies: {Trace: Trace.symbol},
52
+ dependencies: {Trace: Trace.symbol, SourceMaps: SourceMaps.symbol},
52
53
  };
53
54
 
54
55
  /** @type {Map<string, string>} */
@@ -379,15 +380,17 @@ class TraceElements extends BaseGatherer {
379
380
  }
380
381
 
381
382
  /**
382
- * @param {LH.Gatherer.Context<'Trace'|'RootCauses'>} context
383
+ * @param {LH.Gatherer.Context<'Trace'|'RootCauses'|'SourceMaps'>} context
383
384
  * @return {Promise<LH.Artifacts.TraceElement[]>}
384
385
  */
385
386
  async getArtifact(context) {
386
387
  const session = context.driver.defaultSession;
387
388
 
388
389
  const trace = context.dependencies.Trace;
390
+ const SourceMaps = context.dependencies.SourceMaps;
389
391
  const settings = context.settings;
390
- const traceEngineResult = await TraceEngineResult.request({trace, settings}, context);
392
+ const traceEngineResult =
393
+ await TraceEngineResult.request({trace, settings, SourceMaps}, context);
391
394
  const rootCauses = context.dependencies.RootCauses;
392
395
 
393
396
  const processedTrace = await ProcessedTrace.request(trace, context);
@@ -59,6 +59,11 @@ class Trace extends BaseGatherer {
59
59
  // For CLS root causes.
60
60
  'disabled-by-default-devtools.timeline.invalidationTracking',
61
61
 
62
+ // Enhanced traces.
63
+ 'disabled-by-default-devtools.target-rundown',
64
+ 'disabled-by-default-devtools.v8-source-rundown-sources',
65
+ 'disabled-by-default-devtools.v8-source-rundown',
66
+
62
67
  // Not used by Lighthouse (yet) but included for users that want JS samples when looking at
63
68
  // a trace collected by Lighthouse (e.g. "View Trace" workflow in DevTools)
64
69
  // TODO: Re-enable after investigating b/325659693
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "12.4.0-dev.20250318",
4
+ "version": "12.4.0-dev.20250320",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {
@@ -185,7 +185,7 @@
185
185
  "webtreemap-cdt": "^3.2.1"
186
186
  },
187
187
  "dependencies": {
188
- "@paulirish/trace_engine": "0.0.48",
188
+ "@paulirish/trace_engine": "0.0.50",
189
189
  "@sentry/node": "^7.0.0",
190
190
  "axe-core": "^4.10.2",
191
191
  "chrome-launcher": "^1.1.2",