@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 +0,0 @@
1
- {"version":3,"file":"LegacyJavaScript.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/LegacyJavaScript.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,mBAAmB,MAAM,6DAA6D,CAAC;AAEnG,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAC,iCAAiC,EAAE,2BAA2B,EAAC,MAAM,aAAa,CAAC;AAC3F,OAAO,EACL,eAAe,EACf,WAAW,GAIZ,MAAM,YAAY,CAAC;AAEpB,MAAM,EAAC,sBAAsB,EAAC,GAAG,mBAAmB,CAAC,gBAAgB,CAAC;AAEtE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,mBAAmB;IAC1B;;OAEG;IACH,WAAW,EACP,wcAAwc;IAC5c;;OAEG;IACH,YAAY,EAAE,QAAQ;IACtB;;OAEG;IACH,iBAAiB,EAAE,cAAc;IACjC;;OAEG;IACH,kBAAkB,EAAE,4BAA4B;CACxC,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,2CAA2C,EAAE,SAAS,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,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AAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAEhH,OAAO,QAAQ,CAAC;QACd,uBAAuB,EAAE,MAAM;QAC/B,aAAa,EAAE,2BAA2B,CAAC,sBAAsB,EAAE,OAAO,CAAC;QAC3E,WAAW,EAAE,sBAAsB,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;KAChF,CAAC,CAAC;AACL,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,KAAmC;IAChE,OAAO,CAAC,GAAG,KAAK,CAAC,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAC5G,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,OAAO;YACd,aAAa,EAAE,OAAO;SACvB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright 2025 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as LegacyJavaScriptLib from '../../../third_party/legacy-javascript/legacy-javascript.js';\nimport type * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport type * as Types from '../types/types.js';\n\nimport {estimateCompressionRatioForScript, metricSavingsForWastedBytes} from './Common.js';\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type PartialInsightModel,\n} from './types.js';\n\nconst {detectLegacyJavaScript} = LegacyJavaScriptLib.LegacyJavaScript;\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.\n */\n title: 'Legacy JavaScript',\n /**\n * @description Description of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.\n */\n description:\n 'Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren’t necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://developer.chrome.com/docs/performance/insights/legacy-javascript).',\n /**\n * @description Label for a column in a data table; entries will be the individual JavaScript scripts.\n */\n columnScript: 'Script',\n /**\n * @description Label for a column in a data table; entries will be the number of wasted bytes (aka the estimated savings in terms of bytes).\n */\n columnWastedBytes: 'Wasted bytes',\n /**\n * @description Message shown when no legacy JavaScript is found.\n */\n noLegacyJavaScript: 'No legacy JavaScript found',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/LegacyJavaScript.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport interface PatternMatchResult {\n name: string;\n line: number;\n column: number;\n}\n\ninterface LegacyJavaScriptResult {\n matches: PatternMatchResult[];\n estimatedByteSavings: number;\n}\n\ntype LegacyJavaScriptResults = Map<Handlers.ModelHandlers.Scripts.Script, LegacyJavaScriptResult>;\n\nexport type LegacyJavaScriptInsightModel = InsightModel<typeof UIStrings, {\n legacyJavaScriptResults: LegacyJavaScriptResults,\n}>;\n\nconst BYTE_THRESHOLD = 5000;\n\nfunction finalize(partialModel: PartialInsightModel<LegacyJavaScriptInsightModel>): LegacyJavaScriptInsightModel {\n const requests = [...partialModel.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e);\n\n return {\n insightKey: InsightKeys.LEGACY_JAVASCRIPT,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/legacy-javascript',\n category: InsightCategory.ALL,\n state: requests.length ? 'fail' : 'pass',\n relatedEvents: [...new Set(requests)],\n ...partialModel,\n };\n}\n\nexport function isLegacyJavaScript(model: InsightModel): model is LegacyJavaScriptInsightModel {\n return model.insightKey === InsightKeys.LEGACY_JAVASCRIPT;\n}\n\nexport function generateInsight(\n data: Handlers.Types.HandlerData, context: InsightSetContext): LegacyJavaScriptInsightModel {\n const scripts = data.Scripts.scripts.filter(script => {\n if (script.frame !== context.frameId) {\n return false;\n }\n\n if (script.url?.startsWith('chrome-extension://')) {\n return false;\n }\n\n return Helpers.Timing.timestampIsInBounds(context.bounds, script.ts) ||\n (script.request && Helpers.Timing.eventIsInBounds(script.request, context.bounds));\n });\n\n const legacyJavaScriptResults: LegacyJavaScriptResults = new Map();\n const wastedBytesByRequestId = new Map<string, number>();\n\n for (const script of scripts) {\n if (!script.content || script.content.length < BYTE_THRESHOLD) {\n continue;\n }\n\n const result = detectLegacyJavaScript(script.content, script.sourceMap);\n if (result.estimatedByteSavings < BYTE_THRESHOLD) {\n continue;\n }\n\n // Translate from resource size to transfer size.\n const compressionRatio = estimateCompressionRatioForScript(script);\n const transferSize = Math.round(result.estimatedByteSavings * compressionRatio);\n result.estimatedByteSavings = transferSize;\n\n legacyJavaScriptResults.set(script, result);\n\n if (script.request) {\n const requestId = script.request.args.data.requestId;\n wastedBytesByRequestId.set(requestId, transferSize);\n }\n }\n\n const sorted =\n new Map([...legacyJavaScriptResults].sort((a, b) => b[1].estimatedByteSavings - a[1].estimatedByteSavings));\n\n return finalize({\n legacyJavaScriptResults: sorted,\n metricSavings: metricSavingsForWastedBytes(wastedBytesByRequestId, context),\n wastedBytes: wastedBytesByRequestId.values().reduce((acc, cur) => acc + cur, 0),\n });\n}\nexport function createOverlays(model: LegacyJavaScriptInsightModel): Types.Overlays.Overlay[] {\n return [...model.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e).map(request => {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n });\n}\n"]}
@@ -1,23 +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
- export * as Cache from './Cache.js';
5
- export * as CharacterSet from './CharacterSet.js';
6
- export * as CLSCulprits from './CLSCulprits.js';
7
- export * as DocumentLatency from './DocumentLatency.js';
8
- export * as DOMSize from './DOMSize.js';
9
- export * as DuplicatedJavaScript from './DuplicatedJavaScript.js';
10
- export * as FontDisplay from './FontDisplay.js';
11
- export * as ForcedReflow from './ForcedReflow.js';
12
- export * as ImageDelivery from './ImageDelivery.js';
13
- export * as INPBreakdown from './INPBreakdown.js';
14
- export * as LCPBreakdown from './LCPBreakdown.js';
15
- export * as LCPDiscovery from './LCPDiscovery.js';
16
- export * as LegacyJavaScript from './LegacyJavaScript.js';
17
- export * as ModernHTTP from './ModernHTTP.js';
18
- export * as NetworkDependencyTree from './NetworkDependencyTree.js';
19
- export * as RenderBlocking from './RenderBlocking.js';
20
- export * as SlowCSSSelector from './SlowCSSSelector.js';
21
- export * as ThirdParties from './ThirdParties.js';
22
- export * as Viewport from './Viewport.js';
23
- //# sourceMappingURL=Models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Models.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Models.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,eAAe,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\nexport * as Cache from './Cache.js';\nexport * as CharacterSet from './CharacterSet.js';\nexport * as CLSCulprits from './CLSCulprits.js';\nexport * as DocumentLatency from './DocumentLatency.js';\nexport * as DOMSize from './DOMSize.js';\nexport * as DuplicatedJavaScript from './DuplicatedJavaScript.js';\nexport * as FontDisplay from './FontDisplay.js';\nexport * as ForcedReflow from './ForcedReflow.js';\nexport * as ImageDelivery from './ImageDelivery.js';\nexport * as INPBreakdown from './INPBreakdown.js';\nexport * as LCPBreakdown from './LCPBreakdown.js';\nexport * as LCPDiscovery from './LCPDiscovery.js';\nexport * as LegacyJavaScript from './LegacyJavaScript.js';\nexport * as ModernHTTP from './ModernHTTP.js';\nexport * as NetworkDependencyTree from './NetworkDependencyTree.js';\nexport * as RenderBlocking from './RenderBlocking.js';\nexport * as SlowCSSSelector from './SlowCSSSelector.js';\nexport * as ThirdParties from './ThirdParties.js';\nexport * as Viewport from './Viewport.js';\n"]}
@@ -1,205 +0,0 @@
1
- // Copyright 2025 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 Platform from '../../../core/platform/platform.js';
6
- import * as Handlers from '../handlers/handlers.js';
7
- import * as Helpers from '../helpers/helpers.js';
8
- import * as Types from '../types/types.js';
9
- import { InsightCategory, InsightKeys, } from './types.js';
10
- export const UIStrings = {
11
- /**
12
- * @description Title of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
13
- */
14
- title: 'Modern HTTP',
15
- /**
16
- * @description Description of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
17
- */
18
- description: 'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).',
19
- /**
20
- * @description Column header for a table where each cell represents a network request.
21
- */
22
- request: 'Request',
23
- /**
24
- * @description Column header for a table where each cell represents the protocol of a network request.
25
- */
26
- protocol: 'Protocol',
27
- /**
28
- * @description Text explaining that there were no requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
29
- */
30
- noOldProtocolRequests: 'No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.',
31
- };
32
- // const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);
33
- export const i18nString = (i18nId, values) => ({i18nId, values}); // i18n.i18n.getLocalizedString.bind(undefined, str_);
34
- export function isModernHTTPInsight(model) {
35
- return model.insightKey === InsightKeys.MODERN_HTTP;
36
- }
37
- /**
38
- * Determines whether a network request is a "static resource" that would benefit from H2 multiplexing.
39
- * XHRs, tracking pixels, etc generally don't benefit as much because they aren't requested en-masse
40
- * for the same origin at the exact same time.
41
- */
42
- function isMultiplexableStaticAsset(request, entityMappings, firstPartyEntity) {
43
- if (!Helpers.Network.STATIC_RESOURCE_TYPES.has(request.args.data.resourceType)) {
44
- return false;
45
- }
46
- // Resources from third-parties that are less than 100 bytes are usually tracking pixels, not actual resources.
47
- // They can masquerade as static types though (gifs, documents, etc)
48
- if (request.args.data.decodedBodyLength < 100) {
49
- const entity = entityMappings.entityByEvent.get(request);
50
- if (entity) {
51
- // Third-party assets are multiplexable in their first-party context.
52
- if (firstPartyEntity?.name === entity.name) {
53
- return true;
54
- }
55
- // Skip recognizable third-parties' requests.
56
- if (!entity.isUnrecognized) {
57
- return false;
58
- }
59
- }
60
- }
61
- return true;
62
- }
63
- /**
64
- * Determine the set of resources that aren't HTTP/2 but should be.
65
- * We're a little conservative about what we surface for a few reasons:
66
- *
67
- * - The simulator approximation of HTTP/2 is a little more generous than reality.
68
- * - There's a bit of debate surrounding HTTP/2 due to its worse performance in environments with high packet loss. [1][2][3]
69
- * - It's something that you'd have absolutely zero control over with a third-party (can't defer to fix it for example).
70
- *
71
- * Therefore, we only surface requests that were...
72
- *
73
- * - Served over HTTP/1.1 or earlier
74
- * - Served over an origin that serves at least 6 static asset requests
75
- * (if there aren't more requests than browser's max/host, multiplexing isn't as big a deal)
76
- * - Not served on localhost (h2 is a pain to deal with locally & and CI)
77
- *
78
- * [1] https://news.ycombinator.com/item?id=19086639
79
- * [2] https://www.twilio.com/blog/2017/10/http2-issues.html
80
- * [3] https://www.cachefly.com/http-2-is-not-a-magic-bullet/
81
- */
82
- export function determineHttp1Requests(requests, entityMappings, firstPartyEntity) {
83
- const http1Requests = [];
84
- const groupedByOrigin = new Map();
85
- for (const record of requests) {
86
- const url = new URL(record.args.data.url);
87
- if (!isMultiplexableStaticAsset(record, entityMappings, firstPartyEntity)) {
88
- continue;
89
- }
90
- if (Helpers.Network.isSyntheticNetworkRequestLocalhost(record)) {
91
- continue;
92
- }
93
- const originRequests = Platform.MapUtilities.getWithDefault(groupedByOrigin, url.origin, () => []);
94
- originRequests.push(record);
95
- }
96
- const seenURLs = new Set();
97
- for (const request of requests) {
98
- // Skip duplicates.
99
- if (seenURLs.has(request.args.data.url)) {
100
- continue;
101
- }
102
- // Check if record is not served through the service worker, servicer worker uses http/1.1 as a protocol.
103
- // These can generate false positives (bug: https://github.com/GoogleChrome/lighthouse/issues/7158).
104
- if (request.args.data.fromServiceWorker) {
105
- continue;
106
- }
107
- // Test the protocol to see if it was http/1.1.
108
- const isOldHttp = /HTTP\/[01][.\d]?/i.test(request.args.data.protocol);
109
- if (!isOldHttp) {
110
- continue;
111
- }
112
- const url = new URL(request.args.data.url);
113
- // Check if the origin has enough requests to bother flagging.
114
- const group = groupedByOrigin.get(url.origin) || [];
115
- if (group.length < 6) {
116
- continue;
117
- }
118
- seenURLs.add(request.args.data.url);
119
- http1Requests.push(request);
120
- }
121
- return http1Requests;
122
- }
123
- /**
124
- * Computes the estimated effect of all results being converted to http/2 on the provided graph.
125
- */
126
- function computeWasteWithGraph(urlsToChange, graph, simulator) {
127
- const simulationBefore = simulator.simulate(graph);
128
- // Update all the protocols to reflect implementing our recommendations
129
- const originalProtocols = new Map();
130
- graph.traverse(node => {
131
- if (node.type !== 'network') {
132
- return;
133
- }
134
- if (!urlsToChange.has(node.request.url)) {
135
- return;
136
- }
137
- originalProtocols.set(node.request.requestId, node.request.protocol);
138
- node.request.protocol = 'h2';
139
- });
140
- const simulationAfter = simulator.simulate(graph);
141
- // Restore the original protocol after we've done our simulation
142
- graph.traverse(node => {
143
- if (node.type !== 'network') {
144
- return;
145
- }
146
- const originalProtocol = originalProtocols.get(node.request.requestId);
147
- if (originalProtocol === undefined) {
148
- return;
149
- }
150
- node.request.protocol = originalProtocol;
151
- });
152
- const savings = simulationBefore.timeInMs - simulationAfter.timeInMs;
153
- return Platform.NumberUtilities.floor(savings, 1 / 10);
154
- }
155
- function computeMetricSavings(http1Requests, context) {
156
- if (!context.navigation || !('lantern' in context) || !context.lantern) {
157
- return;
158
- }
159
- const urlsToChange = new Set(http1Requests.map(r => r.args.data.url));
160
- const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;
161
- const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;
162
- return {
163
- FCP: computeWasteWithGraph(urlsToChange, fcpGraph, context.lantern.simulator),
164
- LCP: computeWasteWithGraph(urlsToChange, lcpGraph, context.lantern.simulator),
165
- };
166
- }
167
- function finalize(partialModel) {
168
- return {
169
- insightKey: InsightKeys.MODERN_HTTP,
170
- strings: UIStrings,
171
- title: i18nString(UIStrings.title),
172
- description: i18nString(UIStrings.description),
173
- docs: 'https://developer.chrome.com/docs/performance/insights/modern-http',
174
- category: InsightCategory.LCP,
175
- state: partialModel.http1Requests.length > 0 ? 'fail' : 'pass',
176
- ...partialModel,
177
- relatedEvents: partialModel.http1Requests,
178
- };
179
- }
180
- export function generateInsight(data, context) {
181
- const isWithinContext = (event) => Helpers.Timing.eventIsInBounds(event, context.bounds);
182
- const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
183
- const entityMappings = data.NetworkRequests.entityMappings;
184
- let firstPartyUrl = data.Meta.mainFrameURL;
185
- if (context.navigation && !Types.Events.isSoftNavigationStart(context.navigation)) {
186
- firstPartyUrl = context.navigation.args.data?.documentLoaderURL ?? firstPartyUrl;
187
- }
188
- const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);
189
- const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);
190
- return finalize({
191
- http1Requests,
192
- metricSavings: computeMetricSavings(http1Requests, context),
193
- });
194
- }
195
- export function createOverlayForRequest(request) {
196
- return {
197
- type: 'ENTRY_OUTLINE',
198
- entry: request,
199
- outlineReason: 'ERROR',
200
- };
201
- }
202
- export function createOverlays(model) {
203
- return model.http1Requests.map(req => createOverlayForRequest(req)) ?? [];
204
- }
205
- //# sourceMappingURL=ModernHTTP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModernHTTP.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/Mod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GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;IAC3D,IAAI,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;IAC3C,IAAI,OAAO,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAClF,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,IAAI,aAAa,CAAC;IACnF,CAAC;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,sBAAsB,CAAC,eAAe,EAAE,cAAc,EAAE,gBAAgB,IAAI,IAAI,CAAC,CAAC;IAExG,OAAO,QAAQ,CAAC;QACd,aAAa;QACb,aAAa,EAAE,oBAAoB,CAAC,aAAa,EAAE,OAAO,CAAC;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAA6C;IACnF,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA6B;IAC1D,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5E,CAAC","sourcesContent":["// Copyright 2025 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Handlers from '../handlers/handlers.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport * as Types from '../types/types.js';\n\nimport {\n InsightCategory,\n InsightKeys,\n type InsightModel,\n type InsightSetContext,\n type MetricSavings,\n type PartialInsightModel,\n} from './types.js';\n\nexport const UIStrings = {\n /**\n * @description Title of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. \"HTTP\" should not be translated.\n */\n title: 'Modern HTTP',\n /**\n * @description Description of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. \"HTTP\" should not be translated.\n */\n description:\n 'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).',\n /**\n * @description Column header for a table where each cell represents a network request.\n */\n request: 'Request',\n /**\n * @description Column header for a table where each cell represents the protocol of a network request.\n */\n protocol: 'Protocol',\n /**\n * @description Text explaining that there were no requests that were slowed down by using HTTP/1.1. \"HTTP/1.1\" should not be translated.\n */\n noOldProtocolRequests:\n 'No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.',\n} as const;\n\nconst str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);\nexport const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport type ModernHTTPInsightModel = InsightModel<typeof UIStrings, {\n http1Requests: Types.Events.SyntheticNetworkRequest[],\n}>;\n\nexport function isModernHTTPInsight(model: InsightModel): model is ModernHTTPInsightModel {\n return model.insightKey === InsightKeys.MODERN_HTTP;\n}\n\n/**\n * Determines whether a network request is a \"static resource\" that would benefit from H2 multiplexing.\n * XHRs, tracking pixels, etc generally don't benefit as much because they aren't requested en-masse\n * for the same origin at the exact same time.\n */\nfunction isMultiplexableStaticAsset(\n request: Types.Events.SyntheticNetworkRequest, entityMappings: Handlers.Helpers.EntityMappings,\n firstPartyEntity: Handlers.Helpers.Entity|null): boolean {\n if (!Helpers.Network.STATIC_RESOURCE_TYPES.has(request.args.data.resourceType)) {\n return false;\n }\n\n // Resources from third-parties that are less than 100 bytes are usually tracking pixels, not actual resources.\n // They can masquerade as static types though (gifs, documents, etc)\n if (request.args.data.decodedBodyLength < 100) {\n const entity = entityMappings.entityByEvent.get(request);\n if (entity) {\n // Third-party assets are multiplexable in their first-party context.\n if (firstPartyEntity?.name === entity.name) {\n return true;\n }\n // Skip recognizable third-parties' requests.\n if (!entity.isUnrecognized) {\n return false;\n }\n }\n }\n\n return true;\n}\n\n/**\n * Determine the set of resources that aren't HTTP/2 but should be.\n * We're a little conservative about what we surface for a few reasons:\n *\n * - The simulator approximation of HTTP/2 is a little more generous than reality.\n * - There's a bit of debate surrounding HTTP/2 due to its worse performance in environments with high packet loss. [1][2][3]\n * - It's something that you'd have absolutely zero control over with a third-party (can't defer to fix it for example).\n *\n * Therefore, we only surface requests that were...\n *\n * - Served over HTTP/1.1 or earlier\n * - Served over an origin that serves at least 6 static asset requests\n * (if there aren't more requests than browser's max/host, multiplexing isn't as big a deal)\n * - Not served on localhost (h2 is a pain to deal with locally & and CI)\n *\n * [1] https://news.ycombinator.com/item?id=19086639\n * [2] https://www.twilio.com/blog/2017/10/http2-issues.html\n * [3] https://www.cachefly.com/http-2-is-not-a-magic-bullet/\n */\nexport function determineHttp1Requests(\n requests: Types.Events.SyntheticNetworkRequest[], entityMappings: Handlers.Helpers.EntityMappings,\n firstPartyEntity: Handlers.Helpers.Entity|null): Types.Events.SyntheticNetworkRequest[] {\n const http1Requests: Types.Events.SyntheticNetworkRequest[] = [];\n\n const groupedByOrigin = new Map<string, Types.Events.SyntheticNetworkRequest[]>();\n for (const record of requests) {\n const url = new URL(record.args.data.url);\n if (!isMultiplexableStaticAsset(record, entityMappings, firstPartyEntity)) {\n continue;\n }\n if (Helpers.Network.isSyntheticNetworkRequestLocalhost(record)) {\n continue;\n }\n const originRequests = Platform.MapUtilities.getWithDefault(groupedByOrigin, url.origin, () => []);\n originRequests.push(record);\n }\n\n const seenURLs = new Set<string>();\n\n for (const request of requests) {\n // Skip duplicates.\n if (seenURLs.has(request.args.data.url)) {\n continue;\n }\n\n // Check if record is not served through the service worker, servicer worker uses http/1.1 as a protocol.\n // These can generate false positives (bug: https://github.com/GoogleChrome/lighthouse/issues/7158).\n if (request.args.data.fromServiceWorker) {\n continue;\n }\n\n // Test the protocol to see if it was http/1.1.\n const isOldHttp = /HTTP\\/[01][.\\d]?/i.test(request.args.data.protocol);\n if (!isOldHttp) {\n continue;\n }\n\n const url = new URL(request.args.data.url);\n\n // Check if the origin has enough requests to bother flagging.\n const group = groupedByOrigin.get(url.origin) || [];\n if (group.length < 6) {\n continue;\n }\n\n seenURLs.add(request.args.data.url);\n http1Requests.push(request);\n }\n\n return http1Requests;\n}\n\n/**\n * Computes the estimated effect of all results being converted to http/2 on the provided graph.\n */\nfunction computeWasteWithGraph(\n urlsToChange: Set<string>, graph: Lantern.Graph.Node, simulator: Lantern.Simulation.Simulator): Types.Timing.Milli {\n const simulationBefore = simulator.simulate(graph);\n\n // Update all the protocols to reflect implementing our recommendations\n const originalProtocols = new Map();\n graph.traverse(node => {\n if (node.type !== 'network') {\n return;\n }\n if (!urlsToChange.has(node.request.url)) {\n return;\n }\n\n originalProtocols.set(node.request.requestId, node.request.protocol);\n node.request.protocol = 'h2';\n });\n\n const simulationAfter = simulator.simulate(graph);\n\n // Restore the original protocol after we've done our simulation\n graph.traverse(node => {\n if (node.type !== 'network') {\n return;\n }\n const originalProtocol = originalProtocols.get(node.request.requestId);\n if (originalProtocol === undefined) {\n return;\n }\n node.request.protocol = originalProtocol;\n });\n\n const savings = simulationBefore.timeInMs - simulationAfter.timeInMs;\n\n return Platform.NumberUtilities.floor(savings, 1 / 10) as Types.Timing.Milli;\n}\n\nfunction computeMetricSavings(\n http1Requests: Types.Events.SyntheticNetworkRequest[], context: InsightSetContext): MetricSavings|undefined {\n if (!context.navigation || !('lantern' in context) || !context.lantern) {\n return;\n }\n\n const urlsToChange = new Set(http1Requests.map(r => r.args.data.url));\n\n const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;\n const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;\n\n return {\n FCP: computeWasteWithGraph(urlsToChange, fcpGraph, context.lantern.simulator),\n LCP: computeWasteWithGraph(urlsToChange, lcpGraph, context.lantern.simulator),\n };\n}\n\nfunction finalize(partialModel: PartialInsightModel<ModernHTTPInsightModel>): ModernHTTPInsightModel {\n return {\n insightKey: InsightKeys.MODERN_HTTP,\n strings: UIStrings,\n title: i18nString(UIStrings.title),\n description: i18nString(UIStrings.description),\n docs: 'https://developer.chrome.com/docs/performance/insights/modern-http',\n category: InsightCategory.LCP,\n state: partialModel.http1Requests.length > 0 ? 'fail' : 'pass',\n ...partialModel,\n relatedEvents: partialModel.http1Requests,\n };\n}\n\nexport function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ModernHTTPInsightModel {\n const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);\n\n const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);\n\n const entityMappings = data.NetworkRequests.entityMappings;\n let firstPartyUrl = data.Meta.mainFrameURL;\n if (context.navigation && !Types.Events.isSoftNavigationStart(context.navigation)) {\n firstPartyUrl = context.navigation.args.data?.documentLoaderURL ?? firstPartyUrl;\n }\n\n const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);\n const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);\n\n return finalize({\n http1Requests,\n metricSavings: computeMetricSavings(http1Requests, context),\n });\n}\n\nexport function createOverlayForRequest(request: Types.Events.SyntheticNetworkRequest): Types.Overlays.EntryOutline {\n return {\n type: 'ENTRY_OUTLINE',\n entry: request,\n outlineReason: 'ERROR',\n };\n}\n\nexport function createOverlays(model: ModernHTTPInsightModel): Types.Overlays.Overlay[] {\n return model.http1Requests.map(req => createOverlayForRequest(req)) ?? [];\n}\n"]}