lighthouse 12.1.0-dev.20240629 → 12.1.0-dev.20240701

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 (115) hide show
  1. package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +5 -7
  2. package/core/audits/byte-efficiency/byte-efficiency-audit.js +3 -6
  3. package/core/audits/byte-efficiency/render-blocking-resources.d.ts +3 -7
  4. package/core/audits/byte-efficiency/render-blocking-resources.js +10 -16
  5. package/core/audits/dobetterweb/uses-http2.d.ts +4 -6
  6. package/core/audits/dobetterweb/uses-http2.js +2 -5
  7. package/core/audits/long-tasks.d.ts +6 -6
  8. package/core/audits/long-tasks.js +4 -4
  9. package/core/audits/prioritize-lcp-image.d.ts +1 -1
  10. package/core/audits/uses-rel-preload.d.ts +4 -3
  11. package/core/audits/uses-rel-preload.js +8 -6
  12. package/core/computed/critical-request-chains.d.ts +4 -3
  13. package/core/computed/critical-request-chains.js +5 -4
  14. package/core/computed/document-urls.js +1 -1
  15. package/core/computed/load-simulator.d.ts +3 -4
  16. package/core/computed/load-simulator.js +1 -1
  17. package/core/computed/main-resource.js +1 -1
  18. package/core/computed/metrics/lantern-first-contentful-paint.d.ts +2 -4
  19. package/core/computed/metrics/lantern-first-contentful-paint.js +1 -3
  20. package/core/computed/metrics/lantern-interactive.d.ts +2 -4
  21. package/core/computed/metrics/lantern-interactive.js +1 -3
  22. package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +2 -4
  23. package/core/computed/metrics/lantern-largest-contentful-paint.js +1 -3
  24. package/core/computed/metrics/lantern-max-potential-fid.d.ts +2 -4
  25. package/core/computed/metrics/lantern-max-potential-fid.js +1 -3
  26. package/core/computed/metrics/lantern-metric.d.ts +8 -8
  27. package/core/computed/metrics/lantern-metric.js +1 -1
  28. package/core/computed/metrics/lantern-speed-index.d.ts +2 -4
  29. package/core/computed/metrics/lantern-speed-index.js +1 -3
  30. package/core/computed/metrics/lantern-total-blocking-time.d.ts +2 -4
  31. package/core/computed/metrics/lantern-total-blocking-time.js +1 -3
  32. package/core/computed/metrics/total-blocking-time.js +1 -1
  33. package/core/computed/network-analysis.js +1 -1
  34. package/core/computed/page-dependency-graph.d.ts +3 -6
  35. package/core/computed/page-dependency-graph.js +3 -4
  36. package/core/computed/tbt-impact-tasks.js +2 -2
  37. package/core/lib/asset-saver.js +1 -1
  38. package/core/lib/lantern/lantern.d.ts +2 -19
  39. package/core/lib/lantern/lantern.js +2 -45
  40. package/core/lib/lantern-trace-saver.d.ts +4 -6
  41. package/core/lib/lantern-trace-saver.js +2 -3
  42. package/core/lib/navigation-error.js +2 -2
  43. package/core/lib/network-recorder.js +1 -1
  44. package/core/lib/network-request.d.ts +4 -4
  45. package/core/lib/network-request.js +2 -2
  46. package/package.json +2 -2
  47. package/tsconfig.json +0 -11
  48. package/types/artifacts.d.ts +2 -2
  49. package/types/gatherer.d.ts +4 -5
  50. package/core/lib/lantern/BaseNode.d.ts +0 -163
  51. package/core/lib/lantern/BaseNode.js +0 -369
  52. package/core/lib/lantern/BaseNode.test.js +0 -385
  53. package/core/lib/lantern/CpuNode.d.ts +0 -43
  54. package/core/lib/lantern/CpuNode.js +0 -99
  55. package/core/lib/lantern/LanternError.d.ts +0 -8
  56. package/core/lib/lantern/LanternError.js +0 -9
  57. package/core/lib/lantern/Metric.d.ts +0 -69
  58. package/core/lib/lantern/Metric.js +0 -137
  59. package/core/lib/lantern/NetworkNode.d.ts +0 -49
  60. package/core/lib/lantern/NetworkNode.js +0 -136
  61. package/core/lib/lantern/PageDependencyGraph.d.ts +0 -82
  62. package/core/lib/lantern/PageDependencyGraph.js +0 -610
  63. package/core/lib/lantern/PageDependencyGraph.test.js +0 -654
  64. package/core/lib/lantern/TBTUtils.d.ts +0 -44
  65. package/core/lib/lantern/TBTUtils.js +0 -76
  66. package/core/lib/lantern/TBTUtils.test.d.ts +0 -2
  67. package/core/lib/lantern/TBTUtils.test.js +0 -130
  68. package/core/lib/lantern/TraceEngineComputationData.d.ts +0 -25
  69. package/core/lib/lantern/TraceEngineComputationData.js +0 -466
  70. package/core/lib/lantern/metrics/FirstContentfulPaint.d.ts +0 -79
  71. package/core/lib/lantern/metrics/FirstContentfulPaint.js +0 -198
  72. package/core/lib/lantern/metrics/FirstContentfulPaint.test.js +0 -54
  73. package/core/lib/lantern/metrics/Interactive.d.ts +0 -20
  74. package/core/lib/lantern/metrics/Interactive.js +0 -109
  75. package/core/lib/lantern/metrics/Interactive.test.js +0 -56
  76. package/core/lib/lantern/metrics/LargestContentfulPaint.d.ts +0 -19
  77. package/core/lib/lantern/metrics/LargestContentfulPaint.js +0 -105
  78. package/core/lib/lantern/metrics/LargestContentfulPaint.test.js +0 -42
  79. package/core/lib/lantern/metrics/MaxPotentialFID.d.ts +0 -24
  80. package/core/lib/lantern/metrics/MaxPotentialFID.js +0 -91
  81. package/core/lib/lantern/metrics/MetricTestUtils.d.ts +0 -19
  82. package/core/lib/lantern/metrics/MetricTestUtils.js +0 -48
  83. package/core/lib/lantern/metrics/SpeedIndex.d.ts +0 -32
  84. package/core/lib/lantern/metrics/SpeedIndex.js +0 -142
  85. package/core/lib/lantern/metrics/SpeedIndex.test.js +0 -83
  86. package/core/lib/lantern/metrics/TotalBlockingTime.d.ts +0 -25
  87. package/core/lib/lantern/metrics/TotalBlockingTime.js +0 -125
  88. package/core/lib/lantern/metrics/__snapshots__/FirstContentfulPaint.test.js.snap +0 -11
  89. package/core/lib/lantern/metrics/__snapshots__/Interactive.test.js.snap +0 -17
  90. package/core/lib/lantern/metrics/metrics.d.ts +0 -9
  91. package/core/lib/lantern/metrics/metrics.js +0 -16
  92. package/core/lib/lantern/simulation/ConnectionPool.d.ts +0 -48
  93. package/core/lib/lantern/simulation/ConnectionPool.js +0 -152
  94. package/core/lib/lantern/simulation/ConnectionPool.test.js +0 -195
  95. package/core/lib/lantern/simulation/Constants.d.ts +0 -52
  96. package/core/lib/lantern/simulation/Constants.js +0 -48
  97. package/core/lib/lantern/simulation/DNSCache.d.ts +0 -42
  98. package/core/lib/lantern/simulation/DNSCache.js +0 -74
  99. package/core/lib/lantern/simulation/DNSCache.test.js +0 -72
  100. package/core/lib/lantern/simulation/NetworkAnalyzer.d.ts +0 -209
  101. package/core/lib/lantern/simulation/NetworkAnalyzer.js +0 -597
  102. package/core/lib/lantern/simulation/NetworkAnalyzer.test.js +0 -475
  103. package/core/lib/lantern/simulation/SimulationTimingMap.d.ts +0 -153
  104. package/core/lib/lantern/simulation/SimulationTimingMap.js +0 -219
  105. package/core/lib/lantern/simulation/Simulator.d.ts +0 -157
  106. package/core/lib/lantern/simulation/Simulator.js +0 -593
  107. package/core/lib/lantern/simulation/Simulator.test.js +0 -434
  108. package/core/lib/lantern/simulation/TCPConnection.test.d.ts +0 -2
  109. package/core/lib/lantern/simulation/TCPConnection.test.js +0 -374
  110. package/core/lib/lantern/simulation/TcpConnection.d.ts +0 -89
  111. package/core/lib/lantern/simulation/TcpConnection.js +0 -230
  112. package/core/lib/lantern/simulation/simulation.d.ts +0 -21
  113. package/core/lib/lantern/simulation/simulation.js +0 -28
  114. package/core/lib/lantern/types/lantern.d.ts +0 -256
  115. package/core/lib/lantern/types/lantern.js +0 -7
