lighthouse 11.2.0 → 11.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 (106) hide show
  1. package/cli/cli-flags.d.ts +5 -1
  2. package/cli/cli-flags.js +5 -1
  3. package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +2 -2
  4. package/cli/test/smokehouse/frontends/smokehouse-bin.js +18 -7
  5. package/cli/test/smokehouse/lighthouse-runners/bundle.d.ts +2 -4
  6. package/cli/test/smokehouse/lighthouse-runners/bundle.js +8 -4
  7. package/cli/test/smokehouse/lighthouse-runners/cli.d.ts +2 -4
  8. package/cli/test/smokehouse/lighthouse-runners/cli.js +5 -3
  9. package/cli/test/smokehouse/lighthouse-runners/devtools.d.ts +2 -1
  10. package/cli/test/smokehouse/lighthouse-runners/devtools.js +3 -1
  11. package/cli/test/smokehouse/smokehouse.d.ts +4 -2
  12. package/cli/test/smokehouse/smokehouse.js +10 -7
  13. package/core/audits/byte-efficiency/legacy-javascript.js +2 -2
  14. package/core/audits/image-size-responsive.js +1 -1
  15. package/core/audits/layout-shift-elements.js +1 -1
  16. package/core/audits/lcp-lazy-loaded.js +2 -2
  17. package/core/audits/long-tasks.js +1 -1
  18. package/core/audits/metrics/cumulative-layout-shift.js +2 -2
  19. package/core/audits/metrics/interaction-to-next-paint.js +2 -2
  20. package/core/audits/metrics/largest-contentful-paint.js +1 -1
  21. package/core/audits/no-unload-listeners.js +1 -1
  22. package/core/audits/preload-fonts.js +1 -1
  23. package/core/audits/prioritize-lcp-image.js +1 -1
  24. package/core/audits/unsized-images.js +1 -1
  25. package/core/audits/work-during-interaction.js +1 -1
  26. package/core/config/config.d.ts +1 -2
  27. package/core/config/config.js +18 -62
  28. package/core/config/constants.d.ts +1 -3
  29. package/core/config/constants.js +4 -18
  30. package/core/config/default-config.js +8 -8
  31. package/core/config/filters.d.ts +0 -8
  32. package/core/config/filters.js +0 -28
  33. package/core/config/validation.d.ts +4 -15
  34. package/core/config/validation.js +18 -63
  35. package/core/gather/base-artifacts.d.ts +2 -2
  36. package/core/gather/base-artifacts.js +5 -5
  37. package/core/gather/driver/navigation.d.ts +1 -1
  38. package/core/gather/driver/navigation.js +1 -1
  39. package/core/gather/driver/prepare.d.ts +3 -18
  40. package/core/gather/driver/prepare.js +21 -43
  41. package/core/gather/driver/storage.d.ts +2 -1
  42. package/core/gather/driver/storage.js +3 -12
  43. package/core/gather/gatherers/inspector-issues.js +1 -0
  44. package/core/gather/navigation-runner.d.ts +3 -31
  45. package/core/gather/navigation-runner.js +46 -113
  46. package/core/lib/navigation-error.d.ts +8 -3
  47. package/core/lib/navigation-error.js +19 -11
  48. package/dist/report/bundle.esm.js +4 -4
  49. package/dist/report/flow.js +7 -7
  50. package/dist/report/standalone.js +5 -5
  51. package/package.json +8 -8
  52. package/report/renderer/performance-category-renderer.js +2 -1
  53. package/shared/localization/locales/ar-XB.json +78 -75
  54. package/shared/localization/locales/ar.json +78 -75
  55. package/shared/localization/locales/bg.json +78 -75
  56. package/shared/localization/locales/ca.json +78 -75
  57. package/shared/localization/locales/cs.json +78 -75
  58. package/shared/localization/locales/da.json +78 -75
  59. package/shared/localization/locales/de.json +81 -78
  60. package/shared/localization/locales/el.json +84 -81
  61. package/shared/localization/locales/en-GB.json +78 -75
  62. package/shared/localization/locales/en-US.json +26 -23
  63. package/shared/localization/locales/en-XA.json +78 -75
  64. package/shared/localization/locales/en-XL.json +26 -23
  65. package/shared/localization/locales/es-419.json +78 -75
  66. package/shared/localization/locales/es.json +78 -75
  67. package/shared/localization/locales/fi.json +79 -76
  68. package/shared/localization/locales/fil.json +78 -75
  69. package/shared/localization/locales/fr.json +78 -75
  70. package/shared/localization/locales/he.json +78 -75
  71. package/shared/localization/locales/hi.json +78 -75
  72. package/shared/localization/locales/hr.json +78 -75
  73. package/shared/localization/locales/hu.json +78 -75
  74. package/shared/localization/locales/id.json +78 -75
  75. package/shared/localization/locales/it.json +79 -76
  76. package/shared/localization/locales/ja.json +78 -75
  77. package/shared/localization/locales/ko.json +78 -75
  78. package/shared/localization/locales/lt.json +78 -75
  79. package/shared/localization/locales/lv.json +78 -75
  80. package/shared/localization/locales/nl.json +78 -75
  81. package/shared/localization/locales/no.json +78 -75
  82. package/shared/localization/locales/pl.json +78 -75
  83. package/shared/localization/locales/pt-PT.json +78 -75
  84. package/shared/localization/locales/pt.json +79 -76
  85. package/shared/localization/locales/ro.json +78 -75
  86. package/shared/localization/locales/ru.json +78 -75
  87. package/shared/localization/locales/sk.json +78 -75
  88. package/shared/localization/locales/sl.json +78 -75
  89. package/shared/localization/locales/sr-Latn.json +78 -75
  90. package/shared/localization/locales/sr.json +78 -75
  91. package/shared/localization/locales/sv.json +78 -75
  92. package/shared/localization/locales/ta.json +78 -75
  93. package/shared/localization/locales/te.json +78 -75
  94. package/shared/localization/locales/th.json +78 -75
  95. package/shared/localization/locales/tr.json +78 -75
  96. package/shared/localization/locales/uk.json +78 -75
  97. package/shared/localization/locales/vi.json +78 -75
  98. package/shared/localization/locales/zh-HK.json +78 -75
  99. package/shared/localization/locales/zh-TW.json +79 -76
  100. package/shared/localization/locales/zh.json +78 -75
  101. package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +1 -0
  102. package/types/artifacts.d.ts +1 -0
  103. package/types/config.d.ts +0 -38
  104. package/types/internal/rxjs.d.ts +4 -0
  105. package/types/internal/smokehouse.d.ts +10 -5
  106. package/types/lhr/settings.d.ts +13 -0
