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
@@ -0,0 +1,62 @@
1
+ {
2
+ "moment": {
3
+ "repository": "https://github.com/moment/moment.git",
4
+ "lastScraped": 1597344573775,
5
+ "versions": {
6
+ "latest": {
7
+ "gzip": 72054
8
+ },
9
+ "2.25.3": {
10
+ "gzip": 71090
11
+ },
12
+ "2.25.2": {
13
+ "gzip": 71119
14
+ },
15
+ "2.25.1": {
16
+ "gzip": 20811
17
+ },
18
+ "2.25.0": {
19
+ "gzip": 20876
20
+ },
21
+ "2.24.0": {
22
+ "gzip": 67489
23
+ },
24
+ "2.23.0": {
25
+ "gzip": 66675
26
+ },
27
+ "2.22.2": {
28
+ "gzip": 65962
29
+ },
30
+ "2.22.1": {
31
+ "gzip": 65949
32
+ }
33
+ }
34
+ },
35
+ "date-fns": {
36
+ "repository": "https://github.com/date-fns/date-fns.git",
37
+ "lastScraped": 1597344603463,
38
+ "versions": {
39
+ "latest": {
40
+ "gzip": 18463
41
+ }
42
+ }
43
+ },
44
+ "luxon": {
45
+ "repository": "https://github.com/moment/luxon.git",
46
+ "lastScraped": 1597344608583,
47
+ "versions": {
48
+ "latest": {
49
+ "gzip": 20912
50
+ }
51
+ }
52
+ },
53
+ "dayjs": {
54
+ "repository": "https://github.com/iamkun/dayjs.git",
55
+ "lastScraped": 1597344613371,
56
+ "versions": {
57
+ "latest": {
58
+ "gzip": 2856
59
+ }
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license Copyright 2020 The Lighthouse Authors. All Rights Reserved.
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
+ * 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
+ */
6
+
7
+ /**
8
+ * @fileoverview This file contains a mapping of large JavaScript libraries to smaller alternatives.
9
+ * These suggestions have been cherry-picked from BundlePhobia's open-source list of recommendations which can be found here (https://github.com/pastelsky/bundlephobia/blob/b244a53bc55af067bb0edfa3ace867c87fec17e7/server/middlewares/similar-packages/fixtures.js).
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ /** @type {Record<string, string[]>} */
15
+ const suggestions = {
16
+ // general-purpose-date-time
17
+ 'moment': ['date-fns', 'luxon', 'dayjs'],
18
+ };
19
+
20
+ module.exports = {suggestions};
@@ -480,9 +480,7 @@ class NetworkRequest {
480
480
  */
481
481
  static isNonNetworkRequest(record) {
482
482
  // The 'protocol' field in devtools a string more like a `scheme`
483
- return URL.isNonNetworkProtocol(record.protocol) ||
484
- // But `protocol` can fail to be populated if the request fails, so fallback to scheme.
485
- URL.isNonNetworkProtocol(record.parsedURL.scheme);
483
+ return URL.isNonNetworkProtocol(record.protocol);
486
484
  }
487
485
 
488
486
  /**
@@ -9,7 +9,7 @@ const log = require('lighthouse-logger');
9
9
  const TraceProcessor = require('../tracehouse/trace-processor.js');
10
10
 
11
11
  /**
12
- * @param {LH.Result['audits']} auditResults
12
+ * @param {LH.Audit.Results} auditResults
13
13
  * @return {LH.Artifacts.TimingSummary|undefined}
14
14
  */
15
15
  function getUberMetrics(auditResults) {
@@ -22,7 +22,7 @@ function getUberMetrics(auditResults) {
22
22
  class Metrics {
23
23
  /**
24
24
  * @param {Array<LH.TraceEvent>} traceEvents
25
- * @param {LH.Result['audits']} auditResults
25
+ * @param {LH.Audit.Results} auditResults
26
26
  */
27
27
  constructor(traceEvents, auditResults) {
28
28
  this._traceEvents = traceEvents;
@@ -20,13 +20,7 @@ const allowedProtocols = [
20
20
  const SECURE_SCHEMES = ['data', 'https', 'wss', 'blob', 'chrome', 'chrome-extension', 'about',
21
21
  'filesystem'];
22
22
  const SECURE_LOCALHOST_DOMAINS = ['localhost', '127.0.0.1'];
23
- const NON_NETWORK_SCHEMES = [
24
- 'blob', // @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
25
- 'data', // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
26
- 'intent', // @see https://developer.chrome.com/docs/multidevice/android/intents/
27
- 'file', // @see https://en.wikipedia.org/wiki/File_URI_scheme
28
- 'filesystem', // @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystem
29
- ];
23
+ const NON_NETWORK_SCHEMES = ['blob', 'data', 'intent'];
30
24
 
31
25
  /**
32
26
  * There is fancy URL rewriting logic for the chrome://settings page that we need to work around.
@@ -18,7 +18,7 @@ const fs = require('fs');
18
18
  const path = require('path');
19
19
  const URL = require('./lib/url-shim.js');
20
20
  const Sentry = require('./lib/sentry.js');
21
- const generateReport = require('../report/generator/report-generator.js').generateReport;
21
+ const generateReport = require('../report/report-generator.js').generateReport;
22
22
  const LHError = require('./lib/lh-error.js');
23
23
 
24
24
  /** @typedef {import('./gather/connections/connection.js')} Connection */
@@ -132,9 +132,6 @@ class Runner {
132
132
 
133
133
  /** @type {LH.RawIcu<LH.Result>} */
134
134
  const i18nLhr = {
135
- // TODO(FR-COMPAT): Make GatherContext a true base artifact.
136
- // If GatherContext is not collected, then we are in a non-default pass of the legacy runner.
137
- gatherMode: artifacts.GatherContext ? artifacts.GatherContext.gatherMode : 'navigation',
138
135
  userAgent: artifacts.HostUserAgent,
139
136
  environment: {
140
137
  networkUserAgent: artifacts.NetworkUserAgent,
@@ -391,7 +391,7 @@ class Util {
391
391
  }
392
392
 
393
393
  /**
394
- * @param {LH.Result['configSettings']} settings
394
+ * @param {LH.Config.Settings} settings
395
395
  * @return {!Array<{name: string, description: string}>}
396
396
  */
397
397
  static getEnvironmentDisplayValues(settings) {
@@ -414,7 +414,7 @@ class Util {
414
414
  }
415
415
 
416
416
  /**
417
- * @param {LH.Result['configSettings']} settings
417
+ * @param {LH.Config.Settings} settings
418
418
  * @return {{deviceEmulation: string, networkThrottling: string, cpuThrottling: string}}
419
419
  */
420
420
  static getEmulationDescriptions(settings) {
package/now.json CHANGED
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "src": "package.json",
6
6
  "use": "@now/static-build",
7
- "config": {"distDir": "dist"}
7
+ "config": {"distDir": "dist/now"}
8
8
  }
9
9
  ],
10
10
  "github": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse",
3
- "version": "8.3.0-dev.20210907",
3
+ "version": "8.3.0",
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,6 @@
24
24
  "build-lr": "yarn reset-link && node ./build/build-lightrider-bundles.js",
25
25
  "build-pack": "bash build/build-pack.sh",
26
26
  "build-report": "node build/build-report-components.js && yarn eslint --fix report/renderer/components.js && node build/build-report.js",
27
- "build-sample-reports": "yarn build-report && node build/build-sample-reports.js",
28
27
  "build-treemap": "node ./build/build-treemap.js",
29
28
  "build-viewer": "node ./build/build-viewer.js",
30
29
  "reset-link": "(yarn unlink || true) && yarn link && yarn link lighthouse",
@@ -33,7 +32,7 @@
33
32
  "lint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe . || eslint .",
34
33
  "smoke": "node lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js",
35
34
  "debug": "node --inspect-brk ./lighthouse-cli/index.js",
36
- "start": "yarn build-report --standalone && node ./lighthouse-cli/index.js",
35
+ "start": "yarn build-report --only-standalone && node ./lighthouse-cli/index.js",
37
36
  "jest": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
38
37
  "test": "yarn diff:sample-json && yarn lint --quiet && yarn unit && yarn type-check",
39
38
  "test-bundle": "yarn smoke --runner bundle -j=1 --retries=2 --invert-match forms",
@@ -47,11 +46,10 @@
47
46
  "unit-core": "yarn jest \"lighthouse-core\"",
48
47
  "unit-cli": "yarn jest \"lighthouse-cli/\"",
49
48
  "unit-report": "yarn jest \"report/\"",
50
- "unit-treemap": "yarn jest \"lighthouse-treemap/.*-test.js\"",
49
+ "unit-treemap": "jest \"lighthouse-treemap/.*-test.js\"",
51
50
  "unit-viewer": "yarn jest \"lighthouse-viewer/.*-test.js\"",
52
- "unit-flow": "yarn jest \"flow-report/.*-test.[tj]s[x]?\"",
53
- "unit": "yarn unit-core && yarn unit-cli && yarn unit-report && yarn unit-viewer && yarn unit-treemap && yarn unit-flow",
54
- "unit:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit-core -- --ci && npm run unit-cli -- --ci && npm run unit-report -- --ci && npm run unit-viewer -- --ci && npm run unit-treemap -- --ci && npm run unit-flow -- --ci",
51
+ "unit": "yarn unit-core && yarn unit-cli && yarn unit-report && yarn unit-viewer && yarn unit-treemap",
52
+ "unit:ci": "NODE_OPTIONS=--max-old-space-size=8192 npm run unit-core -- --ci && npm run unit-cli -- --ci && npm run unit-report -- --ci && npm run unit-viewer -- --ci && npm run unit-treemap -- --ci",
55
53
  "core-unit": "yarn unit-core",
56
54
  "cli-unit": "yarn unit-cli",
57
55
  "viewer-unit": "yarn unit-viewer",
@@ -64,11 +62,11 @@
64
62
  "fast": "node ./lighthouse-cli/index.js --preset=desktop --throttlingMethod=provided",
65
63
  "deploy-treemap": "yarn build-treemap --deploy",
66
64
  "deploy-viewer": "yarn build-viewer --deploy",
67
- "vercel-build": "yarn build-sample-reports && yarn build-viewer && yarn build-treemap",
65
+ "now-build": "yarn build-report && node lighthouse-core/scripts/build-report-for-autodeployment.js && yarn build-viewer && yarn build-treemap && cp -r dist/gh-pages dist/now/gh-pages",
68
66
  "dogfood-lhci": "./lighthouse-core/scripts/dogfood-lhci.sh",
69
67
  "timing-trace": "node lighthouse-core/scripts/generate-timing-trace.js",
70
68
  "changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile changelog.md --same-file",
71
- "type-check": "tsc --build ./ report/ lighthouse-viewer/ lighthouse-treemap/ flow-report/",
69
+ "type-check": "tsc -p . && tsc -p lighthouse-viewer/ && tsc -p lighthouse-treemap/",
72
70
  "i18n:checks": "./lighthouse-core/scripts/i18n/assert-strings-collected.sh",
73
71
  "i18n:collect-strings": "node lighthouse-core/scripts/i18n/collect-strings.js",
74
72
  "update:lantern-baseline": "node lighthouse-core/scripts/lantern/update-baseline-lantern-values.js",
@@ -96,14 +94,12 @@
96
94
  "@firebase/auth-types": "0.3.2",
97
95
  "@firebase/util": "0.2.1",
98
96
  "@rollup/plugin-node-resolve": "^13.0.4",
99
- "@rollup/plugin-typescript": "^2.1.0",
100
- "@testing-library/preact": "^2.0.1",
101
- "@testing-library/preact-hooks": "^1.1.0",
102
97
  "@types/archiver": "^2.1.2",
103
98
  "@types/browserify": "^12.0.36",
104
- "@types/chrome": "^0.0.154",
99
+ "@types/chrome": "^0.0.60",
105
100
  "@types/configstore": "^4.0.0",
106
101
  "@types/cpy": "^5.1.0",
102
+ "@types/css-font-loading-module": "^0.0.2",
107
103
  "@types/eslint": "^4.16.6",
108
104
  "@types/exorcist": "^0.4.5",
109
105
  "@types/gh-pages": "^2.0.0",
@@ -125,13 +121,13 @@
125
121
  "@types/ws": "^7.0.0",
126
122
  "@types/yargs": "^15.0.11",
127
123
  "@types/yargs-parser": "^15.0.0",
128
- "@typescript-eslint/eslint-plugin": "^4.30.0",
129
- "@typescript-eslint/parser": "^4.30.0",
124
+ "@typescript-eslint/parser": "^4.21.0",
130
125
  "@wardpeet/brfs": "2.1.0",
131
126
  "angular": "^1.7.4",
132
127
  "archiver": "^3.0.0",
133
128
  "browserify": "^17.0.0",
134
129
  "browserify-banner": "^1.0.15",
130
+ "bundle-phobia-cli": "^0.14.6",
135
131
  "c8": "^7.4.0",
136
132
  "chalk": "^2.4.1",
137
133
  "chrome-devtools-frontend": "1.0.727089",
@@ -142,7 +138,6 @@
142
138
  "devtools-protocol": "0.0.863986",
143
139
  "eslint": "^7.23.0",
144
140
  "eslint-config-google": "^0.9.1",
145
- "eslint-plugin-import": "^2.24.2",
146
141
  "eslint-plugin-local-rules": "0.1.0",
147
142
  "event-target-shim": "^6.0.2",
148
143
  "exorcist": "^1.0.1",
@@ -160,7 +155,6 @@
160
155
  "npm-run-posix-or-windows": "^2.0.2",
161
156
  "package-json-versionify": "^1.0.4",
162
157
  "pako": "^2.0.3",
163
- "preact": "^10.5.14",
164
158
  "pretty-json-stringify": "^0.0.2",
165
159
  "puppeteer": "^9.1.1",
166
160
  "rollup": "^2.50.6",
@@ -168,16 +162,15 @@
168
162
  "rollup-plugin-terser": "^7.0.2",
169
163
  "tabulator-tables": "^4.9.3",
170
164
  "terser": "^5.3.8",
171
- "ts-jest": "^27.0.4",
172
165
  "typed-query-selector": "^2.4.0",
173
- "typescript": "4.4.2",
166
+ "typescript": "4.2.3",
174
167
  "webtreemap-cdt": "^3.2.1"
175
168
  },
176
169
  "dependencies": {
177
170
  "axe-core": "4.2.3",
178
171
  "chrome-launcher": "^0.14.0",
179
172
  "configstore": "^5.0.1",
180
- "csp_evaluator": "1.1.0",
173
+ "csp_evaluator": "1.0.4",
181
174
  "cssstyle": "1.2.1",
182
175
  "enquirer": "^2.3.6",
183
176
  "http-link-header": "^0.8.0",
package/report/README.md CHANGED
@@ -8,8 +8,8 @@ Example standalone HTML report, delivered by the CLI: [`dbwtest-3.0.3.html`](htt
8
8
 
9
9
  ### Report Renderer components
10
10
 
11
- 1. [`report/generator/report-generator.js`](https://github.com/GoogleChrome/lighthouse/blob/master/report/generator/report-generator.js) is the entry point for generating the HTML from Node. It compiles together the HTML string with everything required within it.
12
- - It runs natively in Node.js but can run in the browser after a compile step is applied during our bundling pipeline. That compile step uses `brfs`, which takes any `fs.readFileSync()` calls and replaces them with the stringified file content.
11
+ 1. [`report/report-generator.js`](https://github.com/GoogleChrome/lighthouse/blob/master/report/report-generator.js) is the entry point for generating the HTML from Node. It compiles together the HTML string with everything required within it.
12
+ - It runs natively in Node.js but can run in the browser after a compile step is applied during our bundling pipeline. That compile step uses a browserify transform that takes any `fs.readFileSync()` calls and replaces them with the stringified file content.
13
13
  1. [`report/renderer`](https://github.com/GoogleChrome/lighthouse/tree/master/report/renderer) are all client-side JS files. They transform an LHR object into a report DOM tree. They are all executed within the browser.
14
14
  1. [`report/assets/standalone-template.html`](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/report/html/report-template.html) is where the client-side build of the DOM report is typically kicked off ([with these four lines](https://github.com/GoogleChrome/lighthouse/blob/eda3a3e2e271249f261655f9504fd542d6acf0f8/lighthouse-core/report/html/report-template.html#L29-L33)) However, see _Current Uses.._ below for more possibilities.
15
15
 
@@ -25,6 +25,7 @@ limitations under the License.
25
25
  </head>
26
26
  <body class="lh-root lh-vars">
27
27
  <noscript>Lighthouse report requires JavaScript. Please enable.</noscript>
28
+ <div hidden>%%LIGHTHOUSE_TEMPLATES%%</div>
28
29
 
29
30
  <main><!-- report populated here --></main>
30
31
 
@@ -169,7 +169,7 @@
169
169
  }
170
170
 
171
171
  @media not print {
172
- .lh-vars.lh-dark {
172
+ .lh-vars.dark {
173
173
  /* Pallete */
174
174
  --color-gray-200: var(--color-gray-800);
175
175
  --color-gray-300: #616161;
@@ -379,6 +379,10 @@
379
379
  width: 100%;
380
380
  }
381
381
 
382
+ .lh-details.flex .lh-code {
383
+ max-width: 70%;
384
+ }
385
+
382
386
  .lh-audit__stackpack {
383
387
  display: flex;
384
388
  align-items: center;
@@ -391,18 +395,18 @@
391
395
 
392
396
  /* Report header */
393
397
 
394
- .lh-report-icon {
398
+ .report-icon {
395
399
  display: flex;
396
400
  align-items: center;
397
401
  padding: 10px 12px;
398
402
  cursor: pointer;
399
403
  }
400
- .lh-report-icon[disabled] {
404
+ .report-icon[disabled] {
401
405
  opacity: 0.3;
402
406
  pointer-events: none;
403
407
  }
404
408
 
405
- .lh-report-icon::before {
409
+ .report-icon::before {
406
410
  content: "";
407
411
  margin-right: 5px;
408
412
  background-repeat: no-repeat;
@@ -410,28 +414,28 @@
410
414
  height: var(--report-icon-size);
411
415
  opacity: 0.7;
412
416
  }
413
- .lh-report-icon:hover::before {
417
+ .report-icon:hover::before {
414
418
  opacity: 1;
415
419
  }
416
- .lh-dark .lh-report-icon::before {
420
+ .dark .report-icon::before {
417
421
  filter: invert(1);
418
422
  }
419
- .lh-report-icon--print::before {
423
+ .report-icon--print::before {
420
424
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/><path fill="none" d="M0 0h24v24H0z"/></svg>');
421
425
  }
422
- .lh-report-icon--copy::before {
426
+ .report-icon--copy::before {
423
427
  background-image: url('data:image/svg+xml;utf8,<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>');
424
428
  }
425
- .lh-report-icon--open::before {
429
+ .report-icon--open::before {
426
430
  background-image: url('data:image/svg+xml;utf8,<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"/></svg>');
427
431
  }
428
- .lh-report-icon--download::before {
432
+ .report-icon--download::before {
429
433
  background-image: url('data:image/svg+xml;utf8,<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
430
434
  }
431
- .lh-report-icon--dark::before {
435
+ .report-icon--dark::before {
432
436
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 100 125"><path d="M50 23.587c-16.27 0-22.799 12.574-22.799 21.417 0 12.917 10.117 22.451 12.436 32.471h20.726c2.32-10.02 12.436-19.554 12.436-32.471 0-8.843-6.528-21.417-22.799-21.417zM39.637 87.161c0 3.001 1.18 4.181 4.181 4.181h.426l.41 1.231C45.278 94.449 46.042 95 48.019 95h3.963c1.978 0 2.74-.551 3.365-2.427l.409-1.231h.427c3.002 0 4.18-1.18 4.18-4.181V80.91H39.637v6.251zM50 18.265c1.26 0 2.072-.814 2.072-2.073v-9.12C52.072 5.813 51.26 5 50 5c-1.259 0-2.072.813-2.072 2.073v9.12c0 1.259.813 2.072 2.072 2.072zM68.313 23.727c.994.774 2.135.634 2.91-.357l5.614-7.187c.776-.992.636-2.135-.356-2.909-.992-.776-2.135-.636-2.91.357l-5.613 7.186c-.778.993-.636 2.135.355 2.91zM91.157 36.373c-.306-1.222-1.291-1.815-2.513-1.51l-8.85 2.207c-1.222.305-1.814 1.29-1.51 2.512.305 1.223 1.291 1.814 2.513 1.51l8.849-2.206c1.223-.305 1.816-1.291 1.511-2.513zM86.757 60.48l-8.331-3.709c-1.15-.512-2.225-.099-2.736 1.052-.512 1.151-.1 2.224 1.051 2.737l8.33 3.707c1.15.514 2.225.101 2.736-1.05.513-1.149.1-2.223-1.05-2.737zM28.779 23.37c.775.992 1.917 1.131 2.909.357.992-.776 1.132-1.917.357-2.91l-5.615-7.186c-.775-.992-1.917-1.132-2.909-.357s-1.131 1.917-.356 2.909l5.614 7.187zM21.715 39.583c.305-1.223-.288-2.208-1.51-2.513l-8.849-2.207c-1.222-.303-2.208.289-2.513 1.511-.303 1.222.288 2.207 1.511 2.512l8.848 2.206c1.222.304 2.208-.287 2.513-1.509zM21.575 56.771l-8.331 3.711c-1.151.511-1.563 1.586-1.05 2.735.511 1.151 1.586 1.563 2.736 1.052l8.331-3.711c1.151-.511 1.563-1.586 1.05-2.735-.512-1.15-1.585-1.562-2.736-1.052z"/></svg>');
433
437
  }
434
- .lh-report-icon--treemap::before {
438
+ .report-icon--treemap::before {
435
439
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="black"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M3 5v14h19V5H3zm2 2h15v4H5V7zm0 10v-4h4v4H5zm6 0v-4h9v4h-9z"/></svg>');
436
440
  }
437
441
 
@@ -448,7 +452,7 @@
448
452
  color: rgb(26, 115, 232);
449
453
  background-color: var(--report-background-color);
450
454
  }
451
- .lh-dark .lh-button {
455
+ .dark .lh-button {
452
456
  color: var(--color-blue-200);
453
457
  }
454
458
 
@@ -504,9 +508,8 @@
504
508
  }
505
509
  .lh-audit--manual .lh-audit__score-icon,
506
510
  .lh-audit--notapplicable .lh-audit__score-icon {
507
- border: 2px solid var(--color-gray-400);
508
511
  border-radius: 100%;
509
- background: none;
512
+ background: var(--color-gray-400);
510
513
  }
511
514
 
512
515
  .lh-audit--informative .lh-audit__display-text {
@@ -514,8 +517,9 @@
514
517
  }
515
518
 
516
519
  .lh-audit--informative .lh-audit__score-icon {
517
- border: 2px solid var(--color-gray-400);
520
+ border: none;
518
521
  border-radius: 100%;
522
+ background: var(--color-gray-400);
519
523
  }
520
524
 
521
525
  .lh-audit__description,
@@ -1353,7 +1357,7 @@
1353
1357
  z-index: 3;
1354
1358
  }
1355
1359
 
1356
- #lh-log.lh-show {
1360
+ #lh-log.show {
1357
1361
  opacity: 1;
1358
1362
  transform: translateY(0);
1359
1363
  }
@@ -1552,11 +1556,11 @@
1552
1556
 
1553
1557
 
1554
1558
  /* Tooltip */
1555
- .lh-tooltip-boundary {
1559
+ .tooltip-boundary {
1556
1560
  position: relative;
1557
1561
  }
1558
1562
 
1559
- .lh-tooltip {
1563
+ .tooltip {
1560
1564
  position: absolute;
1561
1565
  display: none; /* Don't retain these layers when not needed */
1562
1566
  opacity: 0;
@@ -1571,17 +1575,17 @@
1571
1575
  45vw is chosen to be ~= width of the left column of metrics
1572
1576
  */
1573
1577
  @media screen and (max-width: 535px) {
1574
- .lh-tooltip {
1578
+ .tooltip {
1575
1579
  min-width: 45vw;
1576
1580
  padding: 3vw;
1577
1581
  }
1578
1582
  }
1579
1583
 
1580
- .lh-tooltip-boundary:hover {
1584
+ .tooltip-boundary:hover {
1581
1585
  background-color: var(--color-hover);
1582
1586
  }
1583
1587
 
1584
- .lh-tooltip-boundary:hover .lh-tooltip {
1588
+ .tooltip-boundary:hover .tooltip {
1585
1589
  display: block;
1586
1590
  animation: fadeInTooltip 250ms;
1587
1591
  animation-fill-mode: forwards;
@@ -1593,7 +1597,7 @@
1593
1597
  pointer-events: none;
1594
1598
  }
1595
1599
 
1596
- .lh-tooltip::before {
1600
+ .tooltip::before {
1597
1601
  content: "";
1598
1602
  border: solid transparent;
1599
1603
  border-bottom-color: #fff;