lighthouse 8.3.0-dev.20210907 → 8.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.
Files changed (196) hide show
  1. package/changelog.md +1 -1
  2. package/dist/report/standalone.js +196 -0
  3. package/jest.config.js +0 -4
  4. package/lighthouse-cli/cli-flags.js +6 -14
  5. package/lighthouse-cli/run.js +1 -1
  6. package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +3 -9
  7. package/lighthouse-cli/test/smokehouse/report-assert.js +16 -36
  8. package/lighthouse-core/audits/large-javascript-libraries.js +166 -0
  9. package/lighthouse-core/audits/seo/http-status-code.js +6 -2
  10. package/lighthouse-core/audits/viewport.js +1 -2
  11. package/lighthouse-core/config/config-helpers.js +75 -9
  12. package/lighthouse-core/config/config.js +50 -6
  13. package/lighthouse-core/config/constants.js +0 -1
  14. package/lighthouse-core/config/default-config.js +0 -3
  15. package/lighthouse-core/config/experimental-config.js +8 -0
  16. package/lighthouse-core/config/metrics-to-audits.js +0 -1
  17. package/lighthouse-core/fraggle-rock/config/config.js +4 -3
  18. package/lighthouse-core/fraggle-rock/config/default-config.js +1 -3
  19. package/lighthouse-core/fraggle-rock/config/validation.js +0 -201
  20. package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +0 -4
  21. package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +8 -16
  22. package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +0 -4
  23. package/lighthouse-core/fraggle-rock/gather/session.js +5 -30
  24. package/lighthouse-core/gather/driver/navigation.js +6 -7
  25. package/lighthouse-core/gather/driver/wait-for-condition.js +0 -27
  26. package/lighthouse-core/gather/fetcher.js +7 -17
  27. package/lighthouse-core/gather/gather-runner.js +0 -1
  28. package/lighthouse-core/gather/gatherers/seo/robots-txt.js +6 -2
  29. package/lighthouse-core/gather/gatherers/seo/tap-targets.js +2 -2
  30. package/lighthouse-core/gather/gatherers/stacks.js +1 -1
  31. package/lighthouse-core/lib/asset-saver.js +2 -2
  32. package/lighthouse-core/lib/cdt/SDK.js +0 -1
  33. package/lighthouse-core/lib/csp-evaluator.js +4 -17
  34. package/{report/generator → lighthouse-core/lib}/file-namer.js +0 -0
  35. package/lighthouse-core/lib/i18n/README.md +1 -1
  36. package/lighthouse-core/lib/i18n/i18n.js +7 -7
  37. package/lighthouse-core/lib/i18n/locales/ar-XB.json +18 -0
  38. package/lighthouse-core/lib/i18n/locales/ar.json +18 -0
  39. package/lighthouse-core/lib/i18n/locales/bg.json +18 -0
  40. package/lighthouse-core/lib/i18n/locales/ca.json +18 -0
  41. package/lighthouse-core/lib/i18n/locales/cs.json +18 -0
  42. package/lighthouse-core/lib/i18n/locales/da.json +18 -0
  43. package/lighthouse-core/lib/i18n/locales/de.json +18 -0
  44. package/lighthouse-core/lib/i18n/locales/el.json +18 -0
  45. package/lighthouse-core/lib/i18n/locales/en-GB.json +18 -0
  46. package/lighthouse-core/lib/i18n/locales/en-US.json +18 -18
  47. package/lighthouse-core/lib/i18n/locales/en-XA.json +18 -0
  48. package/lighthouse-core/lib/i18n/locales/en-XL.json +18 -18
  49. package/lighthouse-core/lib/i18n/locales/es-419.json +18 -0
  50. package/lighthouse-core/lib/i18n/locales/es.json +18 -0
  51. package/lighthouse-core/lib/i18n/locales/fi.json +18 -0
  52. package/lighthouse-core/lib/i18n/locales/fil.json +18 -0
  53. package/lighthouse-core/lib/i18n/locales/fr.json +18 -0
  54. package/lighthouse-core/lib/i18n/locales/he.json +18 -0
  55. package/lighthouse-core/lib/i18n/locales/hi.json +18 -0
  56. package/lighthouse-core/lib/i18n/locales/hr.json +18 -0
  57. package/lighthouse-core/lib/i18n/locales/hu.json +18 -0
  58. package/lighthouse-core/lib/i18n/locales/id.json +18 -0
  59. package/lighthouse-core/lib/i18n/locales/it.json +18 -0
  60. package/lighthouse-core/lib/i18n/locales/ja.json +18 -0
  61. package/lighthouse-core/lib/i18n/locales/ko.json +18 -0
  62. package/lighthouse-core/lib/i18n/locales/lt.json +18 -0
  63. package/lighthouse-core/lib/i18n/locales/lv.json +18 -0
  64. package/lighthouse-core/lib/i18n/locales/nl.json +18 -0
  65. package/lighthouse-core/lib/i18n/locales/no.json +18 -0
  66. package/lighthouse-core/lib/i18n/locales/pl.json +18 -0
  67. package/lighthouse-core/lib/i18n/locales/pt-PT.json +18 -0
  68. package/lighthouse-core/lib/i18n/locales/pt.json +18 -0
  69. package/lighthouse-core/lib/i18n/locales/ro.json +18 -0
  70. package/lighthouse-core/lib/i18n/locales/ru.json +18 -0
  71. package/lighthouse-core/lib/i18n/locales/sk.json +18 -0
  72. package/lighthouse-core/lib/i18n/locales/sl.json +18 -0
  73. package/lighthouse-core/lib/i18n/locales/sr-Latn.json +18 -0
  74. package/lighthouse-core/lib/i18n/locales/sr.json +18 -0
  75. package/lighthouse-core/lib/i18n/locales/sv.json +18 -0
  76. package/lighthouse-core/lib/i18n/locales/ta.json +18 -0
  77. package/lighthouse-core/lib/i18n/locales/te.json +18 -0
  78. package/lighthouse-core/lib/i18n/locales/th.json +18 -0
  79. package/lighthouse-core/lib/i18n/locales/tr.json +18 -0
  80. package/lighthouse-core/lib/i18n/locales/uk.json +18 -0
  81. package/lighthouse-core/lib/i18n/locales/vi.json +18 -0
  82. package/lighthouse-core/lib/i18n/locales/zh-HK.json +18 -0
  83. package/lighthouse-core/lib/i18n/locales/zh-TW.json +18 -0
  84. package/lighthouse-core/lib/i18n/locales/zh.json +18 -0
  85. package/lighthouse-core/lib/large-javascript-libraries/bundlephobia-database.json +62 -0
  86. package/lighthouse-core/lib/large-javascript-libraries/library-suggestions.js +20 -0
  87. package/lighthouse-core/lib/network-request.js +1 -3
  88. package/lighthouse-core/lib/traces/pwmetrics-events.js +2 -2
  89. package/lighthouse-core/lib/url-shim.js +1 -7
  90. package/lighthouse-core/runner.js +1 -4
  91. package/lighthouse-core/util-commonjs.js +2 -2
  92. package/now.json +1 -1
  93. package/package.json +13 -20
  94. package/report/README.md +2 -2
  95. package/report/assets/standalone-template.html +1 -0
  96. package/report/assets/styles.css +27 -23
  97. package/report/assets/templates.html +40 -37
  98. package/report/clients/bundle.js +0 -1
  99. package/report/{package.json → clients/package.json} +0 -0
  100. package/report/clients/psi.js +3 -13
  101. package/report/clients/standalone.js +1 -1
  102. package/report/{types/buffer.d.ts → clients/treemap.js} +13 -11
  103. package/report/renderer/category-renderer.js +2 -2
  104. package/report/renderer/components.js +48 -46
  105. package/report/renderer/crc-details-renderer.js +16 -16
  106. package/report/renderer/details-renderer.js +1 -1
  107. package/report/renderer/dom.js +0 -17
  108. package/report/renderer/element-screenshot-renderer.js +9 -9
  109. package/{flow-report/test/setup/global-setup.ts → report/renderer/file-namer.js} +2 -5
  110. package/report/renderer/logger.js +4 -4
  111. package/report/renderer/package.json +4 -0
  112. package/report/renderer/report-renderer.js +11 -4
  113. package/report/renderer/report-ui-features.js +656 -43
  114. package/report/renderer/text-encoding.js +1 -1
  115. package/report/renderer/util.js +2 -2
  116. package/report/{generator/report-assets.js → report-assets.js} +3 -9
  117. package/report/{generator/report-generator.js → report-generator.js} +9 -37
  118. package/report/test/clients/package.json +4 -0
  119. package/report/test/clients/psi-test.js +1 -3
  120. package/report/test/renderer/category-renderer-test.js +3 -8
  121. package/report/test/renderer/components-test.js +0 -35
  122. package/report/test/renderer/crc-details-renderer-test.js +4 -5
  123. package/report/test/renderer/details-renderer-test.js +1 -3
  124. package/report/test/renderer/dom-test.js +6 -8
  125. package/report/test/renderer/i18n-test.js +0 -1
  126. package/report/test/renderer/package.json +4 -0
  127. package/report/test/renderer/performance-category-renderer-test.js +27 -30
  128. package/report/test/renderer/pwa-category-renderer-test.js +1 -2
  129. package/report/test/renderer/report-renderer-test.js +0 -1
  130. package/report/test/renderer/report-ui-features-test.js +28 -20
  131. package/report/test/renderer/snippet-renderer-test.js +0 -1
  132. package/report/test/renderer/text-encoding-test.js +0 -2
  133. package/report/test/renderer/util-test.js +0 -1
  134. package/report/test/{generator/report-generator-test.js → report-generator-test.js} +7 -9
  135. package/third-party/chromium-synchronization/installability-errors-test.js +27 -28
  136. package/third-party/snyk/snapshot.json +0 -2
  137. package/tsconfig.json +5 -24
  138. package/types/artifacts.d.ts +18 -5
  139. package/types/{lhr/audit-details.d.ts → audit-details.d.ts} +3 -18
  140. package/types/audit.d.ts +58 -7
  141. package/types/{lhr/budget.d.ts → budget.d.ts} +0 -0
  142. package/types/bundle-phobia-cli/index.d.ts +40 -0
  143. package/types/config.d.ts +8 -3
  144. package/types/externs.d.ts +119 -5
  145. package/types/gatherer.d.ts +2 -3
  146. package/types/global-lh.d.ts +14 -16
  147. package/{report/types/report-result.d.ts → types/html-renderer.d.ts} +17 -8
  148. package/types/{lhr/i18n.d.ts → i18n.d.ts} +25 -2
  149. package/types/{lhr/lhr.d.ts → lhr.d.ts} +9 -41
  150. package/types/smokehouse.d.ts +3 -3
  151. package/types/{lhr/treemap.d.ts → treemap.d.ts} +3 -3
  152. package/flow-report/assets/standalone-flow-template.html +0 -38
  153. package/flow-report/assets/styles.css +0 -310
  154. package/flow-report/jest.config.js +0 -24
  155. package/flow-report/src/app.tsx +0 -40
  156. package/flow-report/src/common.tsx +0 -72
  157. package/flow-report/src/icons.tsx +0 -96
  158. package/flow-report/src/sidebar/flow.tsx +0 -72
  159. package/flow-report/src/sidebar/sidebar.tsx +0 -89
  160. package/flow-report/src/summary/summary.tsx +0 -178
  161. package/flow-report/src/util.ts +0 -160
  162. package/flow-report/src/wrappers/gauge.tsx +0 -40
  163. package/flow-report/src/wrappers/report-renderer.tsx +0 -46
  164. package/flow-report/src/wrappers/report.tsx +0 -71
  165. package/flow-report/standalone-flow.tsx +0 -23
  166. package/flow-report/test/app-test.tsx +0 -48
  167. package/flow-report/test/common-test.tsx +0 -131
  168. package/flow-report/test/setup/env-setup.ts +0 -25
  169. package/flow-report/test/sidebar/flow-test.tsx +0 -71
  170. package/flow-report/test/sidebar/sidebar-test.tsx +0 -53
  171. package/flow-report/test/summary/summary-test.tsx +0 -132
  172. package/flow-report/test/util-test.tsx +0 -109
  173. package/flow-report/tsconfig.json +0 -39
  174. package/flow-report/types/flow-report.d.ts +0 -27
  175. package/lighthouse-core/audits/lcp-lazy-loaded.js +0 -83
  176. package/report/.eslintrc.cjs +0 -33
  177. package/report/generator/README.md +0 -9
  178. package/report/generator/flow-report-assets.js +0 -20
  179. package/report/generator/package.json +0 -4
  180. package/report/generator/tsconfig.json +0 -28
  181. package/report/renderer/drop-down-menu.js +0 -215
  182. package/report/renderer/features-util.js +0 -26
  183. package/report/renderer/open-tab.js +0 -137
  184. package/report/renderer/topbar-features.js +0 -309
  185. package/report/test/generator/file-namer-test.js +0 -28
  186. package/report/test/generator/package.json +0 -4
  187. package/report/test-assets/faux-psi-template.html +0 -126
  188. package/report/test-assets/faux-psi.js +0 -92
  189. package/report/tsconfig.json +0 -39
  190. package/report/types/augment-dom.d.ts +0 -24
  191. package/report/types/html-renderer.d.ts +0 -28
  192. package/types/lhr/audit-result.d.ts +0 -59
  193. package/types/lhr/flow.d.ts +0 -16
  194. package/types/lhr/settings.d.ts +0 -105
  195. package/types/lhr/tsconfig.json +0 -24
  196. package/types/query-selector.d.ts +0 -36
