lighthouse 9.5.0-dev.20220807 → 9.5.0-dev.20220810

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 (155) hide show
  1. package/cli/test/smokehouse/readme.md +6 -2
  2. package/cli/test/smokehouse/report-assert-test.js +34 -0
  3. package/cli/test/smokehouse/report-assert.js +28 -8
  4. package/core/audits/accessibility/accesskeys.js +1 -1
  5. package/core/audits/accessibility/aria-allowed-attr.js +1 -1
  6. package/core/audits/accessibility/aria-command-name.js +1 -1
  7. package/core/audits/accessibility/aria-hidden-body.js +1 -1
  8. package/core/audits/accessibility/aria-hidden-focus.js +1 -1
  9. package/core/audits/accessibility/aria-input-field-name.js +1 -1
  10. package/core/audits/accessibility/aria-meter-name.js +1 -1
  11. package/core/audits/accessibility/aria-progressbar-name.js +1 -1
  12. package/core/audits/accessibility/aria-required-attr.js +1 -1
  13. package/core/audits/accessibility/aria-required-children.js +1 -1
  14. package/core/audits/accessibility/aria-required-parent.js +1 -1
  15. package/core/audits/accessibility/aria-roles.js +1 -1
  16. package/core/audits/accessibility/aria-toggle-field-name.js +1 -1
  17. package/core/audits/accessibility/aria-tooltip-name.js +1 -1
  18. package/core/audits/accessibility/aria-treeitem-name.js +1 -1
  19. package/core/audits/accessibility/aria-valid-attr-value.js +1 -1
  20. package/core/audits/accessibility/aria-valid-attr.js +1 -1
  21. package/core/audits/accessibility/axe-audit.js +1 -1
  22. package/core/audits/accessibility/button-name.js +1 -1
  23. package/core/audits/accessibility/bypass.js +1 -1
  24. package/core/audits/accessibility/color-contrast.js +1 -1
  25. package/core/audits/accessibility/definition-list.js +1 -1
  26. package/core/audits/accessibility/dlitem.js +1 -1
  27. package/core/audits/accessibility/document-title.js +1 -1
  28. package/core/audits/accessibility/duplicate-id-active.js +1 -1
  29. package/core/audits/accessibility/duplicate-id-aria.js +1 -1
  30. package/core/audits/accessibility/form-field-multiple-labels.js +1 -1
  31. package/core/audits/accessibility/frame-title.js +1 -1
  32. package/core/audits/accessibility/heading-order.js +1 -1
  33. package/core/audits/accessibility/html-has-lang.js +1 -1
  34. package/core/audits/accessibility/html-lang-valid.js +1 -1
  35. package/core/audits/accessibility/image-alt.js +1 -1
  36. package/core/audits/accessibility/input-image-alt.js +1 -1
  37. package/core/audits/accessibility/label.js +1 -1
  38. package/core/audits/accessibility/link-name.js +1 -1
  39. package/core/audits/accessibility/list.js +1 -1
  40. package/core/audits/accessibility/listitem.js +1 -1
  41. package/core/audits/accessibility/meta-refresh.js +1 -1
  42. package/core/audits/accessibility/meta-viewport.js +1 -1
  43. package/core/audits/accessibility/object-alt.js +1 -1
  44. package/core/audits/accessibility/tabindex.js +1 -1
  45. package/core/audits/accessibility/td-headers-attr.js +1 -1
  46. package/core/audits/accessibility/th-has-data-cells.js +1 -1
  47. package/core/audits/accessibility/valid-lang.js +1 -1
  48. package/core/audits/accessibility/video-caption.js +1 -1
  49. package/core/audits/autocomplete.js +1 -1
  50. package/core/audits/bootup-time.js +1 -1
  51. package/core/audits/byte-efficiency/byte-efficiency-audit.js +1 -1
  52. package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
  53. package/core/audits/byte-efficiency/efficient-animated-content.js +1 -1
  54. package/core/audits/byte-efficiency/legacy-javascript.js +1 -1
  55. package/core/audits/byte-efficiency/modern-image-formats.js +1 -1
  56. package/core/audits/byte-efficiency/offscreen-images.js +1 -1
  57. package/core/audits/byte-efficiency/render-blocking-resources.js +1 -1
  58. package/core/audits/byte-efficiency/total-byte-weight.js +1 -1
  59. package/core/audits/byte-efficiency/unminified-css.js +1 -1
  60. package/core/audits/byte-efficiency/unminified-javascript.js +1 -1
  61. package/core/audits/byte-efficiency/unused-css-rules.js +1 -1
  62. package/core/audits/byte-efficiency/unused-javascript.js +1 -1
  63. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +1 -1
  64. package/core/audits/byte-efficiency/uses-optimized-images.js +1 -1
  65. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +1 -1
  66. package/core/audits/byte-efficiency/uses-responsive-images.js +1 -1
  67. package/core/audits/byte-efficiency/uses-text-compression.js +1 -1
  68. package/core/audits/content-width.js +1 -1
  69. package/core/audits/critical-request-chains.js +1 -1
  70. package/core/audits/csp-xss.js +1 -1
  71. package/core/audits/deprecations.js +1 -1
  72. package/core/audits/dobetterweb/charset.js +1 -1
  73. package/core/audits/dobetterweb/doctype.js +1 -1
  74. package/core/audits/dobetterweb/dom-size.js +1 -1
  75. package/core/audits/dobetterweb/geolocation-on-start.js +1 -1
  76. package/core/audits/dobetterweb/inspector-issues.js +1 -1
  77. package/core/audits/dobetterweb/js-libraries.js +1 -1
  78. package/core/audits/dobetterweb/no-document-write.js +1 -1
  79. package/core/audits/dobetterweb/no-vulnerable-libraries.js +1 -1
  80. package/core/audits/dobetterweb/notification-on-start.js +1 -1
  81. package/core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +1 -1
  82. package/core/audits/dobetterweb/uses-http2.js +1 -1
  83. package/core/audits/dobetterweb/uses-passive-event-listeners.js +1 -1
  84. package/core/audits/errors-in-console.js +1 -1
  85. package/core/audits/font-display.js +1 -1
  86. package/core/audits/image-aspect-ratio.js +1 -1
  87. package/core/audits/image-size-responsive.js +1 -1
  88. package/core/audits/installable-manifest.js +1 -1
  89. package/core/audits/is-on-https.js +1 -1
  90. package/core/audits/largest-contentful-paint-element.js +1 -1
  91. package/core/audits/layout-shift-elements.js +1 -1
  92. package/core/audits/lcp-lazy-loaded.js +1 -1
  93. package/core/audits/long-tasks.js +1 -1
  94. package/core/audits/mainthread-work-breakdown.js +1 -1
  95. package/core/audits/manual/pwa-cross-browser.js +1 -1
  96. package/core/audits/manual/pwa-each-page-has-url.js +1 -1
  97. package/core/audits/manual/pwa-page-transitions.js +1 -1
  98. package/core/audits/maskable-icon.js +1 -1
  99. package/core/audits/metrics/cumulative-layout-shift.js +1 -1
  100. package/core/audits/metrics/experimental-interaction-to-next-paint.js +1 -1
  101. package/core/audits/metrics/first-contentful-paint.js +1 -1
  102. package/core/audits/metrics/first-meaningful-paint.js +1 -1
  103. package/core/audits/metrics/interactive.js +1 -1
  104. package/core/audits/metrics/largest-contentful-paint.js +1 -1
  105. package/core/audits/metrics/max-potential-fid.js +1 -1
  106. package/core/audits/metrics/speed-index.js +1 -1
  107. package/core/audits/metrics/total-blocking-time.js +1 -1
  108. package/core/audits/network-rtt.js +1 -1
  109. package/core/audits/network-server-latency.js +1 -1
  110. package/core/audits/no-unload-listeners.js +1 -1
  111. package/core/audits/non-composited-animations.js +1 -1
  112. package/core/audits/performance-budget.js +1 -1
  113. package/core/audits/predictive-perf.js +1 -1
  114. package/core/audits/preload-fonts.js +1 -1
  115. package/core/audits/preload-lcp-image.js +1 -1
  116. package/core/audits/redirects.js +1 -1
  117. package/core/audits/resource-summary.js +1 -1
  118. package/core/audits/seo/canonical.js +1 -1
  119. package/core/audits/seo/crawlable-anchors.js +1 -1
  120. package/core/audits/seo/font-size.js +1 -1
  121. package/core/audits/seo/hreflang.js +1 -1
  122. package/core/audits/seo/http-status-code.js +1 -1
  123. package/core/audits/seo/is-crawlable.js +1 -1
  124. package/core/audits/seo/link-text.js +1 -1
  125. package/core/audits/seo/manual/structured-data.js +1 -1
  126. package/core/audits/seo/meta-description.js +1 -1
  127. package/core/audits/seo/plugins.js +1 -1
  128. package/core/audits/seo/robots-txt.js +1 -1
  129. package/core/audits/seo/tap-targets.js +1 -1
  130. package/core/audits/server-response-time.js +1 -1
  131. package/core/audits/service-worker.js +1 -1
  132. package/core/audits/splash-screen.js +1 -1
  133. package/core/audits/themed-omnibox.js +1 -1
  134. package/core/audits/third-party-facades.js +1 -1
  135. package/core/audits/third-party-summary.js +1 -1
  136. package/core/audits/timing-budget.js +1 -1
  137. package/core/audits/unsized-images.js +1 -1
  138. package/core/audits/user-timings.js +1 -1
  139. package/core/audits/uses-rel-preconnect.js +1 -1
  140. package/core/audits/uses-rel-preload.js +1 -1
  141. package/core/audits/valid-source-maps.js +1 -1
  142. package/core/audits/viewport.js +1 -1
  143. package/core/audits/work-during-interaction.js +1 -1
  144. package/core/config/default-config.js +1 -1
  145. package/core/gather/driver/environment.js +1 -1
  146. package/core/gather/driver/navigation.js +1 -1
  147. package/core/gather/driver/storage.js +1 -1
  148. package/core/lib/csp-evaluator.js +1 -1
  149. package/core/lib/deprecations-strings.js +1 -1
  150. package/core/lib/i18n/i18n.js +0 -2
  151. package/core/lib/lh-error.js +1 -1
  152. package/core/lib/navigation-error.js +1 -1
  153. package/core/lib/stack-packs.js +1 -1
  154. package/package.json +4 -4
  155. package/shared/test/localization/format-test.js +8 -8
