lighthouse 12.0.0-dev.20240605 → 12.0.0-dev.20240607
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/metrics/first-meaningful-paint.d.ts +1 -17
- package/core/audits/metrics/first-meaningful-paint.js +5 -47
- package/core/audits/metrics/interactive.d.ts +1 -1
- package/core/audits/metrics/interactive.js +1 -1
- package/core/audits/predictive-perf.js +0 -6
- package/core/audits/redirects.js +1 -2
- package/core/computed/metrics/lantern-interactive.js +3 -3
- package/core/computed/metrics/lantern-metric.d.ts +2 -2
- package/core/computed/metrics/lantern-metric.js +4 -1
- package/core/computed/metrics/timing-summary.js +0 -6
- package/core/lib/lantern/lantern.d.ts +10 -5
- package/core/lib/lantern/lantern.js +47 -0
- package/core/lib/lantern/metric.d.ts +6 -6
- package/core/lib/lantern/metric.js +3 -3
- package/core/lib/lantern/metrics/first-contentful-paint.js +2 -2
- package/core/lib/lantern/metrics/interactive.js +7 -7
- package/core/lib/lantern/metrics/largest-contentful-paint.js +2 -2
- package/core/lib/lantern/types/lantern.d.ts +8 -1
- package/core/lib/tracehouse/trace-processor.d.ts +0 -2
- package/core/lib/tracehouse/trace-processor.js +1 -31
- package/core/lib/traces/metric-trace-events.js +0 -5
- package/dist/report/bundle.esm.js +1 -1
- package/dist/report/flow.js +1 -1
- package/dist/report/standalone.js +1 -1
- package/package.json +1 -1
- package/report/renderer/performance-category-renderer.js +1 -1
- package/types/artifacts.d.ts +0 -12
- package/core/computed/metrics/first-meaningful-paint.d.ts +0 -21
- package/core/computed/metrics/first-meaningful-paint.js +0 -44
- package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +0 -25
- package/core/computed/metrics/lantern-first-meaningful-paint.js +0 -43
- package/core/lib/lantern/metrics/first-meaningful-paint.d.ts +0 -6
- package/core/lib/lantern/metrics/first-meaningful-paint.js +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as Lantern from '../types/lantern.js';
|
|
8
|
-
import {Metric} from '../metric.js';
|
|
9
|
-
import {FirstContentfulPaint} from './first-contentful-paint.js';
|
|
10
|
-
|
|
11
|
-
/** @typedef {import('../base-node.js').Node} Node */
|
|
12
|
-
|
|
13
|
-
class FirstMeaningfulPaint extends Metric {
|
|
14
|
-
/**
|
|
15
|
-
* @return {Lantern.Simulation.MetricCoefficients}
|
|
16
|
-
*/
|
|
17
|
-
static get COEFFICIENTS() {
|
|
18
|
-
return {
|
|
19
|
-
intercept: 0,
|
|
20
|
-
optimistic: 0.5,
|
|
21
|
-
pessimistic: 0.5,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {Node} dependencyGraph
|
|
27
|
-
* @param {LH.Artifacts.ProcessedNavigation} processedNavigation
|
|
28
|
-
* @return {Node}
|
|
29
|
-
*/
|
|
30
|
-
static getOptimisticGraph(dependencyGraph, processedNavigation) {
|
|
31
|
-
const fmp = processedNavigation.timestamps.firstMeaningfulPaint;
|
|
32
|
-
if (!fmp) {
|
|
33
|
-
throw new Error('NO_FMP');
|
|
34
|
-
}
|
|
35
|
-
return FirstContentfulPaint.getFirstPaintBasedGraph(dependencyGraph, {
|
|
36
|
-
cutoffTimestamp: fmp,
|
|
37
|
-
// See FirstContentfulPaint's getOptimisticGraph implementation for a longer description
|
|
38
|
-
// of why we exclude script initiated resources here.
|
|
39
|
-
treatNodeAsRenderBlocking: node =>
|
|
40
|
-
node.hasRenderBlockingPriority() && node.initiatorType !== 'script',
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @param {Node} dependencyGraph
|
|
46
|
-
* @param {LH.Artifacts.ProcessedNavigation} processedNavigation
|
|
47
|
-
* @return {Node}
|
|
48
|
-
*/
|
|
49
|
-
static getPessimisticGraph(dependencyGraph, processedNavigation) {
|
|
50
|
-
const fmp = processedNavigation.timestamps.firstMeaningfulPaint;
|
|
51
|
-
if (!fmp) {
|
|
52
|
-
throw new Error('NO_FMP');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return FirstContentfulPaint.getFirstPaintBasedGraph(dependencyGraph, {
|
|
56
|
-
cutoffTimestamp: fmp,
|
|
57
|
-
treatNodeAsRenderBlocking: node => node.hasRenderBlockingPriority(),
|
|
58
|
-
// For pessimistic FMP we'll include *all* layout nodes
|
|
59
|
-
additionalCpuNodesToTreatAsRenderBlocking: node => node.didPerformLayout(),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export {FirstMeaningfulPaint};
|