lighthouse 11.6.0-dev.20240313 → 11.6.0-dev.20240314

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.
@@ -70,9 +70,7 @@ class InteractionToNextPaint extends Audit {
70
70
  return {score: null, notApplicable: true};
71
71
  }
72
72
 
73
- // TODO: remove workaround once 103.0.5052.0 is sufficiently released.
74
- const timing = interactionEvent.name === 'FallbackTiming' ?
75
- interactionEvent.duration : interactionEvent.args.data.duration;
73
+ const timing = interactionEvent.args.data.duration;
76
74
 
77
75
  return {
78
76
  score: Audit.computeLogNormalScore({p10: context.options.p10, median: context.options.median},
@@ -14,7 +14,6 @@ import {taskGroups} from '../lib/tracehouse/task-groups.js';
14
14
  import {TraceProcessor} from '../lib/tracehouse/trace-processor.js';
15
15
  import {getExecutionTimingsByURL} from '../lib/tracehouse/task-summary.js';
16
16
  import InteractionToNextPaint from './metrics/interaction-to-next-paint.js';
17
- import {LighthouseError} from '../lib/lh-error.js';
18
17
 
19
18
  /** @typedef {import('../computed/metrics/responsiveness.js').EventTimingEvent} EventTimingEvent */
20
19
  /** @typedef {import('../lib/tracehouse/main-thread-tasks.js').TaskNode} TaskNode */
@@ -243,13 +242,6 @@ class WorkDuringInteraction extends Audit {
243
242
  metricSavings: {INP: 0},
244
243
  };
245
244
  }
246
- // TODO: remove workaround once 103.0.5052.0 is sufficiently released.
247
- if (interactionEvent.name === 'FallbackTiming') {
248
- throw new LighthouseError(
249
- LighthouseError.errors.UNSUPPORTED_OLD_CHROME,
250
- {featureName: 'detailed EventTiming trace events'}
251
- );
252
- }
253
245
 
254
246
  const auditDetailsItems = [];
255
247
 
@@ -38,21 +38,13 @@ export type EventTimingEvent = LH.Trace.AsyncEvent & {
38
38
  data: EventTimingData;
39
39
  };
40
40
  };
41
- /**
42
- * A fallback EventTiming placeholder, used if updated EventTiming events are not available.
43
- * TODO: Remove once 103.0.5052.0 is sufficiently released.
44
- */
45
- export type FallbackTimingEvent = {
46
- name: 'FallbackTiming';
47
- duration: number;
48
- };
49
41
  declare const ResponsivenessComputed: typeof Responsiveness & {
50
42
  request: (dependencies: {
51
43
  trace: LH.Trace;
52
44
  settings: LH.Audit.Context['settings'];
53
45
  }, context: import("../../../types/utility-types.js").default.ImmutableObject<{
54
46
  computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
55
- }>) => Promise<EventTimingEvent | FallbackTimingEvent | null>;
47
+ }>) => Promise<EventTimingEvent | null>;
56
48
  };
57
49
  declare class Responsiveness {
58
50
  /**
@@ -70,18 +62,18 @@ declare class Responsiveness {
70
62
  * one interaction had this duration by returning the first found.
71
63
  * @param {ResponsivenessEvent} responsivenessEvent
72
64
  * @param {LH.Trace} trace
73
- * @return {EventTimingEvent|FallbackTimingEvent}
65
+ * @return {EventTimingEvent}
74
66
  */
75
- static findInteractionEvent(responsivenessEvent: ResponsivenessEvent, { traceEvents }: LH.Trace): EventTimingEvent | FallbackTimingEvent;
67
+ static findInteractionEvent(responsivenessEvent: ResponsivenessEvent, { traceEvents }: LH.Trace): EventTimingEvent;
76
68
  /**
77
69
  * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
78
70
  * @param {LH.Artifacts.ComputedContext} context
79
- * @return {Promise<EventTimingEvent|FallbackTimingEvent|null>}
71
+ * @return {Promise<EventTimingEvent|null>}
80
72
  */
81
73
  static compute_(data: {
82
74
  trace: LH.Trace;
83
75
  settings: LH.Audit.Context['settings'];
84
- }, context: LH.Artifacts.ComputedContext): Promise<EventTimingEvent | FallbackTimingEvent | null>;
76
+ }, context: LH.Artifacts.ComputedContext): Promise<EventTimingEvent | null>;
85
77
  }