@@ -221,9 +221,9 @@ limitations under the License.
221
221
  </style>
222
222
  <div class="lh-scores-wrapper">
223
223
  <div class="lh-scores-container">
224
- <div class="lh-pyro">
225
- <div class="lh-before"></div>
226
- <div class="lh-after"></div>
224
+ <div class="pyro">
225
+ <div class="before"></div>
226
+ <div class="after"></div>
227
227
  </div>
228
228
  </div>
229
229
  </div>
@@ -251,6 +251,9 @@ limitations under the License.
251
251
  user-select: none;
252
252
  flex: none;
253
253
  }
254
+ .lh-topbar__logo .shape {
255
+ fill: var(--report-text-color);
256
+ }
254
257
 
255
258
  .lh-topbar__url {
256
259
  margin: var(--topbar-padding);
@@ -283,10 +286,10 @@ limitations under the License.
283
286
  .lh-tools__button svg {
284
287
  fill: var(--tools-icon-color);
285
288
  }
286
- .lh-dark .lh-tools__button svg {
289
+ .dark .lh-tools__button svg {
287
290
  filter: invert(1);
288
291
  }
289
- .lh-tools__button.lh-active + .lh-tools__dropdown {
292
+ .lh-tools__button.active + .lh-tools__dropdown {
290
293
  opacity: 1;
291
294
  clip: rect(-1px, 194px, 242px, -3px);
292
295
  visibility: visible;
@@ -384,14 +387,14 @@ limitations under the License.
384
387
  </svg>
385
388
  </button>
386
389
  <div id="lh-tools-dropdown" role="menu" class="lh-tools__dropdown" aria-labelledby="lh-tools-button">
387
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--print" data-i18n="dropdownPrintSummary" data-action="print-summary"></a>
388
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--print" data-i18n="dropdownPrintExpanded" data-action="print-expanded"></a>
389
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--copy" data-i18n="dropdownCopyJSON" data-action="copy"></a>
390
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--download" data-i18n="dropdownSaveHTML" data-action="save-html"></a>
391
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--download" data-i18n="dropdownSaveJSON" data-action="save-json"></a>
392
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--open" data-i18n="dropdownViewer" data-action="open-viewer"></a>
393
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--open" data-i18n="dropdownSaveGist" data-action="save-gist"></a>
394
- <a role="menuitem" tabindex="-1" href="#" class="lh-report-icon lh-report-icon--dark" data-i18n="dropdownDarkTheme" data-action="toggle-dark"></a>
390
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--print" data-i18n="dropdownPrintSummary" data-action="print-summary"></a>
391
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--print" data-i18n="dropdownPrintExpanded" data-action="print-expanded"></a>
392
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--copy" data-i18n="dropdownCopyJSON" data-action="copy"></a>
393
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--download" data-i18n="dropdownSaveHTML" data-action="save-html"></a>
394
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--download" data-i18n="dropdownSaveJSON" data-action="save-json"></a>
395
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--open" data-i18n="dropdownViewer" data-action="open-viewer"></a>
396
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--open" data-i18n="dropdownSaveGist" data-action="save-gist"></a>
397
+ <a role="menuitem" tabindex="-1" href="#" class="report-icon report-icon--dark" data-i18n="dropdownDarkTheme" data-action="toggle-dark"></a>
395
398
  </div>
396
399
  </div>
397
400
  </div>
@@ -403,22 +406,22 @@ limitations under the License.
403
406
  /* CSS Fireworks. Originally by Eddie Lin
404
407
  https://codepen.io/paulirish/pen/yEVMbP
405
408
  */
406
- .lh-pyro {
409
+ .pyro {
407
410
  display: none;
408
411
  z-index: 1;
409
412
  pointer-events: none;
410
413
  }
411
- .lh-score100 .lh-pyro {
414
+ .score100 .pyro {
412
415
  display: block;
413
416
  }
414
- .lh-score100 .lh-lighthouse stop:first-child {
417
+ .score100 .lh-lighthouse stop:first-child {
415
418
  stop-color: hsla(200, 12%, 95%, 0);
416
419
  }
417
- .lh-score100 .lh-lighthouse stop:last-child {
420
+ .score100 .lh-lighthouse stop:last-child {
418
421
  stop-color: hsla(65, 81%, 76%, 1);
419
422
  }
420
423
 
421
- .lh-pyro > .lh-pyro-before, .lh-pyro > .lh-pyro-after {
424
+ .pyro > .before, .pyro > .after {
422
425
  position: absolute;
423
426
  width: 5px;
424
427
  height: 5px;
@@ -428,11 +431,11 @@ limitations under the License.
428
431
  animation-delay: 1s, 1s, 1s;
429
432
  }
430
433
 
431
- .lh-pyro > .lh-pyro-after {
434
+ .pyro > .after {
432
435
  animation-delay: 2.25s, 2.25s, 2.25s;
433
436
  animation-duration: 1.25s, 1.25s, 6.25s;
434
437
  }
435
- .lh-fireworks-paused .lh-pyro > div {
438
+ .fireworks-paused .pyro > div {
436
439
  animation-play-state: paused;
437
440
  }
438
441
 
@@ -585,7 +588,7 @@ limitations under the License.
585
588
  .lh-gauge--pwa__logo--secondary-color {
586
589
  fill: #3D3D3D;
587
590
  }
588
- .lh-dark .lh-gauge--pwa__logo--secondary-color {
591
+ .dark .lh-gauge--pwa__logo--secondary-color {
589
592
  fill: #D8B6B6;
590
593
  }
591
594
 
@@ -661,48 +664,48 @@ limitations under the License.
661
664
  <template id="crc">
662
665
  <div class="lh-crc-container">
663
666
  <style>
664
- .lh-crc .lh-tree-marker {
667
+ .lh-crc .tree-marker {
665
668
  width: 12px;
666
669
  height: 26px;
667
670
  display: block;
668
671
  float: left;
669
672
  background-position: top left;
670
673
  }
671
- .lh-crc .lh-horiz-down {
674
+ .lh-crc .horiz-down {
672
675
  background: url('data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><g fill="%23D8D8D8" fill-rule="evenodd"><path d="M16 12v2H-2v-2z"/><path d="M9 12v14H7V12z"/></g></svg>');
673
676
  }
674
- .lh-crc .lh-right {
677
+ .lh-crc .right {
675
678
  background: url('data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M16 12v2H0v-2z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>');
676
679
  }
677
- .lh-crc .lh-up-right {
680
+ .lh-crc .up-right {
678
681
  background: url('data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M7 0h2v14H7zm2 12h7v2H9z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>');
679
682
  }
680
- .lh-crc .lh-vert-right {
683
+ .lh-crc .vert-right {
681
684
  background: url('data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M7 0h2v27H7zm2 12h7v2H9z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>');
682
685
  }
683
- .lh-crc .lh-vert {
686
+ .lh-crc .vert {
684
687
  background: url('data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M7 0h2v26H7z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>');
685
688
  }
686
- .lh-crc .lh-crc-tree {
689
+ .lh-crc .crc-tree {
687
690
  font-size: 14px;
688
691
  width: 100%;
689
692
  overflow-x: auto;
690
693
  }
691
- .lh-crc .lh-crc-node {
694
+ .lh-crc .crc-node {
692
695
  height: 26px;
693
696
  line-height: 26px;
694
697
  white-space: nowrap;
695
698
  }
696
- .lh-crc .lh-crc-node__tree-value {
699
+ .lh-crc .crc-node__tree-value {
697
700
  margin-left: 10px;
698
701
  }
699
- .lh-crc .lh-crc-node__tree-value div {
702
+ .lh-crc .crc-node__tree-value div {
700
703
  display: inline;
701
704
  }
702
- .lh-crc .lh-crc-node__chain-duration {
705
+ .lh-crc .crc-node__chain-duration {
703
706
  font-weight: 700;
704
707
  }
705
- .lh-crc .lh-crc-initial-nav {
708
+ .lh-crc .crc-initial-nav {
706
709
  color: #595959;
707
710
  font-style: italic;
708
711
  }
@@ -716,7 +719,7 @@ limitations under the License.
716
719
  </div>
717
720
  </div>
718
721
  <div class="lh-crc">
719
- <div class="lh-crc-initial-nav"></div>
722
+ <div class="crc-initial-nav"></div>
720
723
  <!-- crcChain -->
721
724
  </div>
722
725
  </div>
@@ -724,9 +727,9 @@ limitations under the License.
724
727
 
725
728
  <!-- Lighthouse crtiical request chains component, single chain -->
726
729
  <template id="crcChain">
727
- <div class="lh-crc-node">
728
- <span class="lh-crc-node__tree-marker"></span>
729
- <span class="lh-crc-node__tree-value"></span>
730
+ <div class="crc-node">
731
+ <span class="crc-node__tree-marker"></span>
732
+ <span class="crc-node__tree-value"></span>
730
733
  </div>
731
734
  </template>
732
735
 
@@ -11,7 +11,6 @@
11
11
  // until we work out a common rendering interface.
12
12
  // See: https://github.com/GoogleChrome/lighthouse/pull/12623
13
13
 
14
- // Modify lighthouse-core/scripts/roll-to-devtools.sh if exports change.
15
14
  export {DOM} from '../renderer/dom.js';
16
15
  export {ReportRenderer} from '../renderer/report-renderer.js';
17
16
  export {ReportUIFeatures} from '../renderer/report-ui-features.js';
File without changes
@@ -20,13 +20,10 @@ import {DetailsRenderer} from '../renderer/details-renderer.js';
20
20
  import {DOM} from '../renderer/dom.js';
21
21
  import {ElementScreenshotRenderer} from '../renderer/element-screenshot-renderer.js';
22
22
  import {I18n} from '../renderer/i18n.js';
23
- import {openTreemap} from '../renderer/open-tab.js';
24
23
  import {PerformanceCategoryRenderer} from '../renderer/performance-category-renderer.js';
25
24
  import {ReportUIFeatures} from '../renderer/report-ui-features.js';
26
25
  import {Util} from '../renderer/util.js';
27
26
 
28
- /** @typedef {{scoreGaugeEl: Element, perfCategoryEl: Element, finalScreenshotDataUri: string|null, scoreScaleEl: Element, installFeatures: Function}} PrepareLabDataResult */
29
-
30
27
  /**
31
28
  * Returns all the elements that PSI needs to render the report
32
29
  * We expose this helper method to minimize the 'public' API surface of the renderer
@@ -39,7 +36,7 @@ import {Util} from '../renderer/util.js';
39
36
  *
40
37
  * @param {LH.Result | string} LHResult The stringified version of {LH.Result}
41
38
  * @param {Document} document The host page's window.document
42
- * @return {PrepareLabDataResult}
39
+ * @return {{scoreGaugeEl: Element, perfCategoryEl: Element, finalScreenshotDataUri: string|null, scoreScaleEl: Element, installFeatures: Function}}
43
40
  */
44
41
  export function prepareLabData(LHResult, document) {
45
42
  const lhResult = (typeof LHResult === 'string') ?
@@ -92,11 +89,10 @@ export function prepareLabData(LHResult, document) {
92
89
  /** @param {HTMLElement} reportEl */
93
90
  const installFeatures = (reportEl) => {
94
91
  if (fullPageScreenshot) {
95
- // 1) Add fpss css var to reportEl parent so any thumbnails will work
96
92
  ElementScreenshotRenderer.installFullPageScreenshot(
97
93
  reportEl, fullPageScreenshot.screenshot);
98
94
 
99
- // 2) Append the overlay element to a specific part of the DOM so that
95
+ // Append the overlay element to a specific part of the DOM so that
100
96
  // the sticky tab group element renders correctly. If put in the reportEl
101
97
  // like normal, then the sticky header would bleed through the overlay
102
98
  // element.
@@ -126,7 +122,7 @@ export function prepareLabData(LHResult, document) {
126
122
  container: buttonContainer,
127
123
  text: Util.i18n.strings.viewTreemapLabel,
128
124
  icon: 'treemap',
129
- onClick: () => openTreemap(lhResult),
125
+ onClick: () => ReportUIFeatures.openTreemap(lhResult),
130
126
  });
131
127
  }
132
128
  };
@@ -145,9 +141,3 @@ function _getFinalScreenshot(perfCategory) {
145
141
  if (!details || details.type !== 'screenshot') return null;
146
142
  return details.data;
147
143
  }
148
-
149
- // TODO: remove with report API refactor.
150
- if (typeof window !== 'undefined') {
151
- // @ts-expect-error
152
- window.prepareLabData = prepareLabData;
153
- }
@@ -11,7 +11,7 @@
11
11
  * The renderer code is bundled and injected into the report HTML along with the JSON report.
12
12
  */
13
13
 
14
- /* global ga */
14
+ /* global document window ga */
15
15
 
16
16
  import {DOM} from '../renderer/dom.js';
17
17
  import {Logger} from '../renderer/logger.js';
@@ -3,17 +3,19 @@
3
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
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
5
  */
6
+ 'use strict';
6
7
 
7
- /**
8
- * A minimal type for Node's `Buffer` to avoid importing all Node types for
9
- * atob/btoa fallback for testing `text-encoding.js`.
10
- */
8
+ /* global window */
9
+
10
+ // TODO(esmodules): delete when treemap app is esm.
11
11
 
12
- declare global {
13
- class Buffer {
14
- static from(str: string, encoding?: string): Buffer;
15
- toString(encoding?: string): string;
16
- }
17
- }
12
+ import {I18n} from '../renderer/i18n.js';
13
+ import {Logger} from '../renderer/logger.js';
14
+ import {TextEncoding} from '../renderer/text-encoding.js';
18
15
 
19
- export {}
16
+ // @ts-expect-error
17
+ window.I18n = I18n;
18
+ // @ts-expect-error
19
+ window.Logger = Logger;
20
+ // @ts-expect-error
21
+ window.TextEncoding = TextEncoding;
@@ -118,8 +118,8 @@ export class CategoryRenderer {
118
118
  auditEl.classList.add(`lh-audit--error`);
119
119
  const textEl = this.dom.find('.lh-audit__display-text', auditEl);
120
120
  textEl.textContent = strings.errorLabel;
121
- textEl.classList.add('lh-tooltip-boundary');
122
- const tooltip = this.dom.createChildOf(textEl, 'div', 'lh-tooltip lh-tooltip--error');
121
+ textEl.classList.add('tooltip-boundary');
122
+ const tooltip = this.dom.createChildOf(textEl, 'div', 'tooltip tooltip--error');
123
123
  tooltip.textContent = audit.result.errorMessage || strings.errorMissingAuditInfo;
124
124
  } else if (audit.result.explanation) {
125
125
  const explEl = this.dom.createChildOf(titleEl, 'div', 'lh-audit-explanation');