@paulirish/trace_engine 0.0.60 → 0.0.61

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 (145) hide show
  1. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
  2. package/generated/protocol.d.ts +10 -9
  3. package/locales/af.json +9 -0
  4. package/locales/am.json +10 -1
  5. package/locales/ar.json +20 -11
  6. package/locales/as.json +9 -0
  7. package/locales/az.json +10 -1
  8. package/locales/be.json +9 -0
  9. package/locales/bg.json +9 -0
  10. package/locales/bn.json +9 -0
  11. package/locales/bs.json +10 -1
  12. package/locales/ca.json +9 -0
  13. package/locales/cs.json +9 -0
  14. package/locales/cy.json +10 -1
  15. package/locales/da.json +9 -0
  16. package/locales/de.json +9 -0
  17. package/locales/el.json +9 -0
  18. package/locales/en-GB.json +9 -0
  19. package/locales/en-US.json +18 -18
  20. package/locales/en-XL.json +18 -18
  21. package/locales/es-419.json +9 -0
  22. package/locales/es.json +9 -0
  23. package/locales/et.json +9 -0
  24. package/locales/eu.json +10 -1
  25. package/locales/fa.json +11 -2
  26. package/locales/fi.json +9 -0
  27. package/locales/fil.json +9 -0
  28. package/locales/fr-CA.json +10 -1
  29. package/locales/fr.json +9 -0
  30. package/locales/gl.json +9 -0
  31. package/locales/gu.json +9 -0
  32. package/locales/he.json +32 -23
  33. package/locales/hi.json +9 -0
  34. package/locales/hr.json +9 -0
  35. package/locales/hu.json +9 -0
  36. package/locales/hy.json +9 -0
  37. package/locales/id.json +9 -0
  38. package/locales/is.json +9 -0
  39. package/locales/it.json +9 -0
  40. package/locales/ja.json +9 -0
  41. package/locales/ka.json +10 -1
  42. package/locales/kk.json +9 -0
  43. package/locales/km.json +10 -1
  44. package/locales/kn.json +11 -2
  45. package/locales/ko.json +10 -1
  46. package/locales/ky.json +9 -0
  47. package/locales/lo.json +10 -1
  48. package/locales/lt.json +9 -0
  49. package/locales/lv.json +10 -1
  50. package/locales/mk.json +9 -0
  51. package/locales/ml.json +11 -2
  52. package/locales/mn.json +9 -0
  53. package/locales/mr.json +9 -0
  54. package/locales/ms.json +9 -0
  55. package/locales/my.json +11 -2
  56. package/locales/ne.json +9 -0
  57. package/locales/nl.json +9 -0
  58. package/locales/no.json +9 -0
  59. package/locales/or.json +9 -0
  60. package/locales/pa.json +9 -0
  61. package/locales/pl.json +9 -0
  62. package/locales/pt-PT.json +9 -0
  63. package/locales/pt.json +9 -0
  64. package/locales/ro.json +10 -1
  65. package/locales/ru.json +9 -0
  66. package/locales/si.json +9 -0
  67. package/locales/sk.json +9 -0
  68. package/locales/sl.json +9 -0
  69. package/locales/sq.json +10 -1
  70. package/locales/sr-Latn.json +9 -0
  71. package/locales/sr.json +9 -0
  72. package/locales/sv.json +9 -0
  73. package/locales/sw.json +9 -0
  74. package/locales/ta.json +9 -0
  75. package/locales/te.json +10 -1
  76. package/locales/th.json +9 -0
  77. package/locales/tr.json +9 -0
  78. package/locales/uk.json +9 -0
  79. package/locales/ur.json +10 -1
  80. package/locales/uz.json +9 -0
  81. package/locales/vi.json +9 -0
  82. package/locales/zh-HK.json +9 -0
  83. package/locales/zh-TW.json +10 -1
  84. package/locales/zh.json +9 -0
  85. package/locales/zu.json +9 -0
  86. package/models/trace/extras/extras.d.ts +0 -3978
  87. package/models/trace/extras/extras.js +0 -3978
  88. package/models/trace/handlers/UserTimingsHandler.d.ts +1 -1
  89. package/models/trace/handlers/UserTimingsHandler.js +1 -1
  90. package/models/trace/handlers/UserTimingsHandler.js.map +1 -1
  91. package/models/trace/insights/CLSCulprits.d.ts +1 -1
  92. package/models/trace/insights/CLSCulprits.js +2 -1
  93. package/models/trace/insights/CLSCulprits.js.map +1 -1
  94. package/models/trace/insights/Cache.d.ts +1 -1
  95. package/models/trace/insights/Cache.js +2 -1
  96. package/models/trace/insights/Cache.js.map +1 -1
  97. package/models/trace/insights/DOMSize.d.ts +1 -1
  98. package/models/trace/insights/DOMSize.js +2 -1
  99. package/models/trace/insights/DOMSize.js.map +1 -1
  100. package/models/trace/insights/DocumentLatency.d.ts +1 -1
  101. package/models/trace/insights/DocumentLatency.js +2 -1
  102. package/models/trace/insights/DocumentLatency.js.map +1 -1
  103. package/models/trace/insights/DuplicatedJavaScript.d.ts +1 -1
  104. package/models/trace/insights/DuplicatedJavaScript.js +2 -1
  105. package/models/trace/insights/DuplicatedJavaScript.js.map +1 -1
  106. package/models/trace/insights/FontDisplay.d.ts +1 -1
  107. package/models/trace/insights/FontDisplay.js +2 -1
  108. package/models/trace/insights/FontDisplay.js.map +1 -1
  109. package/models/trace/insights/ForcedReflow.d.ts +1 -1
  110. package/models/trace/insights/ForcedReflow.js +2 -1
  111. package/models/trace/insights/ForcedReflow.js.map +1 -1
  112. package/models/trace/insights/INPBreakdown.d.ts +1 -1
  113. package/models/trace/insights/INPBreakdown.js +2 -1
  114. package/models/trace/insights/INPBreakdown.js.map +1 -1
  115. package/models/trace/insights/ImageDelivery.d.ts +1 -1
  116. package/models/trace/insights/ImageDelivery.js +2 -1
  117. package/models/trace/insights/ImageDelivery.js.map +1 -1
  118. package/models/trace/insights/LCPBreakdown.d.ts +1 -1
  119. package/models/trace/insights/LCPBreakdown.js +2 -1
  120. package/models/trace/insights/LCPBreakdown.js.map +1 -1
  121. package/models/trace/insights/LCPDiscovery.d.ts +1 -1
  122. package/models/trace/insights/LCPDiscovery.js +2 -1
  123. package/models/trace/insights/LCPDiscovery.js.map +1 -1
  124. package/models/trace/insights/LegacyJavaScript.d.ts +1 -1
  125. package/models/trace/insights/LegacyJavaScript.js +2 -1
  126. package/models/trace/insights/LegacyJavaScript.js.map +1 -1
  127. package/models/trace/insights/ModernHTTP.d.ts +1 -1
  128. package/models/trace/insights/ModernHTTP.js +2 -1
  129. package/models/trace/insights/ModernHTTP.js.map +1 -1
  130. package/models/trace/insights/NetworkDependencyTree.d.ts +1 -1
  131. package/models/trace/insights/NetworkDependencyTree.js +2 -1
  132. package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
  133. package/models/trace/insights/RenderBlocking.js +2 -1
  134. package/models/trace/insights/RenderBlocking.js.map +1 -1
  135. package/models/trace/insights/SlowCSSSelector.d.ts +1 -1
  136. package/models/trace/insights/SlowCSSSelector.js +2 -1
  137. package/models/trace/insights/SlowCSSSelector.js.map +1 -1
  138. package/models/trace/insights/ThirdParties.js +2 -1
  139. package/models/trace/insights/ThirdParties.js.map +1 -1
  140. package/models/trace/insights/Viewport.d.ts +1 -1
  141. package/models/trace/insights/Viewport.js +2 -1
  142. package/models/trace/insights/Viewport.js.map +1 -1
  143. package/models/trace/insights/types.d.ts +2 -1
  144. package/models/trace/insights/types.js.map +1 -1
  145. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ThirdParties.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/ThirdParties.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,yDAAyD,CAAC;AACzF,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EACL,eAAe,EACf,WAAW,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,gJAAgJ;IAChJ,KAAK,EAAE,aAAa;IACpB;;;OAGG;IACH,WAAW,EAAE,4DAA4D;QACrE,0KAA0K;IAC9K,iFAAiF;IACjF,gBAAgB,EAAE,WAAW;IAC7B,4GAA4G;IAC5G,kBAAkB,EAAE,eAAe;IACnC,wJAAwJ;IACxJ,oBAAoB,EAAE,kBAAkB;IACxC;;OAEG;IACH,cAAc,EAAE,wBAAwB;CAChC,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,uCAAuC,EAAE,SAAS,CAAC,CAAC;AAC7F,MAAM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QAAQ,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party-web.js';\nimport * as Extras from '../extras/extras.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport type * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /** Title of an insight that provides details about the code on a web page that the user doesn't control (referred to as \"third-party code\"). */\n title: '3rd parties',\n /**\n * @description Description of a DevTools insight that identifies the code on the page that the user doesn't control.\n * This is displayed after a user expands the section to see more. No character length limits.\n */\n description: '3rd party code can significantly impact load performance. ' +\n '[Reduce and defer loading of 3rd party code](https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/) to prioritize your page\\'s content.',\n /** Label for a table column that displays the name of a third-party provider. */\n columnThirdParty: '3rd party',\n /** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */\n columnTransferSize: 'Transfer size',\n /** Label for a table column that displays how much time each row spent running on the main thread, entries will be the number of milliseconds spent. */\n columnMainThreadTime: 'Main thread time',\n /**\n * @description Text block indicating that no third party content was detected on the page\n */\n noThirdParties: 'No third parties found',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/ThirdParties.ts', UIStrings);\nexport const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type ThirdPartiesInsightModel = InsightModel<typeof UIStrings, {\n /** The entity for this navigation's URL. Any other entity is from a third party. */\n entitySummaries: Extras.ThirdParties.EntitySummary[],\n firstPartyEntity?: Extras.ThirdParties.Entity,\n}>;\n\nfunction getRelatedEvents(\n summaries: Extras.ThirdParties.EntitySummary[],\n firstPartyEntity: Extras.ThirdParties.Entity|undefined): Types.Events.Event[] {\n const relatedEvents = [];\n for (const summary of summaries) {\n if (summary.entity !== firstPartyEntity) {\n relatedEvents.push(...summary.relatedEvents);\n }\n }\n\n return relatedEvents;\n}\n\nfunction finalize(partialModel: PartialInsightModel<ThirdPartiesInsightModel>): ThirdPartiesInsightModel {\n return {\n insightKey: InsightKeys.THIRD_PARTIES,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n category: InsightCategory.ALL,\n state: partialModel.entitySummaries.find(summary => summary.entity !== partialModel.firstPartyEntity) ?\n 'informative' :\n 'pass',\n ...partialModel,\n };\n}\n\nexport function isThirdPartyInsight(model: InsightModel): model is ThirdPartiesInsightModel {\n return model.insightKey === InsightKeys.THIRD_PARTIES;\n}\n\nexport function generateInsight(\n data: Handlers.Types.HandlerData, context: InsightSetContext): ThirdPartiesInsightModel {\n const entitySummaries = Extras.ThirdParties.summarizeByThirdParty(data as Handlers.Types.HandlerData, context.bounds);\n\n const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ?? data.Meta.mainFrameURL;\n const firstPartyEntity = ThirdPartyWeb.ThirdPartyWeb.getEntity(firstPartyUrl) ||\n Handlers.Helpers.makeUpEntity(data.Renderer.entityMappings.createdEntityCache, firstPartyUrl);\n\n return finalize({\n relatedEvents: getRelatedEvents(entitySummaries, firstPartyEntity),\n firstPartyEntity,\n entitySummaries,\n });\n}\n\nexport function createOverlaysForSummary(summary: Extras.ThirdParties.EntitySummary): Types.Overlays.Overlay[] {\n const overlays = [];\n for (const event of summary.relatedEvents) {\n // The events found for a third party can be vast, as they gather every\n // single main thread task along with everything else on the page. If the\n // main thread is busy with large icicles, we can easily create tens of\n // thousands of overlays. Therefore, only create overlays for events of at least 1ms.\n if (event.dur === undefined || event.dur < 1_000) {\n continue;\n }\n\n const overlay: Types.Overlays.Overlay = {\n type: 'ENTRY_OUTLINE',\n entry: event,\n outlineReason: 'INFO',\n };\n overlays.push(overlay);\n }\n return overlays;\n}\n\nexport function createOverlays(model: ThirdPartiesInsightModel): Types.Overlays.Overlay[] {\n const overlays: Types.Overlays.Overlay[] = [];\n const summaries = model.entitySummaries ?? [];\n for (const summary of summaries) {\n if (summary.entity === model.firstPartyEntity) {\n continue;\n }\n\n const summaryOverlays = createOverlaysForSummary(summary);\n overlays.push(...summaryOverlays);\n }\n\n return overlays;\n}\n"]}
1
+ {"version":3,"file":"ThirdParties.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/ThirdParties.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,yDAAyD,CAAC;AACzF,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EACL,eAAe,EACf,WAAW,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,gJAAgJ;IAChJ,KAAK,EAAE,aAAa;IACpB;;;OAGG;IACH,WAAW,EAAE,4DAA4D;QACrE,wJAAwJ;IAC5J,iFAAiF;IACjF,gBAAgB,EAAE,WAAW;IAC7B,4GAA4G;IAC5G,kBAAkB,EAAE,eAAe;IACnC,wJAAwJ;IACxJ,oBAAoB,EAAE,kBAAkB;IACxC;;OAEG;IACH,cAAc,EAAE,wBAAwB;CAChC,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,uCAAuC,EAAE,SAAS,CAAC,CAAC;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAQ7E,SAAS,gBAAgB,CACrB,SAA8C,EAC9C,gBAAsD;IACxD,MAAM,aAA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SD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party-web.js';\nimport * as Extras from '../extras/extras.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport type * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /** Title of an insight that provides details about the code on a web page that the user doesn't control (referred to as \"third-party code\"). */\n title: '3rd parties',\n /**\n * @description Description of a DevTools insight that identifies the code on the page that the user doesn't control.\n * This is displayed after a user expands the section to see more. No character length limits.\n */\n description: '3rd party code can significantly impact load performance. ' +\n '[Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page\\'s content.',\n /** Label for a table column that displays the name of a third-party provider. */\n columnThirdParty: '3rd party',\n /** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */\n columnTransferSize: 'Transfer size',\n /** Label for a table column that displays how much time each row spent running on the main thread, entries will be the number of milliseconds spent. */\n columnMainThreadTime: 'Main thread time',\n /**\n * @description Text block indicating that no third party content was detected on the page\n */\n noThirdParties: 'No third parties found',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/ThirdParties.ts', UIStrings);\nexport const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type ThirdPartiesInsightModel = InsightModel<typeof UIStrings, {\n /** The entity for this navigation's URL. Any other entity is from a third party. */\n entitySummaries: Extras.ThirdParties.EntitySummary[],\n firstPartyEntity?: Extras.ThirdParties.Entity,\n}>;\n\nfunction getRelatedEvents(\n summaries: Extras.ThirdParties.EntitySummary[],\n firstPartyEntity: Extras.ThirdParties.Entity|undefined): Types.Events.Event[] {\n const relatedEvents = [];\n for (const summary of summaries) {\n if (summary.entity !== firstPartyEntity) {\n relatedEvents.push(...summary.relatedEvents);\n }\n }\n\n return relatedEvents;\n}\n\nfunction finalize(partialModel: PartialInsightModel<ThirdPartiesInsightModel>): ThirdPartiesInsightModel {\n return {\n insightKey: InsightKeys.THIRD_PARTIES,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/third-parties',\n category: InsightCategory.ALL,\n state: partialModel.entitySummaries.find(summary => summary.entity !== partialModel.firstPartyEntity) ?\n 'informative' :\n 'pass',\n ...partialModel,\n };\n}\n\nexport function isThirdPartyInsight(model: InsightModel): model is ThirdPartiesInsightModel {\n return model.insightKey === InsightKeys.THIRD_PARTIES;\n}\n\nexport function generateInsight(\n data: Handlers.Types.HandlerData, context: InsightSetContext): ThirdPartiesInsightModel {\n const entitySummaries = Extras.ThirdParties.summarizeByThirdParty(data as Handlers.Types.HandlerData, context.bounds);\n\n const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ?? data.Meta.mainFrameURL;\n const firstPartyEntity = ThirdPartyWeb.ThirdPartyWeb.getEntity(firstPartyUrl) ||\n Handlers.Helpers.makeUpEntity(data.Renderer.entityMappings.createdEntityCache, firstPartyUrl);\n\n return finalize({\n relatedEvents: getRelatedEvents(entitySummaries, firstPartyEntity),\n firstPartyEntity,\n entitySummaries,\n });\n}\n\nexport function createOverlaysForSummary(summary: Extras.ThirdParties.EntitySummary): Types.Overlays.Overlay[] {\n const overlays = [];\n for (const event of summary.relatedEvents) {\n // The events found for a third party can be vast, as they gather every\n // single main thread task along with everything else on the page. If the\n // main thread is busy with large icicles, we can easily create tens of\n // thousands of overlays. Therefore, only create overlays for events of at least 1ms.\n if (event.dur === undefined || event.dur < 1_000) {\n continue;\n }\n\n const overlay: Types.Overlays.Overlay = {\n type: 'ENTRY_OUTLINE',\n entry: event,\n outlineReason: 'INFO',\n };\n overlays.push(overlay);\n }\n return overlays;\n}\n\nexport function createOverlays(model: ThirdPartiesInsightModel): Types.Overlays.Overlay[] {\n const overlays: Types.Overlays.Overlay[] = [];\n const summaries = model.entitySummaries ?? [];\n for (const summary of summaries) {\n if (summary.entity === model.firstPartyEntity) {\n continue;\n }\n\n const summaryOverlays = createOverlaysForSummary(summary);\n overlays.push(...summaryOverlays);\n }\n\n return overlays;\n}\n"]}
@@ -8,7 +8,7 @@ export declare const UIStrings: {
8
8
  /**
9
9
  * @description Text to tell the user how a viewport meta element can improve performance. \xa0 is a non-breaking space
10
10
  */
11
- readonly description: "Tap interactions may be [delayed by up to 300 ms](https://developer.chrome.com/blog/300ms-tap-delay-gone-away/) if the viewport is not optimized for mobile.";
11
+ readonly description: "Tap interactions may be [delayed by up to 300 ms](https://developer.chrome.com/docs/performance/insights/viewport) if the viewport is not optimized for mobile.";
12
12
  /**
13
13
  * @description Text for a label describing the portion of an interaction event that was delayed due to a bad mobile viewport.
14
14
  */
@@ -13,7 +13,7 @@ export const UIStrings = {
13
13
  /**
14
14
  * @description Text to tell the user how a viewport meta element can improve performance. \xa0 is a non-breaking space
15
15
  */
16
- description: 'Tap interactions may be [delayed by up to 300\xA0ms](https://developer.chrome.com/blog/300ms-tap-delay-gone-away/) if the viewport is not optimized for mobile.',
16
+ description: 'Tap interactions may be [delayed by up to 300\xA0ms](https://developer.chrome.com/docs/performance/insights/viewport) if the viewport is not optimized for mobile.',
17
17
  /**
18
18
  * @description Text for a label describing the portion of an interaction event that was delayed due to a bad mobile viewport.
19
19
  */
@@ -27,6 +27,7 @@ function finalize(partialModel) {
27
27
  strings: UIStrings,
28
28
  title: i18nString(UIStrings.title),
29
29
  description: i18nString(UIStrings.description),
30
+ docs: 'https://developer.chrome.com/docs/performance/insights/viewport',
30
31
  category: InsightCategory.INP,
31
32
  state: partialModel.mobileOptimized === false ? 'fail' : 'pass',
32
33
  ...partialModel,
@@ -1 +1 @@
1
- {"version":3,"file":"Viewport.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Viewport.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IA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,CAAC;QACF,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;YAC1F,cAAc,EAAE,aAAa;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n InsightWarning,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /** Title of an insight that provides details about if the page's viewport is optimized for mobile viewing. */\n title: 'Optimize viewport for mobile',\n /**\n * @description Text to tell the user how a viewport meta element can improve performance. \\xa0 is a non-breaking space\n */\n description:\n 'Tap interactions may be [delayed by up to 300\\xA0ms](https://developer.chrome.com/blog/300ms-tap-delay-gone-away/) if the viewport is not optimized for mobile.',\n /**\n * @description Text for a label describing the portion of an interaction event that was delayed due to a bad mobile viewport.\n */\n mobileTapDelayLabel: 'Mobile tap delay',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/Viewport.ts', UIStrings);\nexport const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type ViewportInsightModel = InsightModel<typeof UIStrings, {\n mobileOptimized: boolean | null,\n viewportEvent?: Types.Events.ParseMetaViewport,\n longPointerInteractions?: Types.Events.SyntheticInteractionPair[],\n}>;\n\nfunction finalize(partialModel: PartialInsightModel<ViewportInsightModel>): ViewportInsightModel {\n return {\n insightKey: InsightKeys.VIEWPORT,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n category: InsightCategory.INP,\n state: partialModel.mobileOptimized === false ? 'fail' : 'pass',\n ...partialModel,\n };\n}\n\nexport function isViewportInsight(model: InsightModel): model is ViewportInsightModel {\n return model.insightKey === InsightKeys.VIEWPORT;\n}\n\nexport function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ViewportInsightModel {\n const viewportEvent = data.UserInteractions.parseMetaViewportEvents.find(event => {\n if (event.args.data.frame !== context.frameId) {\n return false;\n }\n\n return Helpers.Timing.eventIsInBounds(event, context.bounds);\n });\n\n const compositorEvents = data.UserInteractions.beginCommitCompositorFrameEvents.filter(event => {\n if (event.args.frame !== context.frameId) {\n return false;\n }\n\n // Commit compositor frame events can be emitted before the viewport tag is parsed.\n // We shouldn't count these since the browser hasn't had time to make the viewport mobile optimized.\n if (viewportEvent && event.ts < viewportEvent.ts) {\n return false;\n }\n\n return Helpers.Timing.eventIsInBounds(event, context.bounds);\n });\n\n if (!compositorEvents.length) {\n // Trace doesn't have the data we need.\n return finalize({\n mobileOptimized: null,\n warnings: [InsightWarning.NO_LAYOUT],\n });\n }\n\n // Returns true only if all events are mobile optimized.\n for (const event of compositorEvents) {\n if (!event.args.is_mobile_optimized) {\n // Grab all the pointer events with at least 50ms of input delay.\n const longPointerInteractions = [...data.UserInteractions.interactionsOverThreshold.values()].filter(\n interaction => Handlers.ModelHandlers.UserInteractions.categoryOfInteraction(interaction) === 'POINTER' &&\n interaction.inputDelay >= 50_000);\n\n // The actual impact varies between 0 and 300.\n // Using inputDelay as the closest thing we have for measuring this, though inputDelay may be high for other reasons.\n // b/371566378#comment8\n const inputDelay = Math.max(0, ...longPointerInteractions.map(interaction => interaction.inputDelay)) / 1000;\n const inpMetricSavings = Platform.NumberUtilities.clamp(inputDelay, 0, 300);\n\n return finalize({\n mobileOptimized: false,\n viewportEvent,\n longPointerInteractions,\n metricSavings: {INP: inpMetricSavings as Types.Timing.Milli},\n });\n }\n }\n\n return finalize({\n mobileOptimized: true,\n viewportEvent,\n });\n}\n\nexport function createOverlays(model: ViewportInsightModel): Types.Overlays.Overlay[] {\n if (!model.longPointerInteractions) {\n return [];\n }\n\n return model.longPointerInteractions.map(interaction => {\n const delay = Math.min(interaction.inputDelay, 300 * 1000);\n const bounds = Helpers.Timing.traceWindowFromMicroSeconds(\n Types.Timing.Micro(interaction.ts),\n Types.Timing.Micro(interaction.ts + delay),\n );\n return {\n type: 'TIMESPAN_BREAKDOWN',\n entry: interaction,\n sections: [{bounds, label: i18nString(UIStrings.mobileTapDelayLabel), showDuration: true}],\n renderLocation: 'ABOVE_EVENT',\n };\n });\n}\n"]}
1
+ {"version":3,"file":"Viewport.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Viewport.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EACL,eAAe,EACf,WAAW,EAGX,cAAc,GAEf,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8GAA8G;IAC9G,KAAK,EAAE,8BAA8B;IACrC;;OAEG;IACH,WAAW,EACP,oKAAoK;IACxK;;OAEG;IACH,mBAAmB,EAAE,kBAAkB;CAC/B,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,mCAAmC,EAAE,SAAS,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAQ7E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AAC;IAED,OAAO,QAAQ,CAAC;QACd,eAAe,EAAE,IAAI;QACrB,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA2B;IACxD,IAAI,CAAC,KAAK,CAAC,uBAAuB,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,2BAA2B,CACrD,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,EAClC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,GAAG,KAAK,CAAC,CAC7C,CAAC;QACF,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;YAC1F,cAAc,EAAE,aAAa;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n InsightWarning,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /** Title of an insight that provides details about if the page's viewport is optimized for mobile viewing. */\n title: 'Optimize viewport for mobile',\n /**\n * @description Text to tell the user how a viewport meta element can improve performance. \\xa0 is a non-breaking space\n */\n description:\n 'Tap interactions may be [delayed by up to 300\\xA0ms](https://developer.chrome.com/docs/performance/insights/viewport) if the viewport is not optimized for mobile.',\n /**\n * @description Text for a label describing the portion of an interaction event that was delayed due to a bad mobile viewport.\n */\n mobileTapDelayLabel: 'Mobile tap delay',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/Viewport.ts', UIStrings);\nexport const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type ViewportInsightModel = InsightModel<typeof UIStrings, {\n mobileOptimized: boolean | null,\n viewportEvent?: Types.Events.ParseMetaViewport,\n longPointerInteractions?: Types.Events.SyntheticInteractionPair[],\n}>;\n\nfunction finalize(partialModel: PartialInsightModel<ViewportInsightModel>): ViewportInsightModel {\n return {\n insightKey: InsightKeys.VIEWPORT,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/viewport',\n category: InsightCategory.INP,\n state: partialModel.mobileOptimized === false ? 'fail' : 'pass',\n ...partialModel,\n };\n}\n\nexport function isViewportInsight(model: InsightModel): model is ViewportInsightModel {\n return model.insightKey === InsightKeys.VIEWPORT;\n}\n\nexport function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ViewportInsightModel {\n const viewportEvent = data.UserInteractions.parseMetaViewportEvents.find(event => {\n if (event.args.data.frame !== context.frameId) {\n return false;\n }\n\n return Helpers.Timing.eventIsInBounds(event, context.bounds);\n });\n\n const compositorEvents = data.UserInteractions.beginCommitCompositorFrameEvents.filter(event => {\n if (event.args.frame !== context.frameId) {\n return false;\n }\n\n // Commit compositor frame events can be emitted before the viewport tag is parsed.\n // We shouldn't count these since the browser hasn't had time to make the viewport mobile optimized.\n if (viewportEvent && event.ts < viewportEvent.ts) {\n return false;\n }\n\n return Helpers.Timing.eventIsInBounds(event, context.bounds);\n });\n\n if (!compositorEvents.length) {\n // Trace doesn't have the data we need.\n return finalize({\n mobileOptimized: null,\n warnings: [InsightWarning.NO_LAYOUT],\n });\n }\n\n // Returns true only if all events are mobile optimized.\n for (const event of compositorEvents) {\n if (!event.args.is_mobile_optimized) {\n // Grab all the pointer events with at least 50ms of input delay.\n const longPointerInteractions = [...data.UserInteractions.interactionsOverThreshold.values()].filter(\n interaction => Handlers.ModelHandlers.UserInteractions.categoryOfInteraction(interaction) === 'POINTER' &&\n interaction.inputDelay >= 50_000);\n\n // The actual impact varies between 0 and 300.\n // Using inputDelay as the closest thing we have for measuring this, though inputDelay may be high for other reasons.\n // b/371566378#comment8\n const inputDelay = Math.max(0, ...longPointerInteractions.map(interaction => interaction.inputDelay)) / 1000;\n const inpMetricSavings = Platform.NumberUtilities.clamp(inputDelay, 0, 300);\n\n return finalize({\n mobileOptimized: false,\n viewportEvent,\n longPointerInteractions,\n metricSavings: {INP: inpMetricSavings as Types.Timing.Milli},\n });\n }\n }\n\n return finalize({\n mobileOptimized: true,\n viewportEvent,\n });\n}\n\nexport function createOverlays(model: ViewportInsightModel): Types.Overlays.Overlay[] {\n if (!model.longPointerInteractions) {\n return [];\n }\n\n return model.longPointerInteractions.map(interaction => {\n const delay = Math.min(interaction.inputDelay, 300 * 1000);\n const bounds = Helpers.Timing.traceWindowFromMicroSeconds(\n Types.Timing.Micro(interaction.ts),\n Types.Timing.Micro(interaction.ts + delay),\n );\n return {\n type: 'TIMESPAN_BREAKDOWN',\n entry: interaction,\n sections: [{bounds, label: i18nString(UIStrings.mobileTapDelayLabel), showDuration: true}],\n renderLocation: 'ABOVE_EVENT',\n };\n });\n}\n"]}
@@ -58,6 +58,7 @@ export type InsightModel<UIStrings extends Record<string, string> = Record<strin
58
58
  strings: UIStrings;
59
59
  title: {i18nId: string, values: Record<string, string|number>, formattedDefault: string};
60
60
  description: {i18nId: string, values: Record<string, string|number>, formattedDefault: string};
61
+ docs: string;
61
62
  category: InsightCategory;
62
63
  state: 'pass' | 'fail' | 'informative';
63
64
  /** Used by RelatedInsightChips.ts */
@@ -81,7 +82,7 @@ export type InsightModel<UIStrings extends Record<string, string> = Record<strin
81
82
  /** This is lazily-generated because some insights may create many overlays. */
82
83
  createOverlays?: () => Types.Overlays.Overlay[];
83
84
  };
84
- export type PartialInsightModel<T> = Omit<T, 'strings' | 'title' | 'description' | 'category' | 'state' | 'insightKey' | 'navigationId' | 'frameId'>;
85
+ export type PartialInsightModel<T> = Omit<T, 'strings' | 'title' | 'description' | 'docs' | 'category' | 'state' | 'insightKey' | 'navigationId' | 'frameId'>;
85
86
  /**
86
87
  * Contains insights for a specific navigation. If a trace began after a navigation already started,
87
88
  * this could instead represent the duration from the beginning of the trace up to the first recorded
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAsC7B,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAYD,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;AACb,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAyED,MAAM,CAAN,IAAY,WAmBX;AAnBD,WAAY,WAAW;IACrB,6CAA8B,CAAA;IAC9B,6CAA8B,CAAA;IAC9B,2CAA4B,CAAA;IAC5B,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,mCAAoB,CAAA;IACpB,4DAA6C,CAAA;IAC7C,2CAA4B,CAAA;IAC5B,6CAA8B,CAAA;IAC9B,+CAAgC,CAAA;IAChC,6CAA8B,CAAA;IAC9B,qDAAsC,CAAA;IACtC,gEAAiD,CAAA;IACjD,iDAAkC,CAAA;IAClC,oDAAqC,CAAA;IACrC,oCAAqB,CAAA;IACrB,yCAA0B,CAAA;IAC1B,8BAAe,CAAA;AACjB,CAAC,EAnBW,WAAW,KAAX,WAAW,QAmBtB","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../../core/common/common.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport type * as Types from '../types/types.js';\n\nimport type * as Models from './Models.js';\n\n/**\n * Context for the portion of the trace an insight should look at.\n */\nexport type InsightSetContext = InsightSetContextWithoutNavigation|InsightSetContextWithNavigation;\n\nexport interface InsightSetContextWithoutNavigation {\n options: Types.Configuration.ParseOptions;\n bounds: Types.Timing.TraceWindowMicro;\n frameId: string;\n navigation?: never;\n}\n\nexport interface InsightSetContextWithNavigation {\n options: Types.Configuration.ParseOptions;\n bounds: Types.Timing.TraceWindowMicro;\n frameId: string;\n navigation: Types.Events.NavigationStart;\n navigationId: string;\n lantern?: LanternContext;\n}\n\nexport interface LanternContext {\n requests: Array<Lantern.Types.NetworkRequest<Types.Events.SyntheticNetworkRequest>>;\n graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;\n simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;\n metrics: Record<string, Lantern.Metrics.MetricResult>;\n}\n\nexport type InsightModelsType = typeof Models;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n NO_LAYOUT = 'NO_LAYOUT',\n}\n\nexport interface MetricSavings {\n /* eslint-disable @typescript-eslint/naming-convention */\n FCP?: Types.Timing.Milli;\n LCP?: Types.Timing.Milli;\n TBT?: Types.Timing.Milli;\n CLS?: number;\n INP?: Types.Timing.Milli;\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport enum InsightCategory {\n ALL = 'All',\n INP = 'INP',\n LCP = 'LCP',\n CLS = 'CLS',\n}\n\nexport type RelatedEventsMap = Map<Types.Events.Event, string[]>;\n\nexport type Checklist<Keys extends string> = Record<Keys, {label: Common.UIString.LocalizedString, value: boolean}>;\n\nexport type InsightModel<UIStrings extends Record<string, string> = Record<string, string>,\n ExtraDetail extends Record<string, unknown> = Record<string, unknown>> =\n ExtraDetail&{\n /** Used internally to identify the type of a model, not shown visibly to users **/\n insightKey: keyof InsightModelsType,\n /** Not used within DevTools - this is for external consumers (like Lighthouse). */\n strings: UIStrings,\n title: Common.UIString.LocalizedString,\n description: Common.UIString.LocalizedString,\n category: InsightCategory,\n state: 'pass' | 'fail' | 'informative',\n /** Used by RelatedInsightChips.ts */\n relatedEvents?: RelatedEventsMap | Types.Events.Event[],\n warnings?: InsightWarning[],\n metricSavings?: MetricSavings,\n /**\n * An estimate for the number of bytes that this insight deems to have been wasted.\n * Bytes are in terms of transfer size: for each component of savings related to an\n * individual request, the insight will estimate its impact on transfer size by using\n * the compression ratio of the resource.\n *\n * This field is only displayed for informational purposes.\n */\n wastedBytes?: number,\n frameId?: string,\n /**\n * If this insight is attached to a navigation, this stores its ID.\n */\n navigationId?: string,\n /** This is lazily-generated because some insights may create many overlays. */\n createOverlays?: () => Types.Overlays.Overlay[],\n };\n\nexport type PartialInsightModel<T> =\n Omit<T, 'strings'|'title'|'description'|'category'|'state'|'insightKey'|'navigationId'|'frameId'>;\n\n/**\n * Contains insights for a specific navigation. If a trace began after a navigation already started,\n * this could instead represent the duration from the beginning of the trace up to the first recorded\n * navigation (or the end of the trace).\n */\nexport interface InsightSet {\n /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */\n id: Types.Events.NavigationId;\n /** The URL to show in the accordion list. */\n url: URL;\n frameId: string;\n bounds: Types.Timing.TraceWindowMicro;\n model: InsightModels;\n navigation?: Types.Events.NavigationStart;\n}\n\n/**\n * Contains insights for a specific insight set.\n */\nexport type InsightModels = {\n [I in keyof InsightModelsType]: ReturnType<InsightModelsType[I]['generateInsight']>;\n};\n\n/**\n * Contains insights for the entire trace. Insights are mostly grouped by `navigationId`, with one exception:\n *\n * If the analyzed trace started after the navigation, and has meaningful work with that span, there is no\n * navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.\n */\nexport type TraceInsightSets = Map<Types.Events.NavigationId, InsightSet>;\n\nexport enum InsightKeys {\n LCP_BREAKDOWN = 'LCPBreakdown',\n INP_BREAKDOWN = 'INPBreakdown',\n CLS_CULPRITS = 'CLSCulprits',\n THIRD_PARTIES = 'ThirdParties',\n DOCUMENT_LATENCY = 'DocumentLatency',\n DOM_SIZE = 'DOMSize',\n DUPLICATE_JAVASCRIPT = 'DuplicatedJavaScript',\n FONT_DISPLAY = 'FontDisplay',\n FORCED_REFLOW = 'ForcedReflow',\n IMAGE_DELIVERY = 'ImageDelivery',\n LCP_DISCOVERY = 'LCPDiscovery',\n LEGACY_JAVASCRIPT = 'LegacyJavaScript',\n NETWORK_DEPENDENCY_TREE = 'NetworkDependencyTree',\n RENDER_BLOCKING = 'RenderBlocking',\n SLOW_CSS_SELECTOR = 'SlowCSSSelector',\n VIEWPORT = 'Viewport',\n MODERN_HTTP = 'ModernHTTP',\n CACHE = 'Cache',\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAsC7B,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAYD,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,8BAAW,CAAA;AACb,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AA0ED,MAAM,CAAN,IAAY,WAmBX;AAnBD,WAAY,WAAW;IACrB,6CAA8B,CAAA;IAC9B,6CAA8B,CAAA;IAC9B,2CAA4B,CAAA;IAC5B,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,mCAAoB,CAAA;IACpB,4DAA6C,CAAA;IAC7C,2CAA4B,CAAA;IAC5B,6CAA8B,CAAA;IAC9B,+CAAgC,CAAA;IAChC,6CAA8B,CAAA;IAC9B,qDAAsC,CAAA;IACtC,gEAAiD,CAAA;IACjD,iDAAkC,CAAA;IAClC,oDAAqC,CAAA;IACrC,oCAAqB,CAAA;IACrB,yCAA0B,CAAA;IAC1B,8BAAe,CAAA;AACjB,CAAC,EAnBW,WAAW,KAAX,WAAW,QAmBtB","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Common from '../../../core/common/common.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport type * as Types from '../types/types.js';\n\nimport type * as Models from './Models.js';\n\n/**\n * Context for the portion of the trace an insight should look at.\n */\nexport type InsightSetContext = InsightSetContextWithoutNavigation|InsightSetContextWithNavigation;\n\nexport interface InsightSetContextWithoutNavigation {\n options: Types.Configuration.ParseOptions;\n bounds: Types.Timing.TraceWindowMicro;\n frameId: string;\n navigation?: never;\n}\n\nexport interface InsightSetContextWithNavigation {\n options: Types.Configuration.ParseOptions;\n bounds: Types.Timing.TraceWindowMicro;\n frameId: string;\n navigation: Types.Events.NavigationStart;\n navigationId: string;\n lantern?: LanternContext;\n}\n\nexport interface LanternContext {\n requests: Array<Lantern.Types.NetworkRequest<Types.Events.SyntheticNetworkRequest>>;\n graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;\n simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;\n metrics: Record<string, Lantern.Metrics.MetricResult>;\n}\n\nexport type InsightModelsType = typeof Models;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n NO_LAYOUT = 'NO_LAYOUT',\n}\n\nexport interface MetricSavings {\n /* eslint-disable @typescript-eslint/naming-convention */\n FCP?: Types.Timing.Milli;\n LCP?: Types.Timing.Milli;\n TBT?: Types.Timing.Milli;\n CLS?: number;\n INP?: Types.Timing.Milli;\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport enum InsightCategory {\n ALL = 'All',\n INP = 'INP',\n LCP = 'LCP',\n CLS = 'CLS',\n}\n\nexport type RelatedEventsMap = Map<Types.Events.Event, string[]>;\n\nexport type Checklist<Keys extends string> = Record<Keys, {label: Common.UIString.LocalizedString, value: boolean}>;\n\nexport type InsightModel<UIStrings extends Record<string, string> = Record<string, string>,\n ExtraDetail extends Record<string, unknown> = Record<string, unknown>> =\n ExtraDetail&{\n /** Used internally to identify the type of a model, not shown visibly to users **/\n insightKey: keyof InsightModelsType,\n /** Not used within DevTools - this is for external consumers (like Lighthouse). */\n strings: UIStrings,\n title: Common.UIString.LocalizedString,\n description: Common.UIString.LocalizedString,\n docs: string,\n category: InsightCategory,\n state: 'pass' | 'fail' | 'informative',\n /** Used by RelatedInsightChips.ts */\n relatedEvents?: RelatedEventsMap | Types.Events.Event[],\n warnings?: InsightWarning[],\n metricSavings?: MetricSavings,\n /**\n * An estimate for the number of bytes that this insight deems to have been wasted.\n * Bytes are in terms of transfer size: for each component of savings related to an\n * individual request, the insight will estimate its impact on transfer size by using\n * the compression ratio of the resource.\n *\n * This field is only displayed for informational purposes.\n */\n wastedBytes?: number,\n frameId?: string,\n /**\n * If this insight is attached to a navigation, this stores its ID.\n */\n navigationId?: string,\n /** This is lazily-generated because some insights may create many overlays. */\n createOverlays?: () => Types.Overlays.Overlay[],\n };\n\nexport type PartialInsightModel<T> =\n Omit<T, 'strings'|'title'|'description'|'docs'|'category'|'state'|'insightKey'|'navigationId'|'frameId'>;\n\n/**\n * Contains insights for a specific navigation. If a trace began after a navigation already started,\n * this could instead represent the duration from the beginning of the trace up to the first recorded\n * navigation (or the end of the trace).\n */\nexport interface InsightSet {\n /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */\n id: Types.Events.NavigationId;\n /** The URL to show in the accordion list. */\n url: URL;\n frameId: string;\n bounds: Types.Timing.TraceWindowMicro;\n model: InsightModels;\n navigation?: Types.Events.NavigationStart;\n}\n\n/**\n * Contains insights for a specific insight set.\n */\nexport type InsightModels = {\n [I in keyof InsightModelsType]: ReturnType<InsightModelsType[I]['generateInsight']>;\n};\n\n/**\n * Contains insights for the entire trace. Insights are mostly grouped by `navigationId`, with one exception:\n *\n * If the analyzed trace started after the navigation, and has meaningful work with that span, there is no\n * navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.\n */\nexport type TraceInsightSets = Map<Types.Events.NavigationId, InsightSet>;\n\nexport enum InsightKeys {\n LCP_BREAKDOWN = 'LCPBreakdown',\n INP_BREAKDOWN = 'INPBreakdown',\n CLS_CULPRITS = 'CLSCulprits',\n THIRD_PARTIES = 'ThirdParties',\n DOCUMENT_LATENCY = 'DocumentLatency',\n DOM_SIZE = 'DOMSize',\n DUPLICATE_JAVASCRIPT = 'DuplicatedJavaScript',\n FONT_DISPLAY = 'FontDisplay',\n FORCED_REFLOW = 'ForcedReflow',\n IMAGE_DELIVERY = 'ImageDelivery',\n LCP_DISCOVERY = 'LCPDiscovery',\n LEGACY_JAVASCRIPT = 'LegacyJavaScript',\n NETWORK_DEPENDENCY_TREE = 'NetworkDependencyTree',\n RENDER_BLOCKING = 'RenderBlocking',\n SLOW_CSS_SELECTOR = 'SlowCSSSelector',\n VIEWPORT = 'Viewport',\n MODERN_HTTP = 'ModernHTTP',\n CACHE = 'Cache',\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paulirish/trace_engine",
3
- "version": "0.0.60",
3
+ "version": "0.0.61",
4
4
  "description": "",
5
5
  "main": "models/trace/trace.js",
6
6
  "scripts": {