lighthouse 11.4.0-dev.20240103 → 11.4.0-dev.20240105

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 (43) hide show
  1. package/cli/test/smokehouse/core-tests.js +2 -0
  2. package/core/audits/audit.d.ts +5 -0
  3. package/core/audits/audit.js +42 -2
  4. package/core/audits/byte-efficiency/byte-efficiency-audit.js +1 -1
  5. package/core/audits/layout-shift-elements.js +1 -1
  6. package/core/audits/layout-shifts.d.ts +33 -0
  7. package/core/audits/layout-shifts.js +158 -0
  8. package/core/audits/viewport.js +10 -0
  9. package/core/computed/metrics/cumulative-layout-shift.d.ts +2 -2
  10. package/core/computed/trace-engine-result.d.ts +40 -0
  11. package/core/computed/trace-engine-result.js +69 -0
  12. package/core/computed/viewport-meta.d.ts +4 -0
  13. package/core/computed/viewport-meta.js +6 -1
  14. package/core/config/default-config.js +3 -0
  15. package/core/config/metrics-to-audits.js +1 -0
  16. package/core/gather/driver/wait-for-condition.js +1 -1
  17. package/core/gather/gatherers/root-causes.d.ts +20 -0
  18. package/core/gather/gatherers/root-causes.js +133 -0
  19. package/core/gather/gatherers/trace-elements.d.ts +38 -7
  20. package/core/gather/gatherers/trace-elements.js +113 -34
  21. package/core/gather/gatherers/trace.js +3 -0
  22. package/core/gather/session.js +16 -3
  23. package/core/lib/i18n/i18n.js +2 -0
  24. package/core/lib/trace-engine.d.ts +5 -2
  25. package/core/lib/trace-engine.js +3 -0
  26. package/dist/report/bundle.esm.js +9 -5
  27. package/dist/report/flow.js +6 -2
  28. package/dist/report/standalone.js +11 -7
  29. package/package.json +4 -4
  30. package/report/assets/styles.css +4 -0
  31. package/report/renderer/category-renderer.d.ts +0 -7
  32. package/report/renderer/category-renderer.js +2 -12
  33. package/report/renderer/components.js +1 -1
  34. package/report/renderer/performance-category-renderer.d.ts +2 -3
  35. package/report/renderer/performance-category-renderer.js +3 -4
  36. package/shared/localization/locales/en-US.json +24 -0
  37. package/shared/localization/locales/en-XL.json +24 -0
  38. package/types/artifacts.d.ts +10 -1
  39. package/types/audit.d.ts +9 -1
  40. package/types/config.d.ts +1 -1
  41. package/types/lhr/audit-result.d.ts +1 -4
  42. package/types/lhr/lhr.d.ts +1 -3
  43. package/types/trace-engine.d.ts +1516 -0
@@ -6,7 +6,6 @@
6
6
 
7
7
  import {FormattedIcu} from './i18n.js';
8
8
  import AuditDetails from './audit-details.js';
9
- import LHResult from './lhr.js';
10
9
 
11
10
  interface ScoreDisplayModes {
12
11
  /** Scores of 0-1 (map to displayed scores of 0-100). */
@@ -32,9 +31,7 @@ interface ScoreDisplayModes {
32
31
 
33
32
  type ScoreDisplayMode = ScoreDisplayModes[keyof ScoreDisplayModes];
34
33
 
35
- export type MetricSavings = {
36
- [M in LHResult.MetricAcronym]?: number;
37
- };
34
+ export type MetricSavings = Partial<Record<string, number>>;
38
35
 
39
36
  /** Audit result returned in Lighthouse report. All audits offer a description and score of 0-1. */
40
37
  export interface Result {
@@ -115,7 +115,7 @@ declare module Result {
115
115
  /** Optional grouping within the category. Matches the key of a Result.Group. */
116
116
  group?: string;
117
117
  /** The conventional acronym for the audit/metric. */
118
- acronym?: MetricAcronym;
118
+ acronym?: string;
119
119
  /** Any audit IDs closely relevant to this one. */
120
120
  relevantAudits?: string[];
121
121
  }
@@ -197,8 +197,6 @@ declare module Result {
197
197
 
198
198
  /** Gather mode used to collect artifacts. */
199
199
  type GatherMode = 'navigation'|'timespan'|'snapshot';
200
-
201
- type MetricAcronym = 'FCP' | 'LCP' | 'TBT' | 'CLS' | 'INP' | 'SI' | 'TTI' | 'FMP';
202
200
  }
203
201
 
204
202
  export default Result;