lighthouse 12.0.0-dev.20240611 → 12.0.0-dev.20240613
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.
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +2 -2
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +2 -2
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +3 -3
- package/core/audits/byte-efficiency/render-blocking-resources.js +4 -4
- package/core/audits/dobetterweb/uses-http2.d.ts +2 -2
- package/core/audits/dobetterweb/uses-http2.js +2 -2
- package/core/audits/long-tasks.d.ts +1 -1
- package/core/audits/long-tasks.js +1 -1
- package/core/audits/prioritize-lcp-image.d.ts +1 -1
- package/core/computed/document-urls.js +3 -2
- package/core/computed/load-simulator.d.ts +4 -4
- package/core/computed/load-simulator.js +3 -3
- package/core/computed/main-resource.js +3 -2
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +4 -4
- package/core/computed/metrics/lantern-first-contentful-paint.js +3 -3
- package/core/computed/metrics/lantern-interactive.d.ts +4 -4
- package/core/computed/metrics/lantern-interactive.js +3 -3
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +4 -4
- package/core/computed/metrics/lantern-largest-contentful-paint.js +3 -3
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +4 -4
- package/core/computed/metrics/lantern-max-potential-fid.js +3 -3
- package/core/computed/metrics/lantern-metric.d.ts +4 -3
- package/core/computed/metrics/lantern-metric.js +4 -4
- package/core/computed/metrics/lantern-speed-index.d.ts +4 -4
- package/core/computed/metrics/lantern-speed-index.js +3 -3
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +4 -4
- package/core/computed/metrics/lantern-total-blocking-time.js +3 -3
- package/core/computed/metrics/total-blocking-time.js +3 -1
- package/core/computed/network-analysis.js +2 -2
- package/core/computed/page-dependency-graph.d.ts +2 -2
- package/core/computed/page-dependency-graph.js +6 -6
- package/core/computed/tbt-impact-tasks.js +3 -2
- package/core/config/constants.js +1 -1
- package/core/lib/asset-saver.js +2 -2
- package/core/lib/lantern/{base-node.d.ts → BaseNode.d.ts} +7 -9
- package/core/lib/lantern/{base-node.js → BaseNode.js} +6 -6
- package/core/lib/lantern/BaseNode.test.js +385 -0
- package/core/lib/lantern/{cpu-node.d.ts → CpuNode.d.ts} +8 -9
- package/core/lib/lantern/{cpu-node.js → CpuNode.js} +4 -5
- package/core/lib/lantern/{lantern-error.d.ts → LanternError.d.ts} +1 -1
- package/core/lib/lantern/{metric.d.ts → Metric.d.ts} +17 -17
- package/core/lib/lantern/{metric.js → Metric.js} +10 -12
- package/core/lib/lantern/{network-node.d.ts → NetworkNode.d.ts} +4 -5
- package/core/lib/lantern/{network-node.js → NetworkNode.js} +4 -5
- package/core/lib/lantern/{page-dependency-graph.d.ts → PageDependencyGraph.d.ts} +5 -5
- package/core/lib/lantern/{page-dependency-graph.js → PageDependencyGraph.js} +11 -10
- package/core/lib/lantern/PageDependencyGraph.test.js +654 -0
- package/core/lib/lantern/{tbt-utils.d.ts → TBTUtils.d.ts} +1 -1
- package/core/lib/lantern/TBTUtils.test.d.ts +2 -0
- package/core/lib/lantern/TBTUtils.test.js +130 -0
- package/core/lib/lantern/{trace-engine-computation-data.d.ts → TraceEngineComputationData.d.ts} +3 -3
- package/core/lib/lantern/{trace-engine-computation-data.js → TraceEngineComputationData.js} +5 -7
- package/core/lib/lantern/lantern.d.ts +16 -46
- package/core/lib/lantern/lantern.js +16 -40
- package/core/lib/lantern/metrics/{first-contentful-paint.d.ts → FirstContentfulPaint.d.ts} +11 -11
- package/core/lib/lantern/metrics/{first-contentful-paint.js → FirstContentfulPaint.js} +8 -10
- package/core/lib/lantern/metrics/FirstContentfulPaint.test.js +54 -0
- package/core/lib/lantern/metrics/{interactive.d.ts → Interactive.d.ts} +4 -5
- package/core/lib/lantern/metrics/{interactive.js → Interactive.js} +10 -13
- package/core/lib/lantern/metrics/Interactive.test.js +56 -0
- package/core/lib/lantern/metrics/{largest-contentful-paint.d.ts → LargestContentfulPaint.d.ts} +5 -6
- package/core/lib/lantern/metrics/{largest-contentful-paint.js → LargestContentfulPaint.js} +9 -12
- package/core/lib/lantern/metrics/LargestContentfulPaint.test.js +42 -0
- package/core/lib/lantern/metrics/{max-potential-fid.d.ts → MaxPotentialFID.d.ts} +5 -6
- package/core/lib/lantern/metrics/{max-potential-fid.js → MaxPotentialFID.js} +8 -9
- package/core/lib/lantern/metrics/MetricTestUtils.d.ts +19 -0
- package/core/lib/lantern/metrics/MetricTestUtils.js +48 -0
- package/core/lib/lantern/metrics/{speed-index.d.ts → SpeedIndex.d.ts} +5 -6
- package/core/lib/lantern/metrics/{speed-index.js → SpeedIndex.js} +7 -9
- package/core/lib/lantern/metrics/SpeedIndex.test.js +83 -0
- package/core/lib/lantern/metrics/{total-blocking-time.d.ts → TotalBlockingTime.d.ts} +5 -6
- package/core/lib/lantern/metrics/{total-blocking-time.js → TotalBlockingTime.js} +9 -12
- package/core/lib/lantern/metrics/__snapshots__/first-contentful-paint-test.js.snap +11 -0
- package/core/lib/lantern/metrics/__snapshots__/interactive-test.js.snap +17 -0
- package/core/lib/lantern/metrics/metrics.d.ts +9 -0
- package/core/lib/lantern/metrics/metrics.js +16 -0
- package/core/lib/lantern/{simulator/connection-pool.d.ts → simulation/ConnectionPool.d.ts} +5 -5
- package/core/lib/lantern/{simulator/connection-pool.js → simulation/ConnectionPool.js} +3 -3
- package/core/lib/lantern/simulation/ConnectionPool.test.js +195 -0
- package/core/lib/lantern/simulation/Constants.d.ts +52 -0
- package/core/lib/lantern/simulation/Constants.js +48 -0
- package/core/lib/lantern/{simulator/dns-cache.d.ts → simulation/DNSCache.d.ts} +2 -2
- package/core/lib/lantern/{simulator/dns-cache.js → simulation/DNSCache.js} +1 -1
- package/core/lib/lantern/simulation/DNSCache.test.js +72 -0
- package/core/lib/lantern/{simulator/network-analyzer.d.ts → simulation/NetworkAnalyzer.d.ts} +2 -2
- package/core/lib/lantern/{simulator/network-analyzer.js → simulation/NetworkAnalyzer.js} +1 -1
- package/core/lib/lantern/simulation/NetworkAnalyzer.test.js +475 -0
- package/core/lib/lantern/{simulator/simulator-timing-map.d.ts → simulation/SimulationTimingMap.d.ts} +7 -7
- package/core/lib/lantern/{simulator/simulator-timing-map.js → simulation/SimulationTimingMap.js} +5 -6
- package/core/lib/lantern/{simulator/simulator.d.ts → simulation/Simulator.d.ts} +13 -15
- package/core/lib/lantern/{simulator/simulator.js → simulation/Simulator.js} +25 -26
- package/core/lib/lantern/simulation/Simulator.test.js +434 -0
- package/core/lib/lantern/simulation/TCPConnection.test.d.ts +2 -0
- package/core/lib/lantern/simulation/TCPConnection.test.js +374 -0
- package/core/lib/lantern/{simulator/tcp-connection.d.ts → simulation/TcpConnection.d.ts} +2 -2
- package/core/lib/lantern/{simulator/tcp-connection.js → simulation/TcpConnection.js} +1 -1
- package/core/lib/lantern/simulation/simulation.d.ts +21 -0
- package/core/lib/lantern/simulation/simulation.js +28 -0
- package/core/lib/lantern/types/lantern.d.ts +5 -5
- package/core/lib/lantern-trace-saver.d.ts +4 -4
- package/core/lib/lantern-trace-saver.js +2 -2
- package/core/lib/navigation-error.js +3 -3
- package/core/lib/network-recorder.js +2 -2
- package/core/lib/network-request.d.ts +1 -1
- package/core/lib/network-request.js +1 -1
- package/package.json +2 -2
- package/tsconfig.json +10 -8
- package/types/artifacts.d.ts +3 -4
- package/types/gatherer.d.ts +1 -1
- /package/core/lib/lantern/{lantern-error.js → LanternError.js} +0 -0
- /package/core/lib/lantern/{tbt-utils.js → TBTUtils.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type Simulator = import('../../lib/lantern/
|
|
2
|
-
export type Node = import('../../lib/lantern/
|
|
1
|
+
export type Simulator = import('../../lib/lantern/simulation/Simulator.js').Simulator;
|
|
2
|
+
export type Node = import('../../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
export type ByteEfficiencyProduct = {
|
|
4
4
|
items: Array<LH.Audit.ByteEfficiencyItem>;
|
|
5
5
|
wastedBytesByUrl?: Map<string, number> | undefined;
|
|
@@ -14,8 +14,8 @@ import {LCPImageRecord} from '../../computed/lcp-image-record.js';
|
|
|
14
14
|
|
|
15
15
|
const str_ = i18n.createIcuMessageFn(import.meta.url, {});
|
|
16
16
|
|
|
17
|
-
/** @typedef {import('../../lib/lantern/
|
|
18
|
-
/** @typedef {import('../../lib/lantern/
|
|
17
|
+
/** @typedef {import('../../lib/lantern/simulation/Simulator.js').Simulator} Simulator */
|
|
18
|
+
/** @typedef {import('../../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
19
19
|
|
|
20
20
|
// Parameters for log-normal distribution scoring. These values were determined by fitting the
|
|
21
21
|
// log-normal cumulative distribution function curve to the former method of linear interpolation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default RenderBlockingResources;
|
|
2
|
-
export type Simulator = import('../../lib/lantern/
|
|
3
|
-
export type Node = import('../../lib/lantern/
|
|
4
|
-
export type NetworkNode = import('../../lib/lantern/
|
|
2
|
+
export type Simulator = import('../../lib/lantern/simulation/Simulator.js').Simulator;
|
|
3
|
+
export type Node = import('../../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>;
|
|
4
|
+
export type NetworkNode = import('../../lib/lantern/NetworkNode.js').NetworkNode<LH.Artifacts.NetworkRequest>;
|
|
5
5
|
declare class RenderBlockingResources extends Audit {
|
|
6
6
|
/**
|
|
7
7
|
* @param {LH.Artifacts} artifacts
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import {Audit} from '../audit.js';
|
|
13
13
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
|
-
import {BaseNode} from '../../lib/lantern/
|
|
14
|
+
import {BaseNode} from '../../lib/lantern/lantern.js';
|
|
15
15
|
import {UnusedCSS} from '../../computed/unused-css.js';
|
|
16
16
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
17
17
|
import {LoadSimulator} from '../../computed/load-simulator.js';
|
|
@@ -20,9 +20,9 @@ import {LCPImageRecord} from '../../computed/lcp-image-record.js';
|
|
|
20
20
|
import {NavigationInsights} from '../../computed/navigation-insights.js';
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
/** @typedef {import('../../lib/lantern/
|
|
24
|
-
/** @typedef {import('../../lib/lantern/
|
|
25
|
-
/** @typedef {import('../../lib/lantern/
|
|
23
|
+
/** @typedef {import('../../lib/lantern/simulation/Simulator.js').Simulator} Simulator */
|
|
24
|
+
/** @typedef {import('../../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
25
|
+
/** @typedef {import('../../lib/lantern/NetworkNode.js').NetworkNode<LH.Artifacts.NetworkRequest>} NetworkNode */
|
|
26
26
|
|
|
27
27
|
// Because of the way we detect blocking stylesheets, asynchronously loaded
|
|
28
28
|
// CSS with link[rel=preload] and an onload handler (see https://github.com/filamentgroup/loadCSS)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default UsesHTTP2Audit;
|
|
2
|
-
export type Simulator = import('../../lib/lantern/
|
|
3
|
-
export type Node = import('../../lib/lantern/
|
|
2
|
+
export type Simulator = import('../../lib/lantern/simulation/Simulator.js').Simulator;
|
|
3
|
+
export type Node = import('../../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>;
|
|
4
4
|
declare class UsesHTTP2Audit extends Audit {
|
|
5
5
|
/**
|
|
6
6
|
* Computes the estimated effect of all results being converted to http/2 on the provided graph.
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* origin are over the http/2 protocol.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/lantern/
|
|
13
|
-
/** @typedef {import('../../lib/lantern/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/simulation/Simulator.js').Simulator} Simulator */
|
|
13
|
+
/** @typedef {import('../../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
14
14
|
|
|
15
15
|
import {Audit} from '../audit.js';
|
|
16
16
|
import {EntityClassification} from '../../computed/entity-classification.js';
|
|
@@ -61,5 +61,5 @@ export namespace UIStrings {
|
|
|
61
61
|
const displayValue: string;
|
|
62
62
|
}
|
|
63
63
|
import { Audit } from './audit.js';
|
|
64
|
-
import * as Lantern from '../lib/lantern/
|
|
64
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
65
65
|
//# sourceMappingURL=long-tasks.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import * as Lantern from '../lib/lantern/
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
8
8
|
import {Audit} from './audit.js';
|
|
9
9
|
import {NetworkRecords} from '../computed/network-records.js';
|
|
10
10
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
@@ -39,7 +39,7 @@ declare class PrioritizeLcpImage extends Audit {
|
|
|
39
39
|
* @return {{lcpNodeToPreload?: LH.Gatherer.Simulation.GraphNetworkNode, initiatorPath?: InitiatorPath}}
|
|
40
40
|
*/
|
|
41
41
|
static getLCPNodeToPreload(mainResource: LH.Artifacts.NetworkRequest, graph: LH.Gatherer.Simulation.GraphNode, lcpRecord: NetworkRequest | undefined): {
|
|
42
|
-
lcpNodeToPreload?: import("../lib/lantern/
|
|
42
|
+
lcpNodeToPreload?: import("../lib/lantern/NetworkNode.js").NetworkNode<NetworkRequest> | undefined;
|
|
43
43
|
initiatorPath?: InitiatorPath | undefined;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
8
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
9
|
import {NetworkRecords} from './network-records.js';
|
|
10
10
|
import {ProcessedTrace} from './processed-trace.js';
|
|
@@ -41,7 +41,8 @@ class DocumentUrls {
|
|
|
41
41
|
}
|
|
42
42
|
if (!requestedUrl || !mainDocumentUrl) throw new Error('No main frame navigations found');
|
|
43
43
|
|
|
44
|
-
const initialRequest =
|
|
44
|
+
const initialRequest =
|
|
45
|
+
Lantern.Simulation.NetworkAnalyzer.findResourceForUrl(networkRecords, requestedUrl);
|
|
45
46
|
if (initialRequest?.redirects?.length) requestedUrl = initialRequest.redirects[0].url;
|
|
46
47
|
|
|
47
48
|
return {requestedUrl, mainDocumentUrl};
|
|
@@ -5,24 +5,24 @@ declare const LoadSimulatorComputed: typeof LoadSimulator & {
|
|
|
5
5
|
settings: LH.Audit.Context['settings'];
|
|
6
6
|
}, context: import("../../types/utility-types.js").default.ImmutableObject<{
|
|
7
7
|
computedCache: Map<string, import("../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
8
|
-
}>) => Promise<Simulator<any>>;
|
|
8
|
+
}>) => Promise<Lantern.Simulation.Simulator<any>>;
|
|
9
9
|
};
|
|
10
10
|
declare class LoadSimulator {
|
|
11
11
|
/**
|
|
12
12
|
* @param {{devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings']}} data
|
|
13
13
|
* @param {LH.Artifacts.ComputedContext} context
|
|
14
|
-
* @return {Promise<Simulator>}
|
|
14
|
+
* @return {Promise<Lantern.Simulation.Simulator>}
|
|
15
15
|
*/
|
|
16
16
|
static compute_(data: {
|
|
17
17
|
devtoolsLog: import("../index.js").DevtoolsLog;
|
|
18
18
|
settings: LH.Audit.Context['settings'];
|
|
19
|
-
}, context: LH.Artifacts.ComputedContext): Promise<Simulator>;
|
|
19
|
+
}, context: LH.Artifacts.ComputedContext): Promise<Lantern.Simulation.Simulator>;
|
|
20
20
|
/**
|
|
21
21
|
* @param {LH.Artifacts.NetworkAnalysis} networkAnalysis
|
|
22
22
|
* @return {LH.PrecomputedLanternData}
|
|
23
23
|
*/
|
|
24
24
|
static convertAnalysisToSaveableLanternData(networkAnalysis: LH.Artifacts.NetworkAnalysis): LH.PrecomputedLanternData;
|
|
25
25
|
}
|
|
26
|
-
import
|
|
26
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
27
27
|
import { NetworkAnalysis } from './network-analysis.js';
|
|
28
28
|
//# sourceMappingURL=load-simulator.d.ts.map
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import
|
|
8
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
9
9
|
import {NetworkAnalysis} from './network-analysis.js';
|
|
10
10
|
|
|
11
11
|
class LoadSimulator {
|
|
12
12
|
/**
|
|
13
13
|
* @param {{devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings']}} data
|
|
14
14
|
* @param {LH.Artifacts.ComputedContext} context
|
|
15
|
-
* @return {Promise<Simulator>}
|
|
15
|
+
* @return {Promise<Lantern.Simulation.Simulator>}
|
|
16
16
|
*/
|
|
17
17
|
static async compute_(data, context) {
|
|
18
18
|
const networkAnalysis = await NetworkAnalysis.request(data.devtoolsLog, context);
|
|
19
|
-
return Simulator.createSimulator({...data.settings, networkAnalysis});
|
|
19
|
+
return Lantern.Simulation.Simulator.createSimulator({...data.settings, networkAnalysis});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
9
|
import {NetworkRecords} from './network-records.js';
|
|
9
|
-
import {NetworkAnalyzer} from '../lib/lantern/simulator/network-analyzer.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @fileoverview This artifact identifies the main resource on the page. Current solution assumes
|
|
@@ -28,7 +28,8 @@ class MainResource {
|
|
|
28
28
|
// document request, we should return the last candidate here. Besides, the browser
|
|
29
29
|
// would have evicted the first request by the time `MainDocumentRequest` (a consumer
|
|
30
30
|
// of this computed artifact) attempts to fetch the contents, resulting in a protocol error.
|
|
31
|
-
const mainResource =
|
|
31
|
+
const mainResource =
|
|
32
|
+
Lantern.Simulation.NetworkAnalyzer.findLastDocumentForUrl(records, mainDocumentUrl);
|
|
32
33
|
if (!mainResource) {
|
|
33
34
|
throw new Error('Unable to identify the main resource');
|
|
34
35
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { LanternFirstContentfulPaintComputed as LanternFirstContentfulPaint };
|
|
2
|
-
export type Extras = import('../../lib/lantern/
|
|
2
|
+
export type Extras = import('../../lib/lantern/Metric.js').Extras;
|
|
3
3
|
declare const LanternFirstContentfulPaintComputed: typeof LanternFirstContentfulPaint & {
|
|
4
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
5
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
6
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
7
7
|
};
|
|
8
|
-
/** @typedef {import('../../lib/lantern/
|
|
9
|
-
declare class LanternFirstContentfulPaint extends FirstContentfulPaint {
|
|
8
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
9
|
+
declare class LanternFirstContentfulPaint extends Lantern.Metrics.FirstContentfulPaint {
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -21,5 +21,5 @@ declare class LanternFirstContentfulPaint extends FirstContentfulPaint {
|
|
|
21
21
|
*/
|
|
22
22
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
23
23
|
}
|
|
24
|
-
import
|
|
24
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
25
25
|
//# sourceMappingURL=lantern-first-contentful-paint.d.ts.map
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
9
|
import {getComputationDataParams, lanternErrorAdapter} from './lantern-metric.js';
|
|
9
|
-
import {FirstContentfulPaint} from '../../lib/lantern/metrics/first-contentful-paint.js';
|
|
10
10
|
|
|
11
|
-
/** @typedef {import('../../lib/lantern/
|
|
11
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
12
12
|
|
|
13
|
-
class LanternFirstContentfulPaint extends FirstContentfulPaint {
|
|
13
|
+
class LanternFirstContentfulPaint extends Lantern.Metrics.FirstContentfulPaint {
|
|
14
14
|
/**
|
|
15
15
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
16
16
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { LanternInteractiveComputed as LanternInteractive };
|
|
2
|
-
export type Extras = import('../../lib/lantern/
|
|
2
|
+
export type Extras = import('../../lib/lantern/Metric.js').Extras;
|
|
3
3
|
declare const LanternInteractiveComputed: typeof LanternInteractive & {
|
|
4
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
5
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
6
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
7
7
|
};
|
|
8
|
-
/** @typedef {import('../../lib/lantern/
|
|
9
|
-
declare class LanternInteractive extends Interactive {
|
|
8
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
9
|
+
declare class LanternInteractive extends Lantern.Metrics.Interactive {
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -21,5 +21,5 @@ declare class LanternInteractive extends Interactive {
|
|
|
21
21
|
*/
|
|
22
22
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
23
23
|
}
|
|
24
|
-
import
|
|
24
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
25
25
|
//# sourceMappingURL=lantern-interactive.d.ts.map
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
9
|
import {LanternLargestContentfulPaint} from './lantern-largest-contentful-paint.js';
|
|
9
|
-
import {Interactive} from '../../lib/lantern/metrics/interactive.js';
|
|
10
10
|
import {getComputationDataParams, lanternErrorAdapter} from './lantern-metric.js';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/lantern/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
13
13
|
|
|
14
|
-
class LanternInteractive extends Interactive {
|
|
14
|
+
class LanternInteractive extends Lantern.Metrics.Interactive {
|
|
15
15
|
/**
|
|
16
16
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
17
17
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { LanternLargestContentfulPaintComputed as LanternLargestContentfulPaint };
|
|
2
|
-
export type Extras = import('../../lib/lantern/
|
|
2
|
+
export type Extras = import('../../lib/lantern/Metric.js').Extras;
|
|
3
3
|
declare const LanternLargestContentfulPaintComputed: typeof LanternLargestContentfulPaint & {
|
|
4
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
5
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
6
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
7
7
|
};
|
|
8
|
-
/** @typedef {import('../../lib/lantern/
|
|
9
|
-
declare class LanternLargestContentfulPaint extends LargestContentfulPaint {
|
|
8
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
9
|
+
declare class LanternLargestContentfulPaint extends Lantern.Metrics.LargestContentfulPaint {
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -21,5 +21,5 @@ declare class LanternLargestContentfulPaint extends LargestContentfulPaint {
|
|
|
21
21
|
*/
|
|
22
22
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
23
23
|
}
|
|
24
|
-
import
|
|
24
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
25
25
|
//# sourceMappingURL=lantern-largest-contentful-paint.d.ts.map
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import {LargestContentfulPaint} from '../../lib/lantern/metrics/largest-contentful-paint.js';
|
|
9
9
|
import {getComputationDataParams, lanternErrorAdapter} from './lantern-metric.js';
|
|
10
10
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/lantern/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
13
13
|
|
|
14
|
-
class LanternLargestContentfulPaint extends LargestContentfulPaint {
|
|
14
|
+
class LanternLargestContentfulPaint extends Lantern.Metrics.LargestContentfulPaint {
|
|
15
15
|
/**
|
|
16
16
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
17
17
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { LanternMaxPotentialFIDComputed as LanternMaxPotentialFID };
|
|
2
|
-
export type Extras = import('../../lib/lantern/
|
|
2
|
+
export type Extras = import('../../lib/lantern/Metric.js').Extras;
|
|
3
3
|
declare const LanternMaxPotentialFIDComputed: typeof LanternMaxPotentialFID & {
|
|
4
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
5
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
6
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
7
7
|
};
|
|
8
|
-
/** @typedef {import('../../lib/lantern/
|
|
9
|
-
declare class LanternMaxPotentialFID extends MaxPotentialFID {
|
|
8
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
9
|
+
declare class LanternMaxPotentialFID extends Lantern.Metrics.MaxPotentialFID {
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -21,5 +21,5 @@ declare class LanternMaxPotentialFID extends MaxPotentialFID {
|
|
|
21
21
|
*/
|
|
22
22
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
23
23
|
}
|
|
24
|
-
import
|
|
24
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
25
25
|
//# sourceMappingURL=lantern-max-potential-fid.d.ts.map
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
|
-
import {MaxPotentialFID} from '../../lib/lantern/metrics/max-potential-fid.js';
|
|
9
9
|
import {getComputationDataParams, lanternErrorAdapter} from './lantern-metric.js';
|
|
10
10
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/lantern/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
13
13
|
|
|
14
|
-
class LanternMaxPotentialFID extends MaxPotentialFID {
|
|
14
|
+
class LanternMaxPotentialFID extends Lantern.Metrics.MaxPotentialFID {
|
|
15
15
|
/**
|
|
16
16
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
17
17
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param {LH.Artifacts.ComputedContext} context
|
|
4
4
|
*/
|
|
5
5
|
export function getComputationDataParamsFromTrace(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<{
|
|
6
|
-
simulator:
|
|
6
|
+
simulator: Lantern.Simulation.Simulator<any>;
|
|
7
7
|
graph: import("../page-dependency-graph.js").Node;
|
|
8
8
|
processedNavigation: import("../../lib/lantern/types/lantern.js").Simulation.ProcessedNavigation;
|
|
9
9
|
}>;
|
|
@@ -12,7 +12,7 @@ export function getComputationDataParamsFromTrace(data: LH.Artifacts.MetricCompu
|
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
13
13
|
*/
|
|
14
14
|
export function getComputationDataParamsFromDevtoolsLog(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<{
|
|
15
|
-
simulator:
|
|
15
|
+
simulator: Lantern.Simulation.Simulator<any>;
|
|
16
16
|
graph: import("../page-dependency-graph.js").Node;
|
|
17
17
|
processedNavigation: import("../../index.js").Artifacts.ProcessedNavigation;
|
|
18
18
|
}>;
|
|
@@ -21,7 +21,7 @@ export function getComputationDataParamsFromDevtoolsLog(data: LH.Artifacts.Metri
|
|
|
21
21
|
* @param {LH.Artifacts.ComputedContext} context
|
|
22
22
|
*/
|
|
23
23
|
export function getComputationDataParams(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<{
|
|
24
|
-
simulator:
|
|
24
|
+
simulator: Lantern.Simulation.Simulator<any>;
|
|
25
25
|
graph: import("../page-dependency-graph.js").Node;
|
|
26
26
|
processedNavigation: import("../../lib/lantern/types/lantern.js").Simulation.ProcessedNavigation;
|
|
27
27
|
}>;
|
|
@@ -30,4 +30,5 @@ export function getComputationDataParams(data: LH.Artifacts.MetricComputationDat
|
|
|
30
30
|
* @return {never}
|
|
31
31
|
*/
|
|
32
32
|
export function lanternErrorAdapter(err: unknown): never;
|
|
33
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
33
34
|
//# sourceMappingURL=lantern-metric.d.ts.map
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
8
8
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
9
9
|
import {LoadSimulator} from '../load-simulator.js';
|
|
10
10
|
import {ProcessedNavigation} from '../processed-navigation.js';
|
|
11
11
|
import {PageDependencyGraph} from '../page-dependency-graph.js';
|
|
12
12
|
import {TraceEngineResult} from '../trace-engine-result.js';
|
|
13
|
-
import {createProcessedNavigation} from '../../lib/lantern/trace-engine-computation-data.js';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
@@ -39,7 +38,8 @@ async function getComputationDataParamsFromTrace(data, context) {
|
|
|
39
38
|
|
|
40
39
|
const graph = await PageDependencyGraph.request({...data, fromTrace: true}, context);
|
|
41
40
|
const traceEngineResult = await TraceEngineResult.request(data, context);
|
|
42
|
-
const processedNavigation =
|
|
41
|
+
const processedNavigation =
|
|
42
|
+
Lantern.TraceEngineComputationData.createProcessedNavigation(traceEngineResult.data);
|
|
43
43
|
const simulator = data.simulator || (await LoadSimulator.request(data, context));
|
|
44
44
|
|
|
45
45
|
return {simulator, graph, processedNavigation};
|
|
@@ -50,7 +50,7 @@ async function getComputationDataParamsFromTrace(data, context) {
|
|
|
50
50
|
* @return {never}
|
|
51
51
|
*/
|
|
52
52
|
function lanternErrorAdapter(err) {
|
|
53
|
-
if (!(err instanceof
|
|
53
|
+
if (!(err instanceof Lantern.Error)) {
|
|
54
54
|
throw err;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { LanternSpeedIndexComputed as LanternSpeedIndex };
|
|
2
|
-
export type Extras = import('../../lib/lantern/
|
|
2
|
+
export type Extras = import('../../lib/lantern/Metric.js').Extras;
|
|
3
3
|
declare const LanternSpeedIndexComputed: typeof LanternSpeedIndex & {
|
|
4
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
5
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
6
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
7
7
|
};
|
|
8
|
-
/** @typedef {import('../../lib/lantern/
|
|
9
|
-
declare class LanternSpeedIndex extends SpeedIndex {
|
|
8
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
9
|
+
declare class LanternSpeedIndex extends Lantern.Metrics.SpeedIndex {
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -21,5 +21,5 @@ declare class LanternSpeedIndex extends SpeedIndex {
|
|
|
21
21
|
*/
|
|
22
22
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
23
23
|
}
|
|
24
|
-
import
|
|
24
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
25
25
|
//# sourceMappingURL=lantern-speed-index.d.ts.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
9
|
import {getComputationDataParams, lanternErrorAdapter} from './lantern-metric.js';
|
|
9
10
|
import {Speedline} from '../speedline.js';
|
|
10
11
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
|
-
import {SpeedIndex} from '../../lib/lantern/metrics/speed-index.js';
|
|
12
12
|
|
|
13
|
-
/** @typedef {import('../../lib/lantern/
|
|
13
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
14
14
|
|
|
15
|
-
class LanternSpeedIndex extends SpeedIndex {
|
|
15
|
+
class LanternSpeedIndex extends Lantern.Metrics.SpeedIndex {
|
|
16
16
|
/**
|
|
17
17
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
18
18
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { LanternTotalBlockingTimeComputed as LanternTotalBlockingTime };
|
|
2
|
-
export type Extras = import('../../lib/lantern/
|
|
2
|
+
export type Extras = import('../../lib/lantern/Metric.js').Extras;
|
|
3
3
|
declare const LanternTotalBlockingTimeComputed: typeof LanternTotalBlockingTime & {
|
|
4
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
5
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
6
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
7
7
|
};
|
|
8
|
-
/** @typedef {import('../../lib/lantern/
|
|
9
|
-
declare class LanternTotalBlockingTime extends TotalBlockingTime {
|
|
8
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
9
|
+
declare class LanternTotalBlockingTime extends Lantern.Metrics.TotalBlockingTime {
|
|
10
10
|
/**
|
|
11
11
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
12
12
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -21,5 +21,5 @@ declare class LanternTotalBlockingTime extends TotalBlockingTime {
|
|
|
21
21
|
*/
|
|
22
22
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
23
23
|
}
|
|
24
|
-
import
|
|
24
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
25
25
|
//# sourceMappingURL=lantern-total-blocking-time.d.ts.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
8
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
9
9
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
10
10
|
import {LanternInteractive} from './lantern-interactive.js';
|
|
11
11
|
import {getComputationDataParams} from './lantern-metric.js';
|
|
12
12
|
|
|
13
|
-
/** @typedef {import('../../lib/lantern/
|
|
13
|
+
/** @typedef {import('../../lib/lantern/Metric.js').Extras} Extras */
|
|
14
14
|
|
|
15
|
-
class LanternTotalBlockingTime extends TotalBlockingTime {
|
|
15
|
+
class LanternTotalBlockingTime extends Lantern.Metrics.TotalBlockingTime {
|
|
16
16
|
/**
|
|
17
17
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
18
18
|
* @param {LH.Artifacts.ComputedContext} context
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
9
|
import ComputedMetric from './metric.js';
|
|
9
10
|
import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js';
|
|
10
11
|
import {LanternTotalBlockingTime} from './lantern-total-blocking-time.js';
|
|
11
12
|
import {Interactive} from './interactive.js';
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
const {calculateSumOfBlockingTime} = Lantern.TBTUtils;
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* @fileoverview This audit determines Total Blocking Time.
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import {NetworkAnalyzer} from '../lib/lantern/simulator/network-analyzer.js';
|
|
9
9
|
import {NetworkRecords} from './network-records.js';
|
|
10
10
|
|
|
11
11
|
class NetworkAnalysis {
|
|
@@ -16,7 +16,7 @@ class NetworkAnalysis {
|
|
|
16
16
|
*/
|
|
17
17
|
static async compute_(devtoolsLog, context) {
|
|
18
18
|
const records = await NetworkRecords.request(devtoolsLog, context);
|
|
19
|
-
return NetworkAnalyzer.analyze(records);
|
|
19
|
+
return Lantern.Simulation.NetworkAnalyzer.analyze(records);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PageDependencyGraphComputed as PageDependencyGraph };
|
|
2
|
-
export type Node = import('../lib/lantern/
|
|
2
|
+
export type Node = import('../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
4
4
|
request: (dependencies: {
|
|
5
5
|
trace: LH.Trace;
|
|
@@ -11,7 +11,7 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
|
11
11
|
}>) => Promise<Node>;
|
|
12
12
|
};
|
|
13
13
|
import { NetworkRequest } from '../lib/network-request.js';
|
|
14
|
-
/** @typedef {import('../lib/lantern/
|
|
14
|
+
/** @typedef {import('../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
15
15
|
declare class PageDependencyGraph {
|
|
16
16
|
/**
|
|
17
17
|
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, URL: LH.Artifacts['URL'], fromTrace?: boolean}} data
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as Lantern from '../lib/lantern/lantern.js';
|
|
7
8
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import {PageDependencyGraph as LanternPageDependencyGraph} from '../lib/lantern/page-dependency-graph.js';
|
|
9
9
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
10
10
|
import {ProcessedTrace} from './processed-trace.js';
|
|
11
11
|
import {NetworkRecords} from './network-records.js';
|
|
12
12
|
import {TraceEngineResult} from './trace-engine-result.js';
|
|
13
|
-
import * as TraceEngineComputationData from '../lib/lantern/trace-engine-computation-data.js';
|
|
14
13
|
|
|
15
|
-
/** @typedef {import('../lib/lantern/
|
|
14
|
+
/** @typedef {import('../lib/lantern/BaseNode.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
16
15
|
|
|
17
16
|
class PageDependencyGraph {
|
|
18
17
|
/**
|
|
@@ -30,14 +29,15 @@ class PageDependencyGraph {
|
|
|
30
29
|
if (data.fromTrace) {
|
|
31
30
|
const traceEngineResult = await TraceEngineResult.request({trace}, context);
|
|
32
31
|
const traceEngineData = traceEngineResult.data;
|
|
33
|
-
const requests =
|
|
32
|
+
const requests =
|
|
33
|
+
Lantern.TraceEngineComputationData.createNetworkRequests(trace, traceEngineData);
|
|
34
34
|
const graph =
|
|
35
|
-
TraceEngineComputationData.createGraph(requests, trace, traceEngineData, URL);
|
|
35
|
+
Lantern.TraceEngineComputationData.createGraph(requests, trace, traceEngineData, URL);
|
|
36
36
|
return graph;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest);
|
|
40
|
-
return
|
|
40
|
+
return Lantern.PageDependencyGraph.createGraph(mainThreadEvents, lanternRequests, URL);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|