lighthouse 13.5.0-dev.20260930 → 13.5.0-dev.20261005
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.
|
@@ -76,8 +76,8 @@ class PredictivePerf extends Audit {
|
|
|
76
76
|
pessimisticLCP: lcp.pessimisticEstimate.timeInMs,
|
|
77
77
|
|
|
78
78
|
roughEstimateOfTTFB: timingSummary.metrics.timeToFirstByte,
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
roughEstimateOfLCPLoadDelay: timingSummary.metrics.lcpLoadDelay,
|
|
80
|
+
roughEstimateOfLCPLoadDuration: timingSummary.metrics.lcpLoadDuration,
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
const score = Audit.computeLogNormalScore(
|
|
@@ -42,15 +42,15 @@ class LCPBreakdown {
|
|
|
42
42
|
const throttleRatio = metricLcp / observedLcp;
|
|
43
43
|
|
|
44
44
|
const unclampedLoadStart = (lcpRecord.networkRequestTime - timeOrigin) * throttleRatio;
|
|
45
|
-
const
|
|
45
|
+
const loadStart = Math.max(ttfb, Math.min(unclampedLoadStart, metricLcp));
|
|
46
46
|
|
|
47
47
|
const unclampedLoadEnd = (lcpRecord.networkEndTime - timeOrigin) * throttleRatio;
|
|
48
|
-
const
|
|
48
|
+
const loadEnd = Math.max(loadStart, Math.min(unclampedLoadEnd, metricLcp));
|
|
49
49
|
|
|
50
50
|
return {
|
|
51
51
|
ttfb,
|
|
52
|
-
loadDelay,
|
|
53
|
-
loadDuration,
|
|
52
|
+
loadDelay: loadStart - ttfb,
|
|
53
|
+
loadDuration: loadEnd - loadStart,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -155,6 +155,8 @@ export class NetworkRequest {
|
|
|
155
155
|
sessionTargetType: LH.Protocol.TargetType | undefined;
|
|
156
156
|
fromWorker: boolean;
|
|
157
157
|
isLinkPreload: boolean;
|
|
158
|
+
/** @type {import('@paulirish/trace_engine/models/trace/types/TraceEvents.js').RenderBlocking|undefined} */
|
|
159
|
+
renderBlocking: import("@paulirish/trace_engine/models/trace/types/TraceEvents.js").RenderBlocking | undefined;
|
|
158
160
|
/**
|
|
159
161
|
* @return {boolean}
|
|
160
162
|
*/
|
|
@@ -66,6 +66,17 @@ const HEADER_TOTAL = 'X-TotalMs';
|
|
|
66
66
|
const HEADER_FETCHED_SIZE = 'X-TotalFetchedSize';
|
|
67
67
|
const HEADER_PROTOCOL_IS_H2 = 'X-ProtocolIsH2';
|
|
68
68
|
|
|
69
|
+
// CDP uses PascalCase (M145+), Lantern uses snake_case.
|
|
70
|
+
/** @type {Record<LH.Crdp.Network.RenderBlockingBehavior,
|
|
71
|
+
* import('@paulirish/trace_engine/models/trace/types/TraceEvents.js').RenderBlocking>} */
|
|
72
|
+
const CDP_TO_LANTERN_RENDER_BLOCKING = {
|
|
73
|
+
'NonBlocking': 'non_blocking',
|
|
74
|
+
'Blocking': 'blocking',
|
|
75
|
+
'InBodyParserBlocking': 'in_body_parser_blocking',
|
|
76
|
+
'PotentiallyBlocking': 'potentially_blocking',
|
|
77
|
+
'NonBlockingDynamic': 'dynamically_injected_non_blocking',
|
|
78
|
+
};
|
|
79
|
+
|
|
69
80
|
/**
|
|
70
81
|
* @typedef HeaderEntry
|
|
71
82
|
* @property {string} name
|
|
@@ -187,6 +198,8 @@ class NetworkRequest {
|
|
|
187
198
|
this.sessionTargetType = undefined;
|
|
188
199
|
this.fromWorker = false;
|
|
189
200
|
this.isLinkPreload = false;
|
|
201
|
+
/** @type {import('@paulirish/trace_engine/models/trace/types/TraceEvents.js').RenderBlocking|undefined} */
|
|
202
|
+
this.renderBlocking = undefined;
|
|
190
203
|
}
|
|
191
204
|
|
|
192
205
|
/**
|
|
@@ -239,6 +252,11 @@ class NetworkRequest {
|
|
|
239
252
|
|
|
240
253
|
this.frameId = data.frameId;
|
|
241
254
|
this.isLinkPreload = data.initiator.type === 'preload' || !!data.request.isLinkPreload;
|
|
255
|
+
// M145+ provides renderBlockingBehavior in CDP
|
|
256
|
+
const renderBlockingBehavior = data.renderBlockingBehavior;
|
|
257
|
+
if (renderBlockingBehavior) {
|
|
258
|
+
this.renderBlocking = CDP_TO_LANTERN_RENDER_BLOCKING[renderBlockingBehavior];
|
|
259
|
+
}
|
|
242
260
|
this.isValid = true;
|
|
243
261
|
}
|
|
244
262
|
|
package/package.json
CHANGED