86
78
  import { ProcessedTrace } from '../processed-trace.js';
87
79
  //# sourceMappingURL=responsiveness.d.ts.map
@@ -24,14 +24,10 @@
24
24
  * @property {number} interactionId
25
25
  */
26
26
  /** @typedef {LH.Trace.AsyncEvent & {name: 'EventTiming', args: {data: EventTimingData}}} EventTimingEvent */
27
- /**
28
- * A fallback EventTiming placeholder, used if updated EventTiming events are not available.
29
- * TODO: Remove once 103.0.5052.0 is sufficiently released.
30
- * @typedef {{name: 'FallbackTiming', duration: number}} FallbackTimingEvent
31
- */
32
27
 
33
28
  import {ProcessedTrace} from '../processed-trace.js';
34
29
  import {makeComputedArtifact} from '../computed-artifact.js';
30
+ import {LighthouseError} from '../../lib/lh-error.js';
35
31
 
36
32
  const KEYBOARD_EVENTS = new Set(['keydown', 'keypress', 'keyup']);
37
33
  const CLICK_TAP_DRAG_EVENTS = new Set([
@@ -79,7 +75,7 @@ class Responsiveness {
79
75
  * one interaction had this duration by returning the first found.
80
76
  * @param {ResponsivenessEvent} responsivenessEvent
81
77
  * @param {LH.Trace} trace
82
- * @return {EventTimingEvent|FallbackTimingEvent}
78
+ * @return {EventTimingEvent}
83
79
  */
84
80
  static findInteractionEvent(responsivenessEvent, {traceEvents}) {
85
81
  const candidates = traceEvents.filter(/** @return {evt is EventTimingEvent} */ evt => {
@@ -87,15 +83,15 @@ class Responsiveness {
87
83
  return evt.name === 'EventTiming' && evt.ph !== 'e';
88
84
  });
89
85
 
90
- // If trace is from < m103, the timestamps cannot be trusted, so we craft a fallback
91
- // <m103 traces (bad) had a args.frame
86
+ // If trace is from < m103, the timestamps cannot be trusted
87
+ // <m103 traces (bad) had a args.frame (we used to provide a fallback trace event, but not
88
+ // any more)
92
89
  // m103+ traces (good) have a args.data.frame (https://crrev.com/c/3632661)
93
- // TODO(compat): remove FallbackTiming handling when we don't care about <m103
94
90
  if (candidates.length && candidates.every(candidate => !candidate.args.data?.frame)) {
95
- return {
96
- name: 'FallbackTiming',
97
- duration: responsivenessEvent.args.data.maxDuration,
98
- };
91
+ throw new LighthouseError(
92
+ LighthouseError.errors.UNSUPPORTED_OLD_CHROME,
93
+ {featureName: 'detailed EventTiming trace events'}
94
+ );
99
95
  }
100
96
 
101
97
  const {maxDuration, interactionType} = responsivenessEvent.args.data;
@@ -136,7 +132,7 @@ class Responsiveness {
136
132
  /**
137
133
  * @param {{trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
138
134
  * @param {LH.Artifacts.ComputedContext} context
139
- * @return {Promise<EventTimingEvent|FallbackTimingEvent|null>}
135
+ * @return {Promise<EventTimingEvent|null>}
140
136
  */
141
137
  static async compute_(data, context) {
142
138
  const {settings, trace} = data;
@@ -155,7 +155,7 @@ class TraceElements extends BaseGatherer {
155
155
  const {settings} = context;
156
156
  try {
157
157
  const responsivenessEvent = await Responsiveness.request({trace, settings}, context);
158
- if (!responsivenessEvent || responsivenessEvent.name === 'FallbackTiming') return;
158
+ if (!responsivenessEvent) return;
159
159
  return {nodeId: responsivenessEvent.args.data.nodeId};
160
160
  } catch {
161
161
  // Don't let responsiveness errors sink the rest of the gatherer.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "11.6.0-dev.20240313",
4
+ "version": "11.6.0-dev.20240314",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {