lighthouse 9.5.0-dev.20220905 → 9.5.0-dev.20220907-2

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 (158) hide show
  1. package/cli/cli-flags.js +17 -0
  2. package/cli/run.js +2 -2
  3. package/cli/test/smokehouse/report-assert.js +0 -4
  4. package/cli/test/smokehouse/smokehouse.js +6 -0
  5. package/core/audits/bootup-time.js +2 -2
  6. package/core/audits/byte-efficiency/byte-efficiency-audit.js +7 -6
  7. package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
  8. package/core/audits/byte-efficiency/legacy-javascript.js +2 -2
  9. package/core/audits/byte-efficiency/modern-image-formats.js +5 -5
  10. package/core/audits/byte-efficiency/offscreen-images.js +4 -4
  11. package/core/audits/byte-efficiency/render-blocking-resources.js +5 -5
  12. package/core/audits/byte-efficiency/total-byte-weight.js +1 -1
  13. package/core/audits/byte-efficiency/unminified-css.js +1 -1
  14. package/core/audits/byte-efficiency/unused-css-rules.js +1 -1
  15. package/core/audits/byte-efficiency/unused-javascript.js +4 -4
  16. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +3 -3
  17. package/core/audits/byte-efficiency/uses-optimized-images.js +5 -5
  18. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +2 -2
  19. package/core/audits/byte-efficiency/uses-responsive-images.js +3 -3
  20. package/core/audits/byte-efficiency/uses-text-compression.js +2 -2
  21. package/core/audits/critical-request-chains.js +1 -1
  22. package/core/audits/csp-xss.js +1 -1
  23. package/core/audits/deprecations.js +2 -2
  24. package/core/audits/diagnostics.js +7 -7
  25. package/core/audits/dobetterweb/charset.js +1 -1
  26. package/core/audits/dobetterweb/uses-http2.js +8 -8
  27. package/core/audits/errors-in-console.js +2 -2
  28. package/core/audits/final-screenshot.js +2 -2
  29. package/core/audits/font-display.js +7 -6
  30. package/core/audits/image-aspect-ratio.js +3 -3
  31. package/core/audits/image-size-responsive.js +3 -3
  32. package/core/audits/installable-manifest.js +1 -1
  33. package/core/audits/is-on-https.js +3 -3
  34. package/core/audits/long-tasks.js +4 -4
  35. package/core/audits/main-thread-tasks.js +1 -1
  36. package/core/audits/mainthread-work-breakdown.js +1 -1
  37. package/core/audits/maskable-icon.js +1 -1
  38. package/core/audits/metrics/cumulative-layout-shift.js +1 -1
  39. package/core/audits/metrics/experimental-interaction-to-next-paint.js +1 -1
  40. package/core/audits/metrics/first-contentful-paint-3g.js +1 -1
  41. package/core/audits/metrics/first-contentful-paint.js +1 -1
  42. package/core/audits/metrics/first-meaningful-paint.js +1 -1
  43. package/core/audits/metrics/interactive.js +1 -1
  44. package/core/audits/metrics/largest-contentful-paint.js +1 -1
  45. package/core/audits/metrics/max-potential-fid.js +1 -1
  46. package/core/audits/metrics/speed-index.js +1 -1
  47. package/core/audits/metrics/total-blocking-time.js +1 -1
  48. package/core/audits/metrics.js +2 -2
  49. package/core/audits/network-requests.js +4 -4
  50. package/core/audits/network-rtt.js +3 -3
  51. package/core/audits/network-server-latency.js +3 -3
  52. package/core/audits/no-unload-listeners.js +2 -2
  53. package/core/audits/performance-budget.js +2 -2
  54. package/core/audits/predictive-perf.js +8 -8
  55. package/core/audits/preload-fonts.js +1 -1
  56. package/core/audits/preload-lcp-image.js +4 -4
  57. package/core/audits/redirects.js +4 -4
  58. package/core/audits/resource-summary.js +1 -1
  59. package/core/audits/screenshot-thumbnails.js +1 -1
  60. package/core/audits/script-treemap-data.js +5 -5
  61. package/core/audits/seo/canonical.js +3 -3
  62. package/core/audits/seo/font-size.js +2 -2
  63. package/core/audits/seo/http-status-code.js +1 -1
  64. package/core/audits/seo/is-crawlable.js +1 -2
  65. package/core/audits/seo/link-text.js +2 -2
  66. package/core/audits/seo/plugins.js +0 -1
  67. package/core/audits/seo/robots-txt.js +0 -1
  68. package/core/audits/seo/tap-targets.js +2 -2
  69. package/core/audits/server-response-time.js +1 -1
  70. package/core/audits/service-worker.js +0 -1
  71. package/core/audits/splash-screen.js +1 -1
  72. package/core/audits/themed-omnibox.js +1 -1
  73. package/core/audits/third-party-facades.js +3 -3
  74. package/core/audits/third-party-summary.js +2 -2
  75. package/core/audits/timing-budget.js +2 -2
  76. package/core/audits/unsized-images.js +4 -4
  77. package/core/audits/user-timings.js +1 -1
  78. package/core/audits/uses-rel-preconnect.js +12 -10
  79. package/core/audits/uses-rel-preload.js +6 -6
  80. package/core/audits/viewport.js +2 -2
  81. package/core/audits/violation-audit.js +2 -2
  82. package/core/audits/work-during-interaction.js +4 -4
  83. package/core/computed/critical-request-chains.js +5 -3
  84. package/core/computed/image-records.js +5 -3
  85. package/core/computed/js-bundles.js +2 -1
  86. package/core/computed/load-simulator.js +3 -5
  87. package/core/computed/main-resource.js +3 -2
  88. package/core/computed/main-thread-tasks.js +3 -2
  89. package/core/computed/manifest-values.js +3 -1
  90. package/core/computed/metrics/cumulative-layout-shift.js +3 -2
  91. package/core/computed/metrics/first-contentful-paint-all-frames.js +3 -2
  92. package/core/computed/metrics/first-contentful-paint.js +4 -3
  93. package/core/computed/metrics/first-meaningful-paint.js +4 -3
  94. package/core/computed/metrics/interactive.js +4 -3
  95. package/core/computed/metrics/lantern-first-contentful-paint.js +3 -2
  96. package/core/computed/metrics/lantern-first-meaningful-paint.js +4 -3
  97. package/core/computed/metrics/lantern-interactive.js +4 -3
  98. package/core/computed/metrics/lantern-largest-contentful-paint.js +4 -3
  99. package/core/computed/metrics/lantern-max-potential-fid.js +5 -4
  100. package/core/computed/metrics/lantern-metric.js +6 -6
  101. package/core/computed/metrics/lantern-speed-index.js +5 -4
  102. package/core/computed/metrics/lantern-total-blocking-time.js +5 -4
  103. package/core/computed/metrics/largest-contentful-paint-all-frames.js +3 -2
  104. package/core/computed/metrics/largest-contentful-paint.js +4 -3
  105. package/core/computed/metrics/max-potential-fid.js +4 -3
  106. package/core/computed/metrics/metric.js +3 -3
  107. package/core/computed/metrics/navigation-metric.js +4 -3
  108. package/core/computed/metrics/responsiveness.js +3 -2
  109. package/core/computed/metrics/speed-index.js +5 -4
  110. package/core/computed/metrics/timing-summary.js +15 -14
  111. package/core/computed/metrics/total-blocking-time.js +5 -4
  112. package/core/computed/module-duplication.js +5 -3
  113. package/core/computed/network-analysis.js +3 -2
  114. package/core/computed/network-records.js +2 -1
  115. package/core/computed/page-dependency-graph.js +13 -11
  116. package/core/computed/processed-navigation.js +2 -1
  117. package/core/computed/processed-trace.js +2 -1
  118. package/core/computed/resource-summary.js +4 -3
  119. package/core/computed/screenshots.js +2 -1
  120. package/core/computed/speedline.js +3 -2
  121. package/core/computed/unused-css.js +3 -2
  122. package/core/computed/unused-javascript-summary.js +2 -1
  123. package/core/computed/user-timings.js +3 -2
  124. package/core/computed/viewport-meta.js +2 -1
  125. package/core/fraggle-rock/gather/navigation-runner.js +9 -6
  126. package/core/fraggle-rock/gather/runner-helpers.js +3 -0
  127. package/core/fraggle-rock/gather/snapshot-runner.js +3 -2
  128. package/core/fraggle-rock/gather/timespan-runner.js +3 -2
  129. package/core/gather/driver/navigation.js +3 -3
  130. package/core/gather/driver/network-monitor.js +2 -2
  131. package/core/gather/gather-runner.js +3 -3
  132. package/core/gather/gatherers/dobetterweb/optimized-images.js +3 -3
  133. package/core/gather/gatherers/dobetterweb/response-compression.js +3 -3
  134. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +1 -1
  135. package/core/gather/gatherers/inspector-issues.js +1 -1
  136. package/core/gather/gatherers/link-elements.js +1 -2
  137. package/core/gather/gatherers/main-document-content.js +1 -1
  138. package/core/gather/gatherers/script-elements.js +1 -1
  139. package/core/gather/gatherers/source-maps.js +0 -1
  140. package/core/gather/gatherers/trace-elements.js +4 -4
  141. package/core/index.js +3 -3
  142. package/core/lib/asset-saver.js +4 -4
  143. package/core/lib/dependency-graph/simulator/network-analyzer.js +2 -2
  144. package/core/lib/icons.js +0 -2
  145. package/core/lib/manifest-parser.js +0 -2
  146. package/core/lib/network-request.js +7 -7
  147. package/core/lib/{url-shim.js → url-utils.js} +4 -12
  148. package/dist/report/flow.js +11 -11
  149. package/lol.report.json +5856 -0
  150. package/package.json +1 -2
  151. package/report/test/renderer/performance-category-renderer-test.js +0 -1
  152. package/report/test/renderer/report-renderer-test.js +0 -1
  153. package/shared/localization/locales/en-US.ctc.json +8059 -0
  154. package/shared/localization/locales/en-XL.ctc.json +8036 -0
  155. package/tsconfig.json +1 -1
  156. package/types/gatherer.d.ts +2 -0
  157. package/changelog.md +0 -5902
  158. package/core/fraggle-rock/replay/stringify-extension.js +0 -104
