lighthouse 9.3.1 → 9.4.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 (58) hide show
  1. package/dist/report/bundle.esm.js +38 -24
  2. package/dist/report/flow.js +5 -5
  3. package/dist/report/standalone.js +9 -9
  4. package/flow-report/src/topbar.tsx +1 -1
  5. package/flow-report/src/wrappers/report.tsx +2 -1
  6. package/flow-report/test/topbar-test.tsx +1 -1
  7. package/lighthouse-cli/bin.js +1 -4
  8. package/lighthouse-cli/run.js +1 -1
  9. package/lighthouse-cli/test/smokehouse/core-tests.js +4 -5
  10. package/lighthouse-cli/test/smokehouse/readme.md +4 -0
  11. package/lighthouse-cli/test/smokehouse/report-assert.js +36 -0
  12. package/lighthouse-core/audits/autocomplete.js +34 -37
  13. package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +1 -0
  14. package/lighthouse-core/audits/seo/hreflang.js +2 -17
  15. package/lighthouse-core/config/default-config.js +2 -2
  16. package/lighthouse-core/fraggle-rock/config/default-config.js +3 -3
  17. package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +50 -31
  18. package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +4 -5
  19. package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +4 -5
  20. package/lighthouse-core/fraggle-rock/user-flow.js +8 -6
  21. package/lighthouse-core/gather/driver/navigation.js +29 -10
  22. package/lighthouse-core/gather/driver/network-monitor.js +8 -6
  23. package/lighthouse-core/gather/driver/prepare.js +13 -7
  24. package/lighthouse-core/gather/driver/wait-for-condition.js +11 -4
  25. package/lighthouse-core/gather/gather-runner.js +1 -1
  26. package/lighthouse-core/gather/gatherers/full-page-screenshot.js +35 -9
  27. package/lighthouse-core/gather/gatherers/inputs.js +113 -0
  28. package/lighthouse-core/index.js +3 -3
  29. package/lighthouse-core/lib/page-functions.js +11 -1
  30. package/lighthouse-core/lib/sentry.js +39 -24
  31. package/lighthouse-core/runner.js +79 -52
  32. package/lighthouse-core/util-commonjs.js +4 -0
  33. package/package.json +2 -3
  34. package/readme.md +1 -1
  35. package/report/assets/templates.html +2 -5
  36. package/report/renderer/components.js +3 -3
  37. package/report/renderer/dom.js +1 -3
  38. package/report/renderer/report-ui-features.js +25 -17
  39. package/report/renderer/topbar-features.js +5 -1
  40. package/report/renderer/util.js +4 -0
  41. package/report/test/renderer/__snapshots__/report-renderer-axe-test.js.snap +107 -0
  42. package/report/test/renderer/report-renderer-axe-test.js +38 -17
  43. package/report/test-assets/faux-psi.js +2 -1
  44. package/report/types/report-renderer.d.ts +21 -2
  45. package/shared/localization/locales/en-US.json +7 -1
  46. package/shared/localization/locales/en-XL.json +7 -1
  47. package/third-party/axe/LICENSE +362 -0
  48. package/third-party/axe/README.md +6 -0
  49. package/third-party/axe/valid-langs.js +110 -0
  50. package/third-party/snyk/snapshot.json +1 -0
  51. package/tsconfig.json +1 -0
  52. package/types/artifacts.d.ts +14 -14
  53. package/types/global-lh.d.ts +1 -0
  54. package/types/parse-cache-control/index.d.ts +1 -0
  55. package/types/smokehouse.d.ts +3 -0
  56. package/changelog.md +0 -5803
  57. package/lighthouse-core/gather/gatherers/form-elements.js +0 -113
  58. package/lighthouse-core/scripts/package.json +0 -4
@@ -139,8 +139,8 @@ export interface GathererArtifacts extends PublicGathererArtifacts,LegacyBaseArt
139
139
  Fonts: Artifacts.Font[];
140
140
  /** Information on poorly sized font usage and the text affected by it. */
141
141
  FontSize: Artifacts.FontSize;
142
- /** All the form elements in the page and formless inputs. */
143
- FormElements: Artifacts.Form[];
142
+ /** All the input elements, including associated form and label elements. */
143
+ Inputs: {inputs: Artifacts.InputElement[]; forms: Artifacts.FormElement[]; labels: Artifacts.LabelElement[]};
144
144
  /** Screenshot of the entire page (rather than just the above the fold content). */
145
145
  FullPageScreenshot: Artifacts.FullPageScreenshot | null;
146
146
  /** Information about event listeners registered on the global object. */
@@ -787,22 +787,22 @@ declare module Artifacts {
787
787
  observedSpeedIndexTs: number;
788
788
  }
789
789
 
790
- interface Form {
791
- /** If attributes is missing that means this is a formless set of elements. */
792
- attributes?: {
793
- id: string;
794
- name: string;
795
- autocomplete: string;
796
- };
797
- node: NodeDetails | null;
798
- inputs: Array<FormInput>;
799
- labels: Array<FormLabel>;
790
+ interface FormElement {
791
+ id: string;
792
+ name: string;
793
+ autocomplete: string;
794
+ node: NodeDetails;
800
795
  }
801
796
 
802
797
  /** Attributes collected for every input element in the inputs array from the forms interface. */
803
- interface FormInput {
798
+ interface InputElement {
799
+ /** If set, the parent form is the index into the associated FormElement array. Otherwise, the input element has no parent form. */
800
+ parentFormIndex?: number;
801
+ /** Array of indices into associated LabelElement array. */
802
+ labelIndices: number[];
804
803
  id: string;
805
804
  name: string;
805
+ type: string;
806
806
  placeholder?: string;
807
807
  autocomplete: {
808
808
  property: string;
@@ -813,7 +813,7 @@ declare module Artifacts {
813
813
  }
814
814
 
815
815
  /** Attributes collected for every label element in the labels array from the forms interface */
816
- interface FormLabel {
816
+ interface LabelElement {
817
817
  for: string;
818
818
  node: NodeDetails;
819
819
  }
@@ -26,6 +26,7 @@ import Treemap_ from './lhr/treemap';
26
26
  declare global {
27
27
  module LH {
28
28
  export type ArbitraryEqualityMap = ArbitraryEqualityMap_;
29
+ export type NavigationRequestor = string | (() => Promise<void> | void);
29
30
 
30
31
  // artifacts.d.ts
31
32
  export import Artifacts = Artifacts_.Artifacts;
@@ -12,6 +12,7 @@ declare module 'parse-cache-control' {
12
12
  'no-cache'?: boolean;
13
13
  'no-store'?: boolean;
14
14
  'private'?: boolean;
15
+ 'stale-while-revalidate'?: boolean;
15
16
  }
16
17
 
17
18
  function ParseCacheControl(headers?: string): CacheHeaders | null;
@@ -20,6 +20,9 @@ declare global {
20
20
  code?: any;
21
21
  message?: any;
22
22
  };
23
+ timing?: {
24
+ entries?: any
25
+ }
23
26
  }
24
27
 
25
28
  export type ExpectedRunnerResult = {