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.
- package/changelog.md +1 -1
- package/dist/report/standalone.js +196 -0
- package/jest.config.js +0 -4
- package/lighthouse-cli/cli-flags.js +6 -14
- package/lighthouse-cli/run.js +1 -1
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +3 -9
- package/lighthouse-cli/test/smokehouse/report-assert.js +16 -36
- package/lighthouse-core/audits/large-javascript-libraries.js +166 -0
- package/lighthouse-core/audits/seo/http-status-code.js +6 -2
- package/lighthouse-core/audits/viewport.js +1 -2
- package/lighthouse-core/config/config-helpers.js +75 -9
- package/lighthouse-core/config/config.js +50 -6
- package/lighthouse-core/config/constants.js +0 -1
- package/lighthouse-core/config/default-config.js +0 -3
- package/lighthouse-core/config/experimental-config.js +8 -0
- package/lighthouse-core/config/metrics-to-audits.js +0 -1
- package/lighthouse-core/fraggle-rock/config/config.js +4 -3
- package/lighthouse-core/fraggle-rock/config/default-config.js +1 -3
- package/lighthouse-core/fraggle-rock/config/validation.js +0 -201
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +0 -4
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +8 -16
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +0 -4
- package/lighthouse-core/fraggle-rock/gather/session.js +5 -30
- package/lighthouse-core/gather/driver/navigation.js +6 -7
- package/lighthouse-core/gather/driver/wait-for-condition.js +0 -27
- package/lighthouse-core/gather/fetcher.js +7 -17
- package/lighthouse-core/gather/gather-runner.js +0 -1
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +6 -2
- package/lighthouse-core/gather/gatherers/seo/tap-targets.js +2 -2
- package/lighthouse-core/gather/gatherers/stacks.js +1 -1
- package/lighthouse-core/lib/asset-saver.js +2 -2
- package/lighthouse-core/lib/cdt/SDK.js +0 -1
- package/lighthouse-core/lib/csp-evaluator.js +4 -17
- package/{report/generator → lighthouse-core/lib}/file-namer.js +0 -0
- package/lighthouse-core/lib/i18n/README.md +1 -1
- package/lighthouse-core/lib/i18n/i18n.js +7 -7
- package/lighthouse-core/lib/i18n/locales/ar-XB.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ar.json +18 -0
- package/lighthouse-core/lib/i18n/locales/bg.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ca.json +18 -0
- package/lighthouse-core/lib/i18n/locales/cs.json +18 -0
- package/lighthouse-core/lib/i18n/locales/da.json +18 -0
- package/lighthouse-core/lib/i18n/locales/de.json +18 -0
- package/lighthouse-core/lib/i18n/locales/el.json +18 -0
- package/lighthouse-core/lib/i18n/locales/en-GB.json +18 -0
- package/lighthouse-core/lib/i18n/locales/en-US.json +18 -18
- package/lighthouse-core/lib/i18n/locales/en-XA.json +18 -0
- package/lighthouse-core/lib/i18n/locales/en-XL.json +18 -18
- package/lighthouse-core/lib/i18n/locales/es-419.json +18 -0
- package/lighthouse-core/lib/i18n/locales/es.json +18 -0
- package/lighthouse-core/lib/i18n/locales/fi.json +18 -0
- package/lighthouse-core/lib/i18n/locales/fil.json +18 -0
- package/lighthouse-core/lib/i18n/locales/fr.json +18 -0
- package/lighthouse-core/lib/i18n/locales/he.json +18 -0
- package/lighthouse-core/lib/i18n/locales/hi.json +18 -0
- package/lighthouse-core/lib/i18n/locales/hr.json +18 -0
- package/lighthouse-core/lib/i18n/locales/hu.json +18 -0
- package/lighthouse-core/lib/i18n/locales/id.json +18 -0
- package/lighthouse-core/lib/i18n/locales/it.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ja.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ko.json +18 -0
- package/lighthouse-core/lib/i18n/locales/lt.json +18 -0
- package/lighthouse-core/lib/i18n/locales/lv.json +18 -0
- package/lighthouse-core/lib/i18n/locales/nl.json +18 -0
- package/lighthouse-core/lib/i18n/locales/no.json +18 -0
- package/lighthouse-core/lib/i18n/locales/pl.json +18 -0
- package/lighthouse-core/lib/i18n/locales/pt-PT.json +18 -0
- package/lighthouse-core/lib/i18n/locales/pt.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ro.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ru.json +18 -0
- package/lighthouse-core/lib/i18n/locales/sk.json +18 -0
- package/lighthouse-core/lib/i18n/locales/sl.json +18 -0
- package/lighthouse-core/lib/i18n/locales/sr-Latn.json +18 -0
- package/lighthouse-core/lib/i18n/locales/sr.json +18 -0
- package/lighthouse-core/lib/i18n/locales/sv.json +18 -0
- package/lighthouse-core/lib/i18n/locales/ta.json +18 -0
- package/lighthouse-core/lib/i18n/locales/te.json +18 -0
- package/lighthouse-core/lib/i18n/locales/th.json +18 -0
- package/lighthouse-core/lib/i18n/locales/tr.json +18 -0
- package/lighthouse-core/lib/i18n/locales/uk.json +18 -0
- package/lighthouse-core/lib/i18n/locales/vi.json +18 -0
- package/lighthouse-core/lib/i18n/locales/zh-HK.json +18 -0
- package/lighthouse-core/lib/i18n/locales/zh-TW.json +18 -0
- package/lighthouse-core/lib/i18n/locales/zh.json +18 -0
- package/lighthouse-core/lib/large-javascript-libraries/bundlephobia-database.json +62 -0
- package/lighthouse-core/lib/large-javascript-libraries/library-suggestions.js +20 -0
- package/lighthouse-core/lib/network-request.js +1 -3
- package/lighthouse-core/lib/traces/pwmetrics-events.js +2 -2
- package/lighthouse-core/lib/url-shim.js +1 -7
- package/lighthouse-core/runner.js +1 -4
- package/lighthouse-core/util-commonjs.js +2 -2
- package/now.json +1 -1
- package/package.json +13 -20
- package/report/README.md +2 -2
- package/report/assets/standalone-template.html +1 -0
- package/report/assets/styles.css +27 -23
- package/report/assets/templates.html +40 -37
- package/report/clients/bundle.js +0 -1
- package/report/{package.json → clients/package.json} +0 -0
- package/report/clients/psi.js +3 -13
- package/report/clients/standalone.js +1 -1
- package/report/{types/buffer.d.ts → clients/treemap.js} +13 -11
- package/report/renderer/category-renderer.js +2 -2
- package/report/renderer/components.js +48 -46
- package/report/renderer/crc-details-renderer.js +16 -16
- package/report/renderer/details-renderer.js +1 -1
- package/report/renderer/dom.js +0 -17
- package/report/renderer/element-screenshot-renderer.js +9 -9
- package/{flow-report/test/setup/global-setup.ts → report/renderer/file-namer.js} +2 -5
- package/report/renderer/logger.js +4 -4
- package/report/renderer/package.json +4 -0
- package/report/renderer/report-renderer.js +11 -4
- package/report/renderer/report-ui-features.js +656 -43
- package/report/renderer/text-encoding.js +1 -1
- package/report/renderer/util.js +2 -2
- package/report/{generator/report-assets.js → report-assets.js} +3 -9
- package/report/{generator/report-generator.js → report-generator.js} +9 -37
- package/report/test/clients/package.json +4 -0
- package/report/test/clients/psi-test.js +1 -3
- package/report/test/renderer/category-renderer-test.js +3 -8
- package/report/test/renderer/components-test.js +0 -35
- package/report/test/renderer/crc-details-renderer-test.js +4 -5
- package/report/test/renderer/details-renderer-test.js +1 -3
- package/report/test/renderer/dom-test.js +6 -8
- package/report/test/renderer/i18n-test.js +0 -1
- package/report/test/renderer/package.json +4 -0
- package/report/test/renderer/performance-category-renderer-test.js +27 -30
- package/report/test/renderer/pwa-category-renderer-test.js +1 -2
- package/report/test/renderer/report-renderer-test.js +0 -1
- package/report/test/renderer/report-ui-features-test.js +28 -20
- package/report/test/renderer/snippet-renderer-test.js +0 -1
- package/report/test/renderer/text-encoding-test.js +0 -2
- package/report/test/renderer/util-test.js +0 -1
- package/report/test/{generator/report-generator-test.js → report-generator-test.js} +7 -9
- package/third-party/chromium-synchronization/installability-errors-test.js +27 -28
- package/third-party/snyk/snapshot.json +0 -2
- package/tsconfig.json +5 -24
- package/types/artifacts.d.ts +18 -5
- package/types/{lhr/audit-details.d.ts → audit-details.d.ts} +3 -18
- package/types/audit.d.ts +58 -7
- package/types/{lhr/budget.d.ts → budget.d.ts} +0 -0
- package/types/bundle-phobia-cli/index.d.ts +40 -0
- package/types/config.d.ts +8 -3
- package/types/externs.d.ts +119 -5
- package/types/gatherer.d.ts +2 -3
- package/types/global-lh.d.ts +14 -16
- package/{report/types/report-result.d.ts → types/html-renderer.d.ts} +17 -8
- package/types/{lhr/i18n.d.ts → i18n.d.ts} +25 -2
- package/types/{lhr/lhr.d.ts → lhr.d.ts} +9 -41
- package/types/smokehouse.d.ts +3 -3
- package/types/{lhr/treemap.d.ts → treemap.d.ts} +3 -3
- package/flow-report/assets/standalone-flow-template.html +0 -38
- package/flow-report/assets/styles.css +0 -310
- package/flow-report/jest.config.js +0 -24
- package/flow-report/src/app.tsx +0 -40
- package/flow-report/src/common.tsx +0 -72
- package/flow-report/src/icons.tsx +0 -96
- package/flow-report/src/sidebar/flow.tsx +0 -72
- package/flow-report/src/sidebar/sidebar.tsx +0 -89
- package/flow-report/src/summary/summary.tsx +0 -178
- package/flow-report/src/util.ts +0 -160
- package/flow-report/src/wrappers/gauge.tsx +0 -40
- package/flow-report/src/wrappers/report-renderer.tsx +0 -46
- package/flow-report/src/wrappers/report.tsx +0 -71
- package/flow-report/standalone-flow.tsx +0 -23
- package/flow-report/test/app-test.tsx +0 -48
- package/flow-report/test/common-test.tsx +0 -131
- package/flow-report/test/setup/env-setup.ts +0 -25
- package/flow-report/test/sidebar/flow-test.tsx +0 -71
- package/flow-report/test/sidebar/sidebar-test.tsx +0 -53
- package/flow-report/test/summary/summary-test.tsx +0 -132
- package/flow-report/test/util-test.tsx +0 -109
- package/flow-report/tsconfig.json +0 -39
- package/flow-report/types/flow-report.d.ts +0 -27
- package/lighthouse-core/audits/lcp-lazy-loaded.js +0 -83
- package/report/.eslintrc.cjs +0 -33
- package/report/generator/README.md +0 -9
- package/report/generator/flow-report-assets.js +0 -20
- package/report/generator/package.json +0 -4
- package/report/generator/tsconfig.json +0 -28
- package/report/renderer/drop-down-menu.js +0 -215
- package/report/renderer/features-util.js +0 -26
- package/report/renderer/open-tab.js +0 -137
- package/report/renderer/topbar-features.js +0 -309
- package/report/test/generator/file-namer-test.js +0 -28
- package/report/test/generator/package.json +0 -4
- package/report/test-assets/faux-psi-template.html +0 -126
- package/report/test-assets/faux-psi.js +0 -92
- package/report/tsconfig.json +0 -39
- package/report/types/augment-dom.d.ts +0 -24
- package/report/types/html-renderer.d.ts +0 -28
- package/types/lhr/audit-result.d.ts +0 -59
- package/types/lhr/flow.d.ts +0 -16
- package/types/lhr/settings.d.ts +0 -105
- package/types/lhr/tsconfig.json +0 -24
- 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="
|
|
225
|
-
<div class="
|
|
226
|
-
<div class="
|
|
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
|
-
.
|
|
289
|
+
.dark .lh-tools__button svg {
|
|
287
290
|
filter: invert(1);
|
|
288
291
|
}
|
|
289
|
-
.lh-tools__button.
|
|
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="
|
|
388
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
389
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
390
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
391
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
392
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
393
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
394
|
-
<a role="menuitem" tabindex="-1" href="#" class="
|
|
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
|
-
.
|
|
409
|
+
.pyro {
|
|
407
410
|
display: none;
|
|
408
411
|
z-index: 1;
|
|
409
412
|
pointer-events: none;
|
|
410
413
|
}
|
|
411
|
-
.
|
|
414
|
+
.score100 .pyro {
|
|
412
415
|
display: block;
|
|
413
416
|
}
|
|
414
|
-
.
|
|
417
|
+
.score100 .lh-lighthouse stop:first-child {
|
|
415
418
|
stop-color: hsla(200, 12%, 95%, 0);
|
|
416
419
|
}
|
|
417
|
-
.
|
|
420
|
+
.score100 .lh-lighthouse stop:last-child {
|
|
418
421
|
stop-color: hsla(65, 81%, 76%, 1);
|
|
419
422
|
}
|
|
420
423
|
|
|
421
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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 .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
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 .
|
|
689
|
+
.lh-crc .crc-tree {
|
|
687
690
|
font-size: 14px;
|
|
688
691
|
width: 100%;
|
|
689
692
|
overflow-x: auto;
|
|
690
693
|
}
|
|
691
|
-
.lh-crc .
|
|
694
|
+
.lh-crc .crc-node {
|
|
692
695
|
height: 26px;
|
|
693
696
|
line-height: 26px;
|
|
694
697
|
white-space: nowrap;
|
|
695
698
|
}
|
|
696
|
-
.lh-crc .
|
|
699
|
+
.lh-crc .crc-node__tree-value {
|
|
697
700
|
margin-left: 10px;
|
|
698
701
|
}
|
|
699
|
-
.lh-crc .
|
|
702
|
+
.lh-crc .crc-node__tree-value div {
|
|
700
703
|
display: inline;
|
|
701
704
|
}
|
|
702
|
-
.lh-crc .
|
|
705
|
+
.lh-crc .crc-node__chain-duration {
|
|
703
706
|
font-weight: 700;
|
|
704
707
|
}
|
|
705
|
-
.lh-crc .
|
|
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="
|
|
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="
|
|
728
|
-
<span class="
|
|
729
|
-
<span class="
|
|
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
|
|
package/report/clients/bundle.js
CHANGED
|
@@ -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
|
package/report/clients/psi.js
CHANGED
|
@@ -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 {
|
|
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
|
-
//
|
|
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
|
-
}
|
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
8
|
+
/* global window */
|
|
9
|
+
|
|
10
|
+
// TODO(esmodules): delete when treemap app is esm.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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('
|
|
122
|
-
const tooltip = this.dom.createChildOf(textEl, 'div', '
|
|
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');
|