lighthouse 13.6.0-dev.20261112 → 13.6.0-dev.20261117

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 (152) hide show
  1. package/.agents/skills/update-ard-port/SKILL.md +1 -1
  2. package/cli/bin.js +8 -3
  3. package/cli/open-file.js +1 -1
  4. package/cli/printer.js +1 -1
  5. package/cli/run.d.ts +7 -0
  6. package/cli/run.js +42 -5
  7. package/cli/sentry-prompt.js +2 -1
  8. package/cli/test/smokehouse/frontends/smokehouse-bin.js +1 -1
  9. package/cli/test/smokehouse/lighthouse-runners/cli.js +1 -2
  10. package/cli/test/smokehouse/report-assert.js +1 -2
  11. package/cli/test/smokehouse/smokehouse.js +1 -2
  12. package/core/audits/autocomplete.js +1 -2
  13. package/core/audits/baseline.d.ts +3 -0
  14. package/core/audits/bootup-time.js +1 -2
  15. package/core/audits/errors-in-console.js +1 -2
  16. package/core/audits/mainthread-work-breakdown.js +1 -2
  17. package/core/audits/metrics.d.ts +2 -2
  18. package/core/audits/metrics.js +1 -1
  19. package/core/computed/computed-artifact.js +1 -2
  20. package/core/computed/entity-classification.d.ts +3 -3
  21. package/core/computed/entity-classification.js +5 -3
  22. package/core/computed/js-bundles.js +1 -2
  23. package/core/computed/lcp-network-record.js +1 -1
  24. package/core/computed/load-simulator.d.ts +5 -3
  25. package/core/computed/load-simulator.js +9 -2
  26. package/core/computed/metrics/lcp-breakdown.d.ts +19 -0
  27. package/core/computed/metrics/lcp-breakdown.js +71 -8
  28. package/core/computed/metrics/responsiveness.d.ts +5 -3
  29. package/core/computed/metrics/responsiveness.js +1 -1
  30. package/core/computed/metrics/time-to-first-byte.js +3 -1
  31. package/core/computed/metrics/timing-summary.d.ts +7 -5
  32. package/core/computed/metrics/timing-summary.js +3 -4
  33. package/core/computed/navigation-insights.d.ts +5 -3
  34. package/core/computed/navigation-insights.js +1 -1
  35. package/core/computed/network-analysis.js +1 -2
  36. package/core/computed/page-dependency-graph.d.ts +5 -3
  37. package/core/computed/page-dependency-graph.js +5 -2
  38. package/core/computed/trace-engine-result.d.ts +7 -5
  39. package/core/computed/trace-engine-result.js +9 -14
  40. package/core/computed/unused-css.d.ts +2 -2
  41. package/core/computed/unused-css.js +1 -1
  42. package/core/config/config.js +1 -2
  43. package/core/gather/base-artifacts.js +1 -2
  44. package/core/gather/driver/environment.js +1 -2
  45. package/core/gather/driver/navigation.js +1 -2
  46. package/core/gather/driver/network-monitor.js +1 -2
  47. package/core/gather/driver/prepare.js +1 -2
  48. package/core/gather/driver/storage.js +1 -2
  49. package/core/gather/driver/target-manager.js +1 -2
  50. package/core/gather/driver/wait-for-condition.js +1 -2
  51. package/core/gather/driver.js +1 -2
  52. package/core/gather/gatherers/agentic/ard.js +1 -1
  53. package/core/gather/gatherers/agentic/llms-txt.js +1 -2
  54. package/core/gather/gatherers/image-elements.js +1 -2
  55. package/core/gather/gatherers/seo/robots-txt.js +1 -2
  56. package/core/gather/gatherers/stacks.js +1 -2
  57. package/core/gather/gatherers/stylesheets.js +1 -2
  58. package/core/gather/navigation-runner.js +1 -1
  59. package/core/gather/runner-helpers.js +1 -2
  60. package/core/gather/session.js +1 -2
  61. package/core/gather/snapshot-runner.js +1 -2
  62. package/core/gather/timespan-runner.js +1 -2
  63. package/core/lib/asset-saver.js +1 -2
  64. package/core/lib/baseline/web-features-data.json +12 -3
  65. package/core/lib/baseline/web-features-metadata.json +1 -1
  66. package/core/lib/csp-evaluator.js +1 -1
  67. package/core/lib/deprecations-strings.d.ts +0 -2
  68. package/core/lib/deprecations-strings.js +1 -18
  69. package/core/lib/i18n/i18n.js +1 -2
  70. package/core/lib/lighthouse-logger.d.ts +127 -0
  71. package/core/lib/lighthouse-logger.js +319 -0
  72. package/core/lib/median-run.d.ts +16 -6
  73. package/core/lib/median-run.js +13 -6
  74. package/core/lib/network-recorder.js +1 -2
  75. package/core/lib/network-request.d.ts +2 -2
  76. package/core/lib/network-request.js +1 -1
  77. package/core/lib/page-functions.js +2 -2
  78. package/core/lib/script-helpers.d.ts +23 -8
  79. package/core/lib/script-helpers.js +7 -6
  80. package/core/lib/sentry-reporter.d.ts +59 -0
  81. package/core/lib/sentry-reporter.js +281 -0
  82. package/core/lib/sentry.d.ts +7 -7
  83. package/core/lib/sentry.js +23 -40
  84. package/core/lib/stack-packs.js +1 -1
  85. package/core/lib/timing-trace-saver.d.ts +2 -2
  86. package/core/lib/timing-trace-saver.js +1 -1
  87. package/core/lib/tracehouse/task-summary.d.ts +16 -4
  88. package/core/lib/tracehouse/task-summary.js +6 -5
  89. package/core/lib/tracehouse/trace-processor.d.ts +6 -6
  90. package/core/lib/tracehouse/trace-processor.js +1 -1
  91. package/core/lib/traces/metric-trace-events.js +1 -2
  92. package/core/lib/url-utils.d.ts +4 -4
  93. package/core/lib/url-utils.js +1 -1
  94. package/core/runner.js +1 -2
  95. package/dist/report/bundle.esm.js +10 -10
  96. package/dist/report/flow.js +12 -12
  97. package/dist/report/standalone.js +11 -11
  98. package/package.json +19 -21
  99. package/report/renderer/text-encoding.d.ts +3 -5
  100. package/report/renderer/text-encoding.js +19 -33
  101. package/report/types/augment-dom.d.ts +0 -4
  102. package/shared/localization/locales/ar-XB.json +3 -0
  103. package/shared/localization/locales/ar.json +3 -0
  104. package/shared/localization/locales/bg.json +3 -0
  105. package/shared/localization/locales/ca.json +75 -72
  106. package/shared/localization/locales/cs.json +3 -0
  107. package/shared/localization/locales/da.json +3 -0
  108. package/shared/localization/locales/de.json +3 -0
  109. package/shared/localization/locales/el.json +3 -0
  110. package/shared/localization/locales/en-GB.json +3 -0
  111. package/shared/localization/locales/es-419.json +3 -0
  112. package/shared/localization/locales/es.json +3 -0
  113. package/shared/localization/locales/fi.json +3 -0
  114. package/shared/localization/locales/fil.json +3 -0
  115. package/shared/localization/locales/fr.json +3 -0
  116. package/shared/localization/locales/he.json +3 -0
  117. package/shared/localization/locales/hi.json +11 -8
  118. package/shared/localization/locales/hr.json +3 -0
  119. package/shared/localization/locales/hu.json +3 -0
  120. package/shared/localization/locales/id.json +3 -0
  121. package/shared/localization/locales/it.json +3 -0
  122. package/shared/localization/locales/ja.json +3 -0
  123. package/shared/localization/locales/ko.json +3 -0
  124. package/shared/localization/locales/lt.json +3 -0
  125. package/shared/localization/locales/lv.json +5 -2
  126. package/shared/localization/locales/nl.json +3 -0
  127. package/shared/localization/locales/no.json +3 -0
  128. package/shared/localization/locales/pl.json +3 -0
  129. package/shared/localization/locales/pt-PT.json +3 -0
  130. package/shared/localization/locales/pt.json +32 -29
  131. package/shared/localization/locales/ro.json +3 -0
  132. package/shared/localization/locales/ru.json +3 -0
  133. package/shared/localization/locales/sk.json +3 -0
  134. package/shared/localization/locales/sl.json +3 -0
  135. package/shared/localization/locales/sr-Latn.json +3 -0
  136. package/shared/localization/locales/sr.json +3 -0
  137. package/shared/localization/locales/sv.json +3 -0
  138. package/shared/localization/locales/ta.json +3 -0
  139. package/shared/localization/locales/te.json +3 -0
  140. package/shared/localization/locales/th.json +3 -0
  141. package/shared/localization/locales/tr.json +3 -0
  142. package/shared/localization/locales/uk.json +3 -0
  143. package/shared/localization/locales/vi.json +3 -0
  144. package/shared/localization/locales/zh-HK.json +3 -0
  145. package/shared/localization/locales/zh-TW.json +3 -0
  146. package/shared/localization/locales/zh.json +3 -0
  147. package/third-party/ard/README.md +1 -1
  148. package/third-party/ard/ard.js +1 -1
  149. package/tsconfig.json +2 -42
  150. package/types/artifacts.d.ts +7 -1
  151. package/types/internal/test.d.ts +5 -0
  152. package/report/types/buffer.d.ts +0 -19
