lighthouse 10.4.0-dev.20230713 → 10.4.0-dev.20230715

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 (174) hide show
  1. package/cli/cli-flags.d.ts +1 -6
  2. package/cli/cli-flags.js +0 -5
  3. package/cli/run.js +3 -10
  4. package/cli/test/smokehouse/lighthouse-runners/bundle.js +3 -1
  5. package/core/config/config-helpers.d.ts +3 -3
  6. package/core/config/config-helpers.js +5 -12
  7. package/core/config/config.js +1 -7
  8. package/core/config/constants.d.ts +0 -2
  9. package/core/config/constants.js +0 -16
  10. package/core/config/filters.js +1 -1
  11. package/core/config/validation.d.ts +5 -10
  12. package/core/config/validation.js +12 -22
  13. package/core/gather/base-artifacts.d.ts +4 -4
  14. package/core/gather/base-artifacts.js +2 -6
  15. package/core/gather/base-gatherer.d.ts +12 -37
  16. package/core/gather/base-gatherer.js +7 -54
  17. package/core/gather/driver/dom.d.ts +4 -4
  18. package/core/gather/driver/dom.js +2 -2
  19. package/core/gather/driver/environment.d.ts +4 -4
  20. package/core/gather/driver/environment.js +2 -2
  21. package/core/gather/driver/execution-context.d.ts +12 -3
  22. package/core/gather/driver/execution-context.js +27 -3
  23. package/core/gather/driver/navigation.d.ts +2 -2
  24. package/core/gather/driver/navigation.js +1 -1
  25. package/core/gather/driver/network-monitor.d.ts +6 -6
  26. package/core/gather/driver/network-monitor.js +3 -3
  27. package/core/gather/driver/network.d.ts +2 -2
  28. package/core/gather/driver/network.js +1 -1
  29. package/core/gather/driver/prepare.d.ts +10 -10
  30. package/core/gather/driver/prepare.js +10 -10
  31. package/core/gather/driver/service-workers.d.ts +4 -4
  32. package/core/gather/driver/service-workers.js +2 -2
  33. package/core/gather/driver/storage.d.ts +6 -6
  34. package/core/gather/driver/storage.js +3 -3
  35. package/core/gather/driver/target-manager.d.ts +6 -5
  36. package/core/gather/driver/target-manager.js +3 -3
  37. package/core/gather/driver/wait-for-condition.d.ts +14 -14
  38. package/core/gather/driver/wait-for-condition.js +8 -8
  39. package/core/gather/driver.d.ts +4 -4
  40. package/core/gather/driver.js +3 -3
  41. package/core/gather/fetcher.d.ts +3 -3
  42. package/core/gather/fetcher.js +1 -1
  43. package/core/gather/gatherers/accessibility.d.ts +4 -4
  44. package/core/gather/gatherers/accessibility.js +3 -3
  45. package/core/gather/gatherers/anchor-elements.d.ts +4 -4
  46. package/core/gather/gatherers/anchor-elements.js +4 -4
  47. package/core/gather/gatherers/bf-cache-failures.d.ts +8 -14
  48. package/core/gather/gatherers/bf-cache-failures.js +5 -14
  49. package/core/gather/gatherers/cache-contents.d.ts +4 -4
  50. package/core/gather/gatherers/cache-contents.js +3 -3
  51. package/core/gather/gatherers/console-messages.d.ts +6 -6
  52. package/core/gather/gatherers/console-messages.js +4 -4
  53. package/core/gather/gatherers/css-usage.d.ts +14 -14
  54. package/core/gather/gatherers/css-usage.js +9 -9
  55. package/core/gather/gatherers/devtools-log-compat.d.ts +5 -5
  56. package/core/gather/gatherers/devtools-log-compat.js +4 -4
  57. package/core/gather/gatherers/devtools-log.d.ts +6 -6
  58. package/core/gather/gatherers/devtools-log.js +4 -4
  59. package/core/gather/gatherers/dobetterweb/doctype.d.ts +4 -4
  60. package/core/gather/gatherers/dobetterweb/doctype.js +3 -3
  61. package/core/gather/gatherers/dobetterweb/domstats.d.ts +4 -4
  62. package/core/gather/gatherers/dobetterweb/domstats.js +3 -3
  63. package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +10 -22
  64. package/core/gather/gatherers/dobetterweb/optimized-images.js +10 -27
  65. package/core/gather/gatherers/dobetterweb/response-compression.d.ts +6 -12
  66. package/core/gather/gatherers/dobetterweb/response-compression.js +6 -15
  67. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +8 -14
  68. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +5 -14
  69. package/core/gather/gatherers/full-page-screenshot.d.ts +10 -10
  70. package/core/gather/gatherers/full-page-screenshot.js +6 -6
  71. package/core/gather/gatherers/global-listeners.d.ts +4 -4
  72. package/core/gather/gatherers/global-listeners.js +3 -3
  73. package/core/gather/gatherers/iframe-elements.d.ts +4 -4
  74. package/core/gather/gatherers/iframe-elements.js +3 -3
  75. package/core/gather/gatherers/image-elements.d.ts +10 -10
  76. package/core/gather/gatherers/image-elements.js +6 -6
  77. package/core/gather/gatherers/inputs.d.ts +4 -4
  78. package/core/gather/gatherers/inputs.js +3 -3
  79. package/core/gather/gatherers/inspector-issues.d.ts +8 -19
  80. package/core/gather/gatherers/inspector-issues.js +9 -26
  81. package/core/gather/gatherers/installability-errors.d.ts +6 -6
  82. package/core/gather/gatherers/installability-errors.js +4 -4
  83. package/core/gather/gatherers/js-usage.d.ts +6 -6
  84. package/core/gather/gatherers/js-usage.js +4 -4
  85. package/core/gather/gatherers/link-elements.d.ts +8 -20
  86. package/core/gather/gatherers/link-elements.js +7 -24
  87. package/core/gather/gatherers/main-document-content.d.ts +4 -16
  88. package/core/gather/gatherers/main-document-content.js +5 -23
  89. package/core/gather/gatherers/meta-elements.d.ts +4 -4
  90. package/core/gather/gatherers/meta-elements.js +3 -3
  91. package/core/gather/gatherers/network-user-agent.d.ts +5 -5
  92. package/core/gather/gatherers/network-user-agent.js +4 -4
  93. package/core/gather/gatherers/script-elements.d.ts +6 -11
  94. package/core/gather/gatherers/script-elements.js +4 -13
  95. package/core/gather/gatherers/scripts.d.ts +6 -6
  96. package/core/gather/gatherers/scripts.js +4 -4
  97. package/core/gather/gatherers/seo/embedded-content.d.ts +4 -4
  98. package/core/gather/gatherers/seo/embedded-content.js +3 -3
  99. package/core/gather/gatherers/seo/font-size.d.ts +6 -6
  100. package/core/gather/gatherers/seo/font-size.js +5 -5
  101. package/core/gather/gatherers/seo/robots-txt.d.ts +4 -4
  102. package/core/gather/gatherers/seo/robots-txt.js +3 -3
  103. package/core/gather/gatherers/seo/tap-targets.d.ts +8 -8
  104. package/core/gather/gatherers/seo/tap-targets.js +5 -5
  105. package/core/gather/gatherers/service-worker.d.ts +4 -10
  106. package/core/gather/gatherers/service-worker.js +3 -15
  107. package/core/gather/gatherers/source-maps.d.ts +12 -12
  108. package/core/gather/gatherers/source-maps.js +7 -7
  109. package/core/gather/gatherers/stacks.d.ts +7 -7
  110. package/core/gather/gatherers/stacks.js +6 -6
  111. package/core/gather/gatherers/trace-compat.d.ts +5 -5
  112. package/core/gather/gatherers/trace-compat.js +4 -4
  113. package/core/gather/gatherers/trace-elements.d.ts +13 -25
  114. package/core/gather/gatherers/trace-elements.js +13 -30
  115. package/core/gather/gatherers/trace.d.ts +8 -8
  116. package/core/gather/gatherers/trace.js +5 -5
  117. package/core/gather/gatherers/viewport-dimensions.d.ts +4 -4
  118. package/core/gather/gatherers/viewport-dimensions.js +3 -3
  119. package/core/gather/gatherers/web-app-manifest.d.ts +8 -8
  120. package/core/gather/gatherers/web-app-manifest.js +5 -5
  121. package/core/gather/navigation-runner.d.ts +9 -9
  122. package/core/gather/navigation-runner.js +6 -6
  123. package/core/gather/runner-helpers.d.ts +3 -3
  124. package/core/gather/runner-helpers.js +12 -4
  125. package/core/gather/session.d.ts +2 -2
  126. package/core/gather/session.js +1 -1
  127. package/core/gather/snapshot-runner.d.ts +2 -2
  128. package/core/gather/snapshot-runner.js +1 -1
  129. package/core/gather/timespan-runner.d.ts +2 -2
  130. package/core/gather/timespan-runner.js +1 -1
  131. package/core/index.cjs +0 -7
  132. package/core/index.d.ts +0 -15
  133. package/core/index.js +2 -40
  134. package/core/lib/asset-saver.js +8 -4
  135. package/core/lib/axe.js +1 -1
  136. package/core/lib/emulation.d.ts +14 -14
  137. package/core/lib/emulation.js +7 -7
  138. package/core/lib/page-functions.d.ts +2 -0
  139. package/core/lib/page-functions.js +10 -0
  140. package/core/lib/sentry.js +9 -2
  141. package/core/runner.d.ts +8 -30
  142. package/core/runner.js +6 -39
  143. package/core/user-flow.d.ts +4 -4
  144. package/core/user-flow.js +2 -2
  145. package/dist/report/bundle.esm.js +2221 -5832
  146. package/dist/report/flow.js +2631 -235
  147. package/dist/report/standalone.js +2586 -234
  148. package/package.json +8 -15
  149. package/third-party/esbuild-plugins-polyfills/LICENSE +3 -0
  150. package/third-party/esbuild-plugins-polyfills/README.md +7 -0
  151. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.d.ts +9 -0
  152. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.js +129 -0
  153. package/tsconfig.json +1 -0
  154. package/types/artifacts.d.ts +12 -45
  155. package/types/config.d.ts +10 -52
  156. package/types/externs.d.ts +0 -2
  157. package/types/gatherer.d.ts +20 -45
  158. package/types/lh.d.ts +0 -2
  159. package/core/gather/gatherers/gatherer.d.ts +0 -46
  160. package/core/gather/gatherers/gatherer.js +0 -58
  161. package/core/legacy/config/config.d.ts +0 -107
  162. package/core/legacy/config/config.js +0 -566
  163. package/core/legacy/config/legacy-default-config.d.ts +0 -4
  164. package/core/legacy/config/legacy-default-config.js +0 -87
  165. package/core/legacy/gather/connections/connection.d.ts +0 -77
  166. package/core/legacy/gather/connections/connection.js +0 -196
  167. package/core/legacy/gather/connections/cri.d.ts +0 -27
  168. package/core/legacy/gather/connections/cri.js +0 -162
  169. package/core/legacy/gather/connections/raw.d.ts +0 -20
  170. package/core/legacy/gather/connections/raw.js +0 -57
  171. package/core/legacy/gather/driver.d.ts +0 -216
  172. package/core/legacy/gather/driver.js +0 -480
  173. package/core/legacy/gather/gather-runner.d.ts +0 -166
  174. package/core/legacy/gather/gather-runner.js +0 -590
