lighthouse 12.7.0 → 12.7.1-dev.20250702

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.
@@ -11,12 +11,12 @@ declare const TraceEngineResultComputed: typeof TraceEngineResult & {
11
11
  */
12
12
  declare class TraceEngineResult {
13
13
  /**
14
- * @param {LH.TraceEvent[]} traceEvents
14
+ * @param {LH.TraceEvent[]} _traceEvents
15
15
  * @param {LH.Audit.Context['settings']} settings
16
16
  * @param {LH.Artifacts['SourceMaps']} SourceMaps
17
17
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
18
18
  */
19
- static runTraceEngine(traceEvents: LH.TraceEvent[], settings: LH.Audit.Context["settings"], SourceMaps: LH.Artifacts["SourceMaps"]): Promise<LH.Artifacts.TraceEngineResult>;
19
+ static runTraceEngine(_traceEvents: LH.TraceEvent[], settings: LH.Audit.Context["settings"], SourceMaps: LH.Artifacts["SourceMaps"]): Promise<LH.Artifacts.TraceEngineResult>;
20
20
  /**
21
21
  * Adapts the given DevTools function that returns a localized string to one
22
22
  * that returns a LH.IcuMessage.
@@ -19,13 +19,15 @@ import * as LH from '../../types/lh.js';
19
19
  */
20
20
  class TraceEngineResult {
21
21
  /**
22
- * @param {LH.TraceEvent[]} traceEvents
22
+ * @param {LH.TraceEvent[]} _traceEvents
23
23
  * @param {LH.Audit.Context['settings']} settings
24
24
  * @param {LH.Artifacts['SourceMaps']} SourceMaps
25
25
  * @return {Promise<LH.Artifacts.TraceEngineResult>}
26
26
  */
27
- static async runTraceEngine(traceEvents, settings, SourceMaps) {
27
+ static async runTraceEngine(_traceEvents, settings, SourceMaps) {
28
28
  const processor = new TraceEngine.TraceProcessor(TraceEngine.TraceHandlers);
29
+ const traceEvents =
30
+ /** @type {import('@paulirish/trace_engine').Types.Events.Event[]} */ (_traceEvents);
29
31
 
30
32
  const lanternSettings = {};
31
33
  if (settings.throttlingMethod) lanternSettings.throttlingMethod = settings.throttlingMethod;
@@ -34,9 +36,10 @@ class TraceEngineResult {
34
36
  lanternSettings.precomputedLanternData = settings.precomputedLanternData;
35
37
  }
36
38
 
37
- await processor.parse(/** @type {import('@paulirish/trace_engine').Types.Events.Event[]} */ (
38
- traceEvents
39
- ), {
39
+ // SyntheticEventsManager must be initialized prior to processor.parse().
40
+ TraceEngine.Helpers.SyntheticEvents.SyntheticEventsManager.createAndActivate(traceEvents);
41
+
42
+ await processor.parse(traceEvents, {
40
43
  logger: {
41
44
  start(id) {
42
45
  const logId = `lh:computed:TraceEngineResult:${id}`;
@@ -15,5 +15,6 @@ export type DevToolsIcuMessage = {
15
15
  export const TraceProcessor: typeof TraceEngine.Processor.TraceProcessor;
16
16
  export const TraceHandlers: typeof TraceEngine.Handlers.ModelHandlers;
17
17
  export const Insights: typeof TraceEngine.Insights;
18
+ export const Helpers: typeof TraceEngine.Helpers;
18
19
  import * as TraceEngine from '@paulirish/trace_engine';
19
20
  //# sourceMappingURL=trace-engine.d.ts.map
@@ -11,9 +11,11 @@ polyfillDOMRect();
11
11
  const TraceProcessor = TraceEngine.Processor.TraceProcessor;
12
12
  const TraceHandlers = TraceEngine.Handlers.ModelHandlers;
13
13
  const Insights = TraceEngine.Insights;
14
+ const Helpers = TraceEngine.Helpers;
14
15
 
15
16
  export {
16
17
  TraceProcessor,
17
18
  TraceHandlers,
18
19
  Insights,
20
+ Helpers,
19
21
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "12.7.0",
4
+ "version": "12.7.1-dev.20250702",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {