lighthouse 11.6.0-dev.20240303 → 11.6.0-dev.20240304
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 +7 -7
- package/core/audits/byte-efficiency/render-blocking-resources.d.ts +4 -3
- package/core/audits/byte-efficiency/render-blocking-resources.js +6 -6
- package/core/audits/dobetterweb/uses-http2.d.ts +3 -3
- package/core/audits/dobetterweb/uses-http2.js +4 -4
- package/core/audits/installable-manifest.d.ts +2 -0
- package/core/audits/installable-manifest.js +2 -0
- package/core/audits/prioritize-lcp-image.d.ts +1 -1
- package/core/computed/document-urls.js +1 -1
- package/core/computed/load-simulator.d.ts +1 -1
- package/core/computed/load-simulator.js +1 -1
- package/core/computed/main-resource.js +1 -1
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +6 -6
- package/core/computed/metrics/lantern-first-contentful-paint.js +4 -4
- package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +2 -2
- package/core/computed/metrics/lantern-first-meaningful-paint.js +1 -1
- package/core/computed/metrics/lantern-interactive.d.ts +2 -6
- package/core/computed/metrics/lantern-interactive.js +2 -2
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +2 -2
- package/core/computed/metrics/lantern-largest-contentful-paint.js +1 -1
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +2 -2
- package/core/computed/metrics/lantern-max-potential-fid.js +2 -2
- package/core/computed/metrics/lantern-metric.d.ts +7 -6
- package/core/computed/metrics/lantern-metric.js +4 -4
- package/core/computed/metrics/lantern-speed-index.d.ts +2 -2
- package/core/computed/metrics/lantern-speed-index.js +2 -2
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +2 -2
- package/core/computed/metrics/lantern-total-blocking-time.js +2 -2
- package/core/computed/network-analysis.js +1 -1
- package/core/computed/page-dependency-graph.d.ts +9 -9
- package/core/computed/page-dependency-graph.js +9 -9
- package/core/lib/asset-saver.js +1 -1
- package/core/lib/{dependency-graph → lantern}/base-node.d.ts +12 -8
- package/core/lib/{dependency-graph → lantern}/base-node.js +8 -3
- package/core/lib/{dependency-graph → lantern}/cpu-node.d.ts +5 -1
- package/core/lib/{dependency-graph → lantern}/cpu-node.js +4 -0
- package/core/lib/lantern/lantern.d.ts +9 -0
- package/core/lib/lantern/lantern.js +34 -0
- package/core/lib/{dependency-graph → lantern}/network-node.d.ts +16 -10
- package/core/lib/lantern/network-node.js +113 -0
- package/core/lib/{dependency-graph → lantern}/simulator/connection-pool.d.ts +11 -11
- package/core/lib/{dependency-graph → lantern}/simulator/connection-pool.js +6 -5
- package/core/lib/{dependency-graph → lantern}/simulator/dns-cache.d.ts +4 -5
- package/core/lib/{dependency-graph → lantern}/simulator/dns-cache.js +3 -3
- package/core/lib/{dependency-graph → lantern}/simulator/network-analyzer.d.ts +35 -32
- package/core/lib/{dependency-graph → lantern}/simulator/network-analyzer.js +21 -17
- package/core/lib/{dependency-graph → lantern}/simulator/simulator.d.ts +3 -3
- package/core/lib/{dependency-graph → lantern}/simulator/simulator.js +8 -7
- package/core/lib/lantern-trace-saver.d.ts +4 -4
- package/core/lib/lantern-trace-saver.js +6 -4
- package/core/lib/navigation-error.js +1 -1
- package/core/lib/network-request.d.ts +5 -0
- package/core/lib/network-request.js +12 -0
- package/package.json +1 -1
- package/shared/localization/locales/en-US.json +3 -0
- package/shared/localization/locales/en-XL.json +3 -0
- package/third-party/chromium-synchronization/installability-errors-test.js +1 -1
- package/tsconfig.json +5 -5
- package/types/artifacts.d.ts +1 -1
- package/types/gatherer.d.ts +5 -5
- package/types/internal/lantern.d.ts +82 -0
- package/core/lib/dependency-graph/network-node.js +0 -99
- /package/core/lib/{dependency-graph → lantern}/simulator/simulator-timing-map.d.ts +0 -0
- /package/core/lib/{dependency-graph → lantern}/simulator/simulator-timing-map.js +0 -0
- /package/core/lib/{dependency-graph → lantern}/simulator/tcp-connection.d.ts +0 -0
- /package/core/lib/{dependency-graph → lantern}/simulator/tcp-connection.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type Simulator = import('../../lib/
|
|
2
|
-
export type Node = import('../../lib/
|
|
1
|
+
export type Simulator = import('../../lib/lantern/simulator/simulator.js').Simulator;
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
export type ByteEfficiencyProduct = {
|
|
4
4
|
items: Array<LH.Audit.ByteEfficiencyItem>;
|
|
5
5
|
wastedBytesByUrl?: Map<string, number> | undefined;
|
|
@@ -16,8 +16,8 @@ import {LCPImageRecord} from '../../computed/lcp-image-record.js';
|
|
|
16
16
|
|
|
17
17
|
const str_ = i18n.createIcuMessageFn(import.meta.url, {});
|
|
18
18
|
|
|
19
|
-
/** @typedef {import('../../lib/
|
|
20
|
-
/** @typedef {import('../../lib/
|
|
19
|
+
/** @typedef {import('../../lib/lantern/simulator/simulator.js').Simulator} Simulator */
|
|
20
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
21
21
|
|
|
22
22
|
// Parameters for log-normal distribution scoring. These values were determined by fitting the
|
|
23
23
|
// log-normal cumulative distribution function curve to the former method of linear interpolation
|
|
@@ -125,10 +125,10 @@ class ByteEfficiencyAudit extends Audit {
|
|
|
125
125
|
const wastedBytes = wastedBytesByUrl.get(node.record.url);
|
|
126
126
|
if (!wastedBytes) return;
|
|
127
127
|
|
|
128
|
-
const original = node.
|
|
129
|
-
originalTransferSizes.set(node.
|
|
128
|
+
const original = node.request.transferSize;
|
|
129
|
+
originalTransferSizes.set(node.request.requestId, original);
|
|
130
130
|
|
|
131
|
-
node.
|
|
131
|
+
node.request.transferSize = Math.max(original - wastedBytes, 0);
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
const simulationAfterChanges = simulator.simulate(graph, {label: afterLabel});
|
|
@@ -136,9 +136,9 @@ class ByteEfficiencyAudit extends Audit {
|
|
|
136
136
|
// Restore the original transfer size after we've done our simulation
|
|
137
137
|
graph.traverse(node => {
|
|
138
138
|
if (node.type !== 'network') return;
|
|
139
|
-
const originalTransferSize = originalTransferSizes.get(node.
|
|
139
|
+
const originalTransferSize = originalTransferSizes.get(node.request.requestId);
|
|
140
140
|
if (originalTransferSize === undefined) return;
|
|
141
|
-
node.
|
|
141
|
+
node.request.transferSize = originalTransferSize;
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
const savings = simulationBeforeChanges.timeInMs - simulationAfterChanges.timeInMs;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default RenderBlockingResources;
|
|
2
|
-
export type Simulator = import('../../lib/
|
|
3
|
-
export type Node = import('../../lib/
|
|
4
|
-
export type NetworkNode =
|
|
2
|
+
export type Simulator = import('../../lib/lantern/simulator/simulator.js').Simulator;
|
|
3
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
4
|
+
export type NetworkNode = import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>;
|
|
5
5
|
declare class RenderBlockingResources extends Audit {
|
|
6
6
|
/**
|
|
7
7
|
* @param {LH.Artifacts} artifacts
|
|
@@ -52,5 +52,6 @@ export namespace UIStrings {
|
|
|
52
52
|
const title: string;
|
|
53
53
|
const description: string;
|
|
54
54
|
}
|
|
55
|
+
import { NetworkRequest } from '../../lib/network-request.js';
|
|
55
56
|
import { Audit } from '../audit.js';
|
|
56
57
|
//# sourceMappingURL=render-blocking-resources.d.ts.map
|
|
@@ -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/
|
|
14
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
15
15
|
import {UnusedCSS} from '../../computed/unused-css.js';
|
|
16
16
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
17
17
|
import {ProcessedNavigation} from '../../computed/processed-navigation.js';
|
|
@@ -20,9 +20,9 @@ import {FirstContentfulPaint} from '../../computed/metrics/first-contentful-pain
|
|
|
20
20
|
import {LCPImageRecord} from '../../computed/lcp-image-record.js';
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
/** @typedef {import('../../lib/
|
|
24
|
-
/** @typedef {import('../../lib/
|
|
25
|
-
/** @typedef {import('../../lib/
|
|
23
|
+
/** @typedef {import('../../lib/lantern/simulator/simulator.js').Simulator} Simulator */
|
|
24
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
25
|
+
/** @typedef {import('../../lib/lantern/network-node.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)
|
|
@@ -249,9 +249,9 @@ class RenderBlockingResources extends Audit {
|
|
|
249
249
|
// Add the inlined bytes to the HTML response
|
|
250
250
|
const originalTransferSize = minimalFCPGraph.record.transferSize;
|
|
251
251
|
const safeTransferSize = originalTransferSize || 0;
|
|
252
|
-
minimalFCPGraph.
|
|
252
|
+
minimalFCPGraph.request.transferSize = safeTransferSize + totalChildNetworkBytes;
|
|
253
253
|
const estimateAfterInline = simulator.simulate(minimalFCPGraph).timeInMs;
|
|
254
|
-
minimalFCPGraph.
|
|
254
|
+
minimalFCPGraph.request.transferSize = originalTransferSize;
|
|
255
255
|
return Math.round(Math.max(estimateBeforeInline - estimateAfterInline, 0));
|
|
256
256
|
}
|
|
257
257
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default UsesHTTP2Audit;
|
|
2
|
-
export type Simulator = import('../../lib/
|
|
3
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Simulator = import('../../lib/lantern/simulator/simulator.js').Simulator;
|
|
3
|
+
export type Node = import('../../lib/lantern/base-node.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.
|
|
@@ -83,7 +83,7 @@ export namespace UIStrings {
|
|
|
83
83
|
const displayValue: string;
|
|
84
84
|
const columnProtocol: string;
|
|
85
85
|
}
|
|
86
|
-
import { Audit } from '../audit.js';
|
|
87
86
|
import { NetworkRequest } from '../../lib/network-request.js';
|
|
87
|
+
import { Audit } from '../audit.js';
|
|
88
88
|
import { EntityClassification } from '../../computed/entity-classification.js';
|
|
89
89
|
//# sourceMappingURL=uses-http2.d.ts.map
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* origin are over the http/2 protocol.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/
|
|
13
|
-
/** @typedef {import('../../lib/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/simulator/simulator.js').Simulator} Simulator */
|
|
13
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
14
14
|
|
|
15
15
|
import {Audit} from '../audit.js';
|
|
16
16
|
import {EntityClassification} from '../../computed/entity-classification.js';
|
|
@@ -94,7 +94,7 @@ class UsesHTTP2Audit extends Audit {
|
|
|
94
94
|
if (!urlsToChange.has(node.record.url)) return;
|
|
95
95
|
|
|
96
96
|
originalProtocols.set(node.record.requestId, node.record.protocol);
|
|
97
|
-
node.
|
|
97
|
+
node.request.protocol = 'h2';
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
const simulationAfter = simulator.simulate(graph, {label: afterLabel, flexibleOrdering});
|
|
@@ -104,7 +104,7 @@ class UsesHTTP2Audit extends Audit {
|
|
|
104
104
|
if (node.type !== 'network') return;
|
|
105
105
|
const originalProtocol = originalProtocols.get(node.record.requestId);
|
|
106
106
|
if (originalProtocol === undefined) return;
|
|
107
|
-
node.
|
|
107
|
+
node.request.protocol = originalProtocol;
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
const savings = simulationBefore.timeInMs - simulationAfter.timeInMs;
|
|
@@ -59,6 +59,8 @@ export const UIStrings: {
|
|
|
59
59
|
'manifest-display-not-supported': string;
|
|
60
60
|
/** Error message explaining that the manifest could not be fetched, might be empty, or could not be parsed. */
|
|
61
61
|
'manifest-empty': string;
|
|
62
|
+
/** Error message explaining that the manifest could not be fetched, might be empty, or could not be parsed. */
|
|
63
|
+
'manifest-parsing-or-network-error': string;
|
|
62
64
|
/**
|
|
63
65
|
* @description Error message explaining that the manifest does not contain a suitable icon.
|
|
64
66
|
* @example {192} value0
|
|
@@ -44,6 +44,8 @@ const UIStrings = {
|
|
|
44
44
|
'manifest-display-not-supported': 'Manifest `display` property must be one of `standalone`, `fullscreen`, or `minimal-ui`',
|
|
45
45
|
/** Error message explaining that the manifest could not be fetched, might be empty, or could not be parsed. */
|
|
46
46
|
'manifest-empty': `Manifest could not be fetched, is empty, or could not be parsed`,
|
|
47
|
+
/** Error message explaining that the manifest could not be fetched, might be empty, or could not be parsed. */
|
|
48
|
+
'manifest-parsing-or-network-error': 'Manifest could not be fetched, is empty, or could not be parsed',
|
|
47
49
|
/**
|
|
48
50
|
* @description Error message explaining that the manifest does not contain a suitable icon.
|
|
49
51
|
* @example {192} value0
|
|
@@ -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("
|
|
42
|
+
lcpNodeToPreload?: import("../../types/gatherer.js").default.Simulation.GraphNetworkNode | 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 {NetworkAnalyzer} from '../lib/
|
|
7
|
+
import {NetworkAnalyzer} from '../lib/lantern/simulator/network-analyzer.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';
|
|
@@ -23,6 +23,6 @@ declare class LoadSimulator {
|
|
|
23
23
|
*/
|
|
24
24
|
static convertAnalysisToSaveableLanternData(networkAnalysis: LH.Artifacts.NetworkAnalysis): LH.PrecomputedLanternData;
|
|
25
25
|
}
|
|
26
|
-
import { Simulator } from '../lib/
|
|
26
|
+
import { Simulator } from '../lib/lantern/simulator/simulator.js';
|
|
27
27
|
import { NetworkAnalysis } from './network-analysis.js';
|
|
28
28
|
//# sourceMappingURL=load-simulator.d.ts.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import * as constants from '../config/constants.js';
|
|
9
|
-
import {Simulator} from '../lib/
|
|
9
|
+
import {Simulator} from '../lib/lantern/simulator/simulator.js';
|
|
10
10
|
import {NetworkAnalysis} from './network-analysis.js';
|
|
11
11
|
|
|
12
12
|
class LoadSimulator {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
8
|
import {NetworkRecords} from './network-records.js';
|
|
9
|
-
import {NetworkAnalyzer} from '../lib/
|
|
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
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { LanternFirstContentfulPaintComputed as LanternFirstContentfulPaint };
|
|
2
|
-
export type Node = import('../../lib/
|
|
3
|
-
export type CPUNode = import('../../lib/
|
|
4
|
-
export type NetworkNode = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
|
+
export type CPUNode = import('../../lib/lantern/cpu-node.js').CPUNode<LH.Artifacts.NetworkRequest>;
|
|
4
|
+
export type NetworkNode = import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>;
|
|
5
5
|
declare const LanternFirstContentfulPaintComputed: typeof LanternFirstContentfulPaint & {
|
|
6
6
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
7
7
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
8
8
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
9
9
|
};
|
|
10
|
-
/** @typedef {import('../../lib/
|
|
11
|
-
/** @typedef {import('../../lib/
|
|
12
|
-
/** @typedef {import('../../lib/
|
|
10
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
11
|
+
/** @typedef {import('../../lib/lantern/cpu-node.js').CPUNode<LH.Artifacts.NetworkRequest>} CPUNode */
|
|
12
|
+
/** @typedef {import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>} NetworkNode */
|
|
13
13
|
declare class LanternFirstContentfulPaint extends LanternMetric {
|
|
14
14
|
/**
|
|
15
15
|
* @typedef FirstPaintBasedGraphOpts
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
8
|
import {LanternMetric} from './lantern-metric.js';
|
|
9
|
-
import {BaseNode} from '../../lib/
|
|
9
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
10
10
|
|
|
11
|
-
/** @typedef {import('../../lib/
|
|
12
|
-
/** @typedef {import('../../lib/
|
|
13
|
-
/** @typedef {import('../../lib/
|
|
11
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
12
|
+
/** @typedef {import('../../lib/lantern/cpu-node.js').CPUNode<LH.Artifacts.NetworkRequest>} CPUNode */
|
|
13
|
+
/** @typedef {import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>} NetworkNode */
|
|
14
14
|
|
|
15
15
|
class LanternFirstContentfulPaint extends LanternMetric {
|
|
16
16
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { LanternFirstMeaningfulPaintComputed as LanternFirstMeaningfulPaint };
|
|
2
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
declare const LanternFirstMeaningfulPaintComputed: typeof LanternFirstMeaningfulPaint & {
|
|
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/
|
|
8
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
9
9
|
declare class LanternFirstMeaningfulPaint extends LanternMetric {
|
|
10
10
|
}
|
|
11
11
|
import { LanternMetric } from './lantern-metric.js';
|
|
@@ -9,7 +9,7 @@ import {LanternMetric} from './lantern-metric.js';
|
|
|
9
9
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
10
10
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
13
13
|
|
|
14
14
|
class LanternFirstMeaningfulPaint extends LanternMetric {
|
|
15
15
|
/**
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export { LanternInteractiveComputed as LanternInteractive };
|
|
2
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
declare const LanternInteractiveComputed: typeof LanternInteractive & {
|
|
4
|
-
/**
|
|
5
|
-
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
6
|
-
* @param {LH.Artifacts.ComputedContext} context
|
|
7
|
-
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
8
|
-
*/
|
|
9
4
|
request: (dependencies: import("../../index.js").Artifacts.MetricComputationDataInput, context: import("../../../types/utility-types.js").default.ImmutableObject<{
|
|
10
5
|
computedCache: Map<string, import("../../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
11
6
|
}>) => Promise<import("../../index.js").Artifacts.LanternMetric>;
|
|
12
7
|
};
|
|
8
|
+
import { NetworkRequest } from '../../lib/network-request.js';
|
|
13
9
|
declare class LanternInteractive extends LanternMetric {
|
|
14
10
|
/**
|
|
15
11
|
* @param {Node} dependencyGraph
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
8
|
import {LanternMetric} from './lantern-metric.js';
|
|
9
|
-
import {BaseNode} from '../../lib/
|
|
9
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
10
10
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
11
11
|
import {LanternFirstMeaningfulPaint} from './lantern-first-meaningful-paint.js';
|
|
12
12
|
|
|
13
|
-
/** @typedef {import('../../lib/
|
|
13
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
14
14
|
|
|
15
15
|
// Any CPU task of 20 ms or more will end up being a critical long task on mobile
|
|
16
16
|
const CRITICAL_LONG_TASK_THRESHOLD = 20;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { LanternLargestContentfulPaintComputed as LanternLargestContentfulPaint };
|
|
2
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
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/
|
|
8
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
9
9
|
declare class LanternLargestContentfulPaint extends LanternMetric {
|
|
10
10
|
/**
|
|
11
11
|
* Low priority image nodes are usually offscreen and very unlikely to be the
|
|
@@ -9,7 +9,7 @@ import {LanternMetric} from './lantern-metric.js';
|
|
|
9
9
|
import {LighthouseError} from '../../lib/lh-error.js';
|
|
10
10
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
13
13
|
|
|
14
14
|
class LanternLargestContentfulPaint extends LanternMetric {
|
|
15
15
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { LanternMaxPotentialFIDComputed as LanternMaxPotentialFID };
|
|
2
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
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/
|
|
8
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
9
9
|
declare class LanternMaxPotentialFID extends LanternMetric {
|
|
10
10
|
/**
|
|
11
11
|
* @param {Node} dependencyGraph
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
8
|
import {LanternMetric} from './lantern-metric.js';
|
|
9
|
-
import {BaseNode} from '../../lib/
|
|
9
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
10
10
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
|
|
12
|
-
/** @typedef {import('../../lib/
|
|
12
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
13
13
|
|
|
14
14
|
class LanternMaxPotentialFID extends LanternMetric {
|
|
15
15
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type Node = import('../../lib/
|
|
2
|
-
export type NetworkNode = import('../../lib/
|
|
3
|
-
export type Simulator = import('../../lib/
|
|
1
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
2
|
+
export type NetworkNode = import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>;
|
|
3
|
+
export type Simulator = import('../../lib/lantern/simulator/simulator.js').Simulator;
|
|
4
4
|
export type Extras = {
|
|
5
5
|
optimistic: boolean;
|
|
6
6
|
fcpResult?: LH.Artifacts.LanternMetric | undefined;
|
|
@@ -10,9 +10,9 @@ export type Extras = {
|
|
|
10
10
|
speedIndex: number;
|
|
11
11
|
} | undefined;
|
|
12
12
|
};
|
|
13
|
-
/** @typedef {import('../../lib/
|
|
14
|
-
/** @typedef {import('../../lib/
|
|
15
|
-
/** @typedef {import('../../lib/
|
|
13
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
14
|
+
/** @typedef {import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>} NetworkNode */
|
|
15
|
+
/** @typedef {import('../../lib/lantern/simulator/simulator.js').Simulator} Simulator */
|
|
16
16
|
/**
|
|
17
17
|
* @typedef Extras
|
|
18
18
|
* @property {boolean} optimistic
|
|
@@ -74,5 +74,6 @@ export class LanternMetric {
|
|
|
74
74
|
*/
|
|
75
75
|
static compute_(data: LH.Artifacts.MetricComputationDataInput, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.LanternMetric>;
|
|
76
76
|
}
|
|
77
|
+
import { NetworkRequest } from '../../lib/network-request.js';
|
|
77
78
|
import { ProcessedNavigation } from '../processed-navigation.js';
|
|
78
79
|
//# sourceMappingURL=lantern-metric.d.ts.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {BaseNode} from '../../lib/
|
|
7
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
8
8
|
import {NetworkRequest} from '../../lib/network-request.js';
|
|
9
9
|
import {ProcessedNavigation} from '../processed-navigation.js';
|
|
10
10
|
import {PageDependencyGraph} from '../page-dependency-graph.js';
|
|
11
11
|
import {LoadSimulator} from '../load-simulator.js';
|
|
12
12
|
|
|
13
|
-
/** @typedef {import('../../lib/
|
|
14
|
-
/** @typedef {import('../../lib/
|
|
15
|
-
/** @typedef {import('../../lib/
|
|
13
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
14
|
+
/** @typedef {import('../../lib/lantern/network-node.js').NetworkNode<LH.Artifacts.NetworkRequest>} NetworkNode */
|
|
15
|
+
/** @typedef {import('../../lib/lantern/simulator/simulator.js').Simulator} Simulator */
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @typedef Extras
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { LanternSpeedIndexComputed as LanternSpeedIndex };
|
|
2
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
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/
|
|
8
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
9
9
|
declare class LanternSpeedIndex extends LanternMetric {
|
|
10
10
|
/**
|
|
11
11
|
* @param {Node} dependencyGraph
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
8
|
import {LanternMetric} from './lantern-metric.js';
|
|
9
|
-
import {BaseNode} from '../../lib/
|
|
9
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
10
10
|
import {Speedline} from '../speedline.js';
|
|
11
11
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
12
12
|
import {throttling as defaultThrottling} from '../../config/constants.js';
|
|
13
13
|
|
|
14
|
-
/** @typedef {import('../../lib/
|
|
14
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
15
15
|
|
|
16
16
|
class LanternSpeedIndex extends LanternMetric {
|
|
17
17
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { LanternTotalBlockingTimeComputed as LanternTotalBlockingTime };
|
|
2
|
-
export type Node = import('../../lib/
|
|
2
|
+
export type Node = import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
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/
|
|
8
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
9
9
|
declare class LanternTotalBlockingTime extends LanternMetric {
|
|
10
10
|
/**
|
|
11
11
|
* @param {Node} dependencyGraph
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
8
8
|
import {LanternMetric} from './lantern-metric.js';
|
|
9
|
-
import {BaseNode} from '../../lib/
|
|
9
|
+
import {BaseNode} from '../../lib/lantern/base-node.js';
|
|
10
10
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
11
11
|
import {LanternInteractive} from './lantern-interactive.js';
|
|
12
12
|
import {BLOCKING_TIME_THRESHOLD, calculateSumOfBlockingTime} from './tbt-utils.js';
|
|
13
13
|
|
|
14
|
-
/** @typedef {import('../../lib/
|
|
14
|
+
/** @typedef {import('../../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
15
15
|
|
|
16
16
|
class LanternTotalBlockingTime extends LanternMetric {
|
|
17
17
|
/**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import {NetworkAnalyzer} from '../lib/
|
|
8
|
+
import {NetworkAnalyzer} from '../lib/lantern/simulator/network-analyzer.js';
|
|
9
9
|
import {NetworkRecords} from './network-records.js';
|
|
10
10
|
|
|
11
11
|
class NetworkAnalysis {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { PageDependencyGraphComputed as PageDependencyGraph };
|
|
2
|
-
export type Node = import('../lib/
|
|
2
|
+
export type Node = import('../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>;
|
|
3
3
|
export type URLArtifact = Omit<LH.Artifacts['URL'], 'finalDisplayedUrl'>;
|
|
4
4
|
export type NetworkNodeOutput = {
|
|
5
|
-
nodes: Array<NetworkNode
|
|
6
|
-
idToNodeMap: Map<string, NetworkNode
|
|
7
|
-
urlToNodeMap: Map<string, Array<NetworkNode
|
|
8
|
-
frameIdToNodeMap: Map<string, NetworkNode | null>;
|
|
5
|
+
nodes: Array<NetworkNode<LH.Artifacts.NetworkRequest>>;
|
|
6
|
+
idToNodeMap: Map<string, NetworkNode<LH.Artifacts.NetworkRequest>>;
|
|
7
|
+
urlToNodeMap: Map<string, Array<NetworkNode<LH.Artifacts.NetworkRequest>>>;
|
|
8
|
+
frameIdToNodeMap: Map<string, NetworkNode<LH.Artifacts.NetworkRequest> | null>;
|
|
9
9
|
};
|
|
10
10
|
declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
11
11
|
request: (dependencies: {
|
|
@@ -14,9 +14,10 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
|
14
14
|
URL: LH.Artifacts['URL'];
|
|
15
15
|
}, context: import("../../types/utility-types.js").default.ImmutableObject<{
|
|
16
16
|
computedCache: Map<string, import("../lib/arbitrary-equality-map.js").ArbitraryEqualityMap>;
|
|
17
|
-
}>) => Promise<
|
|
17
|
+
}>) => Promise<Node>;
|
|
18
18
|
};
|
|
19
|
-
import {
|
|
19
|
+
import { NetworkRequest } from '../lib/network-request.js';
|
|
20
|
+
import { NetworkNode } from '../lib/lantern/network-node.js';
|
|
20
21
|
declare class PageDependencyGraph {
|
|
21
22
|
/**
|
|
22
23
|
* @param {LH.Artifacts.NetworkRequest} record
|
|
@@ -73,7 +74,6 @@ declare class PageDependencyGraph {
|
|
|
73
74
|
URL: LH.Artifacts['URL'];
|
|
74
75
|
}, context: LH.Artifacts.ComputedContext): Promise<Node>;
|
|
75
76
|
}
|
|
76
|
-
import { NetworkRequest } from '../lib/network-request.js';
|
|
77
77
|
import { ProcessedTrace } from './processed-trace.js';
|
|
78
|
-
import { CPUNode } from '../lib/
|
|
78
|
+
import { CPUNode } from '../lib/lantern/cpu-node.js';
|
|
79
79
|
//# sourceMappingURL=page-dependency-graph.d.ts.map
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {makeComputedArtifact} from './computed-artifact.js';
|
|
8
|
-
import {NetworkNode} from '../lib/
|
|
9
|
-
import {CPUNode} from '../lib/
|
|
8
|
+
import {NetworkNode} from '../lib/lantern/network-node.js';
|
|
9
|
+
import {CPUNode} from '../lib/lantern/cpu-node.js';
|
|
10
10
|
import {TraceProcessor} from '../lib/tracehouse/trace-processor.js';
|
|
11
11
|
import {NetworkRequest} from '../lib/network-request.js';
|
|
12
12
|
import {ProcessedTrace} from './processed-trace.js';
|
|
13
13
|
import {NetworkRecords} from './network-records.js';
|
|
14
|
-
import {NetworkAnalyzer} from '../lib/
|
|
14
|
+
import {NetworkAnalyzer} from '../lib/lantern/simulator/network-analyzer.js';
|
|
15
15
|
import {DocumentUrls} from './document-urls.js';
|
|
16
16
|
|
|
17
|
-
/** @typedef {import('../lib/
|
|
17
|
+
/** @typedef {import('../lib/lantern/base-node.js').Node<LH.Artifacts.NetworkRequest>} Node */
|
|
18
18
|
/** @typedef {Omit<LH.Artifacts['URL'], 'finalDisplayedUrl'>} URLArtifact */
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @typedef {Object} NetworkNodeOutput
|
|
22
|
-
* @property {Array<NetworkNode
|
|
23
|
-
* @property {Map<string, NetworkNode
|
|
24
|
-
* @property {Map<string, Array<NetworkNode
|
|
25
|
-
* @property {Map<string, NetworkNode
|
|
22
|
+
* @property {Array<NetworkNode<LH.Artifacts.NetworkRequest>>} nodes
|
|
23
|
+
* @property {Map<string, NetworkNode<LH.Artifacts.NetworkRequest>>} idToNodeMap
|
|
24
|
+
* @property {Map<string, Array<NetworkNode<LH.Artifacts.NetworkRequest>>>} urlToNodeMap
|
|
25
|
+
* @property {Map<string, NetworkNode<LH.Artifacts.NetworkRequest>|null>} frameIdToNodeMap
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
// Shorter tasks have negligible impact on simulation results.
|
|
@@ -88,7 +88,7 @@ class PageDependencyGraph {
|
|
|
88
88
|
record.requestId += ':duplicate';
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
const node = new NetworkNode(record);
|
|
91
|
+
const node = new NetworkNode(NetworkRequest.asLanternNetworkRequest(record));
|
|
92
92
|
nodes.push(node);
|
|
93
93
|
|
|
94
94
|
const urlList = urlToNodeMap.get(record.url) || [];
|
package/core/lib/asset-saver.js
CHANGED
|
@@ -11,7 +11,7 @@ import url from 'url';
|
|
|
11
11
|
|
|
12
12
|
import log from 'lighthouse-logger';
|
|
13
13
|
|
|
14
|
-
import {Simulator} from './
|
|
14
|
+
import {Simulator} from './lantern/simulator/simulator.js';
|
|
15
15
|
import lanternTraceSaver from './lantern-trace-saver.js';
|
|
16
16
|
import {MetricTraceEvents} from './traces/metric-trace-events.js';
|
|
17
17
|
import {NetworkAnalysis} from '../computed/network-analysis.js';
|