@paulirish/trace_engine 0.0.66 → 0.0.67-beta.1

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 (788) hide show
  1. package/README.md +62 -22
  2. package/analyze-trace.mjs +6 -144
  3. package/core/common/Base64.d.ts +12 -0
  4. package/core/common/CharacterIdMap.d.ts +5 -0
  5. package/core/common/Color.d.ts +357 -0
  6. package/core/common/ColorConverter.d.ts +26 -0
  7. package/core/common/ColorUtils.d.ts +45 -0
  8. package/core/common/Console.d.ts +54 -0
  9. package/core/common/Debouncer.d.ts +8 -0
  10. package/core/common/EventTarget.d.ts +22 -0
  11. package/core/common/Gzip.d.ts +23 -0
  12. package/core/common/JavaScriptMetaData.d.ts +20 -0
  13. package/core/common/Lazy.d.ts +4 -0
  14. package/core/common/MapWithDefault.d.ts +9 -0
  15. package/core/common/Mutex.d.ts +13 -0
  16. package/core/common/Object.d.ts +20 -0
  17. package/core/common/ParsedURL.d.ts +87 -0
  18. package/core/common/Progress.d.ts +47 -0
  19. package/core/common/ResolverBase.d.ts +29 -0
  20. package/core/common/ResourceType.d.ts +52 -0
  21. package/core/common/ReturnToPanel.d.ts +10 -0
  22. package/core/common/Revealer.d.ts +66 -0
  23. package/core/common/Runnable.d.ts +14 -0
  24. package/core/common/SegmentedRange.d.ts +14 -0
  25. package/core/common/SettingRegistration.d.ts +136 -0
  26. package/core/common/Settings.d.ts +226 -0
  27. package/core/common/SimpleHistoryManager.d.ts +20 -0
  28. package/core/common/Srcset.d.ts +16 -0
  29. package/core/common/StringOutputStream.d.ts +10 -0
  30. package/core/common/TextDictionary.d.ts +11 -0
  31. package/core/common/Throttler.d.ts +12 -0
  32. package/core/common/Trie.d.ts +24 -0
  33. package/core/common/VersionController.d.ts +85 -0
  34. package/core/common/common.d.ts +33 -1
  35. package/core/host/AidaClient.d.ts +73 -0
  36. package/core/host/AidaClientTypes.d.ts +355 -0
  37. package/core/host/AidaGcaTranslation.d.ts +10 -0
  38. package/core/host/DispatchHttpRequestClient.d.ts +14 -0
  39. package/core/host/GcaClient.d.ts +14 -0
  40. package/core/host/GcaTypes.d.ts +411 -0
  41. package/core/host/GdpClient.d.ts +84 -0
  42. package/core/host/InspectorFrontendHost.d.ts +29 -0
  43. package/core/host/InspectorFrontendHostAPI.d.ts +425 -0
  44. package/core/host/InspectorFrontendHostStub.d.ts +151 -0
  45. package/core/host/Platform.d.ts +11 -0
  46. package/core/host/ResourceLoader.d.ts +15 -0
  47. package/core/host/UserMetrics.d.ts +116 -0
  48. package/core/host/UserMetricsEnums.d.ts +883 -0
  49. package/core/host/host.d.ts +13 -1
  50. package/core/i18n/ByteUtilities.d.ts +11 -0
  51. package/core/i18n/DevToolsLocale.d.ts +41 -0
  52. package/core/i18n/NumberFormatter.d.ts +11 -0
  53. package/core/i18n/i18n.d.ts +10 -0
  54. package/core/i18n/i18nImpl.d.ts +64 -0
  55. package/core/i18n/i18nTypes.d.ts +5 -0
  56. package/core/i18n/locales.d.ts +15 -0
  57. package/core/i18n/time-utilities.d.ts +16 -0
  58. package/core/platform/StringUtilities.d.ts +0 -21
  59. package/core/protocol_client/CDPConnection.d.ts +77 -0
  60. package/core/protocol_client/ConnectionTransport.d.ts +9 -0
  61. package/core/protocol_client/DevToolsCDPConnection.d.ts +16 -0
  62. package/core/protocol_client/InspectorBackend.d.ts +223 -0
  63. package/core/protocol_client/protocol_client.d.ts +5 -0
  64. package/core/root/DevToolsContext.d.ts +34 -0
  65. package/core/root/ExperimentNames.d.ts +8 -0
  66. package/core/root/Runtime.d.ts +351 -0
  67. package/core/root/root.d.ts +4 -1
  68. package/core/sdk/AccessibilityModel.d.ts +76 -0
  69. package/core/sdk/AnimationModel.d.ts +161 -0
  70. package/core/sdk/AutofillModel.d.ts +23 -0
  71. package/core/sdk/CPUProfilerModel.d.ts +46 -0
  72. package/core/sdk/CPUThrottlingManager.d.ts +47 -0
  73. package/core/sdk/CSSContainerQuery.d.ts +42 -0
  74. package/core/sdk/CSSFontFace.d.ts +10 -0
  75. package/core/sdk/CSSLayer.d.ts +9 -0
  76. package/core/sdk/CSSLocation.d.ts +14 -0
  77. package/core/sdk/CSSMatchedStyles.d.ts +138 -0
  78. package/core/sdk/CSSMedia.d.ts +36 -0
  79. package/core/sdk/CSSMetadata.d.ts +87 -0
  80. package/core/sdk/CSSModel.d.ts +180 -0
  81. package/core/sdk/CSSNavigation.d.ts +10 -0
  82. package/core/sdk/CSSProperty.d.ts +53 -0
  83. package/core/sdk/CSSPropertyParser.d.ts +131 -0
  84. package/core/sdk/CSSPropertyParserMatchers.d.ts +442 -0
  85. package/core/sdk/CSSQuery.d.ts +22 -0
  86. package/core/sdk/CSSRule.d.ts +132 -0
  87. package/core/sdk/CSSScope.d.ts +9 -0
  88. package/core/sdk/CSSStartingStyle.d.ts +9 -0
  89. package/core/sdk/CSSStyleDeclaration.d.ts +38 -0
  90. package/core/sdk/CSSStyleSheetHeader.d.ts +53 -0
  91. package/core/sdk/CSSSupports.d.ts +10 -0
  92. package/core/sdk/CategorizedBreakpoint.d.ts +42 -0
  93. package/core/sdk/ChildTargetManager.d.ts +40 -0
  94. package/core/sdk/CompilerSourceMappingContentProvider.d.ts +12 -0
  95. package/core/sdk/Connections.d.ts +36 -0
  96. package/core/sdk/ConsoleModel.d.ts +127 -0
  97. package/core/sdk/ConsoleModelTypes.d.ts +6 -0
  98. package/core/sdk/Cookie.d.ts +68 -0
  99. package/core/sdk/CookieModel.d.ts +31 -0
  100. package/core/sdk/CookieParser.d.ts +14 -0
  101. package/core/sdk/CrashReportContextModel.d.ts +8 -0
  102. package/core/sdk/DOMDebuggerModel.d.ts +127 -0
  103. package/core/sdk/DOMModel.d.ts +436 -0
  104. package/core/sdk/DOMStorageModel.d.ts +79 -0
  105. package/core/sdk/DebuggerModel.d.ts +272 -0
  106. package/core/sdk/EmulationModel.d.ts +95 -0
  107. package/core/sdk/EnhancedTracesParser.d.ts +105 -0
  108. package/core/sdk/EventBreakpointsModel.d.ts +66 -0
  109. package/core/sdk/FrameAssociated.d.ts +6 -0
  110. package/core/sdk/FrameManager.d.ts +68 -0
  111. package/core/sdk/HeapProfilerModel.d.ts +75 -0
  112. package/core/sdk/HttpReasonPhraseStrings.d.ts +5 -0
  113. package/core/sdk/IOModel.d.ts +10 -0
  114. package/core/sdk/IsolateManager.d.ts +53 -0
  115. package/core/sdk/IssuesModel.d.ts +28 -0
  116. package/core/sdk/LayerTreeBase.d.ts +70 -0
  117. package/core/sdk/LogModel.d.ts +20 -0
  118. package/core/sdk/NetworkManager.d.ts +418 -0
  119. package/core/sdk/NetworkRequest.d.ts +469 -0
  120. package/core/sdk/NetworkRequestAccess.d.ts +91 -0
  121. package/core/sdk/OverlayColorGenerator.d.ts +14 -0
  122. package/core/sdk/OverlayModel.d.ts +186 -0
  123. package/core/sdk/OverlayPersistentHighlighter.d.ts +116 -0
  124. package/core/sdk/PageFunctions.d.ts +22 -0
  125. package/core/sdk/PageLoad.d.ts +14 -0
  126. package/core/sdk/PageResourceLoader.d.ts +111 -0
  127. package/core/sdk/PaintProfiler.d.ts +43 -0
  128. package/core/sdk/PerformanceMetricsModel.d.ts +12 -0
  129. package/core/sdk/PreloadingModel.d.ts +146 -0
  130. package/core/sdk/RehydratingConnection.d.ts +73 -0
  131. package/core/sdk/RehydratingObject.d.ts +59 -0
  132. package/core/sdk/RemoteObject.d.ts +210 -0
  133. package/core/sdk/Resource.d.ts +36 -0
  134. package/core/sdk/ResourceTreeModel.d.ts +278 -0
  135. package/core/sdk/RuntimeModel.d.ts +163 -0
  136. package/core/sdk/SDKModel.d.ts +30 -0
  137. package/core/sdk/SDKSettings.d.ts +53 -0
  138. package/core/sdk/ScopeTreeCache.d.ts +21 -0
  139. package/core/sdk/ScreenCaptureModel.d.ts +69 -0
  140. package/core/sdk/Script.d.ts +134 -0
  141. package/core/sdk/SecurityOrigin.d.ts +108 -0
  142. package/core/sdk/SecurityOriginManager.d.ts +23 -0
  143. package/core/sdk/ServerSentEvents.d.ts +18 -0
  144. package/core/sdk/ServerSentEventsProtocol.d.ts +18 -0
  145. package/core/sdk/ServerTiming.d.ts +24 -0
  146. package/core/sdk/ServiceWorkerCacheModel.d.ts +71 -0
  147. package/core/sdk/ServiceWorkerManager.d.ts +125 -0
  148. package/core/sdk/SourceMap.d.ts +197 -0
  149. package/core/sdk/SourceMapCache.d.ts +12 -0
  150. package/core/sdk/SourceMapFunctionRanges.d.ts +26 -0
  151. package/core/sdk/SourceMapManager.d.ts +46 -0
  152. package/core/sdk/SourceMapRangeMappings.d.ts +15 -0
  153. package/core/sdk/SourceMapScopeChainEntry.d.ts +23 -0
  154. package/core/sdk/SourceMapScopesInfo.d.ts +109 -0
  155. package/core/sdk/StorageBucketsModel.d.ts +48 -0
  156. package/core/sdk/StorageKeyManager.d.ts +38 -0
  157. package/core/sdk/Target.d.ts +79 -0
  158. package/core/sdk/TargetManager.d.ts +92 -0
  159. package/core/sdk/TraceObject.d.ts +43 -0
  160. package/core/sdk/WebAuthnModel.d.ts +29 -0
  161. package/core/sdk/sdk.d.ts +97 -1
  162. package/core/text_utils/CodeMirrorUtils.d.ts +3 -0
  163. package/core/text_utils/ContentData.d.ts +94 -0
  164. package/core/text_utils/ContentProvider.d.ts +42 -0
  165. package/core/text_utils/StaticContentProvider.d.ts +13 -0
  166. package/core/text_utils/StreamingContentData.d.ts +49 -0
  167. package/core/text_utils/Text.d.ts +19 -0
  168. package/core/text_utils/TextCursor.d.ts +9 -0
  169. package/core/text_utils/TextRange.d.ts +81 -0
  170. package/core/text_utils/TextUtils.d.ts +97 -0
  171. package/core/text_utils/WasmDisassembly.d.ts +29 -0
  172. package/core/text_utils/text_utils.d.ts +11 -0
  173. package/entrypoints/formatter_actions/formatter_actions.d.ts +48 -0
  174. package/generated/InspectorBackendCommands.d.ts +14 -0
  175. package/generated/SupportedCSSProperties.d.ts +18 -0
  176. package/generated/protocol-mapping.d.ts +5930 -0
  177. package/generated/protocol-proxy-api.d.ts +5396 -0
  178. package/generated/protocol.d.ts +26 -72
  179. package/index.d.ts +2 -0
  180. package/index.js +6 -0
  181. package/locales/af.json +171 -174
  182. package/locales/am.json +351 -354
  183. package/locales/ar.json +352 -355
  184. package/locales/as.json +350 -353
  185. package/locales/az.json +341 -344
  186. package/locales/be.json +351 -354
  187. package/locales/bg.json +351 -354
  188. package/locales/bn.json +351 -354
  189. package/locales/bs.json +253 -256
  190. package/locales/ca.json +283 -286
  191. package/locales/cs.json +336 -339
  192. package/locales/cy.json +144 -147
  193. package/locales/da.json +232 -235
  194. package/locales/de.json +251 -254
  195. package/locales/el.json +336 -339
  196. package/locales/en-GB.json +132 -135
  197. package/locales/en-US.json +294 -297
  198. package/locales/es-419.json +282 -285
  199. package/locales/es.json +282 -285
  200. package/locales/et.json +236 -239
  201. package/locales/eu.json +131 -134
  202. package/locales/fa.json +351 -354
  203. package/locales/fi.json +283 -286
  204. package/locales/fil.json +128 -131
  205. package/locales/fr-CA.json +310 -313
  206. package/locales/fr.json +309 -312
  207. package/locales/gl.json +264 -267
  208. package/locales/gu.json +352 -355
  209. package/locales/he.json +352 -355
  210. package/locales/hi.json +336 -339
  211. package/locales/hr.json +257 -260
  212. package/locales/hu.json +342 -345
  213. package/locales/hy.json +351 -354
  214. package/locales/id.json +128 -131
  215. package/locales/is.json +304 -307
  216. package/locales/it.json +221 -224
  217. package/locales/ja.json +351 -354
  218. package/locales/ka.json +352 -355
  219. package/locales/kk.json +352 -355
  220. package/locales/km.json +351 -354
  221. package/locales/kn.json +352 -355
  222. package/locales/ko.json +351 -354
  223. package/locales/ky.json +350 -353
  224. package/locales/lo.json +352 -355
  225. package/locales/lt.json +323 -326
  226. package/locales/lv.json +317 -320
  227. package/locales/mk.json +352 -355
  228. package/locales/ml.json +351 -354
  229. package/locales/mn.json +351 -354
  230. package/locales/mr.json +351 -354
  231. package/locales/ms.json +128 -131
  232. package/locales/my.json +350 -353
  233. package/locales/ne.json +336 -339
  234. package/locales/nl.json +183 -186
  235. package/locales/no.json +238 -241
  236. package/locales/or.json +351 -354
  237. package/locales/pa.json +351 -354
  238. package/locales/pl.json +307 -310
  239. package/locales/pt-PT.json +273 -276
  240. package/locales/pt.json +270 -273
  241. package/locales/ro.json +309 -312
  242. package/locales/ru.json +351 -354
  243. package/locales/si.json +352 -355
  244. package/locales/sk.json +333 -336
  245. package/locales/sl.json +273 -276
  246. package/locales/sq.json +316 -319
  247. package/locales/sr-Latn.json +256 -259
  248. package/locales/sr.json +352 -355
  249. package/locales/sv.json +296 -299
  250. package/locales/sw.json +128 -131
  251. package/locales/ta.json +352 -355
  252. package/locales/te.json +350 -353
  253. package/locales/th.json +352 -355
  254. package/locales/tr.json +327 -330
  255. package/locales/uk.json +351 -354
  256. package/locales/ur.json +352 -355
  257. package/locales/uz.json +232 -235
  258. package/locales/vi.json +352 -355
  259. package/locales/zh-HK.json +352 -355
  260. package/locales/zh-TW.json +351 -354
  261. package/locales/zh.json +351 -354
  262. package/locales/zu.json +127 -130
  263. package/models/crux-manager/CrUXManager.d.ts +107 -0
  264. package/models/crux-manager/crux-manager.d.ts +1 -0
  265. package/models/emulation/DeviceModeModel.d.ts +156 -0
  266. package/models/emulation/EmulatedDevices.d.ts +148 -0
  267. package/models/emulation/emulation.d.ts +3 -0
  268. package/models/formatter/FormatterWorkerPool.d.ts +58 -0
  269. package/models/formatter/ScriptFormatter.d.ts +11 -0
  270. package/models/formatter/formatter.d.ts +3 -0
  271. package/models/trace/ModelImpl.d.ts +1 -1
  272. package/models/trace/extras/extras.d.ts +2 -7
  273. package/models/trace/handlers/ScriptsHandler.d.ts +2 -2
  274. package/models/trace/insights/CLSCulprits.d.ts +14 -14
  275. package/models/trace/insights/Cache.d.ts +8 -8
  276. package/models/trace/insights/CharacterSet.d.ts +10 -10
  277. package/models/trace/insights/Common.d.ts +4 -4
  278. package/models/trace/insights/DOMSize.d.ts +15 -15
  279. package/models/trace/insights/DocumentLatency.d.ts +13 -13
  280. package/models/trace/insights/DuplicatedJavaScript.d.ts +7 -7
  281. package/models/trace/insights/FontDisplay.d.ts +7 -7
  282. package/models/trace/insights/ForcedReflow.d.ts +9 -9
  283. package/models/trace/insights/INPBreakdown.d.ts +10 -10
  284. package/models/trace/insights/ImageDelivery.d.ts +12 -13
  285. package/models/trace/insights/LCPBreakdown.d.ts +13 -13
  286. package/models/trace/insights/LCPDiscovery.d.ts +12 -12
  287. package/models/trace/insights/LegacyJavaScript.d.ts +7 -7
  288. package/models/trace/insights/ModernHTTP.d.ts +7 -7
  289. package/models/trace/insights/NetworkDependencyTree.d.ts +21 -104
  290. package/models/trace/insights/RenderBlocking.d.ts +7 -7
  291. package/models/trace/insights/SlowCSSSelector.d.ts +12 -12
  292. package/models/trace/insights/ThirdParties.d.ts +8 -8
  293. package/models/trace/insights/Viewport.d.ts +5 -5
  294. package/models/trace/insights/types.d.ts +1 -1
  295. package/models/trace/lantern/core/NetworkAnalyzer.d.ts +0 -1
  296. package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
  297. package/models/trace/lantern/graph/CPUNode.d.ts +2 -4
  298. package/models/trace/lantern/simulation/TCPConnection.d.ts +4 -4
  299. package/models/trace/lantern/types/Lantern.d.ts +19 -27
  300. package/models/trace/trace.js +544 -16
  301. package/models/trace/types/Configuration.d.ts +1 -1
  302. package/models/trace/types/Extensions.d.ts +1 -1
  303. package/models/trace/types/File.d.ts +5 -5
  304. package/models/trace/types/TraceEvents.d.ts +24 -24
  305. package/package.json +37 -8
  306. package/third_party/codemirror.next/codemirror.next.d.ts +9196 -0
  307. package/third_party/i18n/i18n-impl.d.ts +25 -0
  308. package/third_party/i18n/i18n.d.ts +3 -0
  309. package/third_party/i18n/localized-string-set.d.ts +49 -0
  310. package/third_party/intl-messageformat/intl-messageformat.d.ts +1 -0
  311. package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +67 -0
  312. package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +38 -0
  313. package/third_party/source-map-scopes-codec/package/src/codec.d.ts +48 -0
  314. package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +31 -0
  315. package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +8 -0
  316. package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +6 -0
  317. package/third_party/source-map-scopes-codec/package/src/mod.d.ts +5 -0
  318. package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +168 -0
  319. package/third_party/source-map-scopes-codec/package/src/util.d.ts +5 -0
  320. package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +14 -0
  321. package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +1 -0
  322. package/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
  323. package/third_party/third-party-web/package/lib/index.d.ts +34 -0
  324. package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
  325. package/third_party/third-party-web/third-party-web.d.ts +2 -1
  326. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +0 -13
  327. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +0 -1
  328. package/.tmp/tsbuildinfo/analyze-trace.d.mts +0 -17
  329. package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +0 -1
  330. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
  331. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
  332. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +0 -2
  333. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +0 -1
  334. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +0 -3
  335. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +0 -1
  336. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +0 -1
  337. package/analyze-inspector-issues.mjs +0 -60
  338. package/core/common/common.js +0 -1
  339. package/core/host/host.js +0 -1
  340. package/core/platform/ArrayUtilities.js +0 -224
  341. package/core/platform/ArrayUtilities.js.map +0 -1
  342. package/core/platform/Brand.js +0 -5
  343. package/core/platform/Brand.js.map +0 -1
  344. package/core/platform/Constructor.js +0 -5
  345. package/core/platform/Constructor.js.map +0 -1
  346. package/core/platform/DateUtilities.js +0 -14
  347. package/core/platform/DateUtilities.js.map +0 -1
  348. package/core/platform/DevToolsPath.js +0 -28
  349. package/core/platform/DevToolsPath.js.map +0 -1
  350. package/core/platform/HostRuntime.js +0 -31
  351. package/core/platform/HostRuntime.js.map +0 -1
  352. package/core/platform/KeyboardUtilities.js +0 -34
  353. package/core/platform/KeyboardUtilities.js.map +0 -1
  354. package/core/platform/MapUtilities.js +0 -80
  355. package/core/platform/MapUtilities.js.map +0 -1
  356. package/core/platform/MimeType.js +0 -157
  357. package/core/platform/MimeType.js.map +0 -1
  358. package/core/platform/NumberUtilities.js +0 -73
  359. package/core/platform/NumberUtilities.js.map +0 -1
  360. package/core/platform/Size.js +0 -36
  361. package/core/platform/Size.js.map +0 -1
  362. package/core/platform/StringUtilities.js +0 -731
  363. package/core/platform/StringUtilities.js.map +0 -1
  364. package/core/platform/Timing.js +0 -10
  365. package/core/platform/Timing.js.map +0 -1
  366. package/core/platform/TypedArrayUtilities.js +0 -158
  367. package/core/platform/TypedArrayUtilities.js.map +0 -1
  368. package/core/platform/TypescriptUtilities.js +0 -17
  369. package/core/platform/TypescriptUtilities.js.map +0 -1
  370. package/core/platform/UIString.js +0 -5
  371. package/core/platform/UIString.js.map +0 -1
  372. package/core/platform/UserVisibleError.js +0 -23
  373. package/core/platform/UserVisibleError.js.map +0 -1
  374. package/core/platform/api/HostRuntime.js +0 -5
  375. package/core/platform/api/HostRuntime.js.map +0 -1
  376. package/core/platform/api/api-tsconfig.json +0 -58
  377. package/core/platform/api/api-tsconfig.ref.json +0 -26
  378. package/core/platform/api/api.js +0 -6
  379. package/core/platform/api/api.js.map +0 -1
  380. package/core/platform/browser/HostRuntime.js +0 -165
  381. package/core/platform/browser/HostRuntime.js.map +0 -1
  382. package/core/platform/browser/browser-tsconfig.json +0 -59
  383. package/core/platform/browser/browser-tsconfig.ref.json +0 -27
  384. package/core/platform/browser/browser.js +0 -6
  385. package/core/platform/browser/browser.js.map +0 -1
  386. package/core/platform/browser/bundle-tsconfig.json +0 -59
  387. package/core/platform/browser/bundle-tsconfig.ref.json +0 -27
  388. package/core/platform/bundle-tsconfig.json +0 -59
  389. package/core/platform/bundle-tsconfig.ref.json +0 -27
  390. package/core/platform/foundation_unittests-tsconfig.json +0 -73
  391. package/core/platform/foundation_unittests-tsconfig.ref.json +0 -40
  392. package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +0 -70
  393. package/core/platform/node/HostRuntime.js +0 -127
  394. package/core/platform/node/HostRuntime.js.map +0 -1
  395. package/core/platform/node/bundle-tsconfig.json +0 -59
  396. package/core/platform/node/bundle-tsconfig.ref.json +0 -27
  397. package/core/platform/node/node-tsconfig.json +0 -59
  398. package/core/platform/node/node-tsconfig.ref.json +0 -27
  399. package/core/platform/node/node.js +0 -6
  400. package/core/platform/node/node.js.map +0 -1
  401. package/core/platform/platform-tsconfig.json +0 -81
  402. package/core/platform/platform-tsconfig.ref.json +0 -49
  403. package/core/platform/platform.js +0 -28
  404. package/core/platform/platform.js.map +0 -1
  405. package/core/platform/platform_node_typecheck-tsconfig.json +0 -78
  406. package/core/platform/platform_node_typecheck.stamp +0 -0
  407. package/core/root/root.js +0 -1
  408. package/core/sdk/sdk.js +0 -1
  409. package/generated/protocol.js +0 -3304
  410. package/locales/en-XL.json +0 -1058
  411. package/models/cpu_profile/CPUProfileDataModel.js +0 -517
  412. package/models/cpu_profile/CPUProfileDataModel.js.map +0 -1
  413. package/models/cpu_profile/ProfileTreeModel.js +0 -90
  414. package/models/cpu_profile/ProfileTreeModel.js.map +0 -1
  415. package/models/cpu_profile/bundle-tsconfig.json +0 -59
  416. package/models/cpu_profile/bundle-tsconfig.ref.json +0 -27
  417. package/models/cpu_profile/cpu_profile-tsconfig.json +0 -63
  418. package/models/cpu_profile/cpu_profile-tsconfig.ref.json +0 -31
  419. package/models/cpu_profile/cpu_profile.js +0 -7
  420. package/models/cpu_profile/cpu_profile.js.map +0 -1
  421. package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +0 -60
  422. package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
  423. package/models/cpu_profile/foundation_unittests-tsconfig.json +0 -63
  424. package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +0 -30
  425. package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +0 -60
  426. package/models/issues_manager/CheckFormsIssuesTrigger.d.ts +0 -1
  427. package/models/issues_manager/CheckFormsIssuesTrigger.js +0 -1
  428. package/models/issues_manager/ContrastCheckTrigger.d.ts +0 -1
  429. package/models/issues_manager/ContrastCheckTrigger.js +0 -1
  430. package/models/issues_manager/DeprecationIssue.d.ts +0 -1
  431. package/models/issues_manager/DeprecationIssue.js +0 -1
  432. package/models/issues_manager/IssueResolver.d.ts +0 -1
  433. package/models/issues_manager/IssueResolver.js +0 -1
  434. package/models/issues_manager/RelatedIssue.d.ts +0 -1
  435. package/models/issues_manager/RelatedIssue.js +0 -1
  436. package/models/issues_manager/SourceFrameIssuesManager.d.ts +0 -1
  437. package/models/issues_manager/SourceFrameIssuesManager.js +0 -1
  438. package/models/trace/EntityMapper.js +0 -133
  439. package/models/trace/EntityMapper.js.map +0 -1
  440. package/models/trace/EventsSerializer.js +0 -90
  441. package/models/trace/EventsSerializer.js.map +0 -1
  442. package/models/trace/LanternComputationData.js +0 -374
  443. package/models/trace/LanternComputationData.js.map +0 -1
  444. package/models/trace/LegacyTracingModel.d.ts +0 -1
  445. package/models/trace/LegacyTracingModel.js +0 -1
  446. package/models/trace/ModelImpl.js +0 -181
  447. package/models/trace/ModelImpl.js.map +0 -1
  448. package/models/trace/Name.js +0 -115
  449. package/models/trace/Name.js.map +0 -1
  450. package/models/trace/Processor.js +0 -618
  451. package/models/trace/Processor.js.map +0 -1
  452. package/models/trace/Styles.js +0 -836
  453. package/models/trace/Styles.js.map +0 -1
  454. package/models/trace/TracingManager.d.ts +0 -1
  455. package/models/trace/TracingManager.js +0 -1
  456. package/models/trace/bundle-tsconfig.json +0 -77
  457. package/models/trace/bundle-tsconfig.ref.json +0 -45
  458. package/models/trace/extras/FilmStrip.js +0 -45
  459. package/models/trace/extras/FilmStrip.js.map +0 -1
  460. package/models/trace/extras/Initiators.js +0 -47
  461. package/models/trace/extras/Initiators.js.map +0 -1
  462. package/models/trace/extras/MainThreadActivity.js +0 -77
  463. package/models/trace/extras/MainThreadActivity.js.map +0 -1
  464. package/models/trace/extras/ScriptDuplication.js +0 -163
  465. package/models/trace/extras/ScriptDuplication.js.map +0 -1
  466. package/models/trace/extras/StackTraceForEvent.js +0 -192
  467. package/models/trace/extras/StackTraceForEvent.js.map +0 -1
  468. package/models/trace/extras/ThirdParties.js +0 -119
  469. package/models/trace/extras/ThirdParties.js.map +0 -1
  470. package/models/trace/extras/TraceFilter.js +0 -51
  471. package/models/trace/extras/TraceFilter.js.map +0 -1
  472. package/models/trace/extras/TraceTree.js +0 -621
  473. package/models/trace/extras/TraceTree.js.map +0 -1
  474. package/models/trace/extras/bundle-tsconfig.json +0 -59
  475. package/models/trace/extras/bundle-tsconfig.ref.json +0 -27
  476. package/models/trace/extras/extras-tsconfig.json +0 -81
  477. package/models/trace/extras/extras-tsconfig.ref.json +0 -49
  478. package/models/trace/extras/extras.js +0 -13
  479. package/models/trace/extras/extras.js.map +0 -1
  480. package/models/trace/extras/extras_node_typecheck-tsconfig.json +0 -78
  481. package/models/trace/extras/extras_node_typecheck.stamp +0 -0
  482. package/models/trace/extras/foundation_unittests-tsconfig.json +0 -91
  483. package/models/trace/extras/foundation_unittests-tsconfig.ref.json +0 -58
  484. package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +0 -88
  485. package/models/trace/foundation_unittests-tsconfig.json +0 -70
  486. package/models/trace/foundation_unittests-tsconfig.ref.json +0 -37
  487. package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +0 -67
  488. package/models/trace/handlers/AnimationFramesHandler.js +0 -110
  489. package/models/trace/handlers/AnimationFramesHandler.js.map +0 -1
  490. package/models/trace/handlers/AnimationHandler.js +0 -27
  491. package/models/trace/handlers/AnimationHandler.js.map +0 -1
  492. package/models/trace/handlers/AsyncJSCallsHandler.js +0 -188
  493. package/models/trace/handlers/AsyncJSCallsHandler.js.map +0 -1
  494. package/models/trace/handlers/DOMStatsHandler.js +0 -22
  495. package/models/trace/handlers/DOMStatsHandler.js.map +0 -1
  496. package/models/trace/handlers/ExtensionTraceDataHandler.js +0 -264
  497. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +0 -1
  498. package/models/trace/handlers/FlowsHandler.js +0 -149
  499. package/models/trace/handlers/FlowsHandler.js.map +0 -1
  500. package/models/trace/handlers/FramesHandler.js +0 -491
  501. package/models/trace/handlers/FramesHandler.js.map +0 -1
  502. package/models/trace/handlers/GPUHandler.js +0 -36
  503. package/models/trace/handlers/GPUHandler.js.map +0 -1
  504. package/models/trace/handlers/ImagePaintingHandler.js +0 -148
  505. package/models/trace/handlers/ImagePaintingHandler.js.map +0 -1
  506. package/models/trace/handlers/InitiatorsHandler.js +0 -181
  507. package/models/trace/handlers/InitiatorsHandler.js.map +0 -1
  508. package/models/trace/handlers/InvalidationsHandler.js +0 -127
  509. package/models/trace/handlers/InvalidationsHandler.js.map +0 -1
  510. package/models/trace/handlers/LargestImagePaintHandler.js +0 -86
  511. package/models/trace/handlers/LargestImagePaintHandler.js.map +0 -1
  512. package/models/trace/handlers/LargestTextPaintHandler.js +0 -28
  513. package/models/trace/handlers/LargestTextPaintHandler.js.map +0 -1
  514. package/models/trace/handlers/LayerTreeHandler.js +0 -104
  515. package/models/trace/handlers/LayerTreeHandler.js.map +0 -1
  516. package/models/trace/handlers/LayoutShiftsHandler.js +0 -457
  517. package/models/trace/handlers/LayoutShiftsHandler.js.map +0 -1
  518. package/models/trace/handlers/MemoryHandler.js +0 -22
  519. package/models/trace/handlers/MemoryHandler.js.map +0 -1
  520. package/models/trace/handlers/MetaHandler.js +0 -442
  521. package/models/trace/handlers/MetaHandler.js.map +0 -1
  522. package/models/trace/handlers/ModelHandlers.js +0 -33
  523. package/models/trace/handlers/ModelHandlers.js.map +0 -1
  524. package/models/trace/handlers/NetworkRequestsHandler.js +0 -578
  525. package/models/trace/handlers/NetworkRequestsHandler.js.map +0 -1
  526. package/models/trace/handlers/PageFramesHandler.js +0 -43
  527. package/models/trace/handlers/PageFramesHandler.js.map +0 -1
  528. package/models/trace/handlers/PageLoadMetricsHandler.js +0 -462
  529. package/models/trace/handlers/PageLoadMetricsHandler.js.map +0 -1
  530. package/models/trace/handlers/RendererHandler.js +0 -346
  531. package/models/trace/handlers/RendererHandler.js.map +0 -1
  532. package/models/trace/handlers/SamplesHandler.js +0 -261
  533. package/models/trace/handlers/SamplesHandler.js.map +0 -1
  534. package/models/trace/handlers/ScreenshotsHandler.js +0 -56
  535. package/models/trace/handlers/ScreenshotsHandler.js.map +0 -1
  536. package/models/trace/handlers/ScriptsHandler.js +0 -286
  537. package/models/trace/handlers/ScriptsHandler.js.map +0 -1
  538. package/models/trace/handlers/SelectorStatsHandler.js +0 -72
  539. package/models/trace/handlers/SelectorStatsHandler.js.map +0 -1
  540. package/models/trace/handlers/Threads.js +0 -108
  541. package/models/trace/handlers/Threads.js.map +0 -1
  542. package/models/trace/handlers/UserInteractionsHandler.js +0 -319
  543. package/models/trace/handlers/UserInteractionsHandler.js.map +0 -1
  544. package/models/trace/handlers/UserTimingsHandler.js +0 -194
  545. package/models/trace/handlers/UserTimingsHandler.js.map +0 -1
  546. package/models/trace/handlers/WarningsHandler.js +0 -135
  547. package/models/trace/handlers/WarningsHandler.js.map +0 -1
  548. package/models/trace/handlers/WorkersHandler.js +0 -34
  549. package/models/trace/handlers/WorkersHandler.js.map +0 -1
  550. package/models/trace/handlers/bundle-tsconfig.json +0 -59
  551. package/models/trace/handlers/bundle-tsconfig.ref.json +0 -27
  552. package/models/trace/handlers/foundation_unittests-tsconfig.json +0 -102
  553. package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +0 -69
  554. package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +0 -99
  555. package/models/trace/handlers/handlers-tsconfig.json +0 -112
  556. package/models/trace/handlers/handlers-tsconfig.ref.json +0 -80
  557. package/models/trace/handlers/handlers.js +0 -8
  558. package/models/trace/handlers/handlers.js.map +0 -1
  559. package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +0 -109
  560. package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
  561. package/models/trace/handlers/helpers.js +0 -164
  562. package/models/trace/handlers/helpers.js.map +0 -1
  563. package/models/trace/handlers/types.js +0 -2
  564. package/models/trace/handlers/types.js.map +0 -1
  565. package/models/trace/helpers/Extensions.js +0 -42
  566. package/models/trace/helpers/Extensions.js.map +0 -1
  567. package/models/trace/helpers/Network.js +0 -103
  568. package/models/trace/helpers/Network.js.map +0 -1
  569. package/models/trace/helpers/SamplesIntegrator.js +0 -512
  570. package/models/trace/helpers/SamplesIntegrator.js.map +0 -1
  571. package/models/trace/helpers/SyntheticEvents.js +0 -94
  572. package/models/trace/helpers/SyntheticEvents.js.map +0 -1
  573. package/models/trace/helpers/Timing.js +0 -207
  574. package/models/trace/helpers/Timing.js.map +0 -1
  575. package/models/trace/helpers/Trace.js +0 -817
  576. package/models/trace/helpers/Trace.js.map +0 -1
  577. package/models/trace/helpers/TreeHelpers.js +0 -255
  578. package/models/trace/helpers/TreeHelpers.js.map +0 -1
  579. package/models/trace/helpers/bundle-tsconfig.json +0 -59
  580. package/models/trace/helpers/bundle-tsconfig.ref.json +0 -27
  581. package/models/trace/helpers/foundation_unittests-tsconfig.json +0 -73
  582. package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +0 -40
  583. package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +0 -70
  584. package/models/trace/helpers/helpers-tsconfig.json +0 -77
  585. package/models/trace/helpers/helpers-tsconfig.ref.json +0 -45
  586. package/models/trace/helpers/helpers.js +0 -11
  587. package/models/trace/helpers/helpers.js.map +0 -1
  588. package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +0 -74
  589. package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
  590. package/models/trace/insights/CLSCulprits.js +0 -519
  591. package/models/trace/insights/CLSCulprits.js.map +0 -1
  592. package/models/trace/insights/Cache.js +0 -210
  593. package/models/trace/insights/Cache.js.map +0 -1
  594. package/models/trace/insights/CharacterSet.js +0 -132
  595. package/models/trace/insights/CharacterSet.js.map +0 -1
  596. package/models/trace/insights/Common.js +0 -366
  597. package/models/trace/insights/Common.js.map +0 -1
  598. package/models/trace/insights/DOMSize.js +0 -182
  599. package/models/trace/insights/DOMSize.js.map +0 -1
  600. package/models/trace/insights/DocumentLatency.js +0 -259
  601. package/models/trace/insights/DocumentLatency.js.map +0 -1
  602. package/models/trace/insights/DuplicatedJavaScript.js +0 -99
  603. package/models/trace/insights/DuplicatedJavaScript.js.map +0 -1
  604. package/models/trace/insights/FontDisplay.js +0 -93
  605. package/models/trace/insights/FontDisplay.js.map +0 -1
  606. package/models/trace/insights/ForcedReflow.js +0 -162
  607. package/models/trace/insights/ForcedReflow.js.map +0 -1
  608. package/models/trace/insights/INPBreakdown.js +0 -130
  609. package/models/trace/insights/INPBreakdown.js.map +0 -1
  610. package/models/trace/insights/ImageDelivery.js +0 -264
  611. package/models/trace/insights/ImageDelivery.js.map +0 -1
  612. package/models/trace/insights/LCPBreakdown.js +0 -200
  613. package/models/trace/insights/LCPBreakdown.js.map +0 -1
  614. package/models/trace/insights/LCPDiscovery.js +0 -190
  615. package/models/trace/insights/LCPDiscovery.js.map +0 -1
  616. package/models/trace/insights/LegacyJavaScript.js +0 -99
  617. package/models/trace/insights/LegacyJavaScript.js.map +0 -1
  618. package/models/trace/insights/Models.js +0 -23
  619. package/models/trace/insights/Models.js.map +0 -1
  620. package/models/trace/insights/ModernHTTP.js +0 -205
  621. package/models/trace/insights/ModernHTTP.js.map +0 -1
  622. package/models/trace/insights/NetworkDependencyTree.js +0 -972
  623. package/models/trace/insights/NetworkDependencyTree.js.map +0 -1
  624. package/models/trace/insights/RenderBlocking.js +0 -191
  625. package/models/trace/insights/RenderBlocking.js.map +0 -1
  626. package/models/trace/insights/SlowCSSSelector.js +0 -140
  627. package/models/trace/insights/SlowCSSSelector.js.map +0 -1
  628. package/models/trace/insights/Statistics.js +0 -93
  629. package/models/trace/insights/Statistics.js.map +0 -1
  630. package/models/trace/insights/ThirdParties.js +0 -110
  631. package/models/trace/insights/ThirdParties.js.map +0 -1
  632. package/models/trace/insights/Viewport.js +0 -105
  633. package/models/trace/insights/Viewport.js.map +0 -1
  634. package/models/trace/insights/bundle-tsconfig.json +0 -59
  635. package/models/trace/insights/bundle-tsconfig.ref.json +0 -27
  636. package/models/trace/insights/foundation_unittests-tsconfig.json +0 -98
  637. package/models/trace/insights/foundation_unittests-tsconfig.ref.json +0 -65
  638. package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +0 -95
  639. package/models/trace/insights/insights-tsconfig.json +0 -114
  640. package/models/trace/insights/insights-tsconfig.ref.json +0 -82
  641. package/models/trace/insights/insights.js +0 -10
  642. package/models/trace/insights/insights.js.map +0 -1
  643. package/models/trace/insights/insights_node_typecheck-tsconfig.json +0 -111
  644. package/models/trace/insights/insights_node_typecheck.stamp +0 -0
  645. package/models/trace/insights/types.js +0 -41
  646. package/models/trace/insights/types.js.map +0 -1
  647. package/models/trace/lantern/bundle-tsconfig.json +0 -71
  648. package/models/trace/lantern/bundle-tsconfig.ref.json +0 -39
  649. package/models/trace/lantern/core/LanternError.js +0 -7
  650. package/models/trace/lantern/core/LanternError.js.map +0 -1
  651. package/models/trace/lantern/core/NetworkAnalyzer.js +0 -488
  652. package/models/trace/lantern/core/NetworkAnalyzer.js.map +0 -1
  653. package/models/trace/lantern/core/bundle-tsconfig.json +0 -59
  654. package/models/trace/lantern/core/bundle-tsconfig.ref.json +0 -27
  655. package/models/trace/lantern/core/core-tsconfig.json +0 -60
  656. package/models/trace/lantern/core/core-tsconfig.ref.json +0 -28
  657. package/models/trace/lantern/core/core.js +0 -6
  658. package/models/trace/lantern/core/core.js.map +0 -1
  659. package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +0 -57
  660. package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
  661. package/models/trace/lantern/core/foundation_unittests-tsconfig.json +0 -69
  662. package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +0 -36
  663. package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +0 -66
  664. package/models/trace/lantern/graph/BaseNode.js +0 -277
  665. package/models/trace/lantern/graph/BaseNode.js.map +0 -1
  666. package/models/trace/lantern/graph/CPUNode.js +0 -80
  667. package/models/trace/lantern/graph/CPUNode.js.map +0 -1
  668. package/models/trace/lantern/graph/NetworkNode.js +0 -95
  669. package/models/trace/lantern/graph/NetworkNode.js.map +0 -1
  670. package/models/trace/lantern/graph/PageDependencyGraph.js +0 -574
  671. package/models/trace/lantern/graph/PageDependencyGraph.js.map +0 -1
  672. package/models/trace/lantern/graph/bundle-tsconfig.json +0 -59
  673. package/models/trace/lantern/graph/bundle-tsconfig.ref.json +0 -27
  674. package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +0 -61
  675. package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +0 -28
  676. package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +0 -58
  677. package/models/trace/lantern/graph/graph-tsconfig.json +0 -65
  678. package/models/trace/lantern/graph/graph-tsconfig.ref.json +0 -33
  679. package/models/trace/lantern/graph/graph.js +0 -8
  680. package/models/trace/lantern/graph/graph.js.map +0 -1
  681. package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +0 -62
  682. package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
  683. package/models/trace/lantern/lantern.js +0 -10
  684. package/models/trace/lantern/lantern.js.map +0 -1
  685. package/models/trace/lantern/metrics/FirstContentfulPaint.js +0 -137
  686. package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +0 -1
  687. package/models/trace/lantern/metrics/Interactive.js +0 -68
  688. package/models/trace/lantern/metrics/Interactive.js.map +0 -1
  689. package/models/trace/lantern/metrics/LargestContentfulPaint.js +0 -69
  690. package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +0 -1
  691. package/models/trace/lantern/metrics/MaxPotentialFID.js +0 -49
  692. package/models/trace/lantern/metrics/MaxPotentialFID.js.map +0 -1
  693. package/models/trace/lantern/metrics/Metric.js +0 -69
  694. package/models/trace/lantern/metrics/Metric.js.map +0 -1
  695. package/models/trace/lantern/metrics/SpeedIndex.js +0 -102
  696. package/models/trace/lantern/metrics/SpeedIndex.js.map +0 -1
  697. package/models/trace/lantern/metrics/TBTUtils.js +0 -65
  698. package/models/trace/lantern/metrics/TBTUtils.js.map +0 -1
  699. package/models/trace/lantern/metrics/TotalBlockingTime.js +0 -79
  700. package/models/trace/lantern/metrics/TotalBlockingTime.js.map +0 -1
  701. package/models/trace/lantern/metrics/bundle-tsconfig.json +0 -59
  702. package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +0 -27
  703. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +0 -76
  704. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +0 -43
  705. package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +0 -73
  706. package/models/trace/lantern/metrics/metrics-tsconfig.json +0 -75
  707. package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +0 -43
  708. package/models/trace/lantern/metrics/metrics.js +0 -12
  709. package/models/trace/lantern/metrics/metrics.js.map +0 -1
  710. package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +0 -72
  711. package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
  712. package/models/trace/lantern/simulation/ConnectionPool.js +0 -116
  713. package/models/trace/lantern/simulation/ConnectionPool.js.map +0 -1
  714. package/models/trace/lantern/simulation/Constants.js +0 -45
  715. package/models/trace/lantern/simulation/Constants.js.map +0 -1
  716. package/models/trace/lantern/simulation/DNSCache.js +0 -48
  717. package/models/trace/lantern/simulation/DNSCache.js.map +0 -1
  718. package/models/trace/lantern/simulation/SimulationTimingMap.js +0 -135
  719. package/models/trace/lantern/simulation/SimulationTimingMap.js.map +0 -1
  720. package/models/trace/lantern/simulation/Simulator.js +0 -455
  721. package/models/trace/lantern/simulation/Simulator.js.map +0 -1
  722. package/models/trace/lantern/simulation/TCPConnection.js +0 -155
  723. package/models/trace/lantern/simulation/TCPConnection.js.map +0 -1
  724. package/models/trace/lantern/simulation/bundle-tsconfig.json +0 -59
  725. package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +0 -27
  726. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +0 -75
  727. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +0 -42
  728. package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +0 -72
  729. package/models/trace/lantern/simulation/simulation-tsconfig.json +0 -70
  730. package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +0 -38
  731. package/models/trace/lantern/simulation/simulation.js +0 -10
  732. package/models/trace/lantern/simulation/simulation.js.map +0 -1
  733. package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +0 -67
  734. package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
  735. package/models/trace/lantern/testing/bundle-tsconfig.json +0 -60
  736. package/models/trace/lantern/testing/bundle-tsconfig.ref.json +0 -27
  737. package/models/trace/lantern/testing/testing-tsconfig.json +0 -63
  738. package/models/trace/lantern/testing/testing-tsconfig.ref.json +0 -30
  739. package/models/trace/lantern/types/Lantern.js +0 -25
  740. package/models/trace/lantern/types/Lantern.js.map +0 -1
  741. package/models/trace/lantern/types/bundle-tsconfig.json +0 -59
  742. package/models/trace/lantern/types/bundle-tsconfig.ref.json +0 -27
  743. package/models/trace/lantern/types/types-tsconfig.json +0 -59
  744. package/models/trace/lantern/types/types-tsconfig.ref.json +0 -27
  745. package/models/trace/lantern/types/types.js +0 -5
  746. package/models/trace/lantern/types/types.js.map +0 -1
  747. package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +0 -56
  748. package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
  749. package/models/trace/trace-tsconfig.json +0 -89
  750. package/models/trace/trace-tsconfig.ref.json +0 -57
  751. package/models/trace/trace.js.map +0 -1
  752. package/models/trace/trace_node_typecheck-tsconfig.json +0 -86
  753. package/models/trace/trace_node_typecheck.stamp +0 -0
  754. package/models/trace/types/Configuration.js +0 -19
  755. package/models/trace/types/Configuration.js.map +0 -1
  756. package/models/trace/types/Extensions.js +0 -38
  757. package/models/trace/types/Extensions.js.map +0 -1
  758. package/models/trace/types/File.js +0 -82
  759. package/models/trace/types/File.js.map +0 -1
  760. package/models/trace/types/Overlays.js +0 -5
  761. package/models/trace/types/Overlays.js.map +0 -1
  762. package/models/trace/types/Timing.js +0 -16
  763. package/models/trace/types/Timing.js.map +0 -1
  764. package/models/trace/types/TraceEvents.js +0 -986
  765. package/models/trace/types/TraceEvents.js.map +0 -1
  766. package/models/trace/types/bundle-tsconfig.json +0 -59
  767. package/models/trace/types/bundle-tsconfig.ref.json +0 -27
  768. package/models/trace/types/foundation_unittests-tsconfig.json +0 -67
  769. package/models/trace/types/foundation_unittests-tsconfig.ref.json +0 -34
  770. package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +0 -64
  771. package/models/trace/types/types-tsconfig.json +0 -76
  772. package/models/trace/types/types-tsconfig.ref.json +0 -44
  773. package/models/trace/types/types.js +0 -10
  774. package/models/trace/types/types.js.map +0 -1
  775. package/models/trace/types/types_node_typecheck-tsconfig.json +0 -73
  776. package/models/trace/types/types_node_typecheck.stamp +0 -0
  777. package/test/invalid-animation-events.json.gz +0 -0
  778. package/test/test-trace-engine.mjs +0 -191
  779. package/third_party/legacy-javascript/bundle-tsconfig.json +0 -59
  780. package/third_party/legacy-javascript/bundle-tsconfig.ref.json +0 -27
  781. package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +0 -15
  782. package/third_party/legacy-javascript/legacy-javascript.js +0 -3
  783. package/third_party/legacy-javascript/legacy-javascript.js.map +0 -1
  784. package/third_party/legacy-javascript/lib/legacy-javascript.js +0 -1119
  785. package/third_party/marked/marked.d.ts +0 -1
  786. package/third_party/marked/marked.js +0 -1
  787. package/third_party/third-party-web/third-party-web.js +0 -1
  788. package/tsconfig.json +0 -29
