lighthouse 8.6.0-dev.20211101 → 8.6.0-dev.20211105
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/dist/report/flow.js +14 -14
- package/dist/report/standalone.js +41 -35
- package/flow-report/.eslintrc.cjs +2 -0
- package/flow-report/assets/standalone-flow-template.html +3 -2
- package/flow-report/assets/styles.css +1 -1
- package/flow-report/src/common.tsx +11 -4
- package/flow-report/src/i18n/i18n.tsx +10 -6
- package/flow-report/src/icons.tsx +30 -9
- package/flow-report/src/sidebar/sidebar.tsx +27 -8
- package/flow-report/src/summary/category.tsx +7 -2
- package/flow-report/src/summary/summary.tsx +9 -3
- package/flow-report/src/util.ts +21 -9
- package/flow-report/src/wrappers/report-renderer.tsx +10 -3
- package/flow-report/src/wrappers/report.tsx +9 -5
- package/flow-report/standalone-flow.tsx +4 -3
- package/flow-report/test/setup/env-setup.ts +1 -1
- package/flow-report/test/sidebar/sidebar-test.tsx +43 -1
- package/lighthouse-cli/.eslintrc.cjs +2 -0
- package/lighthouse-cli/cli-flags.js +1 -1
- package/lighthouse-core/audits/audit.js +1 -1
- package/lighthouse-core/computed/resource-summary.js +1 -1
- package/lighthouse-core/config/default-config.js +0 -2
- package/lighthouse-core/gather/connections/cri.js +1 -1
- package/lighthouse-core/lib/proto-preprocessor.js +14 -2
- package/lighthouse-core/lib/url-shim.js +1 -1
- package/lighthouse-core/util-commonjs.js +24 -9
- package/package.json +3 -3
- package/report/.eslintrc.cjs +2 -0
- package/report/assets/standalone-template.html +2 -3
- package/report/assets/styles.css +227 -251
- package/report/assets/templates.html +19 -29
- package/report/clients/bundle.js +1 -0
- package/report/clients/standalone.js +6 -13
- package/report/renderer/api.js +32 -0
- package/report/renderer/category-renderer.js +22 -18
- package/report/renderer/components.js +46 -79
- package/report/renderer/crc-details-renderer.js +15 -12
- package/report/renderer/dom.js +16 -1
- package/report/renderer/drop-down-menu.js +2 -2
- package/report/renderer/element-screenshot-renderer.js +6 -6
- package/report/renderer/features-util.js +1 -1
- package/report/renderer/open-tab.js +9 -3
- package/report/renderer/performance-category-renderer.js +31 -19
- package/report/renderer/report-renderer.js +34 -10
- package/report/renderer/report-ui-features.js +36 -33
- package/report/renderer/swap-locale-feature.js +3 -3
- package/report/renderer/topbar-features.js +52 -48
- package/report/renderer/util.js +25 -9
- package/report/test/clients/bundle-test.js +8 -0
- package/report/test/renderer/category-renderer-test.js +2 -2
- package/report/test/renderer/performance-category-renderer-test.js +1 -1
- package/report/test/renderer/report-renderer-axe-test.js +5 -2
- package/report/test/renderer/report-renderer-test.js +13 -10
- package/report/test/renderer/report-ui-features-test.js +17 -10
- package/report/test-assets/faux-psi-template.html +2 -7
- package/report/test-assets/faux-psi.js +20 -39
- package/report/types/html-renderer.d.ts +2 -0
- package/report/types/report-renderer.d.ts +23 -0
- package/shared/localization/locales/ar-XB.json +0 -15
- package/shared/localization/locales/ar.json +0 -15
- package/shared/localization/locales/bg.json +0 -15
- package/shared/localization/locales/ca.json +0 -15
- package/shared/localization/locales/cs.json +0 -15
- package/shared/localization/locales/da.json +0 -15
- package/shared/localization/locales/de.json +0 -15
- package/shared/localization/locales/el.json +0 -15
- package/shared/localization/locales/en-GB.json +0 -15
- package/shared/localization/locales/en-US.json +18 -15
- package/shared/localization/locales/en-XA.json +0 -15
- package/shared/localization/locales/en-XL.json +18 -15
- package/shared/localization/locales/es-419.json +0 -15
- package/shared/localization/locales/es.json +0 -15
- package/shared/localization/locales/fi.json +0 -15
- package/shared/localization/locales/fil.json +0 -15
- package/shared/localization/locales/fr.json +0 -15
- package/shared/localization/locales/he.json +0 -15
- package/shared/localization/locales/hi.json +0 -15
- package/shared/localization/locales/hr.json +0 -15
- package/shared/localization/locales/hu.json +0 -15
- package/shared/localization/locales/id.json +0 -15
- package/shared/localization/locales/it.json +0 -15
- package/shared/localization/locales/ja.json +0 -15
- package/shared/localization/locales/ko.json +0 -15
- package/shared/localization/locales/lt.json +0 -15
- package/shared/localization/locales/lv.json +0 -15
- package/shared/localization/locales/nl.json +0 -15
- package/shared/localization/locales/no.json +0 -15
- package/shared/localization/locales/pl.json +0 -15
- package/shared/localization/locales/pt-PT.json +0 -15
- package/shared/localization/locales/pt.json +0 -15
- package/shared/localization/locales/ro.json +0 -15
- package/shared/localization/locales/ru.json +0 -15
- package/shared/localization/locales/sk.json +0 -15
- package/shared/localization/locales/sl.json +0 -15
- package/shared/localization/locales/sr-Latn.json +0 -15
- package/shared/localization/locales/sr.json +0 -15
- package/shared/localization/locales/sv.json +0 -15
- package/shared/localization/locales/ta.json +0 -15
- package/shared/localization/locales/te.json +0 -15
- package/shared/localization/locales/th.json +0 -15
- package/shared/localization/locales/tr.json +0 -15
- package/shared/localization/locales/uk.json +0 -15
- package/shared/localization/locales/vi.json +0 -15
- package/shared/localization/locales/zh-HK.json +0 -15
- package/shared/localization/locales/zh-TW.json +0 -15
- package/shared/localization/locales/zh.json +0 -15
- package/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +0 -96
|
@@ -11,7 +11,7 @@ const http = require('http');
|
|
|
11
11
|
const log = require('lighthouse-logger');
|
|
12
12
|
const LighthouseError = require('../../lib/lh-error.js');
|
|
13
13
|
|
|
14
|
-
const DEFAULT_HOSTNAME = '
|
|
14
|
+
const DEFAULT_HOSTNAME = '127.0.0.1';
|
|
15
15
|
const CONNECT_TIMEOUT = 10000;
|
|
16
16
|
const DEFAULT_PORT = 9222;
|
|
17
17
|
|
|
@@ -29,10 +29,22 @@ function processForProto(lhr) {
|
|
|
29
29
|
// 'ignore unknown fields' in the language of conversion.
|
|
30
30
|
if (reportJson.configSettings) {
|
|
31
31
|
// The settings that are in both proto and LHR
|
|
32
|
-
const {
|
|
32
|
+
const {
|
|
33
|
+
formFactor,
|
|
34
|
+
locale,
|
|
35
|
+
onlyCategories,
|
|
36
|
+
channel,
|
|
37
|
+
throttling,
|
|
38
|
+
throttlingMethod} = reportJson.configSettings;
|
|
33
39
|
|
|
34
40
|
// @ts-expect-error - intentionally only a subset of settings.
|
|
35
|
-
reportJson.configSettings = {
|
|
41
|
+
reportJson.configSettings = {
|
|
42
|
+
formFactor,
|
|
43
|
+
locale,
|
|
44
|
+
onlyCategories,
|
|
45
|
+
channel,
|
|
46
|
+
throttling,
|
|
47
|
+
throttlingMethod};
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
// Remove runtimeError if it is NO_ERROR
|
|
@@ -42,6 +42,10 @@ const listOfTlds = [
|
|
|
42
42
|
];
|
|
43
43
|
|
|
44
44
|
class Util {
|
|
45
|
+
/** @type {I18n<typeof UIStrings>} */
|
|
46
|
+
// @ts-expect-error: Is set in report renderer.
|
|
47
|
+
static i18n = null;
|
|
48
|
+
|
|
45
49
|
static get PASS_THRESHOLD() {
|
|
46
50
|
return PASS_THRESHOLD;
|
|
47
51
|
}
|
|
@@ -420,7 +424,7 @@ class Util {
|
|
|
420
424
|
throttling.downloadThroughputKbps === 1.6 * 1024 * 0.9 &&
|
|
421
425
|
throttling.uploadThroughputKbps === 750 * 0.9;
|
|
422
426
|
};
|
|
423
|
-
summary =
|
|
427
|
+
summary = isSlow4G() ? Util.i18n.strings.runtimeSlow4g : Util.i18n.strings.runtimeCustom;
|
|
424
428
|
break;
|
|
425
429
|
}
|
|
426
430
|
case 'simulate': {
|
|
@@ -432,7 +436,7 @@ class Util {
|
|
|
432
436
|
const isSlow4G = () => {
|
|
433
437
|
return rttMs === 150 && throughputKbps === 1.6 * 1024;
|
|
434
438
|
};
|
|
435
|
-
summary = isSlow4G() ?
|
|
439
|
+
summary = isSlow4G() ? Util.i18n.strings.runtimeSlow4g : Util.i18n.strings.runtimeCustom;
|
|
436
440
|
break;
|
|
437
441
|
}
|
|
438
442
|
default:
|
|
@@ -557,14 +561,10 @@ Util.getUniqueSuffix = (() => {
|
|
|
557
561
|
};
|
|
558
562
|
})();
|
|
559
563
|
|
|
560
|
-
/** @type {I18n<typeof Util['UIStrings']>} */
|
|
561
|
-
// @ts-expect-error: Is set in report renderer.
|
|
562
|
-
Util.i18n = null;
|
|
563
|
-
|
|
564
564
|
/**
|
|
565
565
|
* Report-renderer-specific strings.
|
|
566
566
|
*/
|
|
567
|
-
|
|
567
|
+
const UIStrings = {
|
|
568
568
|
/** Disclaimer shown to users below the metric values (First Contentful Paint, Time to Interactive, etc) to warn them that the numbers they see will likely change slightly the next time they run Lighthouse. */
|
|
569
569
|
varianceDisclaimer: 'Values are estimated and may vary. The [performance score is calculated](https://web.dev/performance-scoring/) directly from these metrics.',
|
|
570
570
|
/** Text link pointing to an interactive calculator that explains Lighthouse scoring. The link text should be fairly short. */
|
|
@@ -664,7 +664,22 @@ Util.UIStrings = {
|
|
|
664
664
|
|
|
665
665
|
/** Descriptive explanation for environment throttling that was provided by the runtime environment instead of provided by Lighthouse throttling. */
|
|
666
666
|
throttlingProvided: 'Provided by environment',
|
|
667
|
+
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Show' and 'Hide'. */
|
|
668
|
+
show: 'Show',
|
|
669
|
+
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Show' and 'Hide'. */
|
|
670
|
+
hide: 'Hide',
|
|
671
|
+
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Expand view' and 'Collapse view'. */
|
|
672
|
+
expandView: 'Expand view',
|
|
673
|
+
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Expand view' and 'Collapse view'. */
|
|
674
|
+
collapseView: 'Collapse view',
|
|
675
|
+
/** Label indicating that Lighthouse throttled the page to emulate a slow 4G network connection. */
|
|
676
|
+
runtimeSlow4g: 'Slow 4G throttling',
|
|
677
|
+
/** Label indicating that Lighthouse throttled the page using custom throttling settings. */
|
|
678
|
+
runtimeCustom: 'Custom throttling',
|
|
667
679
|
};
|
|
680
|
+
Util.UIStrings = UIStrings;
|
|
668
681
|
|
|
669
|
-
|
|
670
|
-
|
|
682
|
+
module.exports = {
|
|
683
|
+
Util,
|
|
684
|
+
UIStrings,
|
|
685
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
|
-
"version": "8.6.0-dev.
|
|
3
|
+
"version": "8.6.0-dev.20211105",
|
|
4
4
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
5
5
|
"main": "./lighthouse-core/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build-smokehouse-bundle": "node ./build/build-smokehouse-bundle.js",
|
|
25
25
|
"build-lr": "yarn reset-link && node ./build/build-lightrider-bundles.js",
|
|
26
26
|
"build-pack": "bash build/build-pack.sh",
|
|
27
|
-
"build-report": "node build/build-report-components.js && yarn eslint --fix report/renderer/components.js &&
|
|
27
|
+
"build-report": "node build/build-report-components.js && yarn eslint --fix report/renderer/components.js && bash lighthouse-core/scripts/copy-util-commonjs.sh && node build/build-report.js",
|
|
28
28
|
"build-sample-reports": "yarn build-report && node build/build-sample-reports.js",
|
|
29
29
|
"build-treemap": "node ./build/build-treemap.js",
|
|
30
30
|
"build-viewer": "node ./build/build-viewer.js",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
},
|
|
189
189
|
"dependencies": {
|
|
190
190
|
"axe-core": "4.2.3",
|
|
191
|
-
"chrome-launcher": "^0.14.
|
|
191
|
+
"chrome-launcher": "^0.14.2",
|
|
192
192
|
"configstore": "^5.0.1",
|
|
193
193
|
"csp_evaluator": "1.1.0",
|
|
194
194
|
"cssstyle": "1.2.1",
|
package/report/.eslintrc.cjs
CHANGED
|
@@ -21,12 +21,11 @@ limitations under the License.
|
|
|
21
21
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
22
22
|
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEhklEQVR4AWJxL/BhIAesev1U5tcflpncgNrKIsqNIwzC9feMpDUzs70kOczMzMzJJcxwCTMzncP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ans9oX8rOCrj7/JP35DFD+iQ7Au/K2KE1jzx6ujjUnXFH9KjEq6ZlhsTBICrNLJf47Pv/pkHzvup1w4dmUbEei0+bcXRqJuh5kVARQ8byyYxOwNGr7A87xh1tp8sGT+uMInrwi++Xj7TQz2d27NvwEkrOflAFQGIDA5khASBCGdO2/Z/MnLPwYfv5TFhjW7QhVKAB6afwe2LpFlFsCnlQEosgQgDsdOG1/LKeNqJS4JCSPJ/i+TakwEARor7gER1Iva5JmPOJK0RUqmoPnnlzFCtmIAhAAQEIQRgDaiYPIauNXcnDlRIrWNFY3hm7PG9YRqr7IV7HrCgAC17befjEvRq2nGhAHtBqDpOuI/I1diUUAMYIxEdyejBJqLnNoszGZtfiX/CztGv2mq+sdaAAAAAElFTkSuQmCC">
|
|
23
23
|
<title>Lighthouse Report</title>
|
|
24
|
+
<style>body {margin: 0}</style>
|
|
24
25
|
</head>
|
|
25
|
-
<body
|
|
26
|
+
<body>
|
|
26
27
|
<noscript>Lighthouse report requires JavaScript. Please enable.</noscript>
|
|
27
28
|
|
|
28
|
-
<main><!-- report populated here --></main>
|
|
29
|
-
|
|
30
29
|
<div id="lh-log"></div>
|
|
31
30
|
|
|
32
31
|
<script>window.__LIGHTHOUSE_JSON__ = %%LIGHTHOUSE_JSON%%;</script>
|