lighthouse 12.0.0-dev.20240602 → 12.0.0-dev.20240604
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.js +1 -1
- package/core/audits/byte-efficiency/offscreen-images.js +1 -1
- package/core/audits/byte-efficiency/render-blocking-resources.js +6 -6
- package/core/audits/dobetterweb/uses-http2.js +3 -3
- package/core/audits/prioritize-lcp-image.js +2 -2
- package/core/audits/redirects.js +1 -1
- 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 +2 -2
- package/core/audits/uses-rel-preload.js +9 -9
- package/core/computed/critical-request-chains.js +3 -3
- package/core/computed/metrics/lantern-metric.d.ts +18 -0
- package/core/computed/metrics/lantern-metric.js +34 -2
- package/core/computed/navigation-insights.d.ts +2 -0
- package/core/computed/page-dependency-graph.d.ts +3 -1
- package/core/computed/page-dependency-graph.js +11 -4
- package/core/computed/trace-engine-result.d.ts +1 -0
- package/core/computed/trace-engine-result.js +1 -0
- package/core/lib/lantern/metric.js +3 -3
- package/core/lib/lantern/metrics/first-contentful-paint.js +1 -1
- package/core/lib/lantern/metrics/interactive.js +4 -4
- package/core/lib/lantern/metrics/largest-contentful-paint.js +2 -2
- package/core/lib/lantern/network-node.d.ts +2 -2
- package/core/lib/lantern/network-node.js +3 -4
- package/core/lib/lantern/page-dependency-graph.d.ts +62 -6
- package/core/lib/lantern/page-dependency-graph.js +473 -30
- package/core/lib/lantern/simulator/connection-pool.d.ts +10 -10
- package/core/lib/lantern/simulator/connection-pool.js +22 -22
- package/core/lib/lantern/simulator/dns-cache.d.ts +1 -1
- package/core/lib/lantern/simulator/dns-cache.js +1 -1
- package/core/lib/lantern/simulator/network-analyzer.d.ts +12 -12
- package/core/lib/lantern/simulator/network-analyzer.js +53 -53
- package/core/lib/lantern/simulator/simulator.d.ts +5 -5
- package/core/lib/lantern/simulator/simulator.js +18 -18
- package/core/lib/lantern/types/lantern.d.ts +12 -8
- package/core/lib/lantern-trace-saver.js +1 -1
- package/core/lib/network-request.d.ts +21 -0
- package/core/lib/network-request.js +5 -2
- package/package.json +6 -4
- package/tsconfig.json +1 -0
- package/types/artifacts.d.ts +16 -0
|
@@ -33,7 +33,7 @@ function convertNodeTimingsToTrace(nodeTimings) {
|
|
|
33
33
|
traceEvents.push(...createFakeTaskEvents(node, timing));
|
|
34
34
|
} else {
|
|
35
35
|
/** @type {LH.Artifacts.NetworkRequest} */
|
|
36
|
-
const record = node.
|
|
36
|
+
const record = node.rawRequest;
|
|
37
37
|
// Ignore data URIs as they don't really add much value
|
|
38
38
|
if (/^data/.test(record.url)) continue;
|
|
39
39
|
traceEvents.push(...createFakeNetworkEvents(requestId, record, timing));
|
|
@@ -149,6 +149,7 @@ export class NetworkRequest {
|
|
|
149
149
|
sessionId: string | undefined;
|
|
150
150
|
/** @type {LH.Protocol.TargetType|undefined} */
|
|
151
151
|
sessionTargetType: LH.Protocol.TargetType | undefined;
|
|
152
|
+
fromWorker: boolean;
|
|
152
153
|
isLinkPreload: boolean;
|
|
153
154
|
/**
|
|
154
155
|
* @return {boolean}
|
|
@@ -258,6 +259,26 @@ export namespace NetworkRequest {
|
|
|
258
259
|
export { HEADER_FETCHED_SIZE };
|
|
259
260
|
export { HEADER_PROTOCOL_IS_H2 };
|
|
260
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* @typedef HeaderEntry
|
|
264
|
+
* @property {string} name
|
|
265
|
+
* @property {string} value
|
|
266
|
+
*/
|
|
267
|
+
/**
|
|
268
|
+
* @typedef ParsedURL
|
|
269
|
+
* @property {string} scheme Equivalent to a `new URL(url).protocol` BUT w/o the trailing colon (:)
|
|
270
|
+
* @property {string} host Equivalent to a `new URL(url).hostname`
|
|
271
|
+
* @property {string} securityOrigin
|
|
272
|
+
*/
|
|
273
|
+
/**
|
|
274
|
+
* @typedef LightriderStatistics
|
|
275
|
+
* @property {number} endTimeDeltaMs The difference in networkEndTime between the observed Lighthouse networkEndTime and Lightrider's derived networkEndTime.
|
|
276
|
+
* @property {number} TCPMs The time spent making a TCP connection (connect + SSL). Note: this is poorly named.
|
|
277
|
+
* @property {number} requestMs The time spent requesting a resource from a remote server, we use this to approx RTT. Note: this is poorly names, it really should be "server response time".
|
|
278
|
+
* @property {number} responseMs Time to receive the entire response payload starting the clock on receiving the first fragment (first non-header byte).
|
|
279
|
+
*/
|
|
280
|
+
/** @type {LH.Util.SelfMap<LH.Crdp.Network.ResourceType>} */
|
|
281
|
+
export const RESOURCE_TYPES: LH.Util.SelfMap<LH.Crdp.Network.ResourceType>;
|
|
261
282
|
import * as LH from '../../types/lh.js';
|
|
262
283
|
import * as Lantern from './lantern/types/lantern.js';
|
|
263
284
|
declare const HEADER_TCP: "X-TCPMs";
|
|
@@ -180,6 +180,7 @@ class NetworkRequest {
|
|
|
180
180
|
this.sessionId = undefined;
|
|
181
181
|
/** @type {LH.Protocol.TargetType|undefined} */
|
|
182
182
|
this.sessionTargetType = undefined;
|
|
183
|
+
this.fromWorker = false;
|
|
183
184
|
this.isLinkPreload = false;
|
|
184
185
|
}
|
|
185
186
|
|
|
@@ -600,11 +601,13 @@ class NetworkRequest {
|
|
|
600
601
|
}
|
|
601
602
|
}
|
|
602
603
|
|
|
604
|
+
record.fromWorker = record.sessionTargetType === 'worker';
|
|
605
|
+
|
|
603
606
|
return {
|
|
607
|
+
rawRequest: record,
|
|
604
608
|
...record,
|
|
605
609
|
timing,
|
|
606
610
|
serverResponseTime,
|
|
607
|
-
record,
|
|
608
611
|
};
|
|
609
612
|
}
|
|
610
613
|
|
|
@@ -691,4 +694,4 @@ NetworkRequest.HEADER_TOTAL = HEADER_TOTAL;
|
|
|
691
694
|
NetworkRequest.HEADER_FETCHED_SIZE = HEADER_FETCHED_SIZE;
|
|
692
695
|
NetworkRequest.HEADER_PROTOCOL_IS_H2 = HEADER_PROTOCOL_IS_H2;
|
|
693
696
|
|
|
694
|
-
export {NetworkRequest};
|
|
697
|
+
export {NetworkRequest, RESOURCE_TYPES};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "12.0.0-dev.
|
|
4
|
+
"version": "12.0.0-dev.20240604",
|
|
5
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
6
6
|
"main": "./core/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -51,17 +51,19 @@
|
|
|
51
51
|
"test-proto": "yarn compile-proto && yarn build-proto-roundtrip",
|
|
52
52
|
"unit-core": "yarn mocha core",
|
|
53
53
|
"unit-cli": "yarn mocha --testMatch cli/**/*-test.js",
|
|
54
|
+
"unit-lantern-trace": "INTERNAL_LANTERN_USE_TRACE=1 yarn mocha core/test/computed/metrics core/test/audits",
|
|
54
55
|
"unit-report": "yarn mocha --testMatch report/**/*-test.js",
|
|
55
56
|
"unit-treemap": "yarn mocha --testMatch treemap/**/*-test.js",
|
|
56
57
|
"unit-viewer": "yarn mocha --testMatch viewer/**/*-test.js",
|
|
57
58
|
"unit-flow": "bash flow-report/test/run-flow-report-tests.sh",
|
|
58
|
-
"unit": "yarn unit-flow && yarn mocha",
|
|
59
|
+
"unit": "yarn unit-flow && yarn mocha && yarn unit-lantern-trace",
|
|
59
60
|
"unit:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit",
|
|
61
|
+
"unit-lantern-trace:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit-lantern-trace",
|
|
60
62
|
"core-unit": "yarn unit-core",
|
|
61
63
|
"cli-unit": "yarn unit-cli",
|
|
62
64
|
"viewer-unit": "yarn unit-viewer",
|
|
63
65
|
"watch": "yarn unit-core --watch",
|
|
64
|
-
"unit:cicoverage": "yarn c8 --all yarn unit:ci",
|
|
66
|
+
"unit:cicoverage": "yarn c8 --all yarn unit:ci && yarn c8 --all yarn unit-lantern-trace:ci",
|
|
65
67
|
"coverage": "yarn unit:cicoverage && c8 report --reporter html",
|
|
66
68
|
"coverage:smoke": "yarn c8 yarn smoke -j=1 && c8 report --reporter html",
|
|
67
69
|
"devtools": "bash core/scripts/roll-to-devtools.sh",
|
|
@@ -179,7 +181,7 @@
|
|
|
179
181
|
"webtreemap-cdt": "^3.2.1"
|
|
180
182
|
},
|
|
181
183
|
"dependencies": {
|
|
182
|
-
"@paulirish/trace_engine": "^0.0.
|
|
184
|
+
"@paulirish/trace_engine": "^0.0.23",
|
|
183
185
|
"@sentry/node": "^6.17.4",
|
|
184
186
|
"axe-core": "^4.9.0",
|
|
185
187
|
"chrome-launcher": "^1.1.1",
|
package/tsconfig.json
CHANGED
|
@@ -109,5 +109,6 @@
|
|
|
109
109
|
"core/test/computed/metrics/interactive-test.js",
|
|
110
110
|
"core/test/computed/tbt-impact-tasks-test.js",
|
|
111
111
|
"core/test/fixtures/config-plugins/lighthouse-plugin-simple/plugin-simple.js",
|
|
112
|
+
"core/test/lib/lantern/metrics/metric-test-utils.js",
|
|
112
113
|
],
|
|
113
114
|
}
|
package/types/artifacts.d.ts
CHANGED
|
@@ -942,6 +942,22 @@ export interface TraceEvent {
|
|
|
942
942
|
name?: string;
|
|
943
943
|
duration?: number;
|
|
944
944
|
blockingDuration?: number;
|
|
945
|
+
candidateIndex?: number;
|
|
946
|
+
priority?: string;
|
|
947
|
+
requestMethod?: string;
|
|
948
|
+
resourceType?: string;
|
|
949
|
+
fromCache?: boolean;
|
|
950
|
+
fromServiceWorker?: boolean;
|
|
951
|
+
mimeType?: string;
|
|
952
|
+
statusCode?: number;
|
|
953
|
+
timing?: any;
|
|
954
|
+
connectionId?: number;
|
|
955
|
+
connectionReused?: boolean;
|
|
956
|
+
encodedDataLength?: number;
|
|
957
|
+
decodedBodyLength?: number;
|
|
958
|
+
initiator?: {type: string, url?: string, stack?: any};
|
|
959
|
+
protocol?: string;
|
|
960
|
+
finishTime?: number;
|
|
945
961
|
};
|
|
946
962
|
frame?: string;
|
|
947
963
|
name?: string;
|