lighthouse 10.2.0 → 10.3.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/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +4 -6
- package/core/audits/accessibility/html-xml-lang-mismatch.d.ts +10 -0
- package/core/audits/accessibility/html-xml-lang-mismatch.js +47 -0
- package/core/audits/accessibility/input-button-name.d.ts +10 -0
- package/core/audits/accessibility/input-button-name.js +44 -0
- package/core/audits/accessibility/table-fake-caption.d.ts +10 -0
- package/core/audits/accessibility/table-fake-caption.js +47 -0
- package/core/audits/accessibility/td-has-header.d.ts +10 -0
- package/core/audits/accessibility/td-has-header.js +45 -0
- package/core/audits/audit.d.ts +2 -1
- package/core/audits/audit.js +5 -2
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +3 -3
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +14 -19
- package/core/audits/deprecations.js +1 -1
- package/core/audits/largest-contentful-paint-element.d.ts +14 -2
- package/core/audits/largest-contentful-paint-element.js +49 -31
- package/core/audits/layout-shift-elements.d.ts +3 -2
- package/core/audits/layout-shift-elements.js +10 -2
- package/core/audits/metrics.js +0 -2
- package/core/audits/network-requests.js +6 -0
- package/core/audits/seo/crawlable-anchors.js +4 -0
- package/core/audits/server-response-time.d.ts +2 -1
- package/core/audits/server-response-time.js +17 -3
- package/core/audits/uses-rel-preconnect.js +20 -4
- package/core/computed/entity-classification.d.ts +14 -1
- package/core/computed/entity-classification.js +61 -6
- package/core/computed/metrics/cumulative-layout-shift.d.ts +2 -9
- package/core/computed/metrics/cumulative-layout-shift.js +3 -16
- package/core/computed/metrics/time-to-first-byte.js +10 -7
- package/core/computed/metrics/timing-summary.js +0 -3
- package/core/config/default-config.js +8 -0
- package/core/gather/driver/execution-context.js +13 -5
- package/core/gather/driver/target-manager.d.ts +13 -0
- package/core/gather/driver/target-manager.js +49 -0
- package/core/gather/gatherers/accessibility.js +19 -20
- package/core/gather/gatherers/anchor-elements.js +2 -0
- package/core/gather/gatherers/global-listeners.js +38 -21
- package/core/gather/gatherers/inspector-issues.js +2 -1
- package/core/gather/gatherers/trace-elements.d.ts +3 -2
- package/core/gather/gatherers/trace-elements.js +10 -19
- package/core/legacy/config/config.d.ts +1 -1
- package/core/legacy/config/config.js +1 -1
- package/core/legacy/gather/driver.d.ts +1 -0
- package/core/legacy/gather/driver.js +11 -0
- package/core/lib/asset-saver.d.ts +4 -0
- package/core/lib/asset-saver.js +19 -0
- package/core/lib/bf-cache-strings.d.ts +3 -0
- package/core/lib/bf-cache-strings.js +248 -232
- package/core/lib/cdt/generated/SourceMap.d.ts +18 -31
- package/core/lib/cdt/generated/SourceMap.js +51 -101
- package/core/lib/dependency-graph/simulator/network-analyzer.d.ts +6 -2
- package/core/lib/dependency-graph/simulator/network-analyzer.js +45 -13
- package/core/lib/deprecation-description.d.ts +17 -0
- package/core/lib/deprecation-description.js +71 -0
- package/core/lib/deprecations-strings.d.ts +282 -63
- package/core/lib/deprecations-strings.js +282 -551
- package/core/lib/lh-error.d.ts +9 -4
- package/core/lib/lh-error.js +15 -11
- package/core/lib/network-request.d.ts +13 -6
- package/core/lib/network-request.js +39 -14
- package/core/lib/tracehouse/trace-processor.js +1 -1
- package/core/lib/url-utils.js +4 -0
- package/core/runner.js +4 -2
- package/dist/report/bundle.esm.js +24 -7
- package/dist/report/flow.js +3 -3
- package/dist/report/standalone.js +8 -8
- package/package.json +12 -12
- package/readme.md +7 -0
- package/report/assets/styles.css +18 -2
- package/report/assets/templates.html +4 -0
- package/report/renderer/category-renderer.js +5 -2
- package/report/renderer/components.js +2 -2
- package/report/renderer/dom.d.ts +4 -1
- package/report/renderer/dom.js +3 -2
- package/shared/localization/locales/ar-XB.json +20 -170
- package/shared/localization/locales/ar.json +20 -170
- package/shared/localization/locales/bg.json +19 -169
- package/shared/localization/locales/ca.json +19 -169
- package/shared/localization/locales/cs.json +19 -169
- package/shared/localization/locales/da.json +19 -169
- package/shared/localization/locales/de.json +19 -169
- package/shared/localization/locales/el.json +19 -169
- package/shared/localization/locales/en-GB.json +9 -159
- package/shared/localization/locales/en-US.json +151 -70
- package/shared/localization/locales/en-XA.json +20 -170
- package/shared/localization/locales/en-XL.json +151 -70
- package/shared/localization/locales/es-419.json +19 -169
- package/shared/localization/locales/es.json +19 -169
- package/shared/localization/locales/fi.json +19 -169
- package/shared/localization/locales/fil.json +17 -167
- package/shared/localization/locales/fr.json +18 -168
- package/shared/localization/locales/he.json +19 -169
- package/shared/localization/locales/hi.json +20 -170
- package/shared/localization/locales/hr.json +19 -169
- package/shared/localization/locales/hu.json +19 -169
- package/shared/localization/locales/id.json +19 -169
- package/shared/localization/locales/it.json +19 -169
- package/shared/localization/locales/ja.json +19 -169
- package/shared/localization/locales/ko.json +19 -169
- package/shared/localization/locales/lt.json +20 -170
- package/shared/localization/locales/lv.json +20 -170
- package/shared/localization/locales/nl.json +18 -168
- package/shared/localization/locales/no.json +19 -169
- package/shared/localization/locales/pl.json +19 -169
- package/shared/localization/locales/pt-PT.json +19 -169
- package/shared/localization/locales/pt.json +19 -169
- package/shared/localization/locales/ro.json +19 -169
- package/shared/localization/locales/ru.json +19 -169
- package/shared/localization/locales/sk.json +20 -170
- package/shared/localization/locales/sl.json +19 -169
- package/shared/localization/locales/sr-Latn.json +19 -169
- package/shared/localization/locales/sr.json +19 -169
- package/shared/localization/locales/sv.json +19 -169
- package/shared/localization/locales/ta.json +19 -169
- package/shared/localization/locales/te.json +19 -169
- package/shared/localization/locales/th.json +19 -169
- package/shared/localization/locales/tr.json +19 -169
- package/shared/localization/locales/uk.json +19 -169
- package/shared/localization/locales/vi.json +20 -170
- package/shared/localization/locales/zh-HK.json +19 -169
- package/shared/localization/locales/zh-TW.json +19 -169
- package/shared/localization/locales/zh.json +19 -169
- package/shared/util.d.ts +6 -0
- package/shared/util.js +14 -1
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +2 -1
- package/tsconfig-base.json +1 -1
- package/types/artifacts.d.ts +10 -8
- package/types/audit.d.ts +5 -0
- package/types/gatherer.d.ts +1 -0
- package/types/lhr/audit-details.d.ts +1 -0
- package/types/lhr/audit-result.d.ts +10 -0
- package/types/internal/es-main.d.ts +0 -18
package/types/artifacts.d.ts
CHANGED
|
@@ -410,6 +410,7 @@ declare module Artifacts {
|
|
|
410
410
|
target: string
|
|
411
411
|
node: NodeDetails
|
|
412
412
|
onclick: string
|
|
413
|
+
id: string
|
|
413
414
|
listeners?: Array<{
|
|
414
415
|
type: Crdp.DOMDebugger.EventListener['type']
|
|
415
416
|
}>
|
|
@@ -617,7 +618,8 @@ declare module Artifacts {
|
|
|
617
618
|
quirksModeIssue: Crdp.Audits.QuirksModeIssueDetails[];
|
|
618
619
|
cookieIssue: Crdp.Audits.CookieIssueDetails[];
|
|
619
620
|
sharedArrayBufferIssue: Crdp.Audits.SharedArrayBufferIssueDetails[];
|
|
620
|
-
|
|
621
|
+
stylesheetLoadingIssue: Crdp.Audits.StylesheetLoadingIssueDetails[];
|
|
622
|
+
federatedAuthUserInfoRequestIssue: Crdp.Audits.FederatedAuthUserInfoRequestIssueDetails[];
|
|
621
623
|
}
|
|
622
624
|
|
|
623
625
|
// Computed artifact types below.
|
|
@@ -800,7 +802,6 @@ declare module Artifacts {
|
|
|
800
802
|
maxPotentialFID: number | undefined;
|
|
801
803
|
cumulativeLayoutShift: number | undefined;
|
|
802
804
|
cumulativeLayoutShiftMainFrame: number | undefined;
|
|
803
|
-
totalCumulativeLayoutShift: number | undefined;
|
|
804
805
|
totalBlockingTime: number | undefined;
|
|
805
806
|
observedTimeOrigin: number;
|
|
806
807
|
observedTimeOriginTs: number;
|
|
@@ -808,7 +809,6 @@ declare module Artifacts {
|
|
|
808
809
|
observedNavigationStartTs: number | undefined;
|
|
809
810
|
observedCumulativeLayoutShift: number | undefined;
|
|
810
811
|
observedCumulativeLayoutShiftMainFrame: number | undefined;
|
|
811
|
-
observedTotalCumulativeLayoutShift: number | undefined;
|
|
812
812
|
observedFirstPaint: number | undefined;
|
|
813
813
|
observedFirstPaintTs: number | undefined;
|
|
814
814
|
observedFirstContentfulPaint: number | undefined;
|
|
@@ -949,6 +949,12 @@ declare module Artifacts {
|
|
|
949
949
|
// Convenience methods.
|
|
950
950
|
isFirstParty: (url: string) => boolean;
|
|
951
951
|
}
|
|
952
|
+
|
|
953
|
+
interface TraceImpactedNode {
|
|
954
|
+
node_id: number;
|
|
955
|
+
old_rect?: Array<number>;
|
|
956
|
+
new_rect?: Array<number>;
|
|
957
|
+
}
|
|
952
958
|
}
|
|
953
959
|
|
|
954
960
|
export interface Trace {
|
|
@@ -1018,11 +1024,7 @@ export interface TraceEvent {
|
|
|
1018
1024
|
nodeId?: number;
|
|
1019
1025
|
DOMNodeId?: number;
|
|
1020
1026
|
imageUrl?: string;
|
|
1021
|
-
impacted_nodes?:
|
|
1022
|
-
node_id: number,
|
|
1023
|
-
old_rect?: Array<number>,
|
|
1024
|
-
new_rect?: Array<number>,
|
|
1025
|
-
}>;
|
|
1027
|
+
impacted_nodes?: Artifacts.TraceImpactedNode[];
|
|
1026
1028
|
score?: number;
|
|
1027
1029
|
weighted_score_delta?: number;
|
|
1028
1030
|
had_recent_input?: boolean;
|
package/types/audit.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare module Audit {
|
|
|
18
18
|
export type Result = AuditResult.Result;
|
|
19
19
|
export type ScoreDisplayMode = AuditResult.ScoreDisplayMode;
|
|
20
20
|
export type ScoreDisplayModes = AuditResult.ScoreDisplayModes;
|
|
21
|
+
export type MetricSavings = AuditResult.MetricSavings;
|
|
21
22
|
|
|
22
23
|
type Context = Util.Immutable<{
|
|
23
24
|
/** audit options */
|
|
@@ -74,6 +75,8 @@ declare module Audit {
|
|
|
74
75
|
explanation?: string | IcuMessage;
|
|
75
76
|
/** Error message from any exception thrown while running this audit. */
|
|
76
77
|
errorMessage?: string | IcuMessage;
|
|
78
|
+
/** Error stack from any exception thrown while running this audit. */
|
|
79
|
+
errorStack?: string;
|
|
77
80
|
warnings?: Array<string | IcuMessage>;
|
|
78
81
|
/** Overrides scoreDisplayMode with notApplicable if set to true */
|
|
79
82
|
notApplicable?: boolean;
|
|
@@ -81,6 +84,8 @@ declare module Audit {
|
|
|
81
84
|
details?: AuditDetails;
|
|
82
85
|
/** If an audit encounters unusual execution circumstances, strings can be put in this optional array to add top-level warnings to the LHR. */
|
|
83
86
|
runWarnings?: Array<IcuMessage>;
|
|
87
|
+
/** [EXPERIMENTAL] Estimates of how much this audit affects various performance metrics. Values will be in the unit of the respective metrics. */
|
|
88
|
+
metricSavings?: MetricSavings;
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
/** The Audit.Product type for audits that do not return a `numericValue`. */
|
package/types/gatherer.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ declare module Gatherer {
|
|
|
47
47
|
url: () => Promise<string>;
|
|
48
48
|
targetManager: {
|
|
49
49
|
rootSession(): FRProtocolSession;
|
|
50
|
+
mainFrameExecutionContexts(): Array<Crdp.Runtime.ExecutionContextDescription>;
|
|
50
51
|
on(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void
|
|
51
52
|
off(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void
|
|
52
53
|
};
|
|
@@ -24,6 +24,14 @@ interface ScoreDisplayModes {
|
|
|
24
24
|
|
|
25
25
|
type ScoreDisplayMode = ScoreDisplayModes[keyof ScoreDisplayModes];
|
|
26
26
|
|
|
27
|
+
interface MetricSavings {
|
|
28
|
+
LCP?: number;
|
|
29
|
+
FCP?: number;
|
|
30
|
+
CLS?: number;
|
|
31
|
+
TBT?: number;
|
|
32
|
+
INP?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
/** Audit result returned in Lighthouse report. All audits offer a description and score of 0-1. */
|
|
28
36
|
export interface Result {
|
|
29
37
|
displayValue?: string;
|
|
@@ -31,6 +39,8 @@ export interface Result {
|
|
|
31
39
|
explanation?: string;
|
|
32
40
|
/** Error message from any exception thrown while running this audit. */
|
|
33
41
|
errorMessage?: string;
|
|
42
|
+
/** Error stack from any exception thrown while running this audit. */
|
|
43
|
+
errorStack?: string;
|
|
34
44
|
warnings?: string[];
|
|
35
45
|
/** The scored value of the audit, provided in the range `0-1`, or null if `scoreDisplayMode` indicates not scored. */
|
|
36
46
|
score: number|null;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright 2021 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
-
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview Types for the `es-main` npm module.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Test if an ES module is run directly with Node.js.
|
|
13
|
-
* @param importMeta `import.meta`
|
|
14
|
-
*/
|
|
15
|
-
declare function esMain(importMeta: ImportMeta): boolean;
|
|
16
|
-
declare module 'es-main' {
|
|
17
|
-
export = esMain;
|
|
18
|
-
}
|