@@ -10,9 +10,9 @@
10
10
  * This protocol log can be used to recreate the network records using lib/network-recorder.js.
11
11
  */
12
12
 
13
- import FRGatherer from '../base-gatherer.js';
13
+ import BaseGatherer from '../base-gatherer.js';
14
14
 
15
- class DevtoolsLog extends FRGatherer {
15
+ class DevtoolsLog extends BaseGatherer {
16
16
  static symbol = Symbol('DevtoolsLog');
17
17
 
18
18
  /** @type {LH.Gatherer.GathererMeta} */
@@ -31,7 +31,7 @@ class DevtoolsLog extends FRGatherer {
31
31
  }
32
32
 
33
33
  /**
34
- * @param {LH.Gatherer.FRTransitionalContext} passContext
34
+ * @param {LH.Gatherer.Context} passContext
35
35
  */
36
36
  async startSensitiveInstrumentation({driver}) {
37
37
  this._messageLog.reset();
@@ -42,7 +42,7 @@ class DevtoolsLog extends FRGatherer {
42
42
  }
43
43
 
44
44
  /**
45
- * @param {LH.Gatherer.FRTransitionalContext} passContext
45
+ * @param {LH.Gatherer.Context} passContext
46
46
  */
47
47
  async stopSensitiveInstrumentation({driver}) {
48
48
  this._messageLog.endRecording();
@@ -1,10 +1,10 @@
1
1
  export default Doctype;
2
- declare class Doctype extends FRGatherer {
2
+ declare class Doctype extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} passContext
4
+ * @param {LH.Gatherer.Context} passContext
5
5
  * @return {Promise<LH.Artifacts['Doctype']>}
6
6
  */
7
- getArtifact(passContext: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['Doctype']>;
7
+ getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['Doctype']>;
8
8
  }
9
- import FRGatherer from '../../base-gatherer.js';
9
+ import BaseGatherer from '../../base-gatherer.js';
10
10
  //# sourceMappingURL=doctype.d.ts.map
@@ -4,7 +4,7 @@
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
6
 
7
- import FRGatherer from '../../base-gatherer.js';
7
+ import BaseGatherer from '../../base-gatherer.js';
8
8
 
9
9
  /* global document */
10
10
 
@@ -25,14 +25,14 @@ function getDoctype() {
25
25
  return {name, publicId, systemId, documentCompatMode};
26
26
  }
27
27
 
28
- class Doctype extends FRGatherer {
28
+ class Doctype extends BaseGatherer {
29
29
  /** @type {LH.Gatherer.GathererMeta} */
30
30
  meta = {
31
31
  supportedModes: ['snapshot', 'navigation'],
32
32
  };
33
33
 
34
34
  /**
35
- * @param {LH.Gatherer.FRTransitionalContext} passContext
35
+ * @param {LH.Gatherer.Context} passContext
36
36
  * @return {Promise<LH.Artifacts['Doctype']>}
37
37
  */
38
38
  getArtifact(passContext) {
@@ -1,10 +1,10 @@
1
1
  export default DOMStats;
2
- declare class DOMStats extends FRGatherer {
2
+ declare class DOMStats extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} passContext
4
+ * @param {LH.Gatherer.Context} passContext
5
5
  * @return {Promise<LH.Artifacts['DOMStats']>}
6
6
  */
7
- getArtifact(passContext: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['DOMStats']>;
7
+ getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['DOMStats']>;
8
8
  }
9
- import FRGatherer from '../../base-gatherer.js';
9
+ import BaseGatherer from '../../base-gatherer.js';
10
10
  //# sourceMappingURL=domstats.d.ts.map
@@ -12,7 +12,7 @@
12
12
  /* global getNodeDetails document */
13
13
 
14
14
 
15
- import FRGatherer from '../../base-gatherer.js';
15
+ import BaseGatherer from '../../base-gatherer.js';
16
16
  import {pageFunctions} from '../../../lib/page-functions.js';
17
17
 
18
18
  /**
@@ -75,14 +75,14 @@ function getDOMStats(element = document.body, deep = true) {
75
75
  }
76
76
  /* c8 ignore stop */
77
77
 
78
- class DOMStats extends FRGatherer {
78
+ class DOMStats extends BaseGatherer {
79
79
  /** @type {LH.Gatherer.GathererMeta} */
80
80
  meta = {
81
81
  supportedModes: ['snapshot', 'navigation'],
82
82
  };
83
83
 
84
84
  /**
85
- * @param {LH.Gatherer.FRTransitionalContext} passContext
85
+ * @param {LH.Gatherer.Context} passContext
86
86
  * @return {Promise<LH.Artifacts['DOMStats']>}
87
87
  */
88
88
  async getArtifact(passContext) {
@@ -6,7 +6,7 @@ export type SimplifiedNetworkRecord = {
6
6
  resourceSize: number;
7
7
  };
8
8
  /** @typedef {{requestId: string, url: string, mimeType: string, resourceSize: number}} SimplifiedNetworkRecord */
9
- declare class OptimizedImages extends FRGatherer {
9
+ declare class OptimizedImages extends BaseGatherer {
10
10
  /**
11
11
  * @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
12
12
  * @return {Array<SimplifiedNetworkRecord>}
@@ -16,46 +16,34 @@ declare class OptimizedImages extends FRGatherer {
16
16
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
17
17
  _encodingStartAt: number;
18
18
  /**
19
- * @param {LH.Gatherer.FRProtocolSession} session
19
+ * @param {LH.Gatherer.ProtocolSession} session
20
20
  * @param {string} requestId
21
21
  * @param {'jpeg'|'webp'} encoding Either webp or jpeg.
22
22
  * @return {Promise<LH.Crdp.Audits.GetEncodedResponseResponse>}
23
23
  */
24
- _getEncodedResponse(session: LH.Gatherer.FRProtocolSession, requestId: string, encoding: 'jpeg' | 'webp'): Promise<LH.Crdp.Audits.GetEncodedResponseResponse>;
24
+ _getEncodedResponse(session: LH.Gatherer.ProtocolSession, requestId: string, encoding: 'jpeg' | 'webp'): Promise<LH.Crdp.Audits.GetEncodedResponseResponse>;
25
25
  /**
26
- * @param {LH.Gatherer.FRProtocolSession} session
26
+ * @param {LH.Gatherer.ProtocolSession} session
27
27
  * @param {SimplifiedNetworkRecord} networkRecord
28
28
  * @return {Promise<{originalSize: number, jpegSize?: number, webpSize?: number}>}
29
29
  */
30
- calculateImageStats(session: LH.Gatherer.FRProtocolSession, networkRecord: SimplifiedNetworkRecord): Promise<{
30
+ calculateImageStats(session: LH.Gatherer.ProtocolSession, networkRecord: SimplifiedNetworkRecord): Promise<{
31
31
  originalSize: number;
32
32
  jpegSize?: number | undefined;
33
33
  webpSize?: number | undefined;
34
34
  }>;
35
35
  /**
36
- * @param {LH.Gatherer.FRProtocolSession} session
36
+ * @param {LH.Gatherer.ProtocolSession} session
37
37
  * @param {Array<SimplifiedNetworkRecord>} imageRecords
38
38
  * @return {Promise<LH.Artifacts['OptimizedImages']>}
39
39
  */
40
- computeOptimizedImages(session: LH.Gatherer.FRProtocolSession, imageRecords: Array<SimplifiedNetworkRecord>): Promise<LH.Artifacts['OptimizedImages']>;
40
+ computeOptimizedImages(session: LH.Gatherer.ProtocolSession, imageRecords: Array<SimplifiedNetworkRecord>): Promise<LH.Artifacts['OptimizedImages']>;
41
41
  /**
42
- * @param {LH.Gatherer.FRTransitionalContext} context
43
- * @param {LH.Artifacts.NetworkRequest[]} networkRecords
42
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
44
43
  * @return {Promise<LH.Artifacts['OptimizedImages']>}
45
44
  */
46
- _getArtifact(context: LH.Gatherer.FRTransitionalContext, networkRecords: LH.Artifacts.NetworkRequest[]): Promise<LH.Artifacts['OptimizedImages']>;
47
- /**
48
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
49
- * @return {Promise<LH.Artifacts['OptimizedImages']>}
50
- */
51
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['OptimizedImages']>;
52
- /**
53
- * @param {LH.Gatherer.PassContext} passContext
54
- * @param {LH.Gatherer.LoadData} loadData
55
- * @return {Promise<LH.Artifacts['OptimizedImages']>}
56
- */
57
- afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Artifacts['OptimizedImages']>;
45
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['OptimizedImages']>;
58
46
  }
59
- import FRGatherer from '../../base-gatherer.js';
47
+ import BaseGatherer from '../../base-gatherer.js';
60
48
  import { NetworkRequest } from '../../../lib/network-request.js';
61
49
  //# sourceMappingURL=optimized-images.d.ts.map
@@ -12,7 +12,7 @@
12
12
 
13
13
  import log from 'lighthouse-logger';
14
14
 
15
- import FRGatherer from '../../base-gatherer.js';
15
+ import BaseGatherer from '../../base-gatherer.js';
16
16
  import UrlUtils from '../../../lib/url-utils.js';
17
17
  import {NetworkRequest} from '../../../lib/network-request.js';
18
18
  import {Sentry} from '../../../lib/sentry.js';
@@ -34,7 +34,7 @@ const IMAGE_REGEX = /^image\/((x|ms|x-ms)-)?(png|bmp|jpeg)$/;
34
34
 
35
35
  /** @typedef {{requestId: string, url: string, mimeType: string, resourceSize: number}} SimplifiedNetworkRecord */
36
36
 
37
- class OptimizedImages extends FRGatherer {
37
+ class OptimizedImages extends BaseGatherer {
38
38
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
39
39
  meta = {
40
40
  supportedModes: ['timespan', 'navigation'],
@@ -78,7 +78,7 @@ class OptimizedImages extends FRGatherer {
78
78
  }
79
79
 
80
80
  /**
81
- * @param {LH.Gatherer.FRProtocolSession} session
81
+ * @param {LH.Gatherer.ProtocolSession} session
82
82
  * @param {string} requestId
83
83
  * @param {'jpeg'|'webp'} encoding Either webp or jpeg.
84
84
  * @return {Promise<LH.Crdp.Audits.GetEncodedResponseResponse>}
@@ -92,7 +92,7 @@ class OptimizedImages extends FRGatherer {
92
92
  }
93
93
 
94
94
  /**
95
- * @param {LH.Gatherer.FRProtocolSession} session
95
+ * @param {LH.Gatherer.ProtocolSession} session
96
96
  * @param {SimplifiedNetworkRecord} networkRecord
97
97
  * @return {Promise<{originalSize: number, jpegSize?: number, webpSize?: number}>}
98
98
  */
@@ -116,7 +116,7 @@ class OptimizedImages extends FRGatherer {
116
116
  }
117
117
 
118
118
  /**
119
- * @param {LH.Gatherer.FRProtocolSession} session
119
+ * @param {LH.Gatherer.ProtocolSession} session
120
120
  * @param {Array<SimplifiedNetworkRecord>} imageRecords
121
121
  * @return {Promise<LH.Artifacts['OptimizedImages']>}
122
122
  */
@@ -153,11 +153,13 @@ class OptimizedImages extends FRGatherer {
153
153
  }
154
154
 
155
155
  /**
156
- * @param {LH.Gatherer.FRTransitionalContext} context
157
- * @param {LH.Artifacts.NetworkRequest[]} networkRecords
156
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
158
157
  * @return {Promise<LH.Artifacts['OptimizedImages']>}
159
158
  */
160
- async _getArtifact(context, networkRecords) {
159
+ async getArtifact(context) {
160
+ const devtoolsLog = context.dependencies.DevtoolsLog;
161
+ const networkRecords = await NetworkRecords.request(devtoolsLog, context);
162
+
161
163
  const imageRecords = OptimizedImages
162
164
  .filterImageRequests(networkRecords)
163
165
  .sort((a, b) => b.resourceSize - a.resourceSize);
@@ -169,25 +171,6 @@ class OptimizedImages extends FRGatherer {
169
171
  }
170
172
  return results;
171
173
  }
172
-
173
- /**
174
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
175
- * @return {Promise<LH.Artifacts['OptimizedImages']>}
176
- */
177
- async getArtifact(context) {
178
- const devtoolsLog = context.dependencies.DevtoolsLog;
179
- const networkRecords = await NetworkRecords.request(devtoolsLog, context);
180
- return this._getArtifact(context, networkRecords);
181
- }
182
-
183
- /**
184
- * @param {LH.Gatherer.PassContext} passContext
185
- * @param {LH.Gatherer.LoadData} loadData
186
- * @return {Promise<LH.Artifacts['OptimizedImages']>}
187
- */
188
- async afterPass(passContext, loadData) {
189
- return this._getArtifact({...passContext, dependencies: {}}, loadData.networkRecords);
190
- }
191
174
  }
192
175
 
193
176
  export default OptimizedImages;
@@ -1,5 +1,5 @@
1
1
  export default ResponseCompression;
2
- declare class ResponseCompression extends FRGatherer {
2
+ declare class ResponseCompression extends BaseGatherer {
3
3
  /**
4
4
  * @param {LH.Artifacts.NetworkRequest[]} networkRecords
5
5
  * @return {LH.Artifacts['ResponseCompression']}
@@ -8,23 +8,17 @@ declare class ResponseCompression extends FRGatherer {
8
8
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
9
9
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
10
10
  /**
11
- * @param {LH.Gatherer.FRTransitionalContext} context
11
+ * @param {LH.Gatherer.Context} context
12
12
  * @param {LH.Artifacts.NetworkRequest[]} networkRecords
13
13
  * @return {Promise<LH.Artifacts['ResponseCompression']>}
14
14
  */
15
- _getArtifact(context: LH.Gatherer.FRTransitionalContext, networkRecords: LH.Artifacts.NetworkRequest[]): Promise<LH.Artifacts['ResponseCompression']>;
15
+ getCompressibleRecords(context: LH.Gatherer.Context, networkRecords: LH.Artifacts.NetworkRequest[]): Promise<LH.Artifacts['ResponseCompression']>;
16
16
  /**
17
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
17
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
18
18
  * @return {Promise<LH.Artifacts['ResponseCompression']>}
19
19
  */
20
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['ResponseCompression']>;
21
- /**
22
- * @param {LH.Gatherer.PassContext} passContext
23
- * @param {LH.Gatherer.LoadData} loadData
24
- * @return {Promise<LH.Artifacts['ResponseCompression']>}
25
- */
26
- afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Artifacts['ResponseCompression']>;
20
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['ResponseCompression']>;
27
21
  }
28
- import FRGatherer from '../../base-gatherer.js';
22
+ import BaseGatherer from '../../base-gatherer.js';
29
23
  import { NetworkRequest } from '../../../lib/network-request.js';
30
24
  //# sourceMappingURL=response-compression.d.ts.map
@@ -13,7 +13,7 @@
13
13
  import {Buffer} from 'buffer';
14
14
  import {gzip} from 'zlib';
15
15
 
16
- import FRGatherer from '../../base-gatherer.js';
16
+ import BaseGatherer from '../../base-gatherer.js';
17
17
  import UrlUtils from '../../../lib/url-utils.js';
18
18
  import {Sentry} from '../../../lib/sentry.js';
19
19
  import {NetworkRequest} from '../../../lib/network-request.js';
@@ -39,7 +39,7 @@ const textResourceTypes = [
39
39
  NetworkRequest.TYPES.EventSource,
40
40
  ];
41
41
 
42
- class ResponseCompression extends FRGatherer {
42
+ class ResponseCompression extends BaseGatherer {
43
43
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
44
44
  meta = {
45
45
  supportedModes: ['timespan', 'navigation'],
@@ -91,11 +91,11 @@ class ResponseCompression extends FRGatherer {
91
91
  }
92
92
 
93
93
  /**
94
- * @param {LH.Gatherer.FRTransitionalContext} context
94
+ * @param {LH.Gatherer.Context} context
95
95
  * @param {LH.Artifacts.NetworkRequest[]} networkRecords
96
96
  * @return {Promise<LH.Artifacts['ResponseCompression']>}
97
97
  */
98
- async _getArtifact(context, networkRecords) {
98
+ async getCompressibleRecords(context, networkRecords) {
99
99
  const session = context.driver.defaultSession;
100
100
  const textRecords = ResponseCompression.filterUnoptimizedResponses(networkRecords);
101
101
 
@@ -132,22 +132,13 @@ class ResponseCompression extends FRGatherer {
132
132
  }
133
133
 
134
134
  /**
135
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
135
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
136
136
  * @return {Promise<LH.Artifacts['ResponseCompression']>}
137
137
  */
138
138
  async getArtifact(context) {
139
139
  const devtoolsLog = context.dependencies.DevtoolsLog;
140
140
  const networkRecords = await NetworkRecords.request(devtoolsLog, context);
141
- return this._getArtifact(context, networkRecords);
142
- }
143
-
144
- /**
145
- * @param {LH.Gatherer.PassContext} passContext
146
- * @param {LH.Gatherer.LoadData} loadData
147
- * @return {Promise<LH.Artifacts['ResponseCompression']>}
148
- */
149
- async afterPass(passContext, loadData) {
150
- return this._getArtifact({...passContext, dependencies: {}}, loadData.networkRecords);
141
+ return this.getCompressibleRecords(context, networkRecords);
151
142
  }
152
143
  }
153
144
 
@@ -19,35 +19,29 @@ export type ScriptTag = {
19
19
  url: string;
20
20
  src: string;
21
21
  };
22
- declare class TagsBlockingFirstPaint extends FRGatherer {
22
+ declare class TagsBlockingFirstPaint extends BaseGatherer {
23
23
  /**
24
24
  * @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
25
25
  * @return {Map<string, LH.Artifacts.NetworkRequest>}
26
26
  */
27
27
  static _filteredAndIndexedByUrl(networkRecords: Array<LH.Artifacts.NetworkRequest>): Map<string, LH.Artifacts.NetworkRequest>;
28
28
  /**
29
- * @param {LH.Gatherer.FRTransitionalDriver} driver
29
+ * @param {LH.Gatherer.Driver} driver
30
30
  * @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
31
31
  * @return {Promise<Array<LH.Artifacts.TagBlockingFirstPaint>>}
32
32
  */
33
- static findBlockingTags(driver: LH.Gatherer.FRTransitionalDriver, networkRecords: Array<LH.Artifacts.NetworkRequest>): Promise<Array<LH.Artifacts.TagBlockingFirstPaint>>;
33
+ static findBlockingTags(driver: LH.Gatherer.Driver, networkRecords: Array<LH.Artifacts.NetworkRequest>): Promise<Array<LH.Artifacts.TagBlockingFirstPaint>>;
34
34
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
35
35
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
36
36
  /**
37
- * @param {LH.Gatherer.FRTransitionalContext} context
37
+ * @param {LH.Gatherer.Context} context
38
38
  */
39
- startSensitiveInstrumentation(context: LH.Gatherer.FRTransitionalContext): Promise<void>;
39
+ startSensitiveInstrumentation(context: LH.Gatherer.Context): Promise<void>;
40
40
  /**
41
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
41
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
42
42
  * @return {Promise<LH.Artifacts['TagsBlockingFirstPaint']>}
43
43
  */
44
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['TagsBlockingFirstPaint']>;
45
- /**
46
- * @param {LH.Gatherer.PassContext} passContext
47
- * @param {LH.Gatherer.LoadData} loadData
48
- * @return {Promise<LH.Artifacts['TagsBlockingFirstPaint']>}
49
- */
50
- afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Artifacts['TagsBlockingFirstPaint']>;
44
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['TagsBlockingFirstPaint']>;
51
45
  }
52
- import FRGatherer from '../../base-gatherer.js';
46
+ import BaseGatherer from '../../base-gatherer.js';
53
47
  //# sourceMappingURL=tags-blocking-first-paint.d.ts.map
@@ -19,7 +19,7 @@
19
19
 
20
20
  import {NetworkRecords} from '../../../computed/network-records.js';
21
21
  import DevtoolsLog from '../devtools-log.js';
22
- import FRGatherer from '../../base-gatherer.js';
22
+ import BaseGatherer from '../../base-gatherer.js';
23
23
 
24
24
  /* global document, window, HTMLLinkElement, SVGScriptElement */
25
25
 
@@ -113,7 +113,7 @@ async function collectTagsThatBlockFirstPaint() {
113
113
  }
114
114
  /* c8 ignore stop */
115
115
 
116
- class TagsBlockingFirstPaint extends FRGatherer {
116
+ class TagsBlockingFirstPaint extends BaseGatherer {
117
117
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
118
118
  meta = {
119
119
  supportedModes: ['navigation'],
@@ -149,7 +149,7 @@ class TagsBlockingFirstPaint extends FRGatherer {
149
149
  }
150
150
 
151
151
  /**
152
- * @param {LH.Gatherer.FRTransitionalDriver} driver
152
+ * @param {LH.Gatherer.Driver} driver
153
153
  * @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
154
154
  * @return {Promise<Array<LH.Artifacts.TagBlockingFirstPaint>>}
155
155
  */
@@ -206,7 +206,7 @@ class TagsBlockingFirstPaint extends FRGatherer {
206
206
  }
207
207
 
208
208
  /**
209
- * @param {LH.Gatherer.FRTransitionalContext} context
209
+ * @param {LH.Gatherer.Context} context
210
210
  */
211
211
  async startSensitiveInstrumentation(context) {
212
212
  const {executionContext} = context.driver;
@@ -215,7 +215,7 @@ class TagsBlockingFirstPaint extends FRGatherer {
215
215
  }
216
216
 
217
217
  /**
218
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
218
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
219
219
  * @return {Promise<LH.Artifacts['TagsBlockingFirstPaint']>}
220
220
  */
221
221
  async getArtifact(context) {
@@ -223,15 +223,6 @@ class TagsBlockingFirstPaint extends FRGatherer {
223
223
  const networkRecords = await NetworkRecords.request(devtoolsLog, context);
224
224
  return TagsBlockingFirstPaint.findBlockingTags(context.driver, networkRecords);
225
225
  }
226
-
227
- /**
228
- * @param {LH.Gatherer.PassContext} passContext
229
- * @param {LH.Gatherer.LoadData} loadData
230
- * @return {Promise<LH.Artifacts['TagsBlockingFirstPaint']>}
231
- */
232
- afterPass(passContext, loadData) {
233
- return TagsBlockingFirstPaint.findBlockingTags(passContext.driver, loadData.networkRecords);
234
- }
235
226
  }
236
227
 
237
228
  export default TagsBlockingFirstPaint;
@@ -1,19 +1,19 @@
1
1
  export default FullPageScreenshot;
2
- declare class FullPageScreenshot extends FRGatherer {
2
+ declare class FullPageScreenshot extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} context
4
+ * @param {LH.Gatherer.Context} context
5
5
  * @param {{height: number, width: number, mobile: boolean}} deviceMetrics
6
6
  */
7
- _resizeViewport(context: LH.Gatherer.FRTransitionalContext, deviceMetrics: {
7
+ _resizeViewport(context: LH.Gatherer.Context, deviceMetrics: {
8
8
  height: number;
9
9
  width: number;
10
10
  mobile: boolean;
11
11
  }): Promise<void>;
12
12
  /**
13
- * @param {LH.Gatherer.FRTransitionalContext} context
13
+ * @param {LH.Gatherer.Context} context
14
14
  * @return {Promise<LH.Result.FullPageScreenshot['screenshot']>}
15
15
  */
16
- _takeScreenshot(context: LH.Gatherer.FRTransitionalContext): Promise<LH.Result.FullPageScreenshot['screenshot']>;
16
+ _takeScreenshot(context: LH.Gatherer.Context): Promise<LH.Result.FullPageScreenshot['screenshot']>;
17
17
  /**
18
18
  * Gatherers can collect details about DOM nodes, including their position on the page.
19
19
  * Layout shifts occuring after a gatherer runs can cause these positions to be incorrect,
@@ -21,15 +21,15 @@ declare class FullPageScreenshot extends FRGatherer {
21
21
  * `getNodeDetails` maintains a collection of DOM objects in the page, which we can iterate
22
22
  * to re-collect the bounding client rectangle.
23
23
  * @see pageFunctions.getNodeDetails
24
- * @param {LH.Gatherer.FRTransitionalContext} context
24
+ * @param {LH.Gatherer.Context} context
25
25
  * @return {Promise<LH.Result.FullPageScreenshot['nodes']>}
26
26
  */
27
- _resolveNodes(context: LH.Gatherer.FRTransitionalContext): Promise<LH.Result.FullPageScreenshot['nodes']>;
27
+ _resolveNodes(context: LH.Gatherer.Context): Promise<LH.Result.FullPageScreenshot['nodes']>;
28
28
  /**
29
- * @param {LH.Gatherer.FRTransitionalContext} context
29
+ * @param {LH.Gatherer.Context} context
30
30
  * @return {Promise<LH.Artifacts['FullPageScreenshot']>}
31
31
  */
32
- getArtifact(context: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['FullPageScreenshot']>;
32
+ getArtifact(context: LH.Gatherer.Context): Promise<LH.Artifacts['FullPageScreenshot']>;
33
33
  }
34
- import FRGatherer from '../base-gatherer.js';
34
+ import BaseGatherer from '../base-gatherer.js';
35
35
  //# sourceMappingURL=full-page-screenshot.d.ts.map
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* globals window getBoundingClientRect requestAnimationFrame */
8
8
 
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
  import * as emulation from '../../lib/emulation.js';
11
11
  import {pageFunctions} from '../../lib/page-functions.js';
12
12
  import {NetworkMonitor} from '../driver/network-monitor.js';
@@ -65,14 +65,14 @@ function waitForDoubleRaf() {
65
65
 
66
66
  /* c8 ignore stop */
67
67
 
68
- class FullPageScreenshot extends FRGatherer {
68
+ class FullPageScreenshot extends BaseGatherer {
69
69
  /** @type {LH.Gatherer.GathererMeta} */
70
70
  meta = {
71
71
  supportedModes: ['snapshot', 'timespan', 'navigation'],
72
72
  };
73
73
 
74
74
  /**
75
- * @param {LH.Gatherer.FRTransitionalContext} context
75
+ * @param {LH.Gatherer.Context} context
76
76
  * @param {{height: number, width: number, mobile: boolean}} deviceMetrics
77
77
  */
78
78
  async _resizeViewport(context, deviceMetrics) {
@@ -120,7 +120,7 @@ class FullPageScreenshot extends FRGatherer {
120
120
  }
121
121
 
122
122
  /**
123
- * @param {LH.Gatherer.FRTransitionalContext} context
123
+ * @param {LH.Gatherer.Context} context
124
124
  * @return {Promise<LH.Result.FullPageScreenshot['screenshot']>}
125
125
  */
126
126
  async _takeScreenshot(context) {
@@ -150,7 +150,7 @@ class FullPageScreenshot extends FRGatherer {
150
150
  * `getNodeDetails` maintains a collection of DOM objects in the page, which we can iterate
151
151
  * to re-collect the bounding client rectangle.
152
152
  * @see pageFunctions.getNodeDetails
153
- * @param {LH.Gatherer.FRTransitionalContext} context
153
+ * @param {LH.Gatherer.Context} context
154
154
  * @return {Promise<LH.Result.FullPageScreenshot['nodes']>}
155
155
  */
156
156
  async _resolveNodes(context) {
@@ -189,7 +189,7 @@ class FullPageScreenshot extends FRGatherer {
189
189
  }
190
190
 
191
191
  /**
192
- * @param {LH.Gatherer.FRTransitionalContext} context
192
+ * @param {LH.Gatherer.Context} context
193
193
  * @return {Promise<LH.Artifacts['FullPageScreenshot']>}
194
194
  */
195
195
  async getArtifact(context) {
@@ -1,5 +1,5 @@
1
1
  export default GlobalListeners;
2
- declare class GlobalListeners extends FRGatherer {
2
+ declare class GlobalListeners extends BaseGatherer {
3
3
  /**
4
4
  * @param {LH.Crdp.DOMDebugger.EventListener} listener
5
5
  * @return {listener is {type: 'pagehide'|'unload'|'visibilitychange'} & LH.Crdp.DOMDebugger.EventListener}
@@ -18,10 +18,10 @@ declare class GlobalListeners extends FRGatherer {
18
18
  */
19
19
  dedupeListeners(listeners: LH.Artifacts['GlobalListeners']): LH.Artifacts['GlobalListeners'];
20
20
  /**
21
- * @param {LH.Gatherer.FRTransitionalContext} passContext
21
+ * @param {LH.Gatherer.Context} passContext
22
22
  * @return {Promise<LH.Artifacts['GlobalListeners']>}
23
23
  */
24
- getArtifact(passContext: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['GlobalListeners']>;
24
+ getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['GlobalListeners']>;
25
25
  }
26
- import FRGatherer from '../base-gatherer.js';
26
+ import BaseGatherer from '../base-gatherer.js';
27
27
  //# sourceMappingURL=global-listeners.d.ts.map
@@ -13,9 +13,9 @@
13
13
 
14
14
  import log from 'lighthouse-logger';
15
15
 
16
- import FRGatherer from '../base-gatherer.js';
16
+ import BaseGatherer from '../base-gatherer.js';
17
17
 
18
- class GlobalListeners extends FRGatherer {
18
+ class GlobalListeners extends BaseGatherer {
19
19
  /** @type {LH.Gatherer.GathererMeta} */
20
20
  meta = {
21
21
  supportedModes: ['snapshot', 'timespan', 'navigation'],
@@ -57,7 +57,7 @@ class GlobalListeners extends FRGatherer {
57
57
  }
58
58
 
59
59
  /**
60
- * @param {LH.Gatherer.FRTransitionalContext} passContext
60
+ * @param {LH.Gatherer.Context} passContext
61
61
  * @return {Promise<LH.Artifacts['GlobalListeners']>}
62
62
  */
63
63
  async getArtifact(passContext) {
@@ -1,11 +1,11 @@
1
1
  export default IFrameElements;
2
- declare class IFrameElements extends FRGatherer {
2
+ declare class IFrameElements extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} passContext
4
+ * @param {LH.Gatherer.Context} passContext
5
5
  * @return {Promise<LH.Artifacts['IFrameElements']>}
6
6
  * @override
7
7
  */
8
- override getArtifact(passContext: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['IFrameElements']>;
8
+ override getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['IFrameElements']>;
9
9
  }
10
- import FRGatherer from '../base-gatherer.js';
10
+ import BaseGatherer from '../base-gatherer.js';
11
11
  //# sourceMappingURL=iframe-elements.d.ts.map
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* global getNodeDetails */
8
8
 
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
  import {pageFunctions} from '../../lib/page-functions.js';
11
11
 
12
12
  /* eslint-env browser, node */
@@ -37,14 +37,14 @@ function collectIFrameElements() {
37
37
  }
38
38
  /* c8 ignore stop */
39
39
 
40
- class IFrameElements extends FRGatherer {
40
+ class IFrameElements extends BaseGatherer {
41
41
  /** @type {LH.Gatherer.GathererMeta} */
42
42
  meta = {
43
43
  supportedModes: ['snapshot', 'navigation'],
44
44
  };
45
45
 
46
46
  /**
47
- * @param {LH.Gatherer.FRTransitionalContext} passContext
47
+ * @param {LH.Gatherer.Context} passContext
48
48
  * @return {Promise<LH.Artifacts['IFrameElements']>}
49
49
  * @override
50
50
  */