@@ -4,7 +4,9 @@ declare const TimingSummaryComputed: typeof TimingSummary & {
4
4
  trace: LH.Trace;
5
5
  devtoolsLog: LH.DevtoolsLog;
6
6
  gatherContext: LH.Artifacts["GatherContext"];
7
- settings: LH.Util.ImmutableObject<LH.Config.Settings>;
7
+ settings: import("../../index.js").Util.ImmutableObject<Pick<import("../../../types/lhr/settings.js").ConfigSettings, "throttlingMethod"> & Partial<Omit<import("../../../types/lhr/settings.js").ConfigSettings, "throttling">> & {
8
+ throttling?: Partial<import("../../index.js").Config.Settings["throttling"]>;
9
+ }>;
8
10
  URL: LH.Artifacts["URL"];
9
11
  SourceMaps: LH.Artifacts["SourceMaps"];
10
12
  HostDPR: LH.Artifacts["HostDPR"];
@@ -18,19 +20,19 @@ declare class TimingSummary {
18
20
  * @param {LH.Trace} trace
19
21
  * @param {LH.DevtoolsLog} devtoolsLog
20
22
  * @param {LH.Artifacts['GatherContext']} gatherContext
21
- * @param {LH.Util.ImmutableObject<LH.Config.Settings>} settings
23
+ * @param {LH.Artifacts.ComputedSettings} settings
22
24
  * @param {LH.Artifacts['URL']} URL
23
25
  * @param {LH.Artifacts['SourceMaps']} SourceMaps
24
26
  * @param {LH.Artifacts['HostDPR']} HostDPR
25
27
  * @param {LH.Artifacts.ComputedContext} context
26
28
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
27
29
  */
28
- 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"], HostDPR: LH.Artifacts["HostDPR"], context: LH.Artifacts.ComputedContext): Promise<{
30
+ static summarize(trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts["GatherContext"], settings: LH.Artifacts.ComputedSettings, URL: LH.Artifacts["URL"], SourceMaps: LH.Artifacts["SourceMaps"], HostDPR: LH.Artifacts["HostDPR"], context: LH.Artifacts.ComputedContext): Promise<{
29
31
  metrics: LH.Artifacts.TimingSummary;
30
32
  debugInfo: Record<string, boolean>;
31
33
  }>;
32
34
  /**
33
- * @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'], HostDPR: LH.Artifacts['HostDPR']}} data
35
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Artifacts.ComputedSettings, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
34
36
  * @param {LH.Artifacts.ComputedContext} context
35
37
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
36
38
  */
@@ -38,7 +40,7 @@ declare class TimingSummary {
38
40
  trace: LH.Trace;
39
41
  devtoolsLog: LH.DevtoolsLog;
40
42
  gatherContext: LH.Artifacts["GatherContext"];
41
- settings: LH.Util.ImmutableObject<LH.Config.Settings>;
43
+ settings: LH.Artifacts.ComputedSettings;
42
44
  URL: LH.Artifacts["URL"];
43
45
  SourceMaps: LH.Artifacts["SourceMaps"];
44
46
  HostDPR: LH.Artifacts["HostDPR"];
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../lib/lighthouse-logger.js';
9
8
  import {ProcessedTrace} from '../processed-trace.js';
10
9
  import {ProcessedNavigation} from '../processed-navigation.js';
11
10
  import {Speedline} from '../speedline.js';
@@ -28,7 +27,7 @@ class TimingSummary {
28
27
  * @param {LH.Trace} trace
29
28
  * @param {LH.DevtoolsLog} devtoolsLog
30
29
  * @param {LH.Artifacts['GatherContext']} gatherContext
31
- * @param {LH.Util.ImmutableObject<LH.Config.Settings>} settings
30
+ * @param {LH.Artifacts.ComputedSettings} settings
32
31
  * @param {LH.Artifacts['URL']} URL
33
32
  * @param {LH.Artifacts['SourceMaps']} SourceMaps
34
33
  * @param {LH.Artifacts['HostDPR']} HostDPR
@@ -149,7 +148,7 @@ class TimingSummary {
149
148
  return {metrics, debugInfo};
150
149
  }
151
150
  /**
152
- * @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'], HostDPR: LH.Artifacts['HostDPR']}} data
151
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Artifacts.ComputedSettings, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
153
152
  * @param {LH.Artifacts.ComputedContext} context
154
153
  * @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
155
154
  */
@@ -2,7 +2,9 @@ export { NavigationInsightsComputed as NavigationInsights };
2
2
  declare const NavigationInsightsComputed: typeof NavigationInsights & {
3
3
  request: (dependencies: {
4
4
  trace: LH.Trace;
5
- settings: LH.Audit.Context["settings"];
5
+ settings: Partial<import("../index.js").Util.ImmutableObject<Pick<import("../../types/lhr/settings.js").ConfigSettings, "throttlingMethod"> & Partial<Omit<import("../../types/lhr/settings.js").ConfigSettings, "throttling">> & {
6
+ throttling?: Partial<import("../index.js").Config.Settings["throttling"]>;
7
+ }>>;
6
8
  SourceMaps: LH.Artifacts["SourceMaps"];
7
9
  HostDPR: LH.Artifacts["HostDPR"];
8
10
  }, context: LH.Artifacts.ComputedContext) => Promise<import("@paulirish/trace_engine/models/trace/insights/types.js").InsightSet>;
@@ -13,12 +15,12 @@ declare const NavigationInsightsComputed: typeof NavigationInsights & {
13
15
  */
14
16
  declare class NavigationInsights {
15
17
  /**
16
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
18
+ * @param {{trace: LH.Trace, settings: Partial<LH.Artifacts.ComputedSettings>, SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
17
19
  * @param {LH.Artifacts.ComputedContext} context
18
20
  */
19
21
  static compute_(data: {
20
22
  trace: LH.Trace;
21
- settings: LH.Audit.Context["settings"];
23
+ settings: Partial<LH.Artifacts.ComputedSettings>;
22
24
  SourceMaps: LH.Artifacts["SourceMaps"];
23
25
  HostDPR: LH.Artifacts["HostDPR"];
24
26
  }, context: LH.Artifacts.ComputedContext): Promise<import("@paulirish/trace_engine/models/trace/insights/types.js").InsightSet>;
@@ -15,7 +15,7 @@ import {TraceEngineResult} from './trace-engine-result.js';
15
15
  */
16
16
  class NavigationInsights {
17
17
  /**
18
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
18
+ * @param {{trace: LH.Trace, settings: Partial<LH.Artifacts.ComputedSettings>, SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
19
19
  * @param {LH.Artifacts.ComputedContext} context
20
20
  */
21
21
  static async compute_(data, context) {
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../lib/lighthouse-logger.js';
9
8
  import * as Lantern from '../lib/lantern/lantern.js';
10
9
  import {makeComputedArtifact} from './computed-artifact.js';
11
10
  import {NetworkRecords} from './network-records.js';
@@ -3,7 +3,9 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
3
3
  request: (dependencies: {
4
4
  trace: LH.Trace;
5
5
  devtoolsLog: LH.DevtoolsLog;
6
- settings: LH.Audit.Context["settings"];
6
+ settings: Partial<import("../index.js").Util.ImmutableObject<Pick<import("../../types/lhr/settings.js").ConfigSettings, "throttlingMethod"> & Partial<Omit<import("../../types/lhr/settings.js").ConfigSettings, "throttling">> & {
7
+ throttling?: Partial<import("../index.js").Config.Settings["throttling"]>;
8
+ }>>;
7
9
  URL: LH.Artifacts["URL"];
8
10
  SourceMaps: LH.Artifacts["SourceMaps"];
9
11
  HostDPR: LH.Artifacts["HostDPR"];
@@ -12,14 +14,14 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
12
14
  };
13
15
  declare class PageDependencyGraph {
14
16
  /**
15
- * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR'], fromTrace: boolean}} data
17
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: Partial<LH.Artifacts.ComputedSettings>, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR'], fromTrace: boolean}} data
16
18
  * @param {LH.Artifacts.ComputedContext} context
17
19
  * @return {Promise<LH.Gatherer.Simulation.GraphNode>}
18
20
  */
19
21
  static compute_(data: {
20
22
  trace: LH.Trace;
21
23
  devtoolsLog: LH.DevtoolsLog;
22
- settings: LH.Audit.Context["settings"];
24
+ settings: Partial<LH.Artifacts.ComputedSettings>;
23
25
  URL: LH.Artifacts["URL"];
24
26
  SourceMaps: LH.Artifacts["SourceMaps"];
25
27
  HostDPR: LH.Artifacts["HostDPR"];
@@ -13,7 +13,7 @@ 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'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR'], fromTrace: boolean}} data
16
+ * @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: Partial<LH.Artifacts.ComputedSettings>, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR'], fromTrace: boolean}} data
17
17
  * @param {LH.Artifacts.ComputedContext} context
18
18
  * @return {Promise<LH.Gatherer.Simulation.GraphNode>}
19
19
  */
@@ -36,7 +36,10 @@ class PageDependencyGraph {
36
36
  return graph;
37
37
  }
38
38
 
39
- const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest);
39
+ // Exclude data: URIs to match TraceEngine's NetworkRequestsHandler.
40
+ const lanternRequests = networkRecords
41
+ .filter(record => !record.url.startsWith('data:'))
42
+ .map(NetworkRequest.asLanternNetworkRequest);
40
43
  return Lantern.Graph.PageDependencyGraph.createGraph(mainThreadEvents, lanternRequests, URL);
41
44
  }
42
45
  }
@@ -2,7 +2,9 @@ export { TraceEngineResultComputed as TraceEngineResult };
2
2
  declare const TraceEngineResultComputed: typeof TraceEngineResult & {
3
3
  request: (dependencies: {
4
4
  trace: LH.Trace;
5
- settings: LH.Audit.Context["settings"];
5
+ settings: Partial<LH.Util.ImmutableObject<Pick<import("../../types/lhr/settings.js").ConfigSettings, "throttlingMethod"> & Partial<Omit<import("../../types/lhr/settings.js").ConfigSettings, "throttling">> & {
6
+ throttling?: Partial<LH.Config.Settings["throttling"]>;
7
+ }>>;
6
8
  SourceMaps: LH.Artifacts["SourceMaps"];
7
9
  HostDPR: LH.Artifacts["HostDPR"];
8
10
  }, context: LH.Artifacts.ComputedContext) => Promise<LH.Artifacts.TraceEngineResult>;
@@ -13,12 +15,12 @@ declare const TraceEngineResultComputed: typeof TraceEngineResult & {
13
15
  declare class TraceEngineResult {
14
16
  /**
15
17
  * @param {LH.TraceEvent[]} _traceEvents
16
- * @param {LH.Audit.Context['settings']} settings
18
+ * @param {Partial<LH.Artifacts.ComputedSettings>} settings
17
19
  * @param {LH.Artifacts['SourceMaps']} SourceMaps
18
20
  * @param {LH.Artifacts['HostDPR']} HostDPR
19
21
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
20
22
  */
21
- static runTraceEngine(_traceEvents: LH.TraceEvent[], settings: LH.Audit.Context["settings"], SourceMaps: LH.Artifacts["SourceMaps"], HostDPR: LH.Artifacts["HostDPR"]): Promise<LH.Artifacts.TraceEngineResult>;
23
+ static runTraceEngine(_traceEvents: LH.TraceEvent[], settings: Partial<LH.Artifacts.ComputedSettings>, SourceMaps: LH.Artifacts["SourceMaps"], HostDPR: LH.Artifacts["HostDPR"]): Promise<LH.Artifacts.TraceEngineResult>;
22
24
  /**
23
25
  * Adapts the given DevTools function that returns a localized string to one
24
26
  * that returns a LH.IcuMessage.
@@ -51,13 +53,13 @@ declare class TraceEngineResult {
51
53
  */
52
54
  static localizeInsights(insightSets: import("@paulirish/trace_engine/models/trace/insights/types.js").TraceInsightSets): void;
53
55
  /**
54
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
56
+ * @param {{trace: LH.Trace, settings: Partial<LH.Artifacts.ComputedSettings>, SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
55
57
  * @param {LH.Artifacts.ComputedContext} context
56
58
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
57
59
  */
58
60
  static compute_(data: {
59
61
  trace: LH.Trace;
60
- settings: LH.Audit.Context["settings"];
62
+ settings: Partial<LH.Artifacts.ComputedSettings>;
61
63
  SourceMaps: LH.Artifacts["SourceMaps"];
62
64
  HostDPR: LH.Artifacts["HostDPR"];
63
65
  }, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.TraceEngineResult>;
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../lib/lighthouse-logger.js';
9
8
  import * as i18n from '../lib/i18n/i18n.js';
10
9
  import * as Lantern from '../lib/lantern/lantern.js';
11
10
  import * as TraceEngine from '../lib/trace-engine.js';
@@ -21,7 +20,7 @@ import * as LH from '../../types/lh.js';
21
20
  class TraceEngineResult {
22
21
  /**
23
22
  * @param {LH.TraceEvent[]} _traceEvents
24
- * @param {LH.Audit.Context['settings']} settings
23
+ * @param {Partial<LH.Artifacts.ComputedSettings>} settings
25
24
  * @param {LH.Artifacts['SourceMaps']} SourceMaps
26
25
  * @param {LH.Artifacts['HostDPR']} HostDPR
27
26
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
@@ -35,7 +34,12 @@ class TraceEngineResult {
35
34
 
36
35
  const lanternSettings = {};
37
36
  if (settings.throttlingMethod) lanternSettings.throttlingMethod = settings.throttlingMethod;
38
- if (settings.throttling) lanternSettings.throttling = settings.throttling;
37
+ if (settings.throttling) {
38
+ lanternSettings.throttling = {
39
+ ...Lantern.Simulation.Constants.throttling.mobileSlow4G,
40
+ ...settings.throttling,
41
+ };
42
+ }
39
43
  if (settings.precomputedLanternData) {
40
44
  lanternSettings.precomputedLanternData = settings.precomputedLanternData;
41
45
  }
@@ -73,15 +77,6 @@ class TraceEngineResult {
73
77
  const insights = processor.insights;
74
78
  this.localizeInsights(insights);
75
79
 
76
- // Release intermediate handler state retained in module-level TraceHandlers singletons
77
- // and static Lantern simulation node timings after trace processing completes.
78
- for (const handler of Object.values(TraceEngine.TraceHandlers)) {
79
- handler.reset();
80
- }
81
- if (!process.env.LANTERN_DEBUG) {
82
- Lantern.Simulation.Simulator.allNodeTimings.clear();
83
- }
84
-
85
80
  return {data, insights};
86
81
  }
87
82
 
@@ -237,7 +232,7 @@ class TraceEngineResult {
237
232
  }
238
233
 
239
234
  /**
240
- * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
235
+ * @param {{trace: LH.Trace, settings: Partial<LH.Artifacts.ComputedSettings>, SourceMaps: LH.Artifacts['SourceMaps'], HostDPR: LH.Artifacts['HostDPR']}} data
241
236
  * @param {LH.Artifacts.ComputedContext} context
242
237
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
243
238
  */
@@ -1,6 +1,6 @@
1
1
  export { UnusedCSSComputed as UnusedCSS };
2
2
  export type StyleSheetInfo = LH.Artifacts.CSSStyleSheetInfo & {
3
- networkRecord: LH.Artifacts.NetworkRequest;
3
+ networkRecord: LH.Artifacts.NetworkRequest | undefined;
4
4
  usedRules: Array<LH.Crdp.CSS.RuleUsage>;
5
5
  };
6
6
  declare const UnusedCSSComputed: typeof UnusedCSS & {
@@ -10,7 +10,7 @@ declare const UnusedCSSComputed: typeof UnusedCSS & {
10
10
  devtoolsLog: LH.DevtoolsLog;
11
11
  }, context: LH.Artifacts.ComputedContext) => Promise<import("../../types.js").Audit.ByteEfficiencyItem[]>;
12
12
  };
13
- /** @typedef {LH.Artifacts.CSSStyleSheetInfo & {networkRecord: LH.Artifacts.NetworkRequest, usedRules: Array<LH.Crdp.CSS.RuleUsage>}} StyleSheetInfo */
13
+ /** @typedef {LH.Artifacts.CSSStyleSheetInfo & {networkRecord: LH.Artifacts.NetworkRequest|undefined, usedRules: Array<LH.Crdp.CSS.RuleUsage>}} StyleSheetInfo */
14
14
  declare class UnusedCSS {
15
15
  /**
16
16
  * @param {Array<LH.Artifacts.CSSStyleSheetInfo>} styles The output of the Styles gatherer.
@@ -11,7 +11,7 @@ import {estimateCompressedContentSize} from '../lib/script-helpers.js';
11
11
 
12
12
  const PREVIEW_LENGTH = 100;
13
13
 
14
- /** @typedef {LH.Artifacts.CSSStyleSheetInfo & {networkRecord: LH.Artifacts.NetworkRequest, usedRules: Array<LH.Crdp.CSS.RuleUsage>}} StyleSheetInfo */
14
+ /** @typedef {LH.Artifacts.CSSStyleSheetInfo & {networkRecord: LH.Artifacts.NetworkRequest|undefined, usedRules: Array<LH.Crdp.CSS.RuleUsage>}} StyleSheetInfo */
15
15
 
16
16
  class UnusedCSS {
17
17
  /**
@@ -6,8 +6,7 @@
6
6
 
7
7
  import path from 'path';
8
8
 
9
- import log from 'lighthouse-logger';
10
-
9
+ import log from '../lib/lighthouse-logger.js';
11
10
  import * as LH from '../../types/lh.js';
12
11
  import {Runner} from '../runner.js';
13
12
  import defaultConfig from './default-config.js';
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../lib/lighthouse-logger.js';
9
8
  import {
10
9
  getBrowserVersion, getBenchmarkIndex, getEnvironmentWarnings,
11
10
  getDevicePixelRatio,
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../lib/lighthouse-logger.js';
9
8
  import * as constants from '../../config/constants.js';
10
9
  import {pageFunctions} from '../../lib/page-functions.js';
11
10
  import * as i18n from '../../lib/i18n/i18n.js';
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../lib/lighthouse-logger.js';
9
8
  import {waitForFullyLoaded, waitForFrameNavigated, waitForUserToContinue} from './wait-for-condition.js';
10
9
  import * as constants from '../../config/constants.js';
11
10
  import * as i18n from '../../lib/i18n/i18n.js';
@@ -11,8 +11,7 @@
11
11
 
12
12
  import {EventEmitter} from 'events';
13
13
 
14
- import log from 'lighthouse-logger';
15
-
14
+ import log from '../../lib/lighthouse-logger.js';
16
15
  import * as LH from '../../../types/lh.js';
17
16
  import {NetworkRecorder} from '../../lib/network-recorder.js';
18
17
  import {NetworkRequest} from '../../lib/network-request.js';
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../lib/lighthouse-logger.js';
9
8
  import * as storage from './storage.js';
10
9
  import * as emulation from '../../lib/emulation.js';
11
10
  import {pageFunctions} from '../../lib/page-functions.js';
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../lib/lighthouse-logger.js';
9
8
  import * as i18n from '../../lib/i18n/i18n.js';
10
9
  import {Sentry} from '../../lib/sentry.js';
11
10
 
@@ -11,8 +11,7 @@
11
11
 
12
12
  import EventEmitter from 'events';
13
13
 
14
- import log from 'lighthouse-logger';
15
-
14
+ import log from '../../lib/lighthouse-logger.js';
16
15
  import {ProtocolSession} from '../session.js';
17
16
 
18
17
  /**
@@ -6,8 +6,7 @@
6
6
 
7
7
  /* global window */
8
8
 
9
- import log from 'lighthouse-logger';
10
-
9
+ import log from '../../lib/lighthouse-logger.js';
11
10
  import {LighthouseError} from '../../lib/lh-error.js';
12
11
  import {ExecutionContext} from './execution-context.js';
13
12
 
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../lib/lighthouse-logger.js';
9
8
  import {ExecutionContext} from './driver/execution-context.js';
10
9
  import {TargetManager} from './driver/target-manager.js';
11
10
  import {Fetcher} from './fetcher.js';
@@ -11,9 +11,9 @@
11
11
  * @see https://agenticresourcediscovery.org/spec/
12
12
  */
13
13
 
14
- import log from 'lighthouse-logger';
15
14
  import LinkHeader from 'http-link-header';
16
15
 
16
+ import log from '../../../lib/lighthouse-logger.js';
17
17
  import BaseGatherer from '../../base-gatherer.js';
18
18
  import RobotsTxt from '../seo/robots-txt.js';
19
19
  import * as Lantern from '../../../lib/lantern/lantern.js';
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../../lib/lighthouse-logger.js';
9
8
  import BaseGatherer from '../../base-gatherer.js';
10
9
 
11
10
  class LlmsTxt extends BaseGatherer {
@@ -9,8 +9,7 @@
9
9
  * and attribute information. Executes script in the context of the page.
10
10
  */
11
11
 
12
- import log from 'lighthouse-logger';
13
-
12
+ import log from '../../lib/lighthouse-logger.js';
14
13
  import BaseGatherer from '../base-gatherer.js';
15
14
  import {pageFunctions} from '../../lib/page-functions.js';
16
15
 
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../../../lib/lighthouse-logger.js';
9
8
  import BaseGatherer from '../../base-gatherer.js';
10
9
 
11
10
  class RobotsTxt extends BaseGatherer {
@@ -13,8 +13,7 @@
13
13
  import fs from 'fs';
14
14
  import {createRequire} from 'module';
15
15
 
16
- import log from 'lighthouse-logger';
17
-
16
+ import log from '../../lib/lighthouse-logger.js';
18
17
  import BaseGatherer from '../base-gatherer.js';
19
18
 
20
19
 
@@ -8,8 +8,7 @@
8
8
  * @fileoverview Collects all stylesheets and their contents.
9
9
  */
10
10
 
11
- import log from 'lighthouse-logger';
12
-
11
+ import log from '../../lib/lighthouse-logger.js';
13
12
  import BaseGatherer from '../base-gatherer.js';
14
13
  import {Sentry} from '../../lib/sentry.js';
15
14
 
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import puppeteer from 'puppeteer-core';
8
- import log from 'lighthouse-logger';
9
8
 
9
+ import log from '../lib/lighthouse-logger.js';
10
10
  import {Driver} from './driver.js';
11
11
  import {Runner} from '../runner.js';
12
12
  import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js';
@@ -23,8 +23,7 @@
23
23
 
24
24
  /** @typedef {LH.Gatherer.Context<LH.Gatherer.DependencyKey>['dependencies']} Dependencies */
25
25
 
26
- import log from 'lighthouse-logger';
27
-
26
+ import log from '../lib/lighthouse-logger.js';
28
27
  import {Sentry} from '../lib/sentry.js';
29
28
 
30
29
  /**
@@ -6,8 +6,7 @@
6
6
 
7
7
  import EventEmitter from 'events';
8
8
 
9
- import log from 'lighthouse-logger';
10
-
9
+ import log from '../lib/lighthouse-logger.js';
11
10
  import {LighthouseError} from '../lib/lh-error.js';
12
11
 
13
12
  // Controls how long to wait for a response after sending a DevTools protocol command.
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../lib/lighthouse-logger.js';
9
8
  import {Driver} from './driver.js';
10
9
  import {Runner} from '../runner.js';
11
10
  import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js';
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import log from 'lighthouse-logger';
8
-
7
+ import log from '../lib/lighthouse-logger.js';
9
8
  import {Driver} from './driver.js';
10
9
  import {Runner} from '../runner.js';
11
10
  import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js';
@@ -10,8 +10,7 @@ import stream from 'stream';
10
10
  import url from 'url';
11
11
  import {createGzip, gunzipSync} from 'zlib';
12
12
 
13
- import log from 'lighthouse-logger';
14
-
13
+ import log from './lighthouse-logger.js';
15
14
  import * as Lantern from './lantern/lantern.js';
16
15
  import lanternTraceSaver from './lantern-trace-saver.js';
17
16
  import {MetricTraceEvents} from './traces/metric-trace-events.js';