@@ -1,366 +0,0 @@
1
- // Copyright 2024 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- import * as Helpers from '../helpers/helpers.js';
5
- import * as Types from '../types/types.js';
6
- import { getLogNormalScore } from './Statistics.js';
7
- import { InsightKeys, } from './types.js';
8
- const GRAPH_SAVINGS_PRECISION = 50;
9
- export function getInsight(insightName, insightSet) {
10
- return insightSet.model[insightName];
11
- }
12
- export function isInsightKey(key) {
13
- return Object.values(InsightKeys).includes(key);
14
- }
15
- export function getLCP(insightSet) {
16
- const insight = getInsight(InsightKeys.LCP_BREAKDOWN, insightSet);
17
- if (!insight || !insight.lcpMs || !insight.lcpEvent) {
18
- return null;
19
- }
20
- const value = Helpers.Timing.milliToMicro(insight.lcpMs);
21
- return { value, event: insight.lcpEvent };
22
- }
23
- export function getINP(insightSet) {
24
- const insight = getInsight(InsightKeys.INP_BREAKDOWN, insightSet);
25
- if (!insight?.longestInteractionEvent?.dur) {
26
- return null;
27
- }
28
- const value = insight.longestInteractionEvent.dur;
29
- return { value, event: insight.longestInteractionEvent };
30
- }
31
- export function getCLS(insightSet) {
32
- const insight = getInsight(InsightKeys.CLS_CULPRITS, insightSet);
33
- if (!insight) {
34
- // Unlike the other metrics, there is always a value for CLS even with no data.
35
- return { value: 0, worstClusterEvent: null };
36
- }
37
- // TODO(cjamcl): the CLS insight should be doing this for us.
38
- let maxScore = 0;
39
- let worstCluster;
40
- for (const cluster of insight.clusters) {
41
- if (cluster.clusterCumulativeScore > maxScore) {
42
- maxScore = cluster.clusterCumulativeScore;
43
- worstCluster = cluster;
44
- }
45
- }
46
- return { value: maxScore, worstClusterEvent: worstCluster ?? null };
47
- }
48
- export function evaluateLCPMetricScore(value) {
49
- return getLogNormalScore({ p10: 2500, median: 4000 }, value);
50
- }
51
- export function evaluateINPMetricScore(value) {
52
- return getLogNormalScore({ p10: 200, median: 500 }, value);
53
- }
54
- export function evaluateCLSMetricScore(value) {
55
- return getLogNormalScore({ p10: 0.1, median: 0.25 }, value);
56
- }
57
- function getPageResult(cruxFieldData, url, origin, scope = null) {
58
- return cruxFieldData.find(result => {
59
- const key = scope ? result[`${scope.pageScope}-${scope.deviceScope}`]?.record.key :
60
- (result['url-ALL'] || result['origin-ALL'])?.record.key;
61
- return (key?.url && key.url === url) || (key?.origin && key.origin === origin);
62
- });
63
- }
64
- function getMetricResult(pageResult, name, scope = null) {
65
- const scopes = [];
66
- if (scope) {
67
- scopes.push(scope);
68
- }
69
- else {
70
- scopes.push({ pageScope: 'url', deviceScope: 'ALL' });
71
- scopes.push({ pageScope: 'origin', deviceScope: 'ALL' });
72
- }
73
- for (const scope of scopes) {
74
- const key = `${scope.pageScope}-${scope.deviceScope}`;
75
- let value = pageResult[key]?.record.metrics[name]?.percentiles?.p75;
76
- if (typeof value === 'string') {
77
- value = Number(value);
78
- }
79
- if (typeof value === 'number' && Number.isFinite(value)) {
80
- return { value, pageScope: scope.pageScope };
81
- }
82
- }
83
- return null;
84
- }
85
- function getMetricTimingResult(pageResult, name, scope = null) {
86
- const result = getMetricResult(pageResult, name, scope);
87
- if (result) {
88
- const valueMs = result.value;
89
- return { value: Helpers.Timing.milliToMicro(valueMs), pageScope: result.pageScope };
90
- }
91
- return null;
92
- }
93
- export function getFieldMetricsForInsightSet(insightSet, metadata, scope = null) {
94
- const cruxFieldData = metadata?.cruxFieldData;
95
- if (!cruxFieldData) {
96
- return null;
97
- }
98
- let pageResult = getPageResult(cruxFieldData, insightSet.url.href, insightSet.url.origin, scope);
99
- if (!pageResult && insightSet.navigation && Types.Events.isSoftNavigationStart(insightSet.navigation)) {
100
- pageResult = cruxFieldData.find(result => {
101
- const key = scope ? result[`${scope.pageScope}-${scope.deviceScope}`]?.record.key :
102
- (result['url-ALL'] || result['origin-ALL'])?.record.key;
103
- if (!key) {
104
- return false;
105
- }
106
- if (key.url) {
107
- try {
108
- return new URL(key.url).origin === insightSet.url.origin;
109
- }
110
- catch {
111
- return false;
112
- }
113
- }
114
- return key.origin === insightSet.url.origin;
115
- });
116
- }
117
- if (!pageResult) {
118
- return null;
119
- }
120
- return {
121
- fcp: getMetricTimingResult(pageResult, 'first_contentful_paint', scope),
122
- lcp: getMetricTimingResult(pageResult, 'largest_contentful_paint', scope),
123
- inp: getMetricTimingResult(pageResult, 'interaction_to_next_paint', scope),
124
- cls: getMetricResult(pageResult, 'cumulative_layout_shift', scope),
125
- lcpBreakdown: {
126
- ttfb: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_time_to_first_byte', scope),
127
- loadDelay: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_resource_load_delay', scope),
128
- loadDuration: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_resource_load_duration', scope),
129
- renderDelay: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_element_render_delay', scope),
130
- },
131
- };
132
- }
133
- export function calculateMetricWeightsForSorting(insightSet, metadata) {
134
- const weights = {
135
- lcp: 1 / 3,
136
- inp: 1 / 3,
137
- cls: 1 / 3,
138
- };
139
- const cruxFieldData = metadata?.cruxFieldData;
140
- if (!cruxFieldData) {
141
- return weights;
142
- }
143
- const fieldMetrics = getFieldMetricsForInsightSet(insightSet, metadata);
144
- if (!fieldMetrics) {
145
- return weights;
146
- }
147
- const fieldLcp = fieldMetrics.lcp?.value ?? null;
148
- const fieldInp = fieldMetrics.inp?.value ?? null;
149
- const fieldCls = fieldMetrics.cls?.value ?? null;
150
- const fieldLcpScore = fieldLcp !== null ? evaluateLCPMetricScore(Helpers.Timing.microToMilli(fieldLcp)) : 0;
151
- const fieldInpScore = fieldInp !== null ? evaluateINPMetricScore(Helpers.Timing.microToMilli(fieldInp)) : 0;
152
- const fieldClsScore = fieldCls !== null ? evaluateCLSMetricScore(fieldCls) : 0;
153
- const fieldLcpScoreInverted = 1 - fieldLcpScore;
154
- const fieldInpScoreInverted = 1 - fieldInpScore;
155
- const fieldClsScoreInverted = 1 - fieldClsScore;
156
- const invertedSum = fieldLcpScoreInverted + fieldInpScoreInverted + fieldClsScoreInverted;
157
- if (!invertedSum) {
158
- return weights;
159
- }
160
- weights.lcp = fieldLcpScoreInverted / invertedSum;
161
- weights.inp = fieldInpScoreInverted / invertedSum;
162
- weights.cls = fieldClsScoreInverted / invertedSum;
163
- return weights;
164
- }
165
- /**
166
- * Simulates the provided graph before and after the byte savings from `wastedBytesByRequestId` are applied.
167
- */
168
- function estimateSavingsWithGraphs(wastedBytesByRequestId, simulator, graph) {
169
- const simulationBeforeChanges = simulator.simulate(graph);
170
- const originalTransferSizes = new Map();
171
- graph.traverse(node => {
172
- if (node.type !== 'network') {
173
- return;
174
- }
175
- const wastedBytes = wastedBytesByRequestId.get(node.request.requestId);
176
- if (!wastedBytes) {
177
- return;
178
- }
179
- const original = node.request.transferSize;
180
- originalTransferSizes.set(node.request.requestId, original);
181
- node.request.transferSize = Math.max(original - wastedBytes, 0);
182
- });
183
- const simulationAfterChanges = simulator.simulate(graph);
184
- // Restore the original transfer size after we've done our simulation
185
- graph.traverse(node => {
186
- if (node.type !== 'network') {
187
- return;
188
- }
189
- const originalTransferSize = originalTransferSizes.get(node.request.requestId);
190
- if (originalTransferSize === undefined) {
191
- return;
192
- }
193
- node.request.transferSize = originalTransferSize;
194
- });
195
- let savings = simulationBeforeChanges.timeInMs - simulationAfterChanges.timeInMs;
196
- savings = Math.round(savings / GRAPH_SAVINGS_PRECISION) * GRAPH_SAVINGS_PRECISION;
197
- return Types.Timing.Milli(savings);
198
- }
199
- /**
200
- * Estimates the FCP & LCP savings for wasted bytes in `wastedBytesByRequestId`.
201
- */
202
- export function metricSavingsForWastedBytes(wastedBytesByRequestId, context) {
203
- if (!context.navigation || !('lantern' in context) || !context.lantern) {
204
- return;
205
- }
206
- if (!wastedBytesByRequestId.size) {
207
- return { FCP: Types.Timing.Milli(0), LCP: Types.Timing.Milli(0) };
208
- }
209
- const simulator = context.lantern.simulator;
210
- const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;
211
- const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;
212
- return {
213
- FCP: estimateSavingsWithGraphs(wastedBytesByRequestId, simulator, fcpGraph),
214
- LCP: estimateSavingsWithGraphs(wastedBytesByRequestId, simulator, lcpGraph),
215
- };
216
- }
217
- /**
218
- * Returns whether the network request was sent encoded.
219
- */
220
- export function isRequestCompressed(request) {
221
- if (!request.args.data.responseHeaders) {
222
- return false;
223
- }
224
- // FYI: In Lighthouse, older devtools logs (like our test fixtures) seems to be
225
- // lower case, while modern logs are Cased-Like-This.
226
- const patterns = [
227
- /^content-encoding$/i, /^x-content-encoding-over-network$/i,
228
- /^x-original-content-encoding$/i, // Lightrider.
229
- ];
230
- const compressionTypes = ['gzip', 'br', 'deflate', 'zstd'];
231
- return request.args.data.responseHeaders.some(header => patterns.some(p => header.name.match(p)) && compressionTypes.includes(header.value));
232
- }
233
- export function isRequestServedFromBrowserCache(request) {
234
- if (!request.args.data.responseHeaders || request.args.data.failed) {
235
- return false;
236
- }
237
- // Not Modified?
238
- if (request.args.data.statusCode === 304) {
239
- return true;
240
- }
241
- // TODO: for some reason ResourceReceiveResponse events never show a 304 status
242
- // code, so the above is never gonna work. For now, fall back to a dirty check of
243
- // looking at the ratio of transfer size and resource size. If it's really small,
244
- // we certainly did not use the network to fetch it.
245
- const { transferSize, resourceSize } = getRequestSizes(request);
246
- const ratio = resourceSize ? transferSize / resourceSize : 0;
247
- if (ratio < 0.01) {
248
- return true;
249
- }
250
- return false;
251
- }
252
- function getRequestSizes(request) {
253
- const resourceSize = request.args.data.decodedBodyLength;
254
- const transferSize = request.args.data.encodedDataLength;
255
- return { resourceSize, transferSize };
256
- }
257
- /**
258
- * Estimates the number of bytes the content of this network record would have consumed on the network based on the
259
- * uncompressed size (totalBytes). Uses the actual transfer size from the network record if applicable,
260
- * minus the size of the response headers.
261
- *
262
- * @param totalBytes Uncompressed size of the resource
263
- */
264
- export function estimateCompressedContentSize(request, totalBytes, resourceType) {
265
- if (!request || isRequestServedFromBrowserCache(request)) {
266
- // We don't know how many bytes this asset used on the network, but we can guess it was
267
- // roughly the size of the content gzipped.
268
- // See https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer for specific CSS/Script examples
269
- // See https://discuss.httparchive.org/t/file-size-and-compression-savings/145 for fallback multipliers
270
- switch (resourceType) {
271
- case 'Stylesheet':
272
- // Stylesheets tend to compress extremely well.
273
- return Math.round(totalBytes * 0.2);
274
- case 'Script':
275
- case 'Document':
276
- // Scripts and HTML compress fairly well too.
277
- return Math.round(totalBytes * 0.33);
278
- default:
279
- // Otherwise we'll just fallback to the average savings in HTTPArchive
280
- return Math.round(totalBytes * 0.5);
281
- }
282
- }
283
- // Get the size of the response body on the network.
284
- const { transferSize, resourceSize } = getRequestSizes(request);
285
- let contentTransferSize = transferSize;
286
- if (!isRequestCompressed(request)) {
287
- // This is not compressed, so we can use resourceSize directly.
288
- // This would be equivalent to transfer size minus headers transfer size, but transfer size
289
- // may also include bytes for SSL connection etc.
290
- contentTransferSize = resourceSize;
291
- }
292
- // TODO(cjamcl): Get "responseHeadersTransferSize" in Network handler.
293
- // else if (request.responseHeadersTransferSize) {
294
- // // Subtract the size of the encoded headers.
295
- // contentTransferSize =
296
- // Math.max(0, contentTransferSize - request.responseHeadersTransferSize);
297
- // }
298
- if (request.args.data.resourceType === resourceType) {
299
- // This was a regular standalone asset, just use the transfer size.
300
- return contentTransferSize;
301
- }
302
- // This was an asset that was inlined in a different resource type (e.g. HTML document).
303
- // Use the compression ratio of the resource to estimate the total transferred bytes.
304
- // Get the compression ratio, if it's an invalid number, assume no compression.
305
- const compressionRatio = Number.isFinite(resourceSize) && resourceSize > 0 ? (contentTransferSize / resourceSize) : 1;
306
- return Math.round(totalBytes * compressionRatio);
307
- }
308
- /**
309
- * Utility function to estimate the ratio of the compression of a script.
310
- * This excludes the size of the response headers.
311
- */
312
- export function estimateCompressionRatioForScript(script) {
313
- if (!script.request) {
314
- // Can't find request, so just use 1.
315
- return 1;
316
- }
317
- const request = script.request;
318
- const contentLength = request.args.data.decodedBodyLength ?? script.content?.length ?? 0;
319
- const compressedSize = estimateCompressedContentSize(request, contentLength, "Script" /* Protocol.Network.ResourceType.Script */);
320
- if (contentLength === 0 || compressedSize === 0) {
321
- return 1;
322
- }
323
- const compressionRatio = compressedSize / contentLength;
324
- return compressionRatio;
325
- }
326
- export function calculateDocFirstByteTs(docRequest) {
327
- if (docRequest.args.data.protocol === 'file') {
328
- // file: requests do not have timings
329
- return docRequest.ts;
330
- }
331
- // @ts-expect-error
332
- const isLightrider = globalThis.isLightrider;
333
- if (isLightrider) {
334
- const lrServerResponseTime = docRequest.args.data.lrServerResponseTime;
335
- if (lrServerResponseTime !== undefined) {
336
- return Types.Timing.Micro(docRequest.ts + Helpers.Timing.milliToMicro(lrServerResponseTime));
337
- }
338
- }
339
- const timing = docRequest.args.data.timing;
340
- if (!timing) {
341
- // Older traces do not have timings.
342
- return null;
343
- }
344
- // Time that first byte (headers) are received.
345
- // For older traces, receiveHeadersStart can be missing (ex: web.dev.json.gz).
346
- // In that case use the headers end timing, which should be pretty close to when
347
- // the headers start.
348
- return Types.Timing.Micro(Helpers.Timing.secondsToMicro(timing.requestTime) +
349
- Helpers.Timing.milliToMicro(timing.receiveHeadersStart ?? timing.receiveHeadersEnd));
350
- }
351
- /**
352
- * Calculates the trace bounds for the given insight that are relevant.
353
- *
354
- * Uses the insight's overlays to determine the relevant trace bounds. If there are
355
- * no overlays, falls back to the insight set's navigation bounds.
356
- */
357
- export function insightBounds(insight, insightSetBounds) {
358
- const overlays = insight.createOverlays?.() ?? [];
359
- const windows = overlays.map(Helpers.Timing.traceWindowFromOverlay).filter(bounds => !!bounds);
360
- const overlaysBounds = Helpers.Timing.combineTraceWindowsMicro(windows);
361
- if (overlaysBounds) {
362
- return overlaysBounds;
363
- }
364
- return insightSetBounds;
365
- }
366
- //# sourceMappingURL=Common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Common.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAK7B,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,WAAW,GAMZ,MAAM,YAAY,CAAC;AAEpB,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,MAAM,UAAU,UAAU,CACtB,WAAwB,EAAE,UAAsB;IAClD,OAAO,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,GAAkB,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,UAAsB;IAE3C,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAClE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,EAAC,KAAK,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QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+CAA+C;IAC/C,8EAA8E;IAC9E,gFAAgF;IAChF,qBAAqB;IACrB,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACrB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC;QACjD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,mBAAmB,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CACzB,OAAqB,EAAE,gBAA+C;IACxE,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/F,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACxE,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,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 Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../crux-manager/crux-manager.js';\nimport type * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport * as Types from '../types/types.js';\n\nimport {getLogNormalScore} from './Statistics.js';\nimport {\n InsightKeys,\n type InsightModel,\n type InsightModels,\n type InsightSet,\n type InsightSetContext,\n type MetricSavings,\n} from './types.js';\n\nconst GRAPH_SAVINGS_PRECISION = 50;\n\nexport function getInsight<InsightName extends keyof InsightModels>(\n insightName: InsightName, insightSet: InsightSet): InsightModels[InsightName] {\n return insightSet.model[insightName];\n}\n\nexport function isInsightKey(key: string): key is InsightKeys {\n return Object.values(InsightKeys).includes(key as InsightKeys);\n}\n\nexport function getLCP(insightSet: InsightSet):\n {value: Types.Timing.Micro, event: Types.Events.AnyLargestContentfulPaintCandidate}|null {\n const insight = getInsight(InsightKeys.LCP_BREAKDOWN, insightSet);\n if (!insight || !insight.lcpMs || !insight.lcpEvent) {\n return null;\n }\n\n const value = Helpers.Timing.milliToMicro(insight.lcpMs);\n return {value, event: insight.lcpEvent};\n}\n\nexport function getINP(insightSet: InsightSet):\n {value: Types.Timing.Micro, event: Types.Events.SyntheticInteractionPair}|null {\n const insight = getInsight(InsightKeys.INP_BREAKDOWN, insightSet);\n if (!insight?.longestInteractionEvent?.dur) {\n return null;\n }\n\n const value = insight.longestInteractionEvent.dur;\n return {value, event: insight.longestInteractionEvent};\n}\n\nexport function getCLS(insightSet: InsightSet): {value: number, worstClusterEvent: Types.Events.Event|null} {\n const insight = getInsight(InsightKeys.CLS_CULPRITS, insightSet);\n if (!insight) {\n // Unlike the other metrics, there is always a value for CLS even with no data.\n return {value: 0, worstClusterEvent: null};\n }\n\n // TODO(cjamcl): the CLS insight should be doing this for us.\n let maxScore = 0;\n let worstCluster;\n for (const cluster of insight.clusters) {\n if (cluster.clusterCumulativeScore > maxScore) {\n maxScore = cluster.clusterCumulativeScore;\n worstCluster = cluster;\n }\n }\n\n return {value: maxScore, worstClusterEvent: worstCluster ?? null};\n}\n\nexport function evaluateLCPMetricScore(value: Types.Timing.Milli): number {\n return getLogNormalScore({p10: 2500, median: 4000}, value);\n}\n\nexport function evaluateINPMetricScore(value: Types.Timing.Milli): number {\n return getLogNormalScore({p10: 200, median: 500}, value);\n}\n\nexport function evaluateCLSMetricScore(value: number): number {\n return getLogNormalScore({p10: 0.1, median: 0.25}, value);\n}\n\nexport interface CrUXFieldMetricTimingResult {\n value: Types.Timing.Micro;\n pageScope: CrUXManager.PageScope;\n}\nexport interface CrUXFieldMetricNumberResult {\n value: number;\n pageScope: CrUXManager.PageScope;\n}\nexport interface CrUXFieldMetricResults {\n fcp: CrUXFieldMetricTimingResult|null;\n lcp: CrUXFieldMetricTimingResult|null;\n inp: CrUXFieldMetricTimingResult|null;\n cls: CrUXFieldMetricNumberResult|null;\n lcpBreakdown: {\n ttfb: CrUXFieldMetricTimingResult|null,\n loadDelay: CrUXFieldMetricTimingResult|null,\n loadDuration: CrUXFieldMetricTimingResult|null,\n renderDelay: CrUXFieldMetricTimingResult|null,\n };\n}\n\nfunction getPageResult(\n cruxFieldData: CrUXManager.PageResult[], url: string, origin: string,\n scope: CrUXManager.Scope|null = null): CrUXManager.PageResult|undefined {\n return cruxFieldData.find(result => {\n const key = scope ? result[`${scope.pageScope}-${scope.deviceScope}`]?.record.key :\n (result['url-ALL'] || result['origin-ALL'])?.record.key;\n return (key?.url && key.url === url) || (key?.origin && key.origin === origin);\n });\n}\n\nfunction getMetricResult(\n pageResult: CrUXManager.PageResult, name: CrUXManager.StandardMetricNames,\n scope: CrUXManager.Scope|null = null): CrUXFieldMetricNumberResult|null {\n const scopes: Array<{pageScope: CrUXManager.PageScope, deviceScope: CrUXManager.DeviceScope}> = [];\n if (scope) {\n scopes.push(scope);\n } else {\n scopes.push({pageScope: 'url', deviceScope: 'ALL'});\n scopes.push({pageScope: 'origin', deviceScope: 'ALL'});\n }\n\n for (const scope of scopes) {\n const key = `${scope.pageScope}-${scope.deviceScope}` as const;\n let value = pageResult[key]?.record.metrics[name]?.percentiles?.p75;\n if (typeof value === 'string') {\n value = Number(value);\n }\n if (typeof value === 'number' && Number.isFinite(value)) {\n return {value, pageScope: scope.pageScope};\n }\n }\n\n return null;\n}\n\nfunction getMetricTimingResult(\n pageResult: CrUXManager.PageResult, name: CrUXManager.StandardMetricNames,\n scope: CrUXManager.Scope|null = null): CrUXFieldMetricTimingResult|null {\n const result = getMetricResult(pageResult, name, scope);\n if (result) {\n const valueMs = result.value as Types.Timing.Milli;\n return {value: Helpers.Timing.milliToMicro(valueMs), pageScope: result.pageScope};\n }\n\n return null;\n}\n\nexport function getFieldMetricsForInsightSet(\n insightSet: InsightSet, metadata: Types.File.MetaData|null,\n scope: CrUXManager.Scope|null = null): CrUXFieldMetricResults|null {\n const cruxFieldData = metadata?.cruxFieldData;\n if (!cruxFieldData) {\n return null;\n }\n\n let pageResult = getPageResult(cruxFieldData, insightSet.url.href, insightSet.url.origin, scope);\n\n if (!pageResult && insightSet.navigation && Types.Events.isSoftNavigationStart(insightSet.navigation)) {\n pageResult = cruxFieldData.find(result => {\n const key = scope ? result[`${scope.pageScope}-${scope.deviceScope}`]?.record.key :\n (result['url-ALL'] || result['origin-ALL'])?.record.key;\n if (!key) {\n return false;\n }\n if (key.url) {\n try {\n return new URL(key.url).origin === insightSet.url.origin;\n } catch {\n return false;\n }\n }\n return key.origin === insightSet.url.origin;\n });\n }\n\n if (!pageResult) {\n return null;\n }\n\n return {\n fcp: getMetricTimingResult(pageResult, 'first_contentful_paint', scope),\n lcp: getMetricTimingResult(pageResult, 'largest_contentful_paint', scope),\n inp: getMetricTimingResult(pageResult, 'interaction_to_next_paint', scope),\n cls: getMetricResult(pageResult, 'cumulative_layout_shift', scope),\n lcpBreakdown: {\n ttfb: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_time_to_first_byte', scope),\n loadDelay: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_resource_load_delay', scope),\n loadDuration: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_resource_load_duration', scope),\n renderDelay: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_element_render_delay', scope),\n },\n };\n}\n\nexport function calculateMetricWeightsForSorting(\n insightSet: InsightSet, metadata: Types.File.MetaData|null): {lcp: number, inp: number, cls: number} {\n const weights = {\n lcp: 1 / 3,\n inp: 1 / 3,\n cls: 1 / 3,\n };\n\n const cruxFieldData = metadata?.cruxFieldData;\n if (!cruxFieldData) {\n return weights;\n }\n\n const fieldMetrics = getFieldMetricsForInsightSet(insightSet, metadata);\n if (!fieldMetrics) {\n return weights;\n }\n\n const fieldLcp = fieldMetrics.lcp?.value ?? null;\n const fieldInp = fieldMetrics.inp?.value ?? null;\n const fieldCls = fieldMetrics.cls?.value ?? null;\n const fieldLcpScore = fieldLcp !== null ? evaluateLCPMetricScore(Helpers.Timing.microToMilli(fieldLcp)) : 0;\n const fieldInpScore = fieldInp !== null ? evaluateINPMetricScore(Helpers.Timing.microToMilli(fieldInp)) : 0;\n const fieldClsScore = fieldCls !== null ? evaluateCLSMetricScore(fieldCls) : 0;\n const fieldLcpScoreInverted = 1 - fieldLcpScore;\n const fieldInpScoreInverted = 1 - fieldInpScore;\n const fieldClsScoreInverted = 1 - fieldClsScore;\n const invertedSum = fieldLcpScoreInverted + fieldInpScoreInverted + fieldClsScoreInverted;\n if (!invertedSum) {\n return weights;\n }\n\n weights.lcp = fieldLcpScoreInverted / invertedSum;\n weights.inp = fieldInpScoreInverted / invertedSum;\n weights.cls = fieldClsScoreInverted / invertedSum;\n\n return weights;\n}\n\n/**\n * Simulates the provided graph before and after the byte savings from `wastedBytesByRequestId` are applied.\n */\nfunction estimateSavingsWithGraphs(\n wastedBytesByRequestId: Map<string, number>, simulator: Lantern.Simulation.Simulator,\n graph: Lantern.Graph.Node): Types.Timing.Milli {\n const simulationBeforeChanges = simulator.simulate(graph);\n\n const originalTransferSizes = new Map<string, number>();\n graph.traverse(node => {\n if (node.type !== 'network') {\n return;\n }\n const wastedBytes = wastedBytesByRequestId.get(node.request.requestId);\n if (!wastedBytes) {\n return;\n }\n\n const original = node.request.transferSize;\n originalTransferSizes.set(node.request.requestId, original);\n\n node.request.transferSize = Math.max(original - wastedBytes, 0);\n });\n\n const simulationAfterChanges = simulator.simulate(graph);\n\n // Restore the original transfer size after we've done our simulation\n graph.traverse(node => {\n if (node.type !== 'network') {\n return;\n }\n const originalTransferSize = originalTransferSizes.get(node.request.requestId);\n if (originalTransferSize === undefined) {\n return;\n }\n node.request.transferSize = originalTransferSize;\n });\n\n let savings = simulationBeforeChanges.timeInMs - simulationAfterChanges.timeInMs;\n savings = Math.round(savings / GRAPH_SAVINGS_PRECISION) * GRAPH_SAVINGS_PRECISION;\n return Types.Timing.Milli(savings);\n}\n\n/**\n * Estimates the FCP & LCP savings for wasted bytes in `wastedBytesByRequestId`.\n */\nexport function metricSavingsForWastedBytes(\n wastedBytesByRequestId: Map<string, number>, context: InsightSetContext): MetricSavings|undefined {\n if (!context.navigation || !('lantern' in context) || !context.lantern) {\n return;\n }\n\n if (!wastedBytesByRequestId.size) {\n return {FCP: Types.Timing.Milli(0), LCP: Types.Timing.Milli(0)};\n }\n\n const simulator = context.lantern.simulator;\n const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;\n const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;\n\n return {\n FCP: estimateSavingsWithGraphs(wastedBytesByRequestId, simulator, fcpGraph),\n LCP: estimateSavingsWithGraphs(wastedBytesByRequestId, simulator, lcpGraph),\n };\n}\n\n/**\n * Returns whether the network request was sent encoded.\n */\nexport function isRequestCompressed(request: Types.Events.SyntheticNetworkRequest): boolean {\n if (!request.args.data.responseHeaders) {\n return false;\n }\n\n // FYI: In Lighthouse, older devtools logs (like our test fixtures) seems to be\n // lower case, while modern logs are Cased-Like-This.\n const patterns = [\n /^content-encoding$/i, /^x-content-encoding-over-network$/i,\n /^x-original-content-encoding$/i, // Lightrider.\n ];\n const compressionTypes = ['gzip', 'br', 'deflate', 'zstd'];\n return request.args.data.responseHeaders.some(\n header => patterns.some(p => header.name.match(p)) && compressionTypes.includes(header.value));\n}\n\nexport function isRequestServedFromBrowserCache(request: Types.Events.SyntheticNetworkRequest): boolean {\n if (!request.args.data.responseHeaders || request.args.data.failed) {\n return false;\n }\n\n // Not Modified?\n if (request.args.data.statusCode === 304) {\n return true;\n }\n\n // TODO: for some reason ResourceReceiveResponse events never show a 304 status\n // code, so the above is never gonna work. For now, fall back to a dirty check of\n // looking at the ratio of transfer size and resource size. If it's really small,\n // we certainly did not use the network to fetch it.\n\n const {transferSize, resourceSize} = getRequestSizes(request);\n const ratio = resourceSize ? transferSize / resourceSize : 0;\n if (ratio < 0.01) {\n return true;\n }\n\n return false;\n}\n\nfunction getRequestSizes(request: Types.Events.SyntheticNetworkRequest): {resourceSize: number, transferSize: number} {\n const resourceSize = request.args.data.decodedBodyLength;\n const transferSize = request.args.data.encodedDataLength;\n return {resourceSize, transferSize};\n}\n\n/**\n * Estimates the number of bytes the content of this network record would have consumed on the network based on the\n * uncompressed size (totalBytes). Uses the actual transfer size from the network record if applicable,\n * minus the size of the response headers.\n *\n * @param totalBytes Uncompressed size of the resource\n */\nexport function estimateCompressedContentSize(\n request: Types.Events.SyntheticNetworkRequest|undefined, totalBytes: number,\n resourceType: Protocol.Network.ResourceType): number {\n if (!request || isRequestServedFromBrowserCache(request)) {\n // We don't know how many bytes this asset used on the network, but we can guess it was\n // roughly the size of the content gzipped.\n // See https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer for specific CSS/Script examples\n // See https://discuss.httparchive.org/t/file-size-and-compression-savings/145 for fallback multipliers\n switch (resourceType) {\n case 'Stylesheet':\n // Stylesheets tend to compress extremely well.\n return Math.round(totalBytes * 0.2);\n case 'Script':\n case 'Document':\n // Scripts and HTML compress fairly well too.\n return Math.round(totalBytes * 0.33);\n default:\n // Otherwise we'll just fallback to the average savings in HTTPArchive\n return Math.round(totalBytes * 0.5);\n }\n }\n\n // Get the size of the response body on the network.\n const {transferSize, resourceSize} = getRequestSizes(request);\n let contentTransferSize = transferSize;\n if (!isRequestCompressed(request)) {\n // This is not compressed, so we can use resourceSize directly.\n // This would be equivalent to transfer size minus headers transfer size, but transfer size\n // may also include bytes for SSL connection etc.\n contentTransferSize = resourceSize;\n }\n // TODO(cjamcl): Get \"responseHeadersTransferSize\" in Network handler.\n // else if (request.responseHeadersTransferSize) {\n // // Subtract the size of the encoded headers.\n // contentTransferSize =\n // Math.max(0, contentTransferSize - request.responseHeadersTransferSize);\n // }\n\n if (request.args.data.resourceType === resourceType) {\n // This was a regular standalone asset, just use the transfer size.\n return contentTransferSize;\n }\n\n // This was an asset that was inlined in a different resource type (e.g. HTML document).\n // Use the compression ratio of the resource to estimate the total transferred bytes.\n // Get the compression ratio, if it's an invalid number, assume no compression.\n const compressionRatio = Number.isFinite(resourceSize) && resourceSize > 0 ? (contentTransferSize / resourceSize) : 1;\n return Math.round(totalBytes * compressionRatio);\n}\n\n/**\n * Utility function to estimate the ratio of the compression of a script.\n * This excludes the size of the response headers.\n */\nexport function estimateCompressionRatioForScript(script: Handlers.ModelHandlers.Scripts.Script): number {\n if (!script.request) {\n // Can't find request, so just use 1.\n return 1;\n }\n\n const request = script.request;\n const contentLength = request.args.data.decodedBodyLength ?? script.content?.length ?? 0;\n const compressedSize = estimateCompressedContentSize(request, contentLength, Protocol.Network.ResourceType.Script);\n if (contentLength === 0 || compressedSize === 0) {\n return 1;\n }\n\n const compressionRatio = compressedSize / contentLength;\n return compressionRatio;\n}\n\nexport function calculateDocFirstByteTs(docRequest: Types.Events.SyntheticNetworkRequest): Types.Timing.Micro|null {\n if (docRequest.args.data.protocol === 'file') {\n // file: requests do not have timings\n return docRequest.ts;\n }\n\n // @ts-expect-error\n const isLightrider = globalThis.isLightrider;\n if (isLightrider) {\n const lrServerResponseTime = docRequest.args.data.lrServerResponseTime;\n if (lrServerResponseTime !== undefined) {\n return Types.Timing.Micro(docRequest.ts + Helpers.Timing.milliToMicro(lrServerResponseTime));\n }\n }\n\n const timing = docRequest.args.data.timing;\n if (!timing) {\n // Older traces do not have timings.\n return null;\n }\n\n // Time that first byte (headers) are received.\n // For older traces, receiveHeadersStart can be missing (ex: web.dev.json.gz).\n // In that case use the headers end timing, which should be pretty close to when\n // the headers start.\n return Types.Timing.Micro(\n Helpers.Timing.secondsToMicro(timing.requestTime) +\n Helpers.Timing.milliToMicro(timing.receiveHeadersStart ?? timing.receiveHeadersEnd));\n}\n\n/**\n * Calculates the trace bounds for the given insight that are relevant.\n *\n * Uses the insight's overlays to determine the relevant trace bounds. If there are\n * no overlays, falls back to the insight set's navigation bounds.\n */\nexport function insightBounds(\n insight: InsightModel, insightSetBounds: Types.Timing.TraceWindowMicro): Types.Timing.TraceWindowMicro {\n const overlays = insight.createOverlays?.() ?? [];\n const windows = overlays.map(Helpers.Timing.traceWindowFromOverlay).filter(bounds => !!bounds);\n const overlaysBounds = Helpers.Timing.combineTraceWindowsMicro(windows);\n if (overlaysBounds) {\n return overlaysBounds;\n }\n\n return insightSetBounds;\n}\n"]}
@@ -1,182 +0,0 @@
1
- // Copyright 2024 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- // import * as i18n from '../../../core/i18n/i18n.js';
5
- import * as Handlers from '../handlers/handlers.js';
6
- import * as Helpers from '../helpers/helpers.js';
7
- import * as Types from '../types/types.js';
8
- import { InsightCategory, InsightKeys, } from './types.js';
9
- export const UIStrings = {
10
- /**
11
- * @description Title of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. "DOM" is an acronym and should not be translated.
12
- */
13
- title: 'Optimize DOM size',
14
- /**
15
- * @description Description of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. "DOM" is an acronym and should not be translated. "layout reflows" are when the browser will recompute the layout of content on the page.
16
- */
17
- description: 'A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).',
18
- /**
19
- * @description Header for a column containing the names of statistics as opposed to the actual statistic values.
20
- */
21
- statistic: 'Statistic',
22
- /**
23
- * @description Header for a column containing the value of a statistic.
24
- */
25
- value: 'Value',
26
- /**
27
- * @description Header for a column containing the page element related to a statistic.
28
- */
29
- element: 'Element',
30
- /**
31
- * @description Label for a value representing the total number of elements on the page.
32
- */
33
- totalElements: 'Total elements',
34
- /**
35
- * @description Label for a value representing the maximum depth of the Document Object Model (DOM). "DOM" is an acronym and should not be translated.
36
- */
37
- maxDOMDepth: 'DOM depth',
38
- /**
39
- * @description Label for a value representing the maximum number of child elements of any parent element on the page.
40
- */
41
- maxChildren: 'Most children',
42
- /**
43
- * @description Text for a section.
44
- */
45
- topUpdatesDescription: 'These are the largest layout and style recalculation events. Their performance impact may be reduced by making the DOM simpler.',
46
- /**
47
- * @description Label used for a time duration.
48
- */
49
- duration: 'Duration',
50
- /**
51
- * @description Message displayed in a table detailing how big a layout (rendering) is.
52
- * @example {134} PH1
53
- */
54
- largeLayout: 'Layout ({PH1} objects)',
55
- /**
56
- * @description Message displayed in a table detailing how big a style recalculation (rendering) is.
57
- * @example {134} PH1
58
- */
59
- largeStyleRecalc: 'Style recalculation ({PH1} elements)',
60
- };
61
- // const str_ = i18n.i18n.registerUIStrings('models/trace/insights/DOMSize.ts', UIStrings);
62
- export const i18nString = (i18nId, values) => ({i18nId, values}); // i18n.i18n.getLocalizedString.bind(undefined, str_);
63
- const DOM_SIZE_DURATION_THRESHOLD = Helpers.Timing.milliToMicro(Types.Timing.Milli(40));
64
- // These thresholds were selected to maximize the number of long (>40ms) events above
65
- // the threshold while maximizing the number of short (<40ms) events below the threshold.
66
- // See go/rpp-dom-size-thresholds for the analysis that produced these thresholds.
67
- const LAYOUT_OBJECTS_THRESHOLD = 100;
68
- const STYLE_RECALC_ELEMENTS_THRESHOLD = 300;
69
- function finalize(partialModel) {
70
- const relatedEvents = [...partialModel.largeLayoutUpdates, ...partialModel.largeStyleRecalcs];
71
- return {
72
- insightKey: InsightKeys.DOM_SIZE,
73
- strings: UIStrings,
74
- title: i18nString(UIStrings.title),
75
- description: i18nString(UIStrings.description),
76
- docs: 'https://developer.chrome.com/docs/performance/insights/dom-size',
77
- category: InsightCategory.INP,
78
- state: relatedEvents.length > 0 ? 'informative' : 'pass',
79
- ...partialModel,
80
- relatedEvents,
81
- };
82
- }
83
- export function isDomSizeInsight(model) {
84
- return model.insightKey === InsightKeys.DOM_SIZE;
85
- }
86
- export function generateInsight(data, context) {
87
- const isWithinContext = (event) => Helpers.Timing.eventIsInBounds(event, context.bounds);
88
- const mainTid = context.navigation?.tid;
89
- const largeLayoutUpdates = [];
90
- const largeStyleRecalcs = [];
91
- const threads = Handlers.Threads.threadsInRenderer(data.Renderer);
92
- for (const thread of threads) {
93
- if (thread.type !== Handlers.Threads.ThreadType.MAIN_THREAD) {
94
- continue;
95
- }
96
- if (mainTid === undefined) {
97
- // We won't have a specific thread ID to reference if the context does not have a navigation.
98
- // In this case, we'll just filter out any OOPIFs threads.
99
- if (!thread.processIsOnMainFrame) {
100
- continue;
101
- }
102
- }
103
- else if (thread.tid !== mainTid) {
104
- continue;
105
- }
106
- const rendererThread = data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid);
107
- if (!rendererThread) {
108
- continue;
109
- }
110
- const { entries, layoutEvents, recalcStyleEvents } = rendererThread;
111
- if (!entries.length) {
112
- continue;
113
- }
114
- const first = entries[0];
115
- const last = entries[entries.length - 1];
116
- const timeRange = Helpers.Timing.traceWindowFromMicroSeconds(first.ts, Types.Timing.Micro(last.ts + (last.dur ?? 0)));
117
- if (!Helpers.Timing.boundsIncludeTimeRange({ timeRange, bounds: context.bounds })) {
118
- continue;
119
- }
120
- for (const event of layoutEvents) {
121
- if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {
122
- continue;
123
- }
124
- const { dirtyObjects } = event.args.beginData;
125
- if (dirtyObjects > LAYOUT_OBJECTS_THRESHOLD) {
126
- largeLayoutUpdates.push(event);
127
- }
128
- }
129
- for (const event of recalcStyleEvents) {
130
- if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {
131
- continue;
132
- }
133
- const { elementCount } = event.args;
134
- if (elementCount > STYLE_RECALC_ELEMENTS_THRESHOLD) {
135
- largeStyleRecalcs.push(event);
136
- }
137
- }
138
- }
139
- const largeUpdates = [
140
- ...largeLayoutUpdates.map(event => {
141
- const duration = (event.dur / 1000);
142
- const size = event.args.beginData.dirtyObjects;
143
- const label = i18nString(UIStrings.largeLayout, { PH1: size });
144
- return { label, duration, size, event };
145
- }),
146
- ...largeStyleRecalcs.map(event => {
147
- const duration = (event.dur / 1000);
148
- const size = event.args.elementCount;
149
- const label = i18nString(UIStrings.largeStyleRecalc, { PH1: size });
150
- return { label, duration, size, event };
151
- }),
152
- ].sort((a, b) => b.duration - a.duration).slice(0, 5);
153
- const domStatsEvents = data.DOMStats.domStatsByFrameId.get(context.frameId)?.filter(isWithinContext) ?? [];
154
- let maxDOMStats;
155
- for (const domStats of domStatsEvents) {
156
- // While recording a cross-origin navigation, there can be overlapping dom stats from before & after
157
- // the navigation which share a frameId. In this case we should also ensure the pid matches up with
158
- // the navigation we care about (i.e. from after the navigation event).
159
- const navigationPid = context.navigation?.pid;
160
- if (navigationPid && domStats.pid !== navigationPid) {
161
- continue;
162
- }
163
- if (!maxDOMStats || domStats.args.data.totalElements > maxDOMStats.args.data.totalElements) {
164
- maxDOMStats = domStats;
165
- }
166
- }
167
- return finalize({
168
- largeLayoutUpdates,
169
- largeStyleRecalcs,
170
- largeUpdates,
171
- maxDOMStats,
172
- });
173
- }
174
- export function createOverlays(model) {
175
- const entries = [...model.largeStyleRecalcs, ...model.largeLayoutUpdates];
176
- return entries.map(entry => ({
177
- type: 'ENTRY_OUTLINE',
178
- entry,
179
- outlineReason: 'ERROR',
180
- }));
181
- }
182
- //# sourceMappingURL=DOMSize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DOMSize.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/DOMSize.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,K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,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEtD,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IAC3G,IAAI,WAA4C,CAAC;IACjD,KAAK,MAAM,QAAQ,IAAI,cAAc,EAAE,CAAC;QACtC,oGAAoG;QACpG,mGAAmG;QACnG,uEAAuE;QACvE,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;QAC9C,IAAI,aAAa,IAAI,QAAQ,CAAC,GAAG,KAAK,aAAa,EAAE,CAAC;YACpD,SAAS;QACX,CAAC;QAED,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3F,WAAW,GAAG,QAAQ,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;QACd,kBAAkB;QAClB,iBAAiB;QACjB,YAAY;QACZ,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,iBAAiB,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC1E,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,eAAe;QACrB,KAAK;QACL,aAAa,EAAE,OAAO;KACvB,CAAC,CAAC,CAAC;AACzB,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 type * as Common from '../../../core/common/common.js';\nimport * as i18n from '../../../core/i18n/i18n.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 type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. \"DOM\" is an acronym and should not be translated.\n */\n title: 'Optimize DOM size',\n /**\n * @description Description of an insight that recommends reducing the size of the DOM tree as a means to improve page responsiveness. \"DOM\" is an acronym and should not be translated. \"layout reflows\" are when the browser will recompute the layout of content on the page.\n */\n description:\n 'A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).',\n /**\n * @description Header for a column containing the names of statistics as opposed to the actual statistic values.\n */\n statistic: 'Statistic',\n /**\n * @description Header for a column containing the value of a statistic.\n */\n value: 'Value',\n /**\n * @description Header for a column containing the page element related to a statistic.\n */\n element: 'Element',\n /**\n * @description Label for a value representing the total number of elements on the page.\n */\n totalElements: 'Total elements',\n /**\n * @description Label for a value representing the maximum depth of the Document Object Model (DOM). \"DOM\" is an acronym and should not be translated.\n */\n maxDOMDepth: 'DOM depth',\n /**\n * @description Label for a value representing the maximum number of child elements of any parent element on the page.\n */\n maxChildren: 'Most children',\n /**\n * @description Text for a section.\n */\n topUpdatesDescription:\n 'These are the largest layout and style recalculation events. Their performance impact may be reduced by making the DOM simpler.',\n /**\n * @description Label used for a time duration.\n */\n duration: 'Duration',\n /**\n * @description Message displayed in a table detailing how big a layout (rendering) is.\n * @example {134} PH1\n */\n largeLayout: 'Layout ({PH1} objects)',\n /**\n * @description Message displayed in a table detailing how big a style recalculation (rendering) is.\n * @example {134} PH1\n */\n largeStyleRecalc: 'Style recalculation ({PH1} elements)',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/DOMSize.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nconst DOM_SIZE_DURATION_THRESHOLD = Helpers.Timing.milliToMicro(Types.Timing.Milli(40));\n\n// These thresholds were selected to maximize the number of long (>40ms) events above\n// the threshold while maximizing the number of short (<40ms) events below the threshold.\n// See go/rpp-dom-size-thresholds for the analysis that produced these thresholds.\nconst LAYOUT_OBJECTS_THRESHOLD = 100;\nconst STYLE_RECALC_ELEMENTS_THRESHOLD = 300;\n\nexport type DOMSizeInsightModel = InsightModel<typeof UIStrings, {\n largeLayoutUpdates: Types.Events.Layout[],\n largeStyleRecalcs: Types.Events.RecalcStyle[],\n largeUpdates: Array<\n {label: Common.UIString.LocalizedString, duration: Types.Timing.Milli, size: number, event: Types.Events.Event}>,\n maxDOMStats?: Types.Events.DOMStats,\n}>;\n\nfunction finalize(partialModel: PartialInsightModel<DOMSizeInsightModel>): DOMSizeInsightModel {\n const relatedEvents = [...partialModel.largeLayoutUpdates, ...partialModel.largeStyleRecalcs];\n return {\n insightKey: InsightKeys.DOM_SIZE,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/dom-size',\n category: InsightCategory.INP,\n state: relatedEvents.length > 0 ? 'informative' : 'pass',\n ...partialModel,\n relatedEvents,\n };\n}\n\nexport function isDomSizeInsight(model: InsightModel): model is DOMSizeInsightModel {\n return model.insightKey === InsightKeys.DOM_SIZE;\n}\n\nexport function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): DOMSizeInsightModel {\n const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);\n\n const mainTid = context.navigation?.tid;\n\n const largeLayoutUpdates: Types.Events.Layout[] = [];\n const largeStyleRecalcs: Types.Events.RecalcStyle[] = [];\n\n const threads = Handlers.Threads.threadsInRenderer(data.Renderer);\n for (const thread of threads) {\n if (thread.type !== Handlers.Threads.ThreadType.MAIN_THREAD) {\n continue;\n }\n\n if (mainTid === undefined) {\n // We won't have a specific thread ID to reference if the context does not have a navigation.\n // In this case, we'll just filter out any OOPIFs threads.\n if (!thread.processIsOnMainFrame) {\n continue;\n }\n } else if (thread.tid !== mainTid) {\n continue;\n }\n\n const rendererThread = data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid);\n if (!rendererThread) {\n continue;\n }\n\n const {entries, layoutEvents, recalcStyleEvents} = rendererThread;\n if (!entries.length) {\n continue;\n }\n\n const first = entries[0];\n const last = entries[entries.length - 1];\n const timeRange =\n Helpers.Timing.traceWindowFromMicroSeconds(first.ts, Types.Timing.Micro(last.ts + (last.dur ?? 0)));\n if (!Helpers.Timing.boundsIncludeTimeRange({timeRange, bounds: context.bounds})) {\n continue;\n }\n\n for (const event of layoutEvents) {\n if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {\n continue;\n }\n\n const {dirtyObjects} = event.args.beginData;\n if (dirtyObjects > LAYOUT_OBJECTS_THRESHOLD) {\n largeLayoutUpdates.push(event);\n }\n }\n\n for (const event of recalcStyleEvents) {\n if (event.dur < DOM_SIZE_DURATION_THRESHOLD || !isWithinContext(event)) {\n continue;\n }\n\n const {elementCount} = event.args;\n if (elementCount > STYLE_RECALC_ELEMENTS_THRESHOLD) {\n largeStyleRecalcs.push(event);\n }\n }\n }\n\n const largeUpdates: DOMSizeInsightModel['largeUpdates'] = [\n ...largeLayoutUpdates.map(event => {\n const duration = (event.dur / 1000) as Types.Timing.Milli;\n const size = event.args.beginData.dirtyObjects;\n const label = i18nString(UIStrings.largeLayout, {PH1: size});\n return {label, duration, size, event};\n }),\n ...largeStyleRecalcs.map(event => {\n const duration = (event.dur / 1000) as Types.Timing.Milli;\n const size = event.args.elementCount;\n const label = i18nString(UIStrings.largeStyleRecalc, {PH1: size});\n return {label, duration, size, event};\n }),\n ].sort((a, b) => b.duration - a.duration).slice(0, 5);\n\n const domStatsEvents = data.DOMStats.domStatsByFrameId.get(context.frameId)?.filter(isWithinContext) ?? [];\n let maxDOMStats: Types.Events.DOMStats|undefined;\n for (const domStats of domStatsEvents) {\n // While recording a cross-origin navigation, there can be overlapping dom stats from before & after\n // the navigation which share a frameId. In this case we should also ensure the pid matches up with\n // the navigation we care about (i.e. from after the navigation event).\n const navigationPid = context.navigation?.pid;\n if (navigationPid && domStats.pid !== navigationPid) {\n continue;\n }\n\n if (!maxDOMStats || domStats.args.data.totalElements > maxDOMStats.args.data.totalElements) {\n maxDOMStats = domStats;\n }\n }\n\n return finalize({\n largeLayoutUpdates,\n largeStyleRecalcs,\n largeUpdates,\n maxDOMStats,\n });\n}\n\nexport function createOverlays(model: DOMSizeInsightModel): Types.Overlays.Overlay[] {\n const entries = [...model.largeStyleRecalcs, ...model.largeLayoutUpdates];\n return entries.map(entry => ({\n type: 'ENTRY_OUTLINE',\n entry,\n outlineReason: 'ERROR',\n }));\n}\n"]}