@@ -37,6 +37,7 @@ Array [
37
37
  "bounceTrackingIssueDetails",
38
38
  "clientHintIssueDetails",
39
39
  "contentSecurityPolicyIssueDetails",
40
+ "cookieDeprecationMetadataIssueDetails",
40
41
  "cookieIssueDetails",
41
42
  "corsIssueDetails",
42
43
  "deprecationIssueDetails",
@@ -579,6 +579,7 @@ declare module Artifacts {
579
579
  bounceTrackingIssue: Crdp.Audits.BounceTrackingIssueDetails[];
580
580
  clientHintIssue: Crdp.Audits.ClientHintIssueDetails[];
581
581
  contentSecurityPolicyIssue: Crdp.Audits.ContentSecurityPolicyIssueDetails[];
582
+ cookieDeprecationMetadataIssue: Crdp.Audits.CookieDeprecationMetadataIssueDetails[],
582
583
  corsIssue: Crdp.Audits.CorsIssueDetails[];
583
584
  deprecationIssue: Crdp.Audits.DeprecationIssueDetails[];
584
585
  federatedAuthRequestIssue: Crdp.Audits.FederatedAuthRequestIssueDetails[],
package/types/config.d.ts CHANGED
@@ -34,45 +34,11 @@ declare module Config {
34
34
  interface ResolvedConfig {
35
35
  settings: Settings;
36
36
  artifacts: AnyArtifactDefn[] | null;
37
- navigations: NavigationDefn[] | null;
38
37
  audits: AuditDefn[] | null;
39
38
  categories: Record<string, Category> | null;
40
39
  groups: Record<string, Group> | null;
41
40
  }
42
41
 
43
- interface SharedPassNavigationJson {
44
- /**
45
- * Controls the behavior when the navigation fails to complete (due to server error, no FCP, etc).
46
- * Fatal means Lighthouse will exit immediately and return a runtimeError / non-zero exit code.
47
- * Warn means a toplevel warning will appear in the report, but the run will complete with success.
48
- * Ignore means a failure is expected and no action should be taken.
49
- */
50
- loadFailureMode?: 'fatal'|'warn'|'ignore';
51
- /** The number of milliseconds to wait after FCP until the page should be considered loaded. */
52
- pauseAfterFcpMs?: number;
53
- /** The number of milliseconds to wait after the load event until the page should be considered loaded. */
54
- pauseAfterLoadMs?: number;
55
- /** The number of milliseconds to wait between high priority network requests or 3 simulataneous requests before the page should be considered loaded. */
56
- networkQuietThresholdMs?: number;
57
- /** The number of milliseconds to wait between long tasks until the page should be considered loaded. */
58
- cpuQuietThresholdMs?: number;
59
- /** Substring patterns of network resources to block during this navigation, '*' wildcards supported though unnecessary as prefix or suffix (due to substring matching). */
60
- blockedUrlPatterns?: string[];
61
- /** The URL to use for the "blank" neutral page in between navigations. Defaults to `about:blank`. */
62
- blankPage?: string;
63
- }
64
-
65
- interface NavigationJson extends SharedPassNavigationJson {
66
- /** The identifier for the navigation. Config extension will deduplicate navigations with the same id. */
67
- id: string;
68
- /** Whether throttling settings should be skipped for the pass. */
69
- disableThrottling?: boolean;
70
- /** Whether storage clearing (service workers, cache storage) should be skipped for the pass. A run-wide setting of `true` takes precedence over this value. */
71
- disableStorageReset?: boolean;
72
- /** The array of artifacts to collect during the navigation. */
73
- artifacts?: Array<string>;
74
- }
75
-
76
42
  interface ArtifactJson {
77
43
  id: string;
78
44
  gatherer: GathererJson;
@@ -121,10 +87,6 @@ declare module Config {
121
87
 
122
88
  type Settings = ConfigSettings;
123
89
 
124
- interface NavigationDefn extends Omit<Required<NavigationJson>, 'artifacts'> {
125
- artifacts: AnyArtifactDefn[];
126
- }
127
-
128
90
  interface ArtifactDefn<TDependencies extends Gatherer.DependencyKey = Gatherer.DependencyKey> {
129
91
  id: string;
130
92
  gatherer: GathererDefn<TDependencies>;
@@ -25,5 +25,9 @@ declare module 'rxjs' {
25
25
  export const delay: any;
26
26
  export const startWith: any;
27
27
  export const switchMap: any;
28
+ export const bufferCount: any;
29
+ export const concatMap: any;
30
+ export const lastValueFrom: any;
31
+ export const takeUntil: any;
28
32
  }
29
33
 
@@ -56,14 +56,19 @@ declare global {
56
56
  {runnerName?: string} & ((url: string, config?: Config, runnerOptions?: {isDebug?: boolean}) => Promise<{lhr: LHResult, artifacts: Artifacts, log: string}>);
57
57
 
58
58
  export interface SmokehouseOptions {
59
- /** If true, performs extra logging from the test runs. */
60
- isDebug?: boolean;
59
+ /** Options to pass to the specific Lighthouse runner. */
60
+ testRunnerOptions?: {
61
+ /** If true, performs extra logging from the test runs. */
62
+ isDebug?: boolean;
63
+ /** Launch Chrome in the new headless mode (`--headless=new`), rather than the typical desktop headful mode. */
64
+ headless?: boolean;
65
+ };
61
66
  /** Manually set the number of jobs to run at once. `1` runs all tests serially. */
62
- jobs?: number;
67
+ jobs: number;
63
68
  /** The number of times to retry failing tests before accepting. Defaults to 0. */
64
- retries?: number;
69
+ retries: number;
65
70
  /** A function that runs Lighthouse with the given options. Defaults to running Lighthouse via the CLI. */
66
- lighthouseRunner?: LighthouseRunner;
71
+ lighthouseRunner: LighthouseRunner;
67
72
  /** A function that gets a list of URLs requested to the server since the last fetch. */
68
73
  takeNetworkRequestUrls?: () => string[];
69
74
  /** A function run once before all smoke tests. */
@@ -4,6 +4,8 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
+ import type {Protocol as Crdp} from 'devtools-protocol/types/protocol.js';
8
+
7
9
  import Budget from './budget.js';
8
10
 
9
11
  export type Locale = 'en-US'|'en'|'en-AU'|'en-GB'|'en-IE'|'en-SG'|'en-ZA'|'en-IN'|'ar-XB'|'ar'|'bg'|'ca'|'cs'|'da'|'de'|'el'|'en-XA'|'en-XL'|'es'|'es-419'|'es-AR'|'es-BO'|'es-BR'|'es-BZ'|'es-CL'|'es-CO'|'es-CR'|'es-CU'|'es-DO'|'es-EC'|'es-GT'|'es-HN'|'es-MX'|'es-NI'|'es-PA'|'es-PE'|'es-PR'|'es-PY'|'es-SV'|'es-US'|'es-UY'|'es-VE'|'fi'|'fil'|'fr'|'he'|'hi'|'hr'|'hu'|'gsw'|'id'|'in'|'it'|'iw'|'ja'|'ko'|'lt'|'lv'|'mo'|'nl'|'nb'|'no'|'pl'|'pt'|'pt-PT'|'ro'|'ru'|'sk'|'sl'|'sr'|'sr-Latn'|'sv'|'ta'|'te'|'th'|'tl'|'tr'|'uk'|'vi'|'zh'|'zh-HK'|'zh-TW';
@@ -69,6 +71,14 @@ export type ScreenEmulationSettings = {
69
71
  gatherMode?: boolean | string;
70
72
  /** Flag indicating that the browser storage should not be reset for the audit. */
71
73
  disableStorageReset?: boolean;
74
+ /**
75
+ * Flag indicating which kinds of browser storage should be reset for the audit.
76
+ * Cookies are not cleared by default, so the user isn't logged out.
77
+ * indexeddb, websql, and localstorage are not cleared by default to prevent
78
+ * loss of potentially important data.
79
+ * https://chromedevtools.github.io/debugger-protocol-viewer/tot/Storage/#type-StorageType
80
+ */
81
+ clearStorageTypes?: Crdp.Storage.StorageType[];
72
82
  /** Flag indicating that Lighthouse should pause after page load to wait for the user's permission to continue the audit. */
73
83
  debugNavigation?: boolean;
74
84
  /** If set to true, will skip the initial navigation to about:blank. */
@@ -114,6 +124,9 @@ export type ScreenEmulationSettings = {
114
124
  blankPage?: string;
115
125
  /** Disables collection of the full page screenshot, which can be rather large and possibly leave the page in an undesirable state. */
116
126
  disableFullPageScreenshot?: boolean;
127
+
128
+ /** Disables failing on 404 status code, and instead issues a warning */
129
+ ignoreStatusCode?: boolean;
117
130
  }
118
131
 
119
132
  export interface ConfigSettings extends Required<SharedFlagsSettings> {