@@ -1,21 +0,0 @@
1
- export { ConnectionPool } from "./ConnectionPool.js";
2
- export { Constants } from "./Constants.js";
3
- export { DNSCache } from "./DNSCache.js";
4
- export { NetworkAnalyzer } from "./NetworkAnalyzer.js";
5
- export { Simulator } from "./Simulator.js";
6
- export { SimulatorTimingMap } from "./SimulationTimingMap.js";
7
- export { TcpConnection } from "./TcpConnection.js";
8
- export type GraphNetworkNode<T = any> = Lantern.Simulation.GraphNetworkNode<T>;
9
- export type GraphNode<T = any> = Lantern.Simulation.GraphNode<T>;
10
- export type Result<T = any> = Lantern.Simulation.Result<T>;
11
- export type GraphCPUNode = Lantern.Simulation.GraphCPUNode;
12
- export type MetricCoefficients = Lantern.Simulation.MetricCoefficients;
13
- export type MetricComputationDataInput = Lantern.Simulation.MetricComputationDataInput;
14
- export type NodeTiming = Lantern.Simulation.NodeTiming;
15
- export type Options = Lantern.Simulation.Options;
16
- export type PrecomputedLanternData = Lantern.Simulation.PrecomputedLanternData;
17
- export type ProcessedNavigation = Lantern.Simulation.ProcessedNavigation;
18
- export type Settings = Lantern.Simulation.Settings;
19
- export type URL = Lantern.Simulation.URL;
20
- import * as Lantern from '../types/lantern.js';
21
- //# sourceMappingURL=simulation.d.ts.map
@@ -1,28 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2024 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- import * as Lantern from '../types/lantern.js';
8
-
9
- export {ConnectionPool} from './ConnectionPool.js';
10
- export {Constants} from './Constants.js';
11
- export {DNSCache} from './DNSCache.js';
12
- export {NetworkAnalyzer} from './NetworkAnalyzer.js';
13
- export {Simulator} from './Simulator.js';
14
- export {SimulatorTimingMap} from './SimulationTimingMap.js';
15
- export {TcpConnection} from './TcpConnection.js';
16
-
17
- /** @template [T=any] @typedef {Lantern.Simulation.GraphNetworkNode<T>} GraphNetworkNode */
18
- /** @template [T=any] @typedef {Lantern.Simulation.GraphNode<T>} GraphNode */
19
- /** @template [T=any] @typedef {Lantern.Simulation.Result<T>} Result */
20
- /** @typedef {Lantern.Simulation.GraphCPUNode} GraphCPUNode */
21
- /** @typedef {Lantern.Simulation.MetricCoefficients} MetricCoefficients */
22
- /** @typedef {Lantern.Simulation.MetricComputationDataInput} MetricComputationDataInput */
23
- /** @typedef {Lantern.Simulation.NodeTiming} NodeTiming */
24
- /** @typedef {Lantern.Simulation.Options} Options */
25
- /** @typedef {Lantern.Simulation.PrecomputedLanternData} PrecomputedLanternData */
26
- /** @typedef {Lantern.Simulation.ProcessedNavigation} ProcessedNavigation */
27
- /** @typedef {Lantern.Simulation.Settings} Settings */
28
- /** @typedef {Lantern.Simulation.URL} URL */
@@ -1,256 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2024 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- import * as Protocol from '@paulirish/trace_engine/generated/protocol.js';
8
-
9
- declare module Util {
10
- /** An object with the keys in the union K mapped to themselves as values. */
11
- type SelfMap<K extends string> = {
12
- [P in K]: P;
13
- };
14
- }
15
-
16
- type TraceEvent = {
17
- name: string;
18
- cat: string;
19
- args: {
20
- name?: string;
21
- fileName?: string;
22
- snapshot?: string;
23
- sync_id?: string;
24
- beginData?: {
25
- frame?: string;
26
- startLine?: number;
27
- url?: string;
28
- };
29
- data?: {
30
- frame?: string;
31
- readyState?: number;
32
- stackTrace?: {
33
- url: string
34
- }[];
35
- url?: string;
36
- };
37
- };
38
- pid: number;
39
- tid: number;
40
- /** Timestamp of the event in microseconds. */
41
- ts: number;
42
- dur: number;
43
- }
44
- type Trace = {traceEvents: TraceEvent[]};
45
- type ResourcePriority = ('VeryLow' | 'Low' | 'Medium' | 'High' | 'VeryHigh');
46
- type ResourceType = ('Document' | 'Stylesheet' | 'Image' | 'Media' | 'Font' | 'Script' | 'TextTrack' | 'XHR' | 'Fetch' | 'Prefetch' | 'EventSource' | 'WebSocket' | 'Manifest' | 'SignedExchange' | 'Ping' | 'CSPViolationReport' | 'Preflight' | 'Other');
47
- type InitiatorType = ('parser' | 'script' | 'preload' | 'SignedExchange' | 'preflight' | 'other');
48
- type ResourceTiming = Protocol.Network.ResourceTiming;
49
- type CallStack = {
50
- callFrames: Array<{
51
- scriptId: string;
52
- url: string;
53
- lineNumber: number;
54
- columnNumber: number;
55
- functionName: string;
56
- }>;
57
- parent?: CallStack;
58
- }
59
-
60
- type ParsedURL = {
61
- /**
62
- * Equivalent to a `new URL(url).protocol` BUT w/o the trailing colon (:)
63
- */
64
- scheme: string;
65
- /**
66
- * Equivalent to a `new URL(url).hostname`
67
- */
68
- host: string;
69
- securityOrigin: string;
70
- };
71
- type LightriderStatistics = {
72
- /**
73
- * The difference in networkEndTime between the observed Lighthouse networkEndTime and Lightrider's derived networkEndTime.
74
- */
75
- endTimeDeltaMs: number;
76
- /**
77
- * The time spent making a TCP connection (connect + SSL). Note: this is poorly named.
78
- */
79
- TCPMs: number;
80
- /**
81
- * The time spent requesting a resource from a remote server, we use this to approx RTT. Note: this is poorly names, it really should be "server response time".
82
- */
83
- requestMs: number;
84
- /**
85
- * Time to receive the entire response payload starting the clock on receiving the first fragment (first non-header byte).
86
- */
87
- responseMs: number;
88
- };
89
-
90
- export class NetworkRequest<T = any> {
91
- /**
92
- * Implementation-specifc canoncial data structure that this Lantern NetworkRequest
93
- * was derived from.
94
- * Users of Lantern create a NetworkRequest matching this interface,
95
- * but can store the source-of-truth for their network model in this property.
96
- * This is then accessible as a read-only property on NetworkNode.
97
- */
98
- rawRequest?: T;
99
-
100
- requestId: string;
101
- connectionId: number;
102
- connectionReused: boolean;
103
- url: string;
104
- protocol: string;
105
- parsedURL: ParsedURL;
106
- documentURL: string;
107
- /** When the renderer process initially discovers a network request, in milliseconds. */
108
- rendererStartTime: number;
109
- /**
110
- * When the network service is about to handle a request, ie. just before going to the
111
- * HTTP cache or going to the network for DNS/connection setup, in milliseconds.
112
- */
113
- networkRequestTime: number;
114
- /**
115
- * When the last byte of the response headers is received, in milliseconds.
116
- * Equal to networkRequestTime if no data is recieved over the
117
- * network (ex: cached requests or data urls).
118
- */
119
- responseHeadersEndTime: number;
120
- /** When the last byte of the response body is received, in milliseconds. */
121
- networkEndTime: number;
122
- transferSize: number;
123
- resourceSize: number;
124
- fromDiskCache: boolean;
125
- fromMemoryCache: boolean;
126
- isLinkPreload: boolean;
127
- finished: boolean;
128
- failed: boolean;
129
- statusCode: number;
130
- /** The network request that redirected to this one */
131
- redirectSource: NetworkRequest<T> | undefined;
132
- /** The network request that this one redirected to */
133
- redirectDestination: NetworkRequest<T> | undefined;
134
- // TODO: can't use Protocol.Network.Initiator because of type mismatch in Lighthouse initiator.
135
- initiator: {
136
- type: InitiatorType;
137
- url?: string;
138
- stack?: CallStack;
139
- };
140
- initiatorRequest: NetworkRequest<T> | undefined;
141
- /** The chain of network requests that redirected to this one */
142
- redirects: NetworkRequest[] | undefined;
143
- timing: Protocol.Network.ResourceTiming | undefined;
144
- /**
145
- * Optional value for how long the server took to respond to this request.
146
- * When not provided, the server response time is derived from the timing object.
147
- */
148
- serverResponseTime?: number;
149
- resourceType: ResourceType | undefined;
150
- mimeType: string;
151
- priority: ResourcePriority;
152
- frameId: string | undefined;
153
- fromWorker: boolean;
154
- }
155
-
156
- interface MetricResult<T = any> {
157
- timing: number;
158
- timestamp?: never;
159
- optimisticEstimate: Simulation.Result<T>;
160
- pessimisticEstimate: Simulation.Result<T>;
161
- optimisticGraph: Simulation.GraphNode<T>;
162
- pessimisticGraph: Simulation.GraphNode<T>;
163
- }
164
-
165
- export namespace Simulation {
166
- type URL = {
167
- /** URL of the initially requested URL */
168
- requestedUrl?: string;
169
- /** URL of the last document request */
170
- mainDocumentUrl?: string;
171
- };
172
-
173
- type GraphNode<T> = import('../BaseNode.js').Node<T>;
174
- type GraphNetworkNode<T> = import('../NetworkNode.js').NetworkNode<T>;
175
- type GraphCPUNode = import('../CpuNode.js').CPUNode;
176
- type Simulator<T> = import('../simulation/Simulator.js').Simulator<T>;
177
-
178
- interface MetricCoefficients {
179
- intercept: number;
180
- optimistic: number;
181
- pessimistic: number;
182
- }
183
-
184
- /** Simulation settings that control the amount of network & cpu throttling in the run. */
185
- interface ThrottlingSettings {
186
- /** The round trip time in milliseconds. */
187
- rttMs?: number;
188
- /** The network throughput in kilobits per second. */
189
- throughputKbps?: number;
190
- // devtools settings
191
- /** The network request latency in milliseconds. */
192
- requestLatencyMs?: number;
193
- /** The network download throughput in kilobits per second. */
194
- downloadThroughputKbps?: number;
195
- /** The network upload throughput in kilobits per second. */
196
- uploadThroughputKbps?: number;
197
- // used by both
198
- /** The amount of slowdown applied to the cpu (1/<cpuSlowdownMultiplier>). */
199
- cpuSlowdownMultiplier?: number
200
- }
201
-
202
- interface PrecomputedLanternData {
203
- additionalRttByOrigin: {[origin: string]: number};
204
- serverResponseTimeByOrigin: {[origin: string]: number};
205
- }
206
-
207
- interface Settings {
208
- networkAnalysis: {
209
- rtt: number;
210
- additionalRttByOrigin: Map<string, number>;
211
- serverResponseTimeByOrigin: Map<string, number>;
212
- throughput: number;
213
- };
214
- /** The method used to throttle the network. */
215
- throttlingMethod: 'devtools'|'simulate'|'provided';
216
- /** The throttling config settings. */
217
- throttling: Required<ThrottlingSettings>;
218
- /** Precomputed lantern estimates to use instead of observed analysis. */
219
- precomputedLanternData?: PrecomputedLanternData | null;
220
- }
221
-
222
- interface Options {
223
- rtt?: number;
224
- throughput?: number;
225
- observedThroughput: number;
226
- maximumConcurrentRequests?: number;
227
- cpuSlowdownMultiplier?: number;
228
- layoutTaskMultiplier?: number;
229
- additionalRttByOrigin?: Map<string, number>;
230
- serverResponseTimeByOrigin?: Map<string, number>;
231
- }
232
-
233
- interface NodeTiming {
234
- startTime: number;
235
- endTime: number;
236
- duration: number;
237
- }
238
-
239
- interface Result<T = any> {
240
- timeInMs: number;
241
- nodeTimings: Map<GraphNode<T>, NodeTiming>;
242
- }
243
-
244
- interface ProcessedNavigation {
245
- timestamps: {
246
- firstContentfulPaint: number;
247
- largestContentfulPaint?: number;
248
- };
249
- }
250
-
251
- interface MetricComputationDataInput {
252
- simulator: Simulator<any>;
253
- graph: GraphNode<any>;
254
- processedNavigation: ProcessedNavigation;
255
- }
256
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2024 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- export {};