lighthouse 12.4.0 → 12.5.0
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/audit.js +3 -1
- package/core/audits/bootup-time.js +1 -1
- package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
- package/core/audits/byte-efficiency/efficient-animated-content.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +0 -65
- package/core/audits/byte-efficiency/legacy-javascript.js +11 -363
- package/core/audits/byte-efficiency/modern-image-formats.js +1 -1
- package/core/audits/byte-efficiency/offscreen-images.js +4 -3
- package/core/audits/byte-efficiency/render-blocking-resources.js +6 -3
- package/core/audits/byte-efficiency/unminified-css.js +2 -1
- package/core/audits/byte-efficiency/unminified-javascript.js +2 -1
- package/core/audits/byte-efficiency/unused-css-rules.js +1 -1
- package/core/audits/byte-efficiency/unused-javascript.js +2 -2
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +1 -1
- package/core/audits/byte-efficiency/uses-optimized-images.js +1 -1
- package/core/audits/byte-efficiency/uses-responsive-images.js +1 -1
- package/core/audits/byte-efficiency/uses-text-compression.js +2 -1
- package/core/audits/critical-request-chains.js +5 -3
- package/core/audits/dobetterweb/dom-size.js +1 -1
- package/core/audits/dobetterweb/uses-http2.js +1 -1
- package/core/audits/insights/cls-culprits-insight.js +1 -1
- package/core/audits/insights/document-latency-insight.js +1 -1
- package/core/audits/insights/dom-size-insight.js +1 -1
- package/core/audits/insights/{long-critical-network-tree-insight.d.ts → duplicated-javascript-insight.d.ts} +3 -3
- package/core/audits/insights/duplicated-javascript-insight.js +54 -0
- package/core/audits/insights/font-display-insight.js +8 -7
- package/core/audits/insights/forced-reflow-insight.d.ts +10 -0
- package/core/audits/insights/forced-reflow-insight.js +64 -12
- package/core/audits/insights/image-delivery-insight.js +9 -10
- package/core/audits/insights/insight-audit.js +9 -4
- package/core/audits/insights/interaction-to-next-paint-insight.js +1 -1
- package/core/audits/insights/lcp-discovery-insight.js +1 -1
- package/core/audits/insights/lcp-phases-insight.js +1 -1
- package/core/audits/insights/network-dependency-tree-insight.d.ts +11 -0
- package/core/audits/insights/{long-critical-network-tree-insight.js → network-dependency-tree-insight.js} +7 -7
- package/core/audits/insights/render-blocking-insight.js +1 -1
- package/core/audits/insights/slow-css-selector-insight.js +1 -1
- package/core/audits/insights/third-parties-insight.js +1 -1
- package/core/audits/insights/use-cache-insight.d.ts +11 -0
- package/core/audits/insights/use-cache-insight.js +61 -0
- package/core/audits/insights/viewport-insight.js +1 -1
- package/core/audits/largest-contentful-paint-element.js +7 -3
- package/core/audits/layout-shifts.js +5 -2
- package/core/audits/lcp-lazy-loaded.js +1 -1
- package/core/audits/long-tasks.js +6 -4
- package/core/audits/mainthread-work-breakdown.js +1 -1
- package/core/audits/metrics/first-contentful-paint.js +4 -2
- package/core/audits/metrics/interactive.js +6 -3
- package/core/audits/metrics/largest-contentful-paint.js +7 -3
- package/core/audits/metrics/max-potential-fid.js +6 -3
- package/core/audits/metrics/speed-index.js +6 -3
- package/core/audits/metrics/total-blocking-time.js +6 -3
- package/core/audits/metrics.js +4 -3
- package/core/audits/predictive-perf.js +4 -3
- package/core/audits/prioritize-lcp-image.js +5 -3
- package/core/audits/redirects.js +4 -2
- package/core/audits/script-treemap-data.js +8 -4
- package/core/audits/third-party-facades.js +1 -1
- package/core/audits/third-party-summary.js +1 -1
- package/core/audits/uses-rel-preconnect.js +7 -5
- package/core/audits/uses-rel-preload.js +5 -3
- package/core/computed/computed-artifact.d.ts +5 -1
- package/core/computed/computed-artifact.js +23 -2
- package/core/computed/critical-request-chains.d.ts +5 -1
- package/core/computed/critical-request-chains.js +4 -4
- package/core/computed/js-bundles.d.ts +1 -1
- package/core/computed/metrics/first-contentful-paint-all-frames.js +1 -1
- package/core/computed/metrics/first-contentful-paint.js +1 -1
- package/core/computed/metrics/interactive.js +1 -1
- package/core/computed/metrics/lantern-first-contentful-paint.js +1 -1
- package/core/computed/metrics/lantern-interactive.js +1 -1
- package/core/computed/metrics/lantern-largest-contentful-paint.js +1 -1
- package/core/computed/metrics/lantern-max-potential-fid.js +1 -1
- package/core/computed/metrics/lantern-metric.js +1 -1
- package/core/computed/metrics/lantern-speed-index.js +1 -1
- package/core/computed/metrics/lantern-total-blocking-time.js +1 -1
- package/core/computed/metrics/largest-contentful-paint-all-frames.js +1 -1
- package/core/computed/metrics/largest-contentful-paint.js +1 -1
- package/core/computed/metrics/lcp-breakdown.js +1 -1
- package/core/computed/metrics/max-potential-fid.js +1 -1
- package/core/computed/metrics/metric.js +2 -0
- package/core/computed/metrics/speed-index.js +1 -1
- package/core/computed/metrics/time-to-first-byte.js +1 -1
- package/core/computed/metrics/timing-summary.d.ts +5 -2
- package/core/computed/metrics/timing-summary.js +8 -4
- package/core/computed/metrics/total-blocking-time.js +1 -1
- package/core/computed/module-duplication.d.ts +1 -1
- package/core/computed/navigation-insights.d.ts +11 -3
- package/core/computed/navigation-insights.js +7 -4
- package/core/computed/page-dependency-graph.d.ts +7 -3
- package/core/computed/page-dependency-graph.js +6 -5
- package/core/computed/tbt-impact-tasks.js +1 -1
- package/core/computed/trace-engine-result.d.ts +36 -2
- package/core/computed/trace-engine-result.js +119 -25
- package/core/computed/unused-javascript-summary.d.ts +2 -2
- package/core/computed/unused-javascript-summary.js +1 -1
- package/core/config/default-config.js +19 -15
- package/core/config/experimental-config.js +19 -0
- package/core/gather/gatherers/source-maps.d.ts +1 -0
- package/core/gather/gatherers/source-maps.js +3 -0
- package/core/gather/gatherers/trace-elements.d.ts +4 -4
- package/core/gather/gatherers/trace-elements.js +8 -4
- package/core/gather/gatherers/trace.js +5 -0
- package/core/lib/bf-cache-strings.d.ts +0 -122
- package/core/lib/bf-cache-strings.js +1 -2
- package/core/lib/deprecation-description.js +2 -1
- package/core/lib/legacy-javascript/legacy-javascript.d.ts +29 -0
- package/core/lib/legacy-javascript/legacy-javascript.js +351 -0
- package/core/lib/legacy-javascript/polyfill-graph-data.json +93 -0
- package/core/lib/legacy-javascript/polyfill-module-data.json +623 -0
- package/core/lib/trace-engine.d.ts +6 -1
- package/core/lib/trace-engine.js +1 -2
- package/package.json +10 -8
- package/shared/localization/locales/ar-XB.json +783 -513
- package/shared/localization/locales/ar.json +783 -513
- package/shared/localization/locales/bg.json +933 -663
- package/shared/localization/locales/ca.json +925 -655
- package/shared/localization/locales/cs.json +926 -656
- package/shared/localization/locales/da.json +926 -656
- package/shared/localization/locales/de.json +803 -533
- package/shared/localization/locales/el.json +928 -658
- package/shared/localization/locales/en-GB.json +929 -659
- package/shared/localization/locales/en-US.json +593 -551
- package/shared/localization/locales/en-XA.json +28 -508
- package/shared/localization/locales/en-XL.json +593 -551
- package/shared/localization/locales/es-419.json +928 -658
- package/shared/localization/locales/es.json +787 -517
- package/shared/localization/locales/fi.json +925 -655
- package/shared/localization/locales/fil.json +929 -659
- package/shared/localization/locales/fr.json +927 -657
- package/shared/localization/locales/he.json +795 -528
- package/shared/localization/locales/hi.json +798 -528
- package/shared/localization/locales/hr.json +929 -659
- package/shared/localization/locales/hu.json +926 -656
- package/shared/localization/locales/id.json +926 -656
- package/shared/localization/locales/it.json +930 -660
- package/shared/localization/locales/ja.json +927 -657
- package/shared/localization/locales/ko.json +936 -666
- package/shared/localization/locales/lt.json +933 -663
- package/shared/localization/locales/lv.json +809 -539
- package/shared/localization/locales/nl.json +925 -655
- package/shared/localization/locales/no.json +928 -658
- package/shared/localization/locales/pl.json +927 -657
- package/shared/localization/locales/pt-PT.json +841 -571
- package/shared/localization/locales/pt.json +841 -571
- package/shared/localization/locales/ro.json +925 -655
- package/shared/localization/locales/ru.json +935 -668
- package/shared/localization/locales/sk.json +925 -655
- package/shared/localization/locales/sl.json +927 -657
- package/shared/localization/locales/sr-Latn.json +925 -655
- package/shared/localization/locales/sr.json +925 -655
- package/shared/localization/locales/sv.json +936 -666
- package/shared/localization/locales/ta.json +935 -668
- package/shared/localization/locales/te.json +785 -515
- package/shared/localization/locales/th.json +813 -543
- package/shared/localization/locales/tr.json +927 -657
- package/shared/localization/locales/uk.json +795 -525
- package/shared/localization/locales/vi.json +929 -659
- package/shared/localization/locales/zh-HK.json +926 -656
- package/shared/localization/locales/zh-TW.json +784 -514
- package/shared/localization/locales/zh.json +926 -656
- package/tsconfig.json +2 -1
- package/types/artifacts.d.ts +2 -1
- package/core/audits/byte-efficiency/polyfill-graph-data.json +0 -53
|
@@ -126,18 +126,18 @@ class CriticalRequestChains {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
* @param {{URL: LH.Artifacts['URL'], devtoolsLog: LH.DevtoolsLog, trace: LH.Trace}} data
|
|
129
|
+
* @param {{URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], devtoolsLog: LH.DevtoolsLog, trace: LH.Trace, settings: LH.Audit.Context['settings']}} data
|
|
130
130
|
* @param {LH.Artifacts.ComputedContext} context
|
|
131
131
|
* @return {Promise<LH.Artifacts.CriticalRequestNode>}
|
|
132
132
|
*/
|
|
133
133
|
static async compute_(data, context) {
|
|
134
134
|
const mainResource = await MainResource.request(data, context);
|
|
135
|
-
const graph = await PageDependencyGraph.request(data, context);
|
|
135
|
+
const graph = await PageDependencyGraph.request({...data, fromTrace: false}, context);
|
|
136
136
|
|
|
137
137
|
return CriticalRequestChains.extractChainsFromGraph(mainResource, graph);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const CriticalRequestChainsComputed =
|
|
142
|
-
|
|
141
|
+
const CriticalRequestChainsComputed = makeComputedArtifact(CriticalRequestChains,
|
|
142
|
+
['URL', 'SourceMaps', 'devtoolsLog', 'trace', 'settings']);
|
|
143
143
|
export {CriticalRequestChainsComputed as CriticalRequestChains};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { JSBundlesComputed as JSBundles };
|
|
2
2
|
declare const JSBundlesComputed: typeof JSBundles & {
|
|
3
|
-
request: (dependencies: Pick<import("../index.js").Artifacts, "
|
|
3
|
+
request: (dependencies: Pick<import("../index.js").Artifacts, "Scripts" | "SourceMaps">, context: LH.Artifacts.ComputedContext) => ReturnType<typeof JSBundles.compute_>;
|
|
4
4
|
};
|
|
5
5
|
declare class JSBundles {
|
|
6
6
|
/**
|
|
@@ -32,6 +32,6 @@ class FirstContentfulPaintAllFrames extends NavigationMetric {
|
|
|
32
32
|
|
|
33
33
|
const FirstContentfulPaintAllFramesComputed = makeComputedArtifact(
|
|
34
34
|
FirstContentfulPaintAllFrames,
|
|
35
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
35
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
36
36
|
);
|
|
37
37
|
export {FirstContentfulPaintAllFramesComputed as FirstContentfulPaintAllFrames};
|
|
@@ -35,6 +35,6 @@ class FirstContentfulPaint extends NavigationMetric {
|
|
|
35
35
|
|
|
36
36
|
const FirstContentfulPaintComputed = makeComputedArtifact(
|
|
37
37
|
FirstContentfulPaint,
|
|
38
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
38
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
39
39
|
);
|
|
40
40
|
export {FirstContentfulPaintComputed as FirstContentfulPaint};
|
|
@@ -181,7 +181,7 @@ class Interactive extends NavigationMetric {
|
|
|
181
181
|
|
|
182
182
|
const InteractiveComputed = makeComputedArtifact(
|
|
183
183
|
Interactive,
|
|
184
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
184
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
185
185
|
);
|
|
186
186
|
export {InteractiveComputed as Interactive};
|
|
187
187
|
|
|
@@ -32,6 +32,6 @@ class LanternFirstContentfulPaint extends Lantern.Metrics.FirstContentfulPaint {
|
|
|
32
32
|
|
|
33
33
|
const LanternFirstContentfulPaintComputed = makeComputedArtifact(
|
|
34
34
|
LanternFirstContentfulPaint,
|
|
35
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
35
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
36
36
|
);
|
|
37
37
|
export {LanternFirstContentfulPaintComputed as LanternFirstContentfulPaint};
|
|
@@ -34,6 +34,6 @@ class LanternInteractive extends Lantern.Metrics.Interactive {
|
|
|
34
34
|
|
|
35
35
|
const LanternInteractiveComputed = makeComputedArtifact(
|
|
36
36
|
LanternInteractive,
|
|
37
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
37
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
38
38
|
);
|
|
39
39
|
export {LanternInteractiveComputed as LanternInteractive};
|
|
@@ -34,6 +34,6 @@ class LanternLargestContentfulPaint extends Lantern.Metrics.LargestContentfulPai
|
|
|
34
34
|
|
|
35
35
|
const LanternLargestContentfulPaintComputed = makeComputedArtifact(
|
|
36
36
|
LanternLargestContentfulPaint,
|
|
37
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
37
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
38
38
|
);
|
|
39
39
|
export {LanternLargestContentfulPaintComputed as LanternLargestContentfulPaint};
|
|
@@ -34,6 +34,6 @@ class LanternMaxPotentialFID extends Lantern.Metrics.MaxPotentialFID {
|
|
|
34
34
|
|
|
35
35
|
const LanternMaxPotentialFIDComputed = makeComputedArtifact(
|
|
36
36
|
LanternMaxPotentialFID,
|
|
37
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
37
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
38
38
|
);
|
|
39
39
|
export {LanternMaxPotentialFIDComputed as LanternMaxPotentialFID};
|
|
@@ -20,7 +20,7 @@ async function getComputationDataParamsFromDevtoolsLog(data, context) {
|
|
|
20
20
|
throw new Error(`Lantern metrics can only be computed on navigations`);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const graph = await PageDependencyGraph.request(data, context);
|
|
23
|
+
const graph = await PageDependencyGraph.request({...data, fromTrace: false}, context);
|
|
24
24
|
const processedNavigation = await ProcessedNavigation.request(data.trace, context);
|
|
25
25
|
const simulator = data.simulator || (await LoadSimulator.request(data, context));
|
|
26
26
|
|
|
@@ -40,6 +40,6 @@ class LanternSpeedIndex extends Lantern.Metrics.SpeedIndex {
|
|
|
40
40
|
|
|
41
41
|
const LanternSpeedIndexComputed = makeComputedArtifact(
|
|
42
42
|
LanternSpeedIndex,
|
|
43
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
43
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
44
44
|
);
|
|
45
45
|
export {LanternSpeedIndexComputed as LanternSpeedIndex};
|
|
@@ -35,6 +35,6 @@ class LanternTotalBlockingTime extends Lantern.Metrics.TotalBlockingTime {
|
|
|
35
35
|
|
|
36
36
|
const LanternTotalBlockingTimeComputed = makeComputedArtifact(
|
|
37
37
|
LanternTotalBlockingTime,
|
|
38
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
38
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
39
39
|
);
|
|
40
40
|
export {LanternTotalBlockingTimeComputed as LanternTotalBlockingTime};
|
|
@@ -40,6 +40,6 @@ class LargestContentfulPaintAllFrames extends NavigationMetric {
|
|
|
40
40
|
|
|
41
41
|
const LargestContentfulPaintAllFramesComputed = makeComputedArtifact(
|
|
42
42
|
LargestContentfulPaintAllFrames,
|
|
43
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
43
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
44
44
|
);
|
|
45
45
|
export {LargestContentfulPaintAllFramesComputed as LargestContentfulPaintAllFrames};
|
|
@@ -47,6 +47,6 @@ class LargestContentfulPaint extends NavigationMetric {
|
|
|
47
47
|
|
|
48
48
|
const LargestContentfulPaintComputed = makeComputedArtifact(
|
|
49
49
|
LargestContentfulPaint,
|
|
50
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
50
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
51
51
|
);
|
|
52
52
|
export {LargestContentfulPaintComputed as LargestContentfulPaint};
|
|
@@ -52,7 +52,7 @@ class LCPBreakdown {
|
|
|
52
52
|
|
|
53
53
|
const LCPBreakdownComputed = makeComputedArtifact(
|
|
54
54
|
LCPBreakdown,
|
|
55
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
55
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
56
56
|
);
|
|
57
57
|
export {LCPBreakdownComputed as LCPBreakdown};
|
|
58
58
|
|
|
@@ -40,6 +40,6 @@ class MaxPotentialFID extends NavigationMetric {
|
|
|
40
40
|
|
|
41
41
|
const MaxPotentialFIDComputed = makeComputedArtifact(
|
|
42
42
|
MaxPotentialFID,
|
|
43
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
43
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
44
44
|
);
|
|
45
45
|
export {MaxPotentialFIDComputed as MaxPotentialFID};
|
|
@@ -35,6 +35,6 @@ class SpeedIndex extends NavigationMetric {
|
|
|
35
35
|
|
|
36
36
|
const SpeedIndexComputed = makeComputedArtifact(
|
|
37
37
|
SpeedIndex,
|
|
38
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
38
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
39
39
|
);
|
|
40
40
|
export {SpeedIndexComputed as SpeedIndex};
|
|
@@ -58,6 +58,6 @@ class TimeToFirstByte extends NavigationMetric {
|
|
|
58
58
|
|
|
59
59
|
const TimeToFirstByteComputed = makeComputedArtifact(
|
|
60
60
|
TimeToFirstByte,
|
|
61
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
61
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
62
62
|
);
|
|
63
63
|
export {TimeToFirstByteComputed as TimeToFirstByte};
|
|
@@ -6,6 +6,7 @@ declare const TimingSummaryComputed: typeof TimingSummary & {
|
|
|
6
6
|
gatherContext: LH.Artifacts["GatherContext"];
|
|
7
7
|
settings: LH.Util.ImmutableObject<LH.Config.Settings>;
|
|
8
8
|
URL: LH.Artifacts["URL"];
|
|
9
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
9
10
|
}, context: LH.Artifacts.ComputedContext) => ReturnType<typeof TimingSummary.compute_>;
|
|
10
11
|
};
|
|
11
12
|
declare class TimingSummary {
|
|
@@ -15,15 +16,16 @@ declare class TimingSummary {
|
|
|
15
16
|
* @param {LH.Artifacts['GatherContext']} gatherContext
|
|
16
17
|
* @param {LH.Util.ImmutableObject<LH.Config.Settings>} settings
|
|
17
18
|
* @param {LH.Artifacts['URL']} URL
|
|
19
|
+
* @param {LH.Artifacts['SourceMaps']} SourceMaps
|
|
18
20
|
* @param {LH.Artifacts.ComputedContext} context
|
|
19
21
|
* @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
|
|
20
22
|
*/
|
|
21
|
-
static summarize(trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts["GatherContext"], settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts["URL"], context: LH.Artifacts.ComputedContext): Promise<{
|
|
23
|
+
static summarize(trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts["GatherContext"], settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts["URL"], SourceMaps: LH.Artifacts["SourceMaps"], context: LH.Artifacts.ComputedContext): Promise<{
|
|
22
24
|
metrics: LH.Artifacts.TimingSummary;
|
|
23
25
|
debugInfo: Record<string, boolean>;
|
|
24
26
|
}>;
|
|
25
27
|
/**
|
|
26
|
-
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL']}} data
|
|
28
|
+
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps']}} data
|
|
27
29
|
* @param {LH.Artifacts.ComputedContext} context
|
|
28
30
|
* @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
|
|
29
31
|
*/
|
|
@@ -33,6 +35,7 @@ declare class TimingSummary {
|
|
|
33
35
|
gatherContext: LH.Artifacts["GatherContext"];
|
|
34
36
|
settings: LH.Util.ImmutableObject<LH.Config.Settings>;
|
|
35
37
|
URL: LH.Artifacts["URL"];
|
|
38
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
36
39
|
}, context: LH.Artifacts.ComputedContext): Promise<{
|
|
37
40
|
metrics: LH.Artifacts.TimingSummary;
|
|
38
41
|
debugInfo: Record<string, boolean>;
|
|
@@ -27,11 +27,14 @@ class TimingSummary {
|
|
|
27
27
|
* @param {LH.Artifacts['GatherContext']} gatherContext
|
|
28
28
|
* @param {LH.Util.ImmutableObject<LH.Config.Settings>} settings
|
|
29
29
|
* @param {LH.Artifacts['URL']} URL
|
|
30
|
+
* @param {LH.Artifacts['SourceMaps']} SourceMaps
|
|
30
31
|
* @param {LH.Artifacts.ComputedContext} context
|
|
31
32
|
* @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
|
|
32
33
|
*/
|
|
33
|
-
static async summarize(trace, devtoolsLog, gatherContext, settings, URL, context) {
|
|
34
|
-
const metricComputationData =
|
|
34
|
+
static async summarize(trace, devtoolsLog, gatherContext, settings, URL, SourceMaps, context) {
|
|
35
|
+
const metricComputationData =
|
|
36
|
+
{trace, devtoolsLog, gatherContext, settings, URL, SourceMaps, simulator: null};
|
|
37
|
+
|
|
35
38
|
/**
|
|
36
39
|
* @template TArtifacts
|
|
37
40
|
* @template TReturn
|
|
@@ -135,7 +138,7 @@ class TimingSummary {
|
|
|
135
138
|
return {metrics, debugInfo};
|
|
136
139
|
}
|
|
137
140
|
/**
|
|
138
|
-
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL']}} data
|
|
141
|
+
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, gatherContext: LH.Artifacts['GatherContext']; settings: LH.Util.ImmutableObject<LH.Config.Settings>, URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps']}} data
|
|
139
142
|
* @param {LH.Artifacts.ComputedContext} context
|
|
140
143
|
* @return {Promise<{metrics: LH.Artifacts.TimingSummary, debugInfo: Record<string,boolean>}>}
|
|
141
144
|
*/
|
|
@@ -146,6 +149,7 @@ class TimingSummary {
|
|
|
146
149
|
data.gatherContext,
|
|
147
150
|
data.settings,
|
|
148
151
|
data.URL,
|
|
152
|
+
data.SourceMaps,
|
|
149
153
|
context
|
|
150
154
|
);
|
|
151
155
|
}
|
|
@@ -153,6 +157,6 @@ class TimingSummary {
|
|
|
153
157
|
|
|
154
158
|
const TimingSummaryComputed = makeComputedArtifact(
|
|
155
159
|
TimingSummary,
|
|
156
|
-
['devtoolsLog', 'gatherContext', 'settings', 'trace', 'URL']
|
|
160
|
+
['devtoolsLog', 'gatherContext', 'settings', 'trace', 'URL', 'SourceMaps']
|
|
157
161
|
);
|
|
158
162
|
export {TimingSummaryComputed as TimingSummary};
|
|
@@ -71,6 +71,6 @@ class TotalBlockingTime extends ComputedMetric {
|
|
|
71
71
|
|
|
72
72
|
const TotalBlockingTimeComputed = makeComputedArtifact(
|
|
73
73
|
TotalBlockingTime,
|
|
74
|
-
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL']
|
|
74
|
+
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
75
75
|
);
|
|
76
76
|
export {TotalBlockingTimeComputed as TotalBlockingTime};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ModuleDuplicationComputed as ModuleDuplication };
|
|
2
2
|
declare const ModuleDuplicationComputed: typeof ModuleDuplication & {
|
|
3
|
-
request: (dependencies: Pick<import("../index.js").Artifacts, "
|
|
3
|
+
request: (dependencies: Pick<import("../index.js").Artifacts, "Scripts" | "SourceMaps">, context: LH.Artifacts.ComputedContext) => ReturnType<typeof ModuleDuplication.compute_>;
|
|
4
4
|
};
|
|
5
5
|
declare class ModuleDuplication {
|
|
6
6
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { NavigationInsightsComputed as NavigationInsights };
|
|
2
2
|
declare const NavigationInsightsComputed: typeof NavigationInsights & {
|
|
3
|
-
request: (dependencies:
|
|
3
|
+
request: (dependencies: {
|
|
4
|
+
trace: LH.Trace;
|
|
5
|
+
settings: LH.Audit.Context["settings"];
|
|
6
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
7
|
+
}, context: LH.Artifacts.ComputedContext) => ReturnType<typeof NavigationInsights.compute_>;
|
|
4
8
|
};
|
|
5
9
|
/**
|
|
6
10
|
* @fileoverview Gets insights from the shared trace engine for the navigation audited by Lighthouse.
|
|
@@ -8,9 +12,13 @@ declare const NavigationInsightsComputed: typeof NavigationInsights & {
|
|
|
8
12
|
*/
|
|
9
13
|
declare class NavigationInsights {
|
|
10
14
|
/**
|
|
11
|
-
* @param {LH.Trace}
|
|
15
|
+
* @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
|
|
12
16
|
* @param {LH.Artifacts.ComputedContext} context
|
|
13
17
|
*/
|
|
14
|
-
static compute_(
|
|
18
|
+
static compute_(data: {
|
|
19
|
+
trace: LH.Trace;
|
|
20
|
+
settings: LH.Audit.Context["settings"];
|
|
21
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
22
|
+
}, context: LH.Artifacts.ComputedContext): Promise<import("@paulirish/trace_engine/models/trace/insights/types.js").InsightSet>;
|
|
15
23
|
}
|
|
16
24
|
//# sourceMappingURL=navigation-insights.d.ts.map
|
|
@@ -14,12 +14,14 @@ import {TraceEngineResult} from './trace-engine-result.js';
|
|
|
14
14
|
*/
|
|
15
15
|
class NavigationInsights {
|
|
16
16
|
/**
|
|
17
|
-
* @param {LH.Trace}
|
|
17
|
+
* @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
|
|
18
18
|
* @param {LH.Artifacts.ComputedContext} context
|
|
19
19
|
*/
|
|
20
|
-
static async compute_(
|
|
20
|
+
static async compute_(data, context) {
|
|
21
|
+
const {trace, settings, SourceMaps} = data;
|
|
21
22
|
const processedTrace = await ProcessedTrace.request(trace, context);
|
|
22
|
-
const traceEngineResult =
|
|
23
|
+
const traceEngineResult =
|
|
24
|
+
await TraceEngineResult.request({trace, settings, SourceMaps}, context);
|
|
23
25
|
|
|
24
26
|
const navigationId = processedTrace.timeOriginEvt.args.data?.navigationId;
|
|
25
27
|
if (!navigationId) throw new Error('No navigationId found');
|
|
@@ -31,5 +33,6 @@ class NavigationInsights {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
const NavigationInsightsComputed =
|
|
36
|
+
const NavigationInsightsComputed =
|
|
37
|
+
makeComputedArtifact(NavigationInsights, ['trace', 'settings', 'SourceMaps']);
|
|
35
38
|
export {NavigationInsightsComputed as NavigationInsights};
|
|
@@ -3,21 +3,25 @@ declare const PageDependencyGraphComputed: typeof PageDependencyGraph & {
|
|
|
3
3
|
request: (dependencies: {
|
|
4
4
|
trace: LH.Trace;
|
|
5
5
|
devtoolsLog: LH.DevtoolsLog;
|
|
6
|
+
settings: LH.Audit.Context["settings"];
|
|
6
7
|
URL: LH.Artifacts["URL"];
|
|
7
|
-
|
|
8
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
9
|
+
fromTrace: boolean;
|
|
8
10
|
}, context: LH.Artifacts.ComputedContext) => ReturnType<typeof PageDependencyGraph.compute_>;
|
|
9
11
|
};
|
|
10
12
|
declare class PageDependencyGraph {
|
|
11
13
|
/**
|
|
12
|
-
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, URL: LH.Artifacts['URL'], fromTrace
|
|
14
|
+
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], fromTrace: boolean}} data
|
|
13
15
|
* @param {LH.Artifacts.ComputedContext} context
|
|
14
16
|
* @return {Promise<LH.Gatherer.Simulation.GraphNode>}
|
|
15
17
|
*/
|
|
16
18
|
static compute_(data: {
|
|
17
19
|
trace: LH.Trace;
|
|
18
20
|
devtoolsLog: LH.DevtoolsLog;
|
|
21
|
+
settings: LH.Audit.Context["settings"];
|
|
19
22
|
URL: LH.Artifacts["URL"];
|
|
20
|
-
|
|
23
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
24
|
+
fromTrace: boolean;
|
|
21
25
|
}, context: LH.Artifacts.ComputedContext): Promise<LH.Gatherer.Simulation.GraphNode>;
|
|
22
26
|
}
|
|
23
27
|
//# sourceMappingURL=page-dependency-graph.d.ts.map
|
|
@@ -13,19 +13,20 @@ import {TraceEngineResult} from './trace-engine-result.js';
|
|
|
13
13
|
|
|
14
14
|
class PageDependencyGraph {
|
|
15
15
|
/**
|
|
16
|
-
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, URL: LH.Artifacts['URL'], fromTrace
|
|
16
|
+
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], fromTrace: boolean}} data
|
|
17
17
|
* @param {LH.Artifacts.ComputedContext} context
|
|
18
18
|
* @return {Promise<LH.Gatherer.Simulation.GraphNode>}
|
|
19
19
|
*/
|
|
20
20
|
static async compute_(data, context) {
|
|
21
|
-
const {trace, devtoolsLog, URL} = data;
|
|
21
|
+
const {trace, settings, devtoolsLog, URL, SourceMaps} = data;
|
|
22
22
|
const [{mainThreadEvents}, networkRecords] = await Promise.all([
|
|
23
23
|
ProcessedTrace.request(trace, context),
|
|
24
24
|
NetworkRecords.request(devtoolsLog, context),
|
|
25
25
|
]);
|
|
26
26
|
|
|
27
27
|
if (data.fromTrace) {
|
|
28
|
-
const traceEngineResult =
|
|
28
|
+
const traceEngineResult =
|
|
29
|
+
await TraceEngineResult.request({trace, settings, SourceMaps}, context);
|
|
29
30
|
const traceEngineData = traceEngineResult.data;
|
|
30
31
|
const requests =
|
|
31
32
|
Lantern.TraceEngineComputationData.createNetworkRequests(trace, traceEngineData);
|
|
@@ -40,6 +41,6 @@ class PageDependencyGraph {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
const PageDependencyGraphComputed =
|
|
44
|
-
|
|
44
|
+
const PageDependencyGraphComputed = makeComputedArtifact(PageDependencyGraph,
|
|
45
|
+
['devtoolsLog', 'settings', 'trace', 'URL', 'SourceMaps', 'fromTrace']);
|
|
45
46
|
export {PageDependencyGraphComputed as PageDependencyGraph};
|
|
@@ -239,6 +239,6 @@ class TBTImpactTasks {
|
|
|
239
239
|
|
|
240
240
|
const TBTImpactTasksComputed = makeComputedArtifact(
|
|
241
241
|
TBTImpactTasks,
|
|
242
|
-
['trace', 'devtoolsLog', 'URL', 'gatherContext', 'settings', 'simulator']
|
|
242
|
+
['trace', 'devtoolsLog', 'URL', 'SourceMaps', 'gatherContext', 'settings', 'simulator']
|
|
243
243
|
);
|
|
244
244
|
export {TBTImpactTasksComputed as TBTImpactTasks};
|
|
@@ -2,6 +2,8 @@ export { TraceEngineResultComputed as TraceEngineResult };
|
|
|
2
2
|
declare const TraceEngineResultComputed: typeof TraceEngineResult & {
|
|
3
3
|
request: (dependencies: {
|
|
4
4
|
trace: LH.Trace;
|
|
5
|
+
settings: LH.Audit.Context["settings"];
|
|
6
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
5
7
|
}, context: LH.Artifacts.ComputedContext) => ReturnType<typeof TraceEngineResult.compute_>;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
@@ -10,21 +12,53 @@ declare const TraceEngineResultComputed: typeof TraceEngineResult & {
|
|
|
10
12
|
declare class TraceEngineResult {
|
|
11
13
|
/**
|
|
12
14
|
* @param {LH.TraceEvent[]} traceEvents
|
|
15
|
+
* @param {LH.Audit.Context['settings']} settings
|
|
16
|
+
* @param {LH.Artifacts['SourceMaps']} SourceMaps
|
|
13
17
|
* @return {Promise<LH.Artifacts.TraceEngineResult>}
|
|
14
18
|
*/
|
|
15
|
-
static runTraceEngine(traceEvents: LH.TraceEvent[]): Promise<LH.Artifacts.TraceEngineResult>;
|
|
19
|
+
static runTraceEngine(traceEvents: LH.TraceEvent[], settings: LH.Audit.Context["settings"], SourceMaps: LH.Artifacts["SourceMaps"]): Promise<LH.Artifacts.TraceEngineResult>;
|
|
20
|
+
/**
|
|
21
|
+
* Adapts the given DevTools function that returns a localized string to one
|
|
22
|
+
* that returns a LH.IcuMessage.
|
|
23
|
+
*
|
|
24
|
+
* @template {any[]} Args
|
|
25
|
+
* @template {import('../lib/trace-engine.js').DevToolsIcuMessage} Ret
|
|
26
|
+
* @param {ReturnType<i18n.createIcuMessageFn>} str_
|
|
27
|
+
* @param {(...args: Args) => Ret} fn
|
|
28
|
+
* @return {(...args: Args) => LH.IcuMessage}
|
|
29
|
+
*/
|
|
30
|
+
static localizeFunction<Args extends any[], Ret extends import("../lib/trace-engine.js").DevToolsIcuMessage>(str_: ReturnType<typeof i18n.createIcuMessageFn>, fn: (...args: Args) => Ret): (...args: Args) => LH.IcuMessage;
|
|
31
|
+
/**
|
|
32
|
+
* Converts the input parameters given to `i18nString` usages in DevTools to a
|
|
33
|
+
* LH.IcuMessage.
|
|
34
|
+
*
|
|
35
|
+
* @param {ReturnType<i18n.createIcuMessageFn>} str_
|
|
36
|
+
* @param {import('../lib/trace-engine.js').DevToolsIcuMessage} traceEngineI18nObject
|
|
37
|
+
* @return {LH.IcuMessage}
|
|
38
|
+
*/
|
|
39
|
+
static localize(str_: ReturnType<typeof i18n.createIcuMessageFn>, traceEngineI18nObject: import("../lib/trace-engine.js").DevToolsIcuMessage): LH.IcuMessage;
|
|
40
|
+
/**
|
|
41
|
+
* Recursively finds all DevToolsIcuMessage objects and replaces them with LH.IcuMessage.
|
|
42
|
+
*
|
|
43
|
+
* @param {ReturnType<i18n.createIcuMessageFn>} str_
|
|
44
|
+
* @param {object} object
|
|
45
|
+
*/
|
|
46
|
+
static localizeObject(str_: ReturnType<typeof i18n.createIcuMessageFn>, object: object): void;
|
|
16
47
|
/**
|
|
17
48
|
* @param {import('@paulirish/trace_engine/models/trace/insights/types.js').TraceInsightSets} insightSets
|
|
18
49
|
*/
|
|
19
50
|
static localizeInsights(insightSets: import("@paulirish/trace_engine/models/trace/insights/types.js").TraceInsightSets): void;
|
|
20
51
|
/**
|
|
21
|
-
* @param {{trace: LH.Trace}} data
|
|
52
|
+
* @param {{trace: LH.Trace, settings: LH.Audit.Context['settings'], SourceMaps: LH.Artifacts['SourceMaps']}} data
|
|
22
53
|
* @param {LH.Artifacts.ComputedContext} context
|
|
23
54
|
* @return {Promise<LH.Artifacts.TraceEngineResult>}
|
|
24
55
|
*/
|
|
25
56
|
static compute_(data: {
|
|
26
57
|
trace: LH.Trace;
|
|
58
|
+
settings: LH.Audit.Context["settings"];
|
|
59
|
+
SourceMaps: LH.Artifacts["SourceMaps"];
|
|
27
60
|
}, context: LH.Artifacts.ComputedContext): Promise<LH.Artifacts.TraceEngineResult>;
|
|
28
61
|
}
|
|
29
62
|
import * as LH from '../../types/lh.js';
|
|
63
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
30
64
|
//# sourceMappingURL=trace-engine-result.d.ts.map
|