lighthouse 12.8.2 → 13.0.0-dev.20251010

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 (270) hide show
  1. package/cli/cli-flags.js +1 -1
  2. package/cli/test/smokehouse/config/exclusions.js +0 -2
  3. package/cli/test/smokehouse/version-check.d.ts +1 -1
  4. package/core/audits/accessibility/accesskeys.js +3 -3
  5. package/core/audits/accessibility/aria-allowed-attr.js +3 -3
  6. package/core/audits/accessibility/aria-allowed-role.js +2 -1
  7. package/core/audits/accessibility/aria-command-name.js +1 -1
  8. package/core/audits/accessibility/aria-conditional-attr.js +1 -1
  9. package/core/audits/accessibility/aria-deprecated-role.js +1 -1
  10. package/core/audits/accessibility/aria-dialog-name.js +1 -1
  11. package/core/audits/accessibility/aria-hidden-body.js +3 -3
  12. package/core/audits/accessibility/aria-hidden-focus.js +3 -3
  13. package/core/audits/accessibility/aria-input-field-name.js +3 -3
  14. package/core/audits/accessibility/aria-meter-name.js +1 -1
  15. package/core/audits/accessibility/aria-progressbar-name.js +1 -1
  16. package/core/audits/accessibility/aria-prohibited-attr.js +1 -1
  17. package/core/audits/accessibility/aria-required-attr.js +3 -3
  18. package/core/audits/accessibility/aria-required-children.js +3 -3
  19. package/core/audits/accessibility/aria-required-parent.js +3 -3
  20. package/core/audits/accessibility/aria-roles.js +3 -3
  21. package/core/audits/accessibility/aria-text.js +3 -3
  22. package/core/audits/accessibility/aria-toggle-field-name.js +3 -3
  23. package/core/audits/accessibility/aria-tooltip-name.js +1 -1
  24. package/core/audits/accessibility/aria-treeitem-name.js +1 -1
  25. package/core/audits/accessibility/aria-valid-attr-value.js +3 -3
  26. package/core/audits/accessibility/aria-valid-attr.js +3 -3
  27. package/core/audits/accessibility/button-name.js +3 -3
  28. package/core/audits/accessibility/bypass.js +3 -3
  29. package/core/audits/accessibility/color-contrast.js +3 -3
  30. package/core/audits/accessibility/definition-list.js +3 -3
  31. package/core/audits/accessibility/dlitem.js +3 -3
  32. package/core/audits/accessibility/document-title.js +3 -3
  33. package/core/audits/accessibility/duplicate-id-aria.js +3 -3
  34. package/core/audits/accessibility/empty-heading.js +3 -3
  35. package/core/audits/accessibility/form-field-multiple-labels.js +3 -3
  36. package/core/audits/accessibility/frame-title.js +3 -3
  37. package/core/audits/accessibility/heading-order.js +3 -3
  38. package/core/audits/accessibility/html-has-lang.js +3 -3
  39. package/core/audits/accessibility/html-lang-valid.js +3 -3
  40. package/core/audits/accessibility/html-xml-lang-mismatch.js +3 -3
  41. package/core/audits/accessibility/identical-links-same-purpose.js +3 -3
  42. package/core/audits/accessibility/image-alt.js +3 -3
  43. package/core/audits/accessibility/image-redundant-alt.js +4 -3
  44. package/core/audits/accessibility/input-button-name.js +3 -3
  45. package/core/audits/accessibility/input-image-alt.js +3 -3
  46. package/core/audits/accessibility/label-content-name-mismatch.js +3 -3
  47. package/core/audits/accessibility/label.js +3 -3
  48. package/core/audits/accessibility/landmark-one-main.js +3 -4
  49. package/core/audits/accessibility/link-in-text-block.js +3 -3
  50. package/core/audits/accessibility/link-name.js +3 -3
  51. package/core/audits/accessibility/list.js +3 -3
  52. package/core/audits/accessibility/listitem.js +3 -3
  53. package/core/audits/accessibility/meta-refresh.js +3 -3
  54. package/core/audits/accessibility/meta-viewport.js +3 -3
  55. package/core/audits/accessibility/object-alt.js +3 -3
  56. package/core/audits/accessibility/select-name.js +3 -3
  57. package/core/audits/accessibility/skip-link.js +3 -3
  58. package/core/audits/accessibility/tabindex.js +3 -3
  59. package/core/audits/accessibility/table-duplicate-name.js +4 -3
  60. package/core/audits/accessibility/table-fake-caption.js +3 -3
  61. package/core/audits/accessibility/target-size.js +3 -3
  62. package/core/audits/accessibility/td-has-header.js +3 -3
  63. package/core/audits/accessibility/td-headers-attr.js +3 -3
  64. package/core/audits/accessibility/th-has-data-cells.js +3 -3
  65. package/core/audits/accessibility/valid-lang.js +3 -3
  66. package/core/audits/accessibility/video-caption.js +3 -3
  67. package/core/audits/audit.d.ts +0 -4
  68. package/core/audits/audit.js +2 -13
  69. package/core/audits/insights/cls-culprits-insight.js +1 -1
  70. package/core/audits/insights/dom-size-insight.js +11 -7
  71. package/core/audits/insights/font-display-insight.js +3 -1
  72. package/core/audits/insights/image-delivery-insight.js +4 -1
  73. package/core/audits/insights/insight-audit.d.ts +6 -4
  74. package/core/audits/insights/insight-audit.js +27 -8
  75. package/core/audits/insights/third-parties-insight.js +1 -1
  76. package/core/audits/layout-shifts.js +1 -1
  77. package/core/audits/predictive-perf.js +2 -2
  78. package/core/audits/seo/crawlable-anchors.js +2 -3
  79. package/core/audits/seo/manual/structured-data.js +1 -1
  80. package/core/audits/server-response-time.d.ts +0 -5
  81. package/core/audits/server-response-time.js +12 -26
  82. package/core/computed/metrics/cumulative-layout-shift.js +2 -2
  83. package/core/computed/metrics/lantern-metric.js +3 -3
  84. package/core/computed/metrics/lcp-breakdown.d.ts +10 -5
  85. package/core/computed/metrics/lcp-breakdown.js +50 -22
  86. package/core/computed/metrics/time-to-first-byte.js +33 -10
  87. package/core/computed/metrics/timing-summary.js +3 -2
  88. package/core/computed/page-dependency-graph.js +1 -1
  89. package/core/computed/trace-engine-result.js +2 -2
  90. package/core/config/default-config.js +110 -152
  91. package/core/config/experimental-config.js +1 -32
  92. package/core/config/filters.js +6 -9
  93. package/core/config/lr-desktop-config.js +0 -1
  94. package/core/config/lr-mobile-config.js +0 -1
  95. package/core/gather/driver/target-manager.d.ts +1 -1
  96. package/core/gather/driver.d.ts +1 -1
  97. package/core/gather/gatherers/anchor-elements.js +8 -24
  98. package/core/gather/gatherers/image-elements.js +32 -6
  99. package/core/gather/gatherers/inspector-issues.js +1 -28
  100. package/core/gather/gatherers/trace-elements.d.ts +2 -11
  101. package/core/gather/gatherers/trace-elements.js +9 -39
  102. package/core/gather/navigation-runner.js +0 -3
  103. package/core/gather/session.d.ts +1 -1
  104. package/core/lib/asset-saver.d.ts +2 -2
  105. package/core/lib/asset-saver.js +33 -43
  106. package/core/lib/bf-cache-strings.js +10 -9
  107. package/core/lib/deprecations-strings.js +5 -5
  108. package/core/lib/emulation.d.ts +10 -0
  109. package/core/lib/emulation.js +21 -6
  110. package/core/lib/legacy-javascript/legacy-javascript.js +4 -11
  111. package/core/lib/network-request.d.ts +0 -7
  112. package/core/lib/network-request.js +0 -16
  113. package/core/lib/proto-preprocessor.js +10 -25
  114. package/core/runner.js +1 -8
  115. package/core/scoring.js +1 -1
  116. package/dist/report/bundle.esm.js +10 -49
  117. package/dist/report/flow.js +12 -51
  118. package/dist/report/standalone.js +11 -50
  119. package/flow-report/src/i18n/i18n.d.ts +4 -6
  120. package/package.json +16 -19
  121. package/readme.md +2 -2
  122. package/report/assets/styles.css +0 -39
  123. package/report/renderer/api.js +0 -1
  124. package/report/renderer/category-renderer.js +6 -0
  125. package/report/renderer/components.js +1 -1
  126. package/report/renderer/details-renderer.d.ts +1 -2
  127. package/report/renderer/details-renderer.js +0 -1
  128. package/report/renderer/dom.d.ts +0 -13
  129. package/report/renderer/dom.js +0 -38
  130. package/report/renderer/performance-category-renderer.d.ts +0 -26
  131. package/report/renderer/performance-category-renderer.js +10 -142
  132. package/report/renderer/report-ui-features.d.ts +0 -1
  133. package/report/renderer/report-ui-features.js +2 -13
  134. package/report/renderer/report-utils.d.ts +2 -3
  135. package/report/renderer/report-utils.js +4 -6
  136. package/report/types/report-renderer.d.ts +0 -6
  137. package/shared/localization/locales/ar-XB.json +107 -455
  138. package/shared/localization/locales/ar.json +107 -455
  139. package/shared/localization/locales/bg.json +96 -444
  140. package/shared/localization/locales/ca.json +96 -444
  141. package/shared/localization/locales/cs.json +96 -444
  142. package/shared/localization/locales/da.json +96 -444
  143. package/shared/localization/locales/de.json +96 -444
  144. package/shared/localization/locales/el.json +96 -444
  145. package/shared/localization/locales/en-GB.json +96 -444
  146. package/shared/localization/locales/en-US.json +116 -467
  147. package/shared/localization/locales/en-XA.json +93 -441
  148. package/shared/localization/locales/en-XL.json +116 -467
  149. package/shared/localization/locales/es-419.json +96 -444
  150. package/shared/localization/locales/es.json +96 -444
  151. package/shared/localization/locales/fi.json +96 -444
  152. package/shared/localization/locales/fil.json +96 -444
  153. package/shared/localization/locales/fr.json +96 -444
  154. package/shared/localization/locales/he.json +118 -466
  155. package/shared/localization/locales/hi.json +96 -444
  156. package/shared/localization/locales/hr.json +100 -448
  157. package/shared/localization/locales/hu.json +96 -444
  158. package/shared/localization/locales/id.json +96 -444
  159. package/shared/localization/locales/it.json +96 -444
  160. package/shared/localization/locales/ja.json +96 -444
  161. package/shared/localization/locales/ko.json +97 -445
  162. package/shared/localization/locales/lt.json +96 -444
  163. package/shared/localization/locales/lv.json +97 -445
  164. package/shared/localization/locales/nl.json +96 -444
  165. package/shared/localization/locales/no.json +96 -444
  166. package/shared/localization/locales/pl.json +96 -444
  167. package/shared/localization/locales/pt-PT.json +96 -444
  168. package/shared/localization/locales/pt.json +97 -445
  169. package/shared/localization/locales/ro.json +97 -445
  170. package/shared/localization/locales/ru.json +96 -444
  171. package/shared/localization/locales/sk.json +96 -444
  172. package/shared/localization/locales/sl.json +96 -444
  173. package/shared/localization/locales/sr-Latn.json +96 -444
  174. package/shared/localization/locales/sr.json +96 -444
  175. package/shared/localization/locales/sv.json +96 -444
  176. package/shared/localization/locales/ta.json +96 -444
  177. package/shared/localization/locales/te.json +97 -445
  178. package/shared/localization/locales/th.json +96 -444
  179. package/shared/localization/locales/tr.json +96 -444
  180. package/shared/localization/locales/uk.json +96 -444
  181. package/shared/localization/locales/vi.json +96 -444
  182. package/shared/localization/locales/zh-HK.json +96 -444
  183. package/shared/localization/locales/zh-TW.json +97 -445
  184. package/shared/localization/locales/zh.json +96 -444
  185. package/shared/localization/locales.d.ts +2 -0
  186. package/shared/localization/locales.js +130 -139
  187. package/shared/tsconfig.json +2 -0
  188. package/tsconfig-base.json +2 -2
  189. package/tsconfig.json +1 -4
  190. package/types/artifacts.d.ts +6 -81
  191. package/types/audit.d.ts +1 -1
  192. package/types/lhr/settings.d.ts +1 -1
  193. package/core/audits/byte-efficiency/duplicated-javascript.d.ts +0 -45
  194. package/core/audits/byte-efficiency/duplicated-javascript.js +0 -223
  195. package/core/audits/byte-efficiency/efficient-animated-content.d.ts +0 -22
  196. package/core/audits/byte-efficiency/efficient-animated-content.js +0 -93
  197. package/core/audits/byte-efficiency/legacy-javascript.d.ts +0 -28
  198. package/core/audits/byte-efficiency/legacy-javascript.js +0 -144
  199. package/core/audits/byte-efficiency/modern-image-formats.d.ts +0 -38
  200. package/core/audits/byte-efficiency/modern-image-formats.js +0 -187
  201. package/core/audits/byte-efficiency/offscreen-images.d.ts +0 -63
  202. package/core/audits/byte-efficiency/offscreen-images.js +0 -240
  203. package/core/audits/byte-efficiency/render-blocking-resources.d.ts +0 -53
  204. package/core/audits/byte-efficiency/render-blocking-resources.js +0 -312
  205. package/core/audits/byte-efficiency/uses-long-cache-ttl.d.ts +0 -59
  206. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +0 -293
  207. package/core/audits/byte-efficiency/uses-optimized-images.d.ts +0 -33
  208. package/core/audits/byte-efficiency/uses-optimized-images.js +0 -146
  209. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.d.ts +0 -16
  210. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +0 -106
  211. package/core/audits/byte-efficiency/uses-responsive-images.d.ts +0 -44
  212. package/core/audits/byte-efficiency/uses-responsive-images.js +0 -202
  213. package/core/audits/byte-efficiency/uses-text-compression.d.ts +0 -14
  214. package/core/audits/byte-efficiency/uses-text-compression.js +0 -108
  215. package/core/audits/critical-request-chains.d.ts +0 -44
  216. package/core/audits/critical-request-chains.js +0 -221
  217. package/core/audits/dobetterweb/dom-size.d.ts +0 -32
  218. package/core/audits/dobetterweb/dom-size.js +0 -182
  219. package/core/audits/dobetterweb/no-document-write.d.ts +0 -16
  220. package/core/audits/dobetterweb/no-document-write.js +0 -86
  221. package/core/audits/dobetterweb/uses-http2.d.ts +0 -72
  222. package/core/audits/dobetterweb/uses-http2.js +0 -276
  223. package/core/audits/dobetterweb/uses-passive-event-listeners.d.ts +0 -16
  224. package/core/audits/dobetterweb/uses-passive-event-listeners.js +0 -69
  225. package/core/audits/font-display.d.ts +0 -32
  226. package/core/audits/font-display.js +0 -195
  227. package/core/audits/largest-contentful-paint-element.d.ts +0 -34
  228. package/core/audits/largest-contentful-paint-element.js +0 -181
  229. package/core/audits/lcp-lazy-loaded.d.ts +0 -22
  230. package/core/audits/lcp-lazy-loaded.js +0 -115
  231. package/core/audits/metrics/first-meaningful-paint.d.ts +0 -12
  232. package/core/audits/metrics/first-meaningful-paint.js +0 -47
  233. package/core/audits/preload-fonts.d.ts +0 -25
  234. package/core/audits/preload-fonts.js +0 -97
  235. package/core/audits/prioritize-lcp-image.d.ts +0 -74
  236. package/core/audits/prioritize-lcp-image.js +0 -297
  237. package/core/audits/seo/font-size.d.ts +0 -24
  238. package/core/audits/seo/font-size.js +0 -344
  239. package/core/audits/third-party-facades.d.ts +0 -41
  240. package/core/audits/third-party-facades.js +0 -234
  241. package/core/audits/third-party-summary.d.ts +0 -78
  242. package/core/audits/third-party-summary.js +0 -236
  243. package/core/audits/uses-rel-preconnect.d.ts +0 -37
  244. package/core/audits/uses-rel-preconnect.js +0 -286
  245. package/core/audits/uses-rel-preload.d.ts +0 -57
  246. package/core/audits/uses-rel-preload.js +0 -263
  247. package/core/audits/viewport.d.ts +0 -17
  248. package/core/audits/viewport.js +0 -87
  249. package/core/audits/work-during-interaction.d.ts +0 -81
  250. package/core/audits/work-during-interaction.js +0 -287
  251. package/core/computed/critical-request-chains.d.ts +0 -42
  252. package/core/computed/critical-request-chains.js +0 -143
  253. package/core/computed/viewport-meta.d.ts +0 -37
  254. package/core/computed/viewport-meta.js +0 -71
  255. package/core/gather/gatherers/cache-contents.d.ts +0 -11
  256. package/core/gather/gatherers/cache-contents.js +0 -56
  257. package/core/gather/gatherers/devtools-log-compat.d.ts +0 -13
  258. package/core/gather/gatherers/devtools-log-compat.js +0 -35
  259. package/core/gather/gatherers/dobetterweb/domstats.d.ts +0 -10
  260. package/core/gather/gatherers/dobetterweb/domstats.js +0 -102
  261. package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +0 -48
  262. package/core/gather/gatherers/dobetterweb/optimized-images.js +0 -169
  263. package/core/gather/gatherers/dobetterweb/response-compression.d.ts +0 -23
  264. package/core/gather/gatherers/dobetterweb/response-compression.js +0 -136
  265. package/core/gather/gatherers/seo/font-size.d.ts +0 -131
  266. package/core/gather/gatherers/seo/font-size.js +0 -347
  267. package/core/gather/gatherers/trace-compat.d.ts +0 -13
  268. package/core/gather/gatherers/trace-compat.js +0 -35
  269. package/types/internal/metaviewport-parser.d.ts +0 -13
  270. package/types/internal/parse-cache-control.d.ts +0 -20
@@ -146,9 +146,8 @@ export class DetailsRenderer {
146
146
  /**
147
147
  * @param {LH.Audit.Details.SourceLocationValue} item
148
148
  * @return {Element|null}
149
- * @protected
150
149
  */
151
- protected renderSourceLocation(item: LH.Audit.Details.SourceLocationValue): Element | null;
150
+ renderSourceLocation(item: LH.Audit.Details.SourceLocationValue): Element | null;
152
151
  /**
153
152
  * @param {LH.Audit.Details.Filmstrip} details
154
153
  * @return {Element}
@@ -656,7 +656,6 @@ export class DetailsRenderer {
656
656
  /**
657
657
  * @param {LH.Audit.Details.SourceLocationValue} item
658
658
  * @return {Element|null}
659
- * @protected
660
659
  */
661
660
  renderSourceLocation(item) {
662
661
  if (!item.url) {
@@ -12,10 +12,6 @@ export class DOM {
12
12
  _componentCache: Map<string, DocumentFragment>;
13
13
  /** @type {HTMLElement} */
14
14
  rootEl: HTMLElement;
15
- /** @type {WeakMap<Element, Element>} */
16
- _swappableSections: WeakMap<Element, Element>;
17
- _onSwap: () => void;
18
- _onSwapHook: () => void;
19
15
  /**
20
16
  * @template {string} T
21
17
  * @param {T} name
@@ -141,15 +137,6 @@ export class DOM {
141
137
  * @param {string} filename
142
138
  */
143
139
  saveFile(blob: Blob | File, filename: string): void;
144
- /**
145
- * @param {Element} section1
146
- * @param {Element} section2
147
- */
148
- registerSwappableSections(section1: Element, section2: Element): void;
149
- /**
150
- * @param {Element} section
151
- */
152
- swapSectionIfPossible(section: Element): void;
153
140
  }
154
141
  export type HTMLElementByTagName = HTMLElementTagNameMap & {
155
142
  [id: string]: HTMLElement;
@@ -28,10 +28,6 @@ export class DOM {
28
28
  /** @type {HTMLElement} */
29
29
  // For legacy Report API users, this'll be undefined, but set in renderReport
30
30
  this.rootEl = rootEl;
31
- /** @type {WeakMap<Element, Element>} */
32
- this._swappableSections = new WeakMap();
33
- this._onSwap = () => {};
34
- this._onSwapHook = () => {};
35
31
  }
36
32
 
37
33
  /**
@@ -327,38 +323,4 @@ export class DOM {
327
323
  this._document.body.removeChild(a);
328
324
  setTimeout(() => URL.revokeObjectURL(a.href), 500);
329
325
  }
330
-
331
- /**
332
- * @param {Element} section1
333
- * @param {Element} section2
334
- */
335
- registerSwappableSections(section1, section2) {
336
- this._swappableSections.set(section1, section2);
337
- this._swappableSections.set(section2, section1);
338
- }
339
-
340
- /**
341
- * @param {Element} section
342
- */
343
- swapSectionIfPossible(section) {
344
- const newSection = this._swappableSections.get(section);
345
- if (!newSection) return;
346
-
347
- const parent = section.parentNode;
348
- if (!parent) return;
349
-
350
- // LH Report enforces that only the first instance of a component will include the styles.
351
- // If these single-instance happen to be in `section` then they could be lost once `section` is
352
- // removed from the DOM.
353
- // Therefore we need to transfer any styles that only exist in `section` into `newSection`.
354
- const stylesToTransfer = section.querySelectorAll('style');
355
- newSection.append(...stylesToTransfer);
356
-
357
- parent.insertBefore(newSection, section);
358
- section.remove();
359
- this._onSwap();
360
- if (this._onSwapHook) {
361
- this._onSwapHook();
362
- }
363
- }
364
326
  }
@@ -1,9 +1,4 @@
1
- /**
2
- * @typedef {('DEFAULT'|'AUDITS'|'INSIGHTS')} InsightsExperimentState
3
- */
4
1
  export class PerformanceCategoryRenderer extends CategoryRenderer {
5
- /** @type InsightsExperimentState*/
6
- _memoryInsightToggleState: InsightsExperimentState;
7
2
  /**
8
3
  * @param {LH.ReportResult.AuditRef} audit
9
4
  * @return {!Element}
@@ -28,26 +23,6 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
28
23
  overallImpact: number;
29
24
  overallLinearImpact: number;
30
25
  };
31
- /**
32
- * @param {InsightsExperimentState} newState
33
- **/
34
- _persistInsightToggleToStorage(newState: InsightsExperimentState): void;
35
- /**
36
- * @returns {InsightsExperimentState}
37
- **/
38
- _getInsightToggleState(): InsightsExperimentState;
39
- /**
40
- * @returns {InsightsExperimentState}
41
- **/
42
- _getRawInsightToggleState(): InsightsExperimentState;
43
- /**
44
- * @param {HTMLButtonElement} button
45
- **/
46
- _setInsightToggleButtonText(button: HTMLButtonElement): void;
47
- /**
48
- * @param {HTMLElement} element
49
- */
50
- _renderInsightsToggle(element: HTMLElement): void;
51
26
  /**
52
27
  * @param {LH.ReportResult.Category} category
53
28
  * @param {Object<string, LH.Result.ReportGroup>} groups
@@ -79,6 +54,5 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
79
54
  renderMetricAuditFilter(filterableMetrics: LH.ReportResult.AuditRef[], categoryEl: HTMLDivElement, onFilterChange: (acronym: string) => void): void;
80
55
  }
81
56
  export type DOM = import("./dom.js").DOM;
82
- export type InsightsExperimentState = ("DEFAULT" | "AUDITS" | "INSIGHTS");
83
57
  import { CategoryRenderer } from './category-renderer.js';
84
58
  //# sourceMappingURL=performance-category-renderer.d.ts.map
@@ -12,16 +12,7 @@ import {Globals} from './report-globals.js';
12
12
  import {Util} from '../../shared/util.js';
13
13
  import {createGauge, updateGauge} from './explodey-gauge.js';
14
14
 
15
- const LOCAL_STORAGE_INSIGHTS_KEY = '__lh__insights_audits_toggle_state_2';
16
-
17
- /**
18
- * @typedef {('DEFAULT'|'AUDITS'|'INSIGHTS')} InsightsExperimentState
19
- */
20
-
21
15
  export class PerformanceCategoryRenderer extends CategoryRenderer {
22
- /** @type InsightsExperimentState*/
23
- _memoryInsightToggleState = 'DEFAULT';
24
-
25
16
  /**
26
17
  * @param {LH.ReportResult.AuditRef} audit
27
18
  * @return {!Element}
@@ -143,84 +134,6 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
143
134
  return {overallImpact, overallLinearImpact};
144
135
  }
145
136
 
146
- /**
147
- * @param {InsightsExperimentState} newState
148
- **/
149
- _persistInsightToggleToStorage(newState) {
150
- try {
151
- window.localStorage.setItem(LOCAL_STORAGE_INSIGHTS_KEY, newState);
152
- } finally {
153
- this._memoryInsightToggleState = newState;
154
- }
155
- }
156
-
157
- /**
158
- * @returns {InsightsExperimentState}
159
- **/
160
- _getInsightToggleState() {
161
- let state = this._getRawInsightToggleState();
162
- if (state === 'DEFAULT') state = 'INSIGHTS';
163
- return state;
164
- }
165
-
166
- /**
167
- * @returns {InsightsExperimentState}
168
- **/
169
- _getRawInsightToggleState() {
170
- try {
171
- const fromStorage = window.localStorage.getItem(LOCAL_STORAGE_INSIGHTS_KEY);
172
- if (fromStorage === 'AUDITS' || fromStorage === 'INSIGHTS') {
173
- return fromStorage;
174
- }
175
- } catch {
176
- return this._memoryInsightToggleState;
177
- }
178
- return 'DEFAULT';
179
- }
180
-
181
- /**
182
- * @param {HTMLButtonElement} button
183
- **/
184
- _setInsightToggleButtonText(button) {
185
- const state = this._getInsightToggleState();
186
- button.innerText =
187
- state === 'AUDITS' ? Globals.strings.tryInsights : Globals.strings.goBackToAudits;
188
- }
189
-
190
- /**
191
- * @param {HTMLElement} element
192
- */
193
- _renderInsightsToggle(element) {
194
- // Insights / Audits toggle.
195
- const container = this.dom.createChildOf(element, 'div', 'lh-perf-insights-toggle');
196
- const textSpan = this.dom.createChildOf(container, 'span', 'lh-perf-toggle-text');
197
- const icon = this.dom.createElement('span', 'lh-perf-insights-icon insights-icon-url');
198
- textSpan.appendChild(icon);
199
- textSpan.appendChild(this.dom.convertMarkdownLinkSnippets(Globals.strings.insightsNotice));
200
-
201
- const buttonClasses = 'lh-button lh-button-insight-toggle';
202
- const button = this.dom.createChildOf(container, 'button', buttonClasses);
203
- this._setInsightToggleButtonText(button);
204
-
205
- button.addEventListener('click', event => {
206
- event.preventDefault();
207
- const swappableSection = this.dom.maybeFind('.lh-perf-audits--swappable');
208
- if (swappableSection) {
209
- this.dom.swapSectionIfPossible(swappableSection);
210
- }
211
- const currentState = this._getInsightToggleState();
212
- const newState = currentState === 'AUDITS' ? 'INSIGHTS' : 'AUDITS';
213
- this.dom.fireEventOn('lh-analytics', this.dom.document(), {
214
- name: 'toggle_insights',
215
- data: {newState},
216
- });
217
- this._persistInsightToggleToStorage(newState);
218
- this._setInsightToggleButtonText(button);
219
- });
220
-
221
- container.appendChild(button);
222
- }
223
-
224
137
  /**
225
138
  * @param {LH.ReportResult.Category} category
226
139
  * @param {Object<string, LH.Result.ReportGroup>} groups
@@ -288,44 +201,12 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
288
201
  filmstripEl && timelineEl.append(filmstripEl);
289
202
  }
290
203
 
291
- this._renderInsightsToggle(element);
292
-
293
- const legacyAuditsSection =
294
- this.renderFilterableSection(category, groups, ['diagnostics'], metricAudits);
295
- legacyAuditsSection?.classList.add('lh-perf-audits--swappable', 'lh-perf-audits--legacy');
296
-
297
- const experimentalInsightsSection =
204
+ const auditsSection =
298
205
  this.renderFilterableSection(category, groups, ['insights', 'diagnostics'], metricAudits);
299
- experimentalInsightsSection?.classList.add(
300
- 'lh-perf-audits--swappable', 'lh-perf-audits--experimental');
301
-
302
- if (legacyAuditsSection) {
303
- element.append(legacyAuditsSection);
304
-
305
- // Many tests expect just one of these sections to be in the DOM at a given time.
306
- // To prevent the hidden section from tripping up these tests, we will just remove the hidden
307
- // section from the DOM and store it in memory.
308
- if (experimentalInsightsSection) {
309
- this.dom.registerSwappableSections(legacyAuditsSection, experimentalInsightsSection);
310
- }
206
+ if (auditsSection) {
207
+ auditsSection.classList.add('lh-perf-audits');
208
+ element.append(auditsSection);
311
209
  }
312
- // Deal with the user loading the report and having toggled to Insights
313
- // which is now stored in local storage. Put in a rAF otherwise this code
314
- // runs before the DOM is created.
315
- if (this._getInsightToggleState() === 'INSIGHTS') {
316
- requestAnimationFrame(() => {
317
- const swappableSection = this.dom.maybeFind('.lh-perf-audits--swappable');
318
- if (swappableSection) {
319
- this.dom.swapSectionIfPossible(swappableSection);
320
- }
321
- });
322
- }
323
-
324
- // Log the initial state.
325
- this.dom.fireEventOn('lh-analytics', this.dom.document(), {
326
- name: 'initial_insights_state',
327
- data: {state: this._getRawInsightToggleState()},
328
- });
329
210
 
330
211
  const isNavigationMode = !options || options?.gatherMode === 'navigation';
331
212
  if (isNavigationMode && category.score !== null) {
@@ -349,31 +230,18 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
349
230
 
350
231
  const element = this.dom.createElement('div');
351
232
 
352
- /** @type {Set<string>} */
353
- const replacedAuditIds = new Set();
354
-
355
233
  /**
356
- * This exists to temporarily allow showing insights - which are in the hidden
357
- * group by default - when using the insights toggle.
358
- * See https://github.com/GoogleChrome/lighthouse/pull/16418 for motivation.
359
- *
360
234
  * @param {LH.ReportResult.AuditRef} auditRef
361
235
  */
362
236
  const getGroup = (auditRef) => {
363
- return auditRef.id.endsWith('-insight') ? 'insights' : auditRef.group ?? '';
237
+ return auditRef.group ?? '';
364
238
  };
365
239
 
366
240
  const allGroupAudits =
367
241
  category.auditRefs.filter(audit => groupNames.includes(getGroup(audit)));
368
- for (const auditRef of allGroupAudits) {
369
- auditRef.result.replacesAudits?.forEach(replacedAuditId => {
370
- replacedAuditIds.add(replacedAuditId);
371
- });
372
- }
373
242
 
374
243
  // Diagnostics
375
244
  const allFilterableAudits = allGroupAudits
376
- .filter(audit => !replacedAuditIds.has(audit.id))
377
245
  .map(auditRef => {
378
246
  const {overallImpact, overallLinearImpact} = this.overallImpact(auditRef, metricAudits);
379
247
  const guidanceLevel = auditRef.result.guidanceLevel || 1;
@@ -382,7 +250,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
382
250
  return {auditRef, auditEl, overallImpact, overallLinearImpact, guidanceLevel};
383
251
  });
384
252
 
385
- const filterableAudits = allFilterableAudits
253
+ const notPassedAudits = allFilterableAudits
386
254
  .filter(audit => !ReportUtils.showAsPassed(audit.auditRef.result));
387
255
 
388
256
  const passedAudits = allFilterableAudits
@@ -409,7 +277,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
409
277
  }
410
278
  }
411
279
 
412
- filterableAudits.sort((a, b) => {
280
+ notPassedAudits.sort((a, b) => {
413
281
  // Performance diagnostics should only have score display modes of "informative" and "metricSavings"
414
282
  // If the score display mode is "metricSavings", the `score` will be a coarse approximation of the overall impact.
415
283
  // Therefore, it makes sense to sort audits by score first to ensure visual clarity with the score icons.
@@ -441,7 +309,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
441
309
  return b.guidanceLevel - a.guidanceLevel;
442
310
  });
443
311
 
444
- for (const audit of filterableAudits) {
312
+ for (const audit of notPassedAudits) {
445
313
  if (!audit.auditRef.group) continue;
446
314
 
447
315
  const groupEls = groupElsMap[getGroup(audit.auditRef)];
@@ -454,7 +322,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
454
322
 
455
323
  /** @type {Set<string>} */
456
324
  const filterableMetricAcronyms = new Set();
457
- for (const audit of filterableAudits) {
325
+ for (const audit of notPassedAudits) {
458
326
  const metricSavings = audit.auditRef.result.metricSavings || {};
459
327
  for (const [key, value] of Object.entries(metricSavings)) {
460
328
  if (typeof value === 'number') filterableMetricAcronyms.add(key);
@@ -472,7 +340,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
472
340
  refreshFilteredAudits('All');
473
341
 
474
342
  for (const groupName of groupNames) {
475
- if (filterableAudits.some(audit => getGroup(audit.auditRef) === groupName)) {
343
+ if (notPassedAudits.some(audit => getGroup(audit.auditRef) === groupName)) {
476
344
  const groupEls = groupElsMap[groupName];
477
345
  if (!groupEls) continue;
478
346
  element.append(groupEls[0]);
@@ -10,7 +10,6 @@ export class ReportUIFeatures {
10
10
  _dom: DOM;
11
11
  _opts: import("../types/report-renderer.js").default.Options;
12
12
  _topbar: TopbarFeatures | null;
13
- _tablesHandledFor3p: WeakSet<object>;
14
13
  /**
15
14
  * Handle media query change events.
16
15
  * @param {MediaQueryList|MediaQueryListEvent} mql
@@ -40,7 +40,6 @@ export class ReportUIFeatures {
40
40
  this._opts = opts;
41
41
 
42
42
  this._topbar = opts.omitTopbar ? null : new TopbarFeatures(this, dom);
43
- this._tablesHandledFor3p = new WeakSet();
44
43
  this.onMediaQueryChange = this.onMediaQueryChange.bind(this);
45
44
  }
46
45
 
@@ -61,9 +60,6 @@ export class ReportUIFeatures {
61
60
  this._setupThirdPartyFilter();
62
61
  this._setupElementScreenshotOverlay(this._dom.rootEl);
63
62
 
64
- // TODO(v13): remove.
65
- this._dom._onSwap = () => this._setupThirdPartyFilter();
66
-
67
63
  // Do not query the system preferences for DevTools - DevTools should only apply dark theme
68
64
  // if dark is selected in the settings panel.
69
65
  // TODO: set `disableDarkMode` in devtools and delete this special case.
@@ -215,6 +211,8 @@ export class ReportUIFeatures {
215
211
  }
216
212
 
217
213
  _setupThirdPartyFilter() {
214
+ // Note: do not remove deleted audits from the below arrays.
215
+
218
216
  // Some audits should not display the third party filter option.
219
217
  const thirdPartyFilterAuditExclusions = [
220
218
  // These audits deal explicitly with third party resources.
@@ -242,15 +240,6 @@ export class ReportUIFeatures {
242
240
  });
243
241
 
244
242
  tablesWithUrls.forEach((tableEl) => {
245
- // The "toggle insights/audits" button means that not all tables are on the DOM on init.
246
- // So we call this whole setup function multiple times for now, once every time we toggle.
247
- // TODO(v13): remove.
248
- if (this._tablesHandledFor3p.has(tableEl)) {
249
- return;
250
- }
251
-
252
- this._tablesHandledFor3p.add(tableEl);
253
-
254
243
  const rowEls = getTableRows(tableEl);
255
244
  const nonSubItemRows = rowEls.filter(rowEl => !rowEl.classList.contains('lh-sub-item-row'));
256
245
  const thirdPartyRowEls = this._getThirdPartyRows(nonSubItemRows,
@@ -136,8 +136,7 @@ export namespace UIStrings {
136
136
  let firstPartyChipLabel: string;
137
137
  let openInANewTabTooltip: string;
138
138
  let unattributable: string;
139
- let insightsNotice: string;
140
- let tryInsights: string;
141
- let goBackToAudits: string;
139
+ let unscoredLabel: string;
140
+ let unscoredTitle: string;
142
141
  }
143
142
  //# sourceMappingURL=report-utils.d.ts.map
@@ -483,12 +483,10 @@ const UIStrings = {
483
483
  /** Generic category name for all resources that could not be attributed to a 1st or 3rd party entity. */
484
484
  unattributable: 'Unattributable',
485
485
 
486
- /** Notice about upcoming planned changes to Lighthouse, to replace most performance audits with a new set of "insight" audits. */
487
- insightsNotice: 'Later this year, insights will replace performance audits. [Learn more and provide feedback here](https://github.com/GoogleChrome/lighthouse/discussions/16462).',
488
- /** Text for a button to try out "Performance insight audits", a new set of performance advice that will replace performance audits. */
489
- tryInsights: 'Try insights',
490
- /** Text for a button for going back to normal "Performance audits", instead of using the new set of performance insight audits that will replace performance audits. */
491
- goBackToAudits: 'Go back to audits',
486
+ /** Descriptive explanation used when an audit is not part of the calculated score. */
487
+ unscoredLabel: 'Unscored',
488
+ /** Descriptive explanation used when an audit is not part of the calculated score. */
489
+ unscoredTitle: 'This audit does not contribute to the overall category score.',
492
490
  };
493
491
 
494
492
  export {
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  import { Result as AuditResult } from "../../types/lhr/audit-result";
8
- import { ReportUIFeatures } from "../renderer/report-ui-features.js";
9
8
 
10
9
  declare module Renderer {
11
10
  function renderReport(lhr: AuditResult, options?: Options): HTMLElement;
@@ -47,11 +46,6 @@ declare module Renderer {
47
46
  * data, which can be gotten from the artifacts.
48
47
  */
49
48
  onViewTrace?: () => void;
50
- /**
51
- * Called when the performance audits/insights are swapped out.
52
- * TODO(v13): remove
53
- */
54
- _onSwapHook?: () => void;
55
49
  }
56
50
  }
57
51