@@ -1,104 +0,0 @@
1
- /**
2
- * @license Copyright 2022 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
- import * as PuppeteerReplay from '@puppeteer/replay';
8
-
9
- /**
10
- * @param {PuppeteerReplay.Schema.Step} step
11
- * @return {boolean}
12
- */
13
- function isNavigationStep(step) {
14
- return Boolean(
15
- step.type === 'navigate' ||
16
- step.assertedEvents?.some(event => event.type === 'navigation')
17
- );
18
- }
19
-
20
- class LighthouseStringifyExtension extends PuppeteerReplay.PuppeteerStringifyExtension {
21
- #isProcessingTimespan = false;
22
-
23
- /**
24
- * @override
25
- * @param {PuppeteerReplay.LineWriter} out
26
- * @param {PuppeteerReplay.Schema.UserFlow} flow
27
- */
28
- async beforeAllSteps(out, flow) {
29
- out.appendLine(`const fs = require('fs');`);
30
-
31
- let isMobile = true;
32
- for (const step of flow.steps) {
33
- if (step.type !== 'setViewport') continue;
34
- isMobile = step.isMobile;
35
- }
36
-
37
- await super.beforeAllSteps(out, flow);
38
-
39
- const flags = {
40
- screenEmulation: {
41
- disabled: true,
42
- },
43
- };
44
- out.appendLine(`const flags = ${JSON.stringify(flags)}`);
45
- if (isMobile) {
46
- out.appendLine(`const config = undefined;`);
47
- } else {
48
- // eslint-disable-next-line max-len
49
- out.appendLine(`const config = (await import('lighthouse/core/config/desktop-config.js')).default;`);
50
- }
51
-
52
- out.appendLine(`const lhApi = await import('lighthouse/core/fraggle-rock/api.js');`);
53
- // eslint-disable-next-line max-len
54
- out.appendLine(`const lhFlow = await lhApi.startFlow(page, {name: ${JSON.stringify(flow.title)}, config, flags});`);
55
- }
56
-
57
- /**
58
- * @override
59
- * @param {PuppeteerReplay.LineWriter} out
60
- * @param {PuppeteerReplay.Schema.Step} step
61
- * @param {PuppeteerReplay.Schema.UserFlow} flow
62
- */
63
- async stringifyStep(out, step, flow) {
64
- if (step.type === 'setViewport') {
65
- await super.stringifyStep(out, step, flow);
66
- return;
67
- }
68
-
69
- const isNavigation = isNavigationStep(step);
70
-
71
- if (isNavigation) {
72
- if (this.#isProcessingTimespan) {
73
- out.appendLine(`await lhFlow.endTimespan();`);
74
- this.#isProcessingTimespan = false;
75
- }
76
- out.appendLine(`await lhFlow.startNavigation();`);
77
- } else if (!this.#isProcessingTimespan) {
78
- out.appendLine(`await lhFlow.startTimespan();`);
79
- this.#isProcessingTimespan = true;
80
- }
81
-
82
- await super.stringifyStep(out, step, flow);
83
-
84
- if (isNavigation) {
85
- out.appendLine(`await lhFlow.endNavigation();`);
86
- }
87
- }
88
-
89
- /**
90
- * @override
91
- * @param {PuppeteerReplay.LineWriter} out
92
- * @param {PuppeteerReplay.Schema.UserFlow} flow
93
- */
94
- async afterAllSteps(out, flow) {
95
- if (this.#isProcessingTimespan) {
96
- out.appendLine(`await lhFlow.endTimespan();`);
97
- }
98
- out.appendLine(`const lhFlowReport = await lhFlow.generateReport();`);
99
- out.appendLine(`fs.writeFileSync(__dirname + '/flow.report.html', lhFlowReport)`);
100
- await super.afterAllSteps(out, flow);
101
- }
102
- }
103
-
104
- export default LighthouseStringifyExtension;