@@ -46,7 +46,7 @@ const UIStrings = {
46
46
  unsupportedTimingParameters: 'Effect has unsupported timing parameters',
47
47
  };
48
48
 
49
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
49
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
50
50
 
51
51
  /**
52
52
  * Each failure reason is represented by a bit flag. The bit shift operator '<<' is used to define which bit corresponds to each failure reason.
@@ -25,7 +25,7 @@ const UIStrings = {
25
25
  }`,
26
26
  };
27
27
 
28
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
28
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
29
29
 
30
30
  /** @typedef {import('../computed/resource-summary.js').ResourceEntry} ResourceEntry */
31
31
  /** @typedef {{resourceType: LH.Budget.ResourceType, label: LH.IcuMessage, requestCount: number, transferSize: number, sizeOverBudget: number | undefined, countOverBudget: LH.IcuMessage | undefined}} BudgetItem */
@@ -18,7 +18,7 @@ import LanternLcp from '../computed/metrics/lantern-largest-contentful-paint.js'
18
18
  const SCORING_P10 = 3651;
19
19
  const SCORING_MEDIAN = 10000;
20
20
 
21
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, {});
21
+ const str_ = i18n.createIcuMessageFn(import.meta.url, {});
22
22
 
23
23
  class PredictivePerf extends Audit {
24
24
  /**
@@ -26,7 +26,7 @@ const UIStrings = {
26
26
  description: 'Preload `optional` fonts so first-time visitors may use them. [Learn more about preloading fonts](https://web.dev/preload-optional-fonts/)',
27
27
  };
28
28
 
29
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
29
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
30
30
 
31
31
  class PreloadFontsAudit extends Audit {
32
32
  /**
@@ -21,7 +21,7 @@ const UIStrings = {
21
21
  'image in order to improve LCP. [Learn more about preloading LCP elements](https://web.dev/optimize-lcp/#preload-important-resources).',
22
22
  };
23
23
 
24
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
24
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
25
25
 
26
26
  /**
27
27
  * @typedef {Array<{url: string, initiatorType: string}>} InitiatorPath
@@ -20,7 +20,7 @@ const UIStrings = {
20
20
  description: 'Redirects introduce additional delays before the page can be loaded. [Learn how to avoid page redirects](https://web.dev/redirects/).',
21
21
  };
22
22
 
23
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
23
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
24
24
 
25
25
  class Redirects extends Audit {
26
26
  /**
@@ -22,7 +22,7 @@ const UIStrings = {
22
22
  `other {# requests • {byteCount, number, bytes} KiB}}`,
23
23
  };
24
24
 
25
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
25
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
26
26
 
27
27
  class ResourceSummary extends Audit {
28
28
  /**
@@ -43,7 +43,7 @@ const UIStrings = {
43
43
  'instead of an equivalent page of content',
44
44
  };
45
45
 
46
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
46
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
47
47
 
48
48
  /**
49
49
  * @typedef CanonicalURLData
@@ -19,7 +19,7 @@ const UIStrings = {
19
19
  columnFailingLink: 'Uncrawlable Link',
20
20
  };
21
21
 
22
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
22
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
23
23
 
24
24
  class CrawlableAnchors extends Audit {
25
25
  /**
@@ -38,7 +38,7 @@ const UIStrings = {
38
38
  columnFontSize: 'Font Size',
39
39
  };
40
40
 
41
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
41
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
42
42
 
43
43
  /**
44
44
  * @param {Array<FailingNodeData>} fontSizeArtifact
@@ -31,7 +31,7 @@ const UIStrings = {
31
31
  notFullyQualified: 'Relative href value',
32
32
  };
33
33
 
34
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
34
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
35
35
 
36
36
  /**
37
37
  * @param {string} href
@@ -22,7 +22,7 @@ const UIStrings = {
22
22
  '[Learn more about HTTP status codes](https://web.dev/http-status-code/).',
23
23
  };
24
24
 
25
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
25
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
26
26
 
27
27
  class HTTPStatusCode extends Audit {
28
28
  /**
@@ -30,7 +30,7 @@ const UIStrings = {
30
30
  'if they don\'t have permission to crawl them. [Learn more about crawler directives](https://web.dev/is-crawable/).',
31
31
  };
32
32
 
33
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
33
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
34
34
 
35
35
  /**
36
36
  * Checks if given directive is a valid unavailable_after directive with a date in the past
@@ -92,7 +92,7 @@ const UIStrings = {
92
92
  }`,
93
93
  };
94
94
 
95
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
95
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
96
96
 
97
97
  class LinkText extends Audit {
98
98
  /**
@@ -15,7 +15,7 @@ const UIStrings = {
15
15
  title: 'Structured data is valid',
16
16
  };
17
17
 
18
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
18
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
19
19
 
20
20
  /**
21
21
  * @fileoverview Manual SEO audit to check if structured data on page is valid.
@@ -21,7 +21,7 @@ const UIStrings = {
21
21
  explanation: 'Description text is empty.',
22
22
  };
23
23
 
24
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
24
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
25
25
 
26
26
  class Description extends Audit {
27
27
  /**
@@ -44,7 +44,7 @@ const UIStrings = {
44
44
  '[Learn more about avoiding plugins](https://web.dev/plugins/).',
45
45
  };
46
46
 
47
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
47
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
48
48
 
49
49
  /**
50
50
  * Verifies if given MIME type matches any known plugin MIME type
@@ -57,7 +57,7 @@ const UIStrings = {
57
57
  explanation: 'Lighthouse was unable to download a robots.txt file',
58
58
  };
59
59
 
60
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
60
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
61
61
 
62
62
  /**
63
63
  * @param {string} directiveName
@@ -43,7 +43,7 @@ const UIStrings = {
43
43
  displayValue: '{decimalProportion, number, percent} appropriately sized tap targets',
44
44
  };
45
45
 
46
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
46
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
47
47
 
48
48
  const FINGER_SIZE_PX = 48;
49
49
  // Ratio of the finger area tapping on an unintended element
@@ -20,7 +20,7 @@ const UIStrings = {
20
20
  displayValue: `Root document took {timeInMs, number, milliseconds}\xa0ms`,
21
21
  };
22
22
 
23
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
23
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
24
24
 
25
25
  // Due to the way that DevTools throttling works we cannot see if server response took less than ~570ms.
26
26
  // We set our failure threshold to 600ms to avoid those false positives but we want devs to shoot for 100ms.
@@ -39,7 +39,7 @@ const UIStrings = {
39
39
  'the `start_url` ({startUrl}) is not in the service worker\'s scope ({scopeUrl})',
40
40
  };
41
41
 
42
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
42
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
43
43
 
44
44
  class ServiceWorker extends Audit {
45
45
  /**
@@ -20,7 +20,7 @@ const UIStrings = {
20
20
  '[Learn more about splash screens](https://web.dev/splash-screen/).',
21
21
  };
22
22
 
23
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
23
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
24
24
 
25
25
  /**
26
26
  * @fileoverview
@@ -20,7 +20,7 @@ const UIStrings = {
20
20
  '[Learn more about theming the address bar](https://web.dev/themed-omnibox/).',
21
21
  };
22
22
 
23
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
23
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
24
24
 
25
25
  /**
26
26
  * @fileoverview
@@ -67,7 +67,7 @@ const UIStrings = {
67
67
  categorySocial: '{productName} (Social)',
68
68
  };
69
69
 
70
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
70
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
71
71
 
72
72
  /** @type {Record<string, string>} */
73
73
  const CATEGORY_UI_MAP = {
@@ -29,7 +29,7 @@ const UIStrings = {
29
29
  `{timeInMs, number, milliseconds}\xa0ms`,
30
30
  };
31
31
 
32
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
32
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
33
33
 
34
34
  // A page passes when all third-party code blocks for less than 250 ms.
35
35
  const PASS_THRESHOLD_IN_MS = 250;
@@ -22,7 +22,7 @@ const UIStrings = {
22
22
  columnMeasurement: 'Measurement',
23
23
  };
24
24
 
25
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
25
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
26
26
 
27
27
  /** @typedef {{metric: LH.Budget.TimingMetric, label: LH.IcuMessage, measurement?: LH.Audit.Details.NumericValue|number, overBudget?: LH.Audit.Details.NumericValue|number}} BudgetItem */
28
28
 
@@ -23,7 +23,7 @@ const UIStrings = {
23
23
  description: 'Set an explicit width and height on image elements to reduce layout shifts and improve CLS. [Learn how to set image dimensions](https://web.dev/optimize-cls/#images-without-dimensions)',
24
24
  };
25
25
 
26
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
26
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
27
27
 
28
28
  class UnsizedImages extends Audit {
29
29
  /**
@@ -25,7 +25,7 @@ const UIStrings = {
25
25
  columnType: 'Type',
26
26
  };
27
27
 
28
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
28
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
29
29
 
30
30
  /** @typedef {{name: string, isMark: true, args: LH.TraceEvent['args'], startTime: number}} MarkEvent */
31
31
  /** @typedef {{name: string, isMark: false, args: LH.TraceEvent['args'], startTime: number, endTime: number, duration: number}} MeasureEvent */
@@ -52,7 +52,7 @@ const UIStrings = {
52
52
  'These should be used sparingly and only to the most important origins.',
53
53
  };
54
54
 
55
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
55
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
56
56
 
57
57
  class UsesRelPreconnectAudit extends Audit {
58
58
  /**
@@ -30,7 +30,7 @@ const UIStrings = {
30
30
  'by the browser. Check that you are using the `crossorigin` attribute properly.',
31
31
  };
32
32
 
33
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
33
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
34
34
 
35
35
  const THRESHOLD_IN_MS = 100;
36
36
 
@@ -30,7 +30,7 @@ const UIStrings = {
30
30
  }`,
31
31
  };
32
32
 
33
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
33
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
34
34
 
35
35
  const LARGE_JS_BYTE_THRESHOLD = 500 * 1024;
36
36
 
@@ -23,7 +23,7 @@ const UIStrings = {
23
23
  explanationNoTag: 'No `<meta name="viewport">` tag found',
24
24
  };
25
25
 
26
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
26
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
27
27
 
28
28
  class Viewport extends Audit {
29
29
  /**
@@ -44,7 +44,7 @@ const UIStrings = {
44
44
  eventTarget: 'Event target',
45
45
  };
46
46
 
47
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
47
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
48
48
 
49
49
  /**
50
50
  * @fileoverview This metric gives a high-percentile measure of responsiveness to input.
@@ -121,7 +121,7 @@ const UIStrings = {
121
121
  pwaOptimizedGroupTitle: 'PWA Optimized',
122
122
  };
123
123
 
124
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
124
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
125
125
 
126
126
  // Ensure all artifact IDs match the typedefs.
127
127
  /** @type {Record<keyof LH.FRArtifacts, string>} */
@@ -27,7 +27,7 @@ const UIStrings = {
27
27
  */
28
28
  const SLOW_CPU_BENCHMARK_INDEX_THRESHOLD = 1000;
29
29
 
30
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
30
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
31
31
 
32
32
  /**
33
33
  * @param {LH.Gatherer.FRProtocolSession} session
@@ -28,7 +28,7 @@ const UIStrings = {
28
28
  'Results may be incomplete.',
29
29
  };
30
30
 
31
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
31
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
32
32
 
33
33
 
34
34
  // Controls how long to wait after FCP before continuing
@@ -24,7 +24,7 @@ const UIStrings = {
24
24
  }`,
25
25
  };
26
26
 
27
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
27
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
28
28
 
29
29
 
30
30
  /**
@@ -88,7 +88,7 @@ const UIStrings = {
88
88
  'Plain URL schemes allow scripts to be sourced from an unsafe domain.',
89
89
  };
90
90
 
91
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
91
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
92
92
 
93
93
  /** @type {Record<number, string|LH.IcuMessage|Record<string, LH.IcuMessage>>} */
94
94
  const FINDING_TO_UI_STRING = {
@@ -269,7 +269,7 @@ const UIStrings = {
269
269
  '`supportsSession()` is deprecated. Please use `isSessionSupported()` and check the resolved boolean value instead.',
270
270
  };
271
271
 
272
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
272
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
273
273
 
274
274
  /**
275
275
  * @param {LH.Crdp.Audits.DeprecationIssueDetails} issueDetails
@@ -217,6 +217,4 @@ export {
217
217
  lookupLocale,
218
218
  createIcuMessageFn,
219
219
  isStringOrIcuMessage,
220
- // TODO: exported for backwards compatibility. Consider removing on future breaking change.
221
- createIcuMessageFn as createMessageInstanceIdFn,
222
220
  };
@@ -89,7 +89,7 @@ const UIStrings = {
89
89
  oldChromeDoesNotSupportFeature: 'This version of Chrome is too old to support \'{featureName}\'. Use a newer version to see full results.',
90
90
  };
91
91
 
92
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
92
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
93
93
 
94
94
 
95
95
  /**
@@ -19,7 +19,7 @@ const UIStrings = {
19
19
  'The page MIME type is XHTML: Lighthouse does not explicitly support this document type',
20
20
  };
21
21
 
22
- const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
22
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
23
23
 
24
24
  // MIME types are case-insensitive but Chrome normalizes MIME types to be lowercase.
25
25
  const HTML_MIME_TYPE = 'text/html';
@@ -86,7 +86,7 @@ function getStackPacks(pageStacks) {
86
86
  }
87
87
 
88
88
  // Create i18n handler to get translated strings.
89
- const str_ = i18n.createMessageInstanceIdFn(
89
+ const str_ = i18n.createIcuMessageFn(
90
90
  `node_modules/lighthouse-stack-packs/packs/${matchedPack.id}.js`,
91
91
  matchedPack.UIStrings
92
92
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "9.5.0-dev.20220807",
4
+ "version": "9.5.0-dev.20220810",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {
@@ -168,7 +168,7 @@
168
168
  "pako": "^2.0.3",
169
169
  "preact": "^10.7.2",
170
170
  "pretty-json-stringify": "^0.0.2",
171
- "puppeteer": "13.7.0",
171
+ "puppeteer": "^16.1.0",
172
172
  "resolve": "^1.20.0",
173
173
  "rollup": "^2.52.7",
174
174
  "rollup-plugin-node-resolve": "^5.2.0",
@@ -189,7 +189,7 @@
189
189
  "axe-core": "4.4.1",
190
190
  "chrome-launcher": "^0.15.1",
191
191
  "configstore": "^5.0.1",
192
- "csp_evaluator": "1.1.0",
192
+ "csp_evaluator": "1.1.1",
193
193
  "cssstyle": "1.2.1",
194
194
  "enquirer": "^2.3.6",
195
195
  "http-link-header": "^0.8.0",
@@ -204,7 +204,7 @@
204
204
  "open": "^8.4.0",
205
205
  "parse-cache-control": "1.0.1",
206
206
  "ps-list": "^8.0.0",
207
- "puppeteer-core": "^13.7.0",
207
+ "puppeteer-core": "^16.1.0",
208
208
  "robots-parser": "^3.0.0",
209
209
  "semver": "^5.3.0",
210
210
  "speedline-core": "^1.4.3",
@@ -85,7 +85,7 @@ describe('format', () => {
85
85
  it('replaces the references in the LHR', () => {
86
86
  const fakeFile = path.join(__dirname, 'fake-file-number-2.js');
87
87
  const UIStrings = {aString: 'different {x}!'};
88
- const formatter = i18n.createMessageInstanceIdFn(fakeFile, UIStrings);
88
+ const formatter = i18n.createIcuMessageFn(fakeFile, UIStrings);
89
89
 
90
90
  const title = formatter(UIStrings.aString, {x: 1});
91
91
  const lhr = {audits: {'fake-audit': {title}}};
@@ -115,14 +115,14 @@ describe('format', () => {
115
115
  describe('#getFormatted', () => {
116
116
  it('returns the formatted string', () => {
117
117
  const UIStrings = {testMessage: 'happy test'};
118
- const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
118
+ const str_ = i18n.createIcuMessageFn(__filename, UIStrings);
119
119
  const formattedStr = format.getFormatted(str_(UIStrings.testMessage), 'en');
120
120
  expect(formattedStr).toEqual('happy test');
121
121
  });
122
122
 
123
123
  it('returns the formatted string with replacements', () => {
124
124
  const UIStrings = {testMessage: 'replacement test ({errorCode})'};
125
- const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
125
+ const str_ = i18n.createIcuMessageFn(__filename, UIStrings);
126
126
  const formattedStr = format.getFormatted(str_(UIStrings.testMessage,
127
127
  {errorCode: 'BOO'}), 'en');
128
128
  expect(formattedStr).toEqual('replacement test (BOO)');
@@ -131,7 +131,7 @@ describe('format', () => {
131
131
  it('throws an error for invalid locales', () => {
132
132
  // Populate a string to try to localize to a bad locale.
133
133
  const UIStrings = {testMessage: 'testy test'};
134
- const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
134
+ const str_ = i18n.createIcuMessageFn(__filename, UIStrings);
135
135
 
136
136
  expect(_ => format.getFormatted(str_(UIStrings.testMessage), 'still-not-a-locale'))
137
137
  .toThrow(`Unsupported locale 'still-not-a-locale'`);
@@ -141,7 +141,7 @@ describe('format', () => {
141
141
  const UIStrings = {
142
142
  testMessage: 'needs {count, number, bytes}KB test {str} in {timeInMs, number, seconds}s',
143
143
  };
144
- const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
144
+ const str_ = i18n.createIcuMessageFn(__filename, UIStrings);
145
145
 
146
146
  const replacements = {
147
147
  count: 2555,
@@ -184,7 +184,7 @@ describe('format', () => {
184
184
  format.registerLocaleData('en-XZ', localeData);
185
185
 
186
186
  const UIStrings = {testString: 'en-US string!'};
187
- const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
187
+ const str_ = i18n.createIcuMessageFn(__filename, UIStrings);
188
188
  const formattedStr = format.getFormatted(str_(UIStrings.testString), 'en-XZ');
189
189
  expect(formattedStr).toEqual('en-XZ cuerda!');
190
190
  });
@@ -192,7 +192,7 @@ describe('format', () => {
192
192
  it('overwrites existing locale strings', async () => {
193
193
  const filename = 'core/audits/is-on-https.js';
194
194
  const {UIStrings} = await import('../../../core/audits/is-on-https.js');
195
- const str_ = i18n.createMessageInstanceIdFn(filename, UIStrings);
195
+ const str_ = i18n.createIcuMessageFn(filename, UIStrings);
196
196
 
197
197
  // To start with, we get back the intended string..
198
198
  const origTitle = format.getFormatted(str_(UIStrings.title), 'es-419');
@@ -324,7 +324,7 @@ describe('format', () => {
324
324
 
325
325
  let str_;
326
326
  before(() => {
327
- str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
327
+ str_ = i18n.createIcuMessageFn(__filename, UIStrings);
328
328
  });
329
329
 
330
330
  it('formats a basic message', () => {