lighthouse 10.0.2 → 10.1.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.
Files changed (114) hide show
  1. package/cli/bin.js +1 -1
  2. package/cli/run.js +1 -1
  3. package/cli/test/smokehouse/config/exclusions.js +0 -2
  4. package/cli/test/smokehouse/lighthouse-runners/bundle.js +1 -1
  5. package/core/audits/audit.d.ts +6 -0
  6. package/core/audits/audit.js +16 -4
  7. package/core/audits/bootup-time.js +2 -3
  8. package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +4 -0
  9. package/core/audits/byte-efficiency/byte-efficiency-audit.js +8 -2
  10. package/core/audits/byte-efficiency/legacy-javascript.d.ts +5 -0
  11. package/core/audits/byte-efficiency/legacy-javascript.js +42 -16
  12. package/core/audits/byte-efficiency/polyfill-graph-data.json +50 -50
  13. package/core/audits/byte-efficiency/total-byte-weight.js +1 -1
  14. package/core/audits/byte-efficiency/unminified-javascript.js +2 -1
  15. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +2 -2
  16. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +4 -0
  17. package/core/audits/dobetterweb/doctype.js +3 -2
  18. package/core/audits/long-tasks.js +2 -1
  19. package/core/audits/mainthread-work-breakdown.js +2 -1
  20. package/core/audits/network-rtt.js +1 -1
  21. package/core/audits/network-server-latency.js +2 -1
  22. package/core/audits/performance-budget.js +1 -1
  23. package/core/audits/prioritize-lcp-image.js +1 -1
  24. package/core/audits/seo/tap-targets.js +1 -1
  25. package/core/audits/third-party-summary.js +4 -1
  26. package/core/audits/timing-budget.js +2 -1
  27. package/core/audits/uses-rel-preconnect.js +1 -1
  28. package/core/audits/uses-rel-preload.js +1 -1
  29. package/core/audits/valid-source-maps.js +1 -1
  30. package/core/audits/work-during-interaction.js +1 -1
  31. package/core/computed/metrics/cumulative-layout-shift.d.ts +3 -3
  32. package/core/computed/metrics/cumulative-layout-shift.js +21 -9
  33. package/core/computed/unused-css.js +8 -7
  34. package/core/config/lr-mobile-config.js +0 -11
  35. package/core/gather/driver/prepare.js +15 -0
  36. package/core/lib/asset-saver.js +2 -12
  37. package/core/lib/i18n/i18n.d.ts +1 -1
  38. package/core/lib/i18n/i18n.js +1 -1
  39. package/core/lib/lighthouse-compatibility.js +17 -0
  40. package/core/lib/network-request.js +1 -1
  41. package/core/lib/page-functions.d.ts +17 -5
  42. package/core/lib/page-functions.js +41 -22
  43. package/core/lib/tracehouse/trace-processor.d.ts +8 -0
  44. package/core/lib/tracehouse/trace-processor.js +27 -6
  45. package/core/lib/url-utils.js +1 -1
  46. package/core/runner.js +1 -0
  47. package/dist/report/bundle.esm.js +258 -45
  48. package/dist/report/flow.js +18 -18
  49. package/dist/report/standalone.js +17 -17
  50. package/flow-report/src/i18n/i18n.d.ts +6 -0
  51. package/flow-report/src/summary/category.tsx +0 -1
  52. package/package.json +6 -7
  53. package/report/assets/styles.css +89 -5
  54. package/report/renderer/components.js +1 -1
  55. package/report/renderer/details-renderer.d.ts +26 -6
  56. package/report/renderer/details-renderer.js +144 -21
  57. package/report/renderer/performance-category-renderer.js +3 -3
  58. package/report/renderer/report-renderer.js +1 -0
  59. package/report/renderer/report-ui-features.js +18 -9
  60. package/report/renderer/report-utils.d.ts +13 -4
  61. package/report/renderer/report-utils.js +43 -11
  62. package/shared/localization/locales/ar-XB.json +1 -1
  63. package/shared/localization/locales/ar.json +1 -1
  64. package/shared/localization/locales/bg.json +1 -1
  65. package/shared/localization/locales/ca.json +1 -1
  66. package/shared/localization/locales/cs.json +1 -1
  67. package/shared/localization/locales/da.json +1 -1
  68. package/shared/localization/locales/de.json +1 -1
  69. package/shared/localization/locales/el.json +1 -1
  70. package/shared/localization/locales/en-GB.json +1 -1
  71. package/shared/localization/locales/en-US.json +11 -2
  72. package/shared/localization/locales/en-XA.json +1 -1
  73. package/shared/localization/locales/en-XL.json +11 -2
  74. package/shared/localization/locales/es-419.json +1 -1
  75. package/shared/localization/locales/es.json +1 -1
  76. package/shared/localization/locales/fi.json +1 -1
  77. package/shared/localization/locales/fil.json +1 -1
  78. package/shared/localization/locales/fr.json +1 -1
  79. package/shared/localization/locales/he.json +1 -1
  80. package/shared/localization/locales/hi.json +1 -1
  81. package/shared/localization/locales/hr.json +1 -1
  82. package/shared/localization/locales/hu.json +1 -1
  83. package/shared/localization/locales/id.json +1 -1
  84. package/shared/localization/locales/it.json +1 -1
  85. package/shared/localization/locales/ja.json +1 -1
  86. package/shared/localization/locales/ko.json +1 -1
  87. package/shared/localization/locales/lt.json +1 -1
  88. package/shared/localization/locales/lv.json +1 -1
  89. package/shared/localization/locales/nl.json +1 -1
  90. package/shared/localization/locales/no.json +1 -1
  91. package/shared/localization/locales/pl.json +1 -1
  92. package/shared/localization/locales/pt-PT.json +1 -1
  93. package/shared/localization/locales/pt.json +1 -1
  94. package/shared/localization/locales/ro.json +1 -1
  95. package/shared/localization/locales/ru.json +1 -1
  96. package/shared/localization/locales/sk.json +1 -1
  97. package/shared/localization/locales/sl.json +1 -1
  98. package/shared/localization/locales/sr-Latn.json +1 -1
  99. package/shared/localization/locales/sr.json +1 -1
  100. package/shared/localization/locales/sv.json +1 -1
  101. package/shared/localization/locales/ta.json +1 -1
  102. package/shared/localization/locales/te.json +1 -1
  103. package/shared/localization/locales/th.json +1 -1
  104. package/shared/localization/locales/tr.json +1 -1
  105. package/shared/localization/locales/uk.json +1 -1
  106. package/shared/localization/locales/vi.json +1 -1
  107. package/shared/localization/locales/zh-HK.json +1 -1
  108. package/shared/localization/locales/zh-TW.json +1 -1
  109. package/shared/localization/locales/zh.json +1 -1
  110. package/shared/tsconfig.json +1 -1
  111. package/shared/util.d.ts +6 -0
  112. package/shared/util.js +33 -0
  113. package/types/artifacts.d.ts +2 -1
  114. package/types/lhr/audit-details.d.ts +35 -11
@@ -7,6 +7,16 @@
7
7
  import {IcuMessage} from './i18n.js';
8
8
  import Treemap from './treemap.js';
9
9
 
10
+ /** Common properties for all details types. */
11
+ interface BaseDetails {
12
+ /** If present and audit is part of the performance category, audit is treated as an Opportunity. */
13
+ overallSavingsMs?: number;
14
+ /** Optional additional Opportunity information. */
15
+ overallSavingsBytes?: number;
16
+ /** Additional information, usually used for including debug or meta information in the LHR */
17
+ debugData?: Details.DebugData;
18
+ }
19
+
10
20
  type Details =
11
21
  Details.CriticalRequestChain |
12
22
  Details.DebugData |
@@ -19,7 +29,7 @@ type Details =
19
29
 
20
30
  // Details namespace.
21
31
  declare module Details {
22
- interface CriticalRequestChain {
32
+ interface CriticalRequestChain extends BaseDetails {
23
33
  type: 'criticalrequestchain';
24
34
  longestChain: {
25
35
  duration: number;
@@ -42,7 +52,7 @@ declare module Details {
42
52
  }
43
53
  }
44
54
 
45
- interface Filmstrip {
55
+ interface Filmstrip extends BaseDetails {
46
56
  type: 'filmstrip';
47
57
  scale: number;
48
58
  items: {
@@ -55,23 +65,29 @@ declare module Details {
55
65
  }[];
56
66
  }
57
67
 
58
- interface List {
68
+ interface List extends BaseDetails {
59
69
  type: 'list';
60
70
  // NOTE: any `Details` type *should* be usable in `items`, but check
61
71
  // styles/report-ui-features are good before adding.
62
72
  items: Array<Table | DebugData>;
63
73
  }
64
74
 
65
- interface Opportunity {
75
+ interface Opportunity extends BaseDetails {
66
76
  type: 'opportunity';
67
- overallSavingsMs: number;
68
- overallSavingsBytes?: number;
69
77
  headings: TableColumnHeading[];
70
78
  items: OpportunityItem[];
71
- debugData?: DebugData;
79
+ /**
80
+ * Columns to sort the items by, during grouping.
81
+ * If omitted, entity groups will be sorted by the audit ordering vs. the new totals.
82
+ */
83
+ sortedBy?: Array<string>;
84
+ /** Will be true if the table is already grouped by entities. */
85
+ isEntityGrouped?: boolean;
86
+ /** Column keys to skip summing. If omitted, all column types supported are summed. */
87
+ skipSumming?: Array<string>;
72
88
  }
73
89
 
74
- interface Screenshot {
90
+ interface Screenshot extends BaseDetails {
75
91
  type: 'screenshot';
76
92
  timing: number;
77
93
  timestamp: number;
@@ -87,7 +103,7 @@ declare module Details {
87
103
  left: number;
88
104
  }
89
105
 
90
- interface Table {
106
+ interface Table extends BaseDetails {
91
107
  type: 'table';
92
108
  headings: TableColumnHeading[];
93
109
  items: TableItem[];
@@ -95,7 +111,15 @@ declare module Details {
95
111
  wastedMs?: number;
96
112
  wastedBytes?: number;
97
113
  };
98
- debugData?: DebugData;
114
+ /**
115
+ * Columns to sort the items by, during grouping.
116
+ * If omitted, entity groups will be sorted by the audit ordering vs. the new totals.
117
+ */
118
+ sortedBy?: Array<string>;
119
+ /** Will be true if the table is already grouped by entities. */
120
+ isEntityGrouped?: boolean;
121
+ /** Column keys to skip summing. If omitted, all column types supported are summed. */
122
+ skipSumming?: Array<string>;
99
123
  }
100
124
 
101
125
  /** A table item for rows that are nested within a top-level TableItem (row). */
@@ -113,7 +137,7 @@ declare module Details {
113
137
  [p: string]: any;
114
138
  }
115
139
 
116
- interface TreemapData {
140
+ interface TreemapData extends BaseDetails {
117
141
  type: 'treemap-data';
118
142
  nodes: Treemap.Node[];
119
143
  }