@paulirish/trace_engine 0.0.35 → 0.0.37

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 (126) hide show
  1. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
  2. package/README.md +0 -1
  3. package/generated/protocol.d.ts +26 -4
  4. package/models/trace/Processor.d.ts +2 -1
  5. package/models/trace/Processor.js +6 -10
  6. package/models/trace/Processor.js.map +1 -1
  7. package/models/trace/extras/TimelineJSProfile.d.ts +13 -0
  8. package/models/trace/extras/TimelineJSProfile.js +55 -0
  9. package/models/trace/extras/TimelineJSProfile.js.map +1 -0
  10. package/models/trace/extras/TraceFilter.d.ts +21 -0
  11. package/models/trace/extras/TraceFilter.js +51 -0
  12. package/models/trace/extras/TraceFilter.js.map +1 -0
  13. package/models/trace/extras/TraceTree.d.ts +91 -0
  14. package/models/trace/extras/TraceTree.js +515 -0
  15. package/models/trace/extras/TraceTree.js.map +1 -0
  16. package/models/trace/extras/extras-tsconfig.json +3 -0
  17. package/models/trace/extras/extras.js.map +1 -1
  18. package/models/trace/handlers/AnimationHandler.js +0 -5
  19. package/models/trace/handlers/AnimationHandler.js.map +1 -1
  20. package/models/trace/handlers/ExtensionTraceDataHandler.d.ts +1 -1
  21. package/models/trace/handlers/ExtensionTraceDataHandler.js +0 -9
  22. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
  23. package/models/trace/handlers/FramesHandler.d.ts +1 -2
  24. package/models/trace/handlers/FramesHandler.js +0 -11
  25. package/models/trace/handlers/FramesHandler.js.map +1 -1
  26. package/models/trace/handlers/GPUHandler.d.ts +1 -2
  27. package/models/trace/handlers/GPUHandler.js +0 -18
  28. package/models/trace/handlers/GPUHandler.js.map +1 -1
  29. package/models/trace/handlers/ImagePaintingHandler.d.ts +1 -0
  30. package/models/trace/handlers/ImagePaintingHandler.js +2 -0
  31. package/models/trace/handlers/ImagePaintingHandler.js.map +1 -1
  32. package/models/trace/handlers/InitiatorsHandler.d.ts +0 -1
  33. package/models/trace/handlers/InitiatorsHandler.js +0 -12
  34. package/models/trace/handlers/InitiatorsHandler.js.map +1 -1
  35. package/models/trace/handlers/InvalidationsHandler.d.ts +0 -1
  36. package/models/trace/handlers/InvalidationsHandler.js +0 -12
  37. package/models/trace/handlers/InvalidationsHandler.js.map +1 -1
  38. package/models/trace/handlers/LargestImagePaintHandler.d.ts +9 -2
  39. package/models/trace/handlers/LargestImagePaintHandler.js +45 -1
  40. package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
  41. package/models/trace/handlers/LargestTextPaintHandler.d.ts +1 -0
  42. package/models/trace/handlers/LargestTextPaintHandler.js +2 -0
  43. package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -1
  44. package/models/trace/handlers/LayerTreeHandler.d.ts +1 -2
  45. package/models/trace/handlers/LayerTreeHandler.js +0 -12
  46. package/models/trace/handlers/LayerTreeHandler.js.map +1 -1
  47. package/models/trace/handlers/LayoutShiftsHandler.d.ts +1 -2
  48. package/models/trace/handlers/LayoutShiftsHandler.js +0 -15
  49. package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
  50. package/models/trace/handlers/MemoryHandler.d.ts +1 -0
  51. package/models/trace/handlers/MemoryHandler.js +2 -0
  52. package/models/trace/handlers/MemoryHandler.js.map +1 -1
  53. package/models/trace/handlers/MetaHandler.d.ts +0 -1
  54. package/models/trace/handlers/MetaHandler.js +2 -21
  55. package/models/trace/handlers/MetaHandler.js.map +1 -1
  56. package/models/trace/handlers/NetworkRequestsHandler.d.ts +1 -2
  57. package/models/trace/handlers/NetworkRequestsHandler.js +2 -15
  58. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
  59. package/models/trace/handlers/PageFramesHandler.d.ts +1 -0
  60. package/models/trace/handlers/PageFramesHandler.js +2 -0
  61. package/models/trace/handlers/PageFramesHandler.js.map +1 -1
  62. package/models/trace/handlers/RendererHandler.d.ts +1 -2
  63. package/models/trace/handlers/RendererHandler.js +0 -18
  64. package/models/trace/handlers/RendererHandler.js.map +1 -1
  65. package/models/trace/handlers/SamplesHandler.d.ts +0 -1
  66. package/models/trace/handlers/SamplesHandler.js +0 -18
  67. package/models/trace/handlers/SamplesHandler.js.map +1 -1
  68. package/models/trace/handlers/SelectorStatsHandler.d.ts +1 -0
  69. package/models/trace/handlers/SelectorStatsHandler.js +2 -0
  70. package/models/trace/handlers/SelectorStatsHandler.js.map +1 -1
  71. package/models/trace/handlers/ServerTimingsHandler.d.ts +1 -2
  72. package/models/trace/handlers/ServerTimingsHandler.js +0 -12
  73. package/models/trace/handlers/ServerTimingsHandler.js.map +1 -1
  74. package/models/trace/handlers/UserInteractionsHandler.d.ts +2 -2
  75. package/models/trace/handlers/UserInteractionsHandler.js +13 -21
  76. package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
  77. package/models/trace/handlers/UserTimingsHandler.js +0 -12
  78. package/models/trace/handlers/UserTimingsHandler.js.map +1 -1
  79. package/models/trace/handlers/WorkersHandler.d.ts +0 -1
  80. package/models/trace/handlers/WorkersHandler.js +0 -18
  81. package/models/trace/handlers/WorkersHandler.js.map +1 -1
  82. package/models/trace/handlers/types.d.ts +1 -7
  83. package/models/trace/handlers/types.js.map +1 -1
  84. package/models/trace/insights/CLSCulprits.d.ts +57 -0
  85. package/models/trace/insights/CLSCulprits.js +335 -0
  86. package/models/trace/insights/CLSCulprits.js.map +1 -0
  87. package/models/trace/insights/Common.d.ts +2 -10
  88. package/models/trace/insights/Common.js +1 -36
  89. package/models/trace/insights/Common.js.map +1 -1
  90. package/models/trace/insights/DocumentLatency.d.ts +3 -3
  91. package/models/trace/insights/DocumentLatency.js.map +1 -1
  92. package/models/trace/insights/FontDisplay.d.ts +3 -3
  93. package/models/trace/insights/FontDisplay.js.map +1 -1
  94. package/models/trace/insights/InteractionToNextPaint.d.ts +3 -3
  95. package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
  96. package/models/trace/insights/LCPDiscovery.d.ts +13 -0
  97. package/models/trace/insights/LCPDiscovery.js +60 -0
  98. package/models/trace/insights/LCPDiscovery.js.map +1 -0
  99. package/models/trace/insights/LCPPhases.d.ts +34 -0
  100. package/models/trace/insights/LCPPhases.js +97 -0
  101. package/models/trace/insights/LCPPhases.js.map +1 -0
  102. package/models/trace/insights/Models.d.ts +10 -0
  103. package/models/trace/insights/Models.js +14 -0
  104. package/models/trace/insights/Models.js.map +1 -0
  105. package/models/trace/insights/RenderBlocking.d.ts +4 -4
  106. package/models/trace/insights/RenderBlocking.js +1 -16
  107. package/models/trace/insights/RenderBlocking.js.map +1 -1
  108. package/models/trace/insights/SlowCSSSelector.d.ts +3 -3
  109. package/models/trace/insights/SlowCSSSelector.js.map +1 -1
  110. package/models/trace/insights/ThirdParties.d.ts +13 -0
  111. package/models/trace/insights/ThirdParties.js +42 -0
  112. package/models/trace/insights/ThirdParties.js.map +1 -0
  113. package/models/trace/insights/Viewport.d.ts +3 -3
  114. package/models/trace/insights/Viewport.js.map +1 -1
  115. package/models/trace/insights/insights-tsconfig.json +5 -4
  116. package/models/trace/insights/insights.d.ts +1 -1
  117. package/models/trace/insights/insights.js +1 -1
  118. package/models/trace/insights/insights.js.map +1 -1
  119. package/models/trace/insights/types.d.ts +9 -9
  120. package/models/trace/insights/types.js.map +1 -1
  121. package/models/trace/trace-tsconfig.json +6 -0
  122. package/models/trace/types/TraceEvents.d.ts +42 -19
  123. package/models/trace/types/TraceEvents.js +5 -3
  124. package/models/trace/types/TraceEvents.js.map +1 -1
  125. package/package.json +1 -1
  126. package/test/test-trace-engine.mjs +12 -16
@@ -1,7 +1,7 @@
1
1
  import type * as Handlers from '../handlers/handlers.js';
2
2
  import type * as Lantern from '../lantern/lantern.js';
3
3
  import type * as Types from '../types/types.js';
4
- import type * as InsightsRunners from './InsightRunners.js';
4
+ import type * as Models from './Models.js';
5
5
  /**
6
6
  * Context for the portion of the trace an insight should look at.
7
7
  */
@@ -23,7 +23,7 @@ export interface LanternContext {
23
23
  simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;
24
24
  metrics: Record<string, Lantern.Metrics.MetricResult>;
25
25
  }
26
- export type InsightRunnersType = typeof InsightsRunners;
26
+ export type InsightModelsType = typeof Models;
27
27
  export declare enum InsightWarning {
28
28
  NO_FP = "NO_FP",
29
29
  NO_LCP = "NO_LCP",
@@ -37,7 +37,7 @@ export interface MetricSavings {
37
37
  CLS?: number;
38
38
  INP?: Types.Timing.MilliSeconds;
39
39
  }
40
- export type InsightResult<R extends Record<string, unknown>> = R & {
40
+ export type InsightModel<R extends Record<string, unknown>> = R & {
41
41
  relatedEvents?: Types.Events.Event[];
42
42
  warnings?: InsightWarning[];
43
43
  metricSavings?: MetricSavings;
@@ -47,21 +47,21 @@ export type InsightResult<R extends Record<string, unknown>> = R & {
47
47
  * this could instead represent the duration from the beginning of the trace up to the first recorded
48
48
  * navigation (or the end of the trace).
49
49
  */
50
- export type InsightSets = {
50
+ export type InsightSet = {
51
51
  /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */
52
52
  id: Types.Events.NavigationId;
53
53
  /** The URL to show in the accordion list. */
54
54
  url: URL;
55
55
  frameId: string;
56
56
  bounds: Types.Timing.TraceWindowMicroSeconds;
57
- data: InsightResults;
57
+ model: InsightModels;
58
58
  navigation?: Types.Events.NavigationStart;
59
59
  };
60
60
  /**
61
- * Contains insights for a specific navigation.
61
+ * Contains insights for a specific insight set.
62
62
  */
63
- export type InsightResults = {
64
- [I in keyof InsightRunnersType]: ReturnType<InsightRunnersType[I]['generateInsight']>;
63
+ export type InsightModels = {
64
+ [I in keyof InsightModelsType]: ReturnType<InsightModelsType[I]['generateInsight']>;
65
65
  };
66
66
  /**
67
67
  * Contains insights for the entire trace. Insights are mostly grouped by `navigationId`, with one exception:
@@ -69,7 +69,7 @@ export type InsightResults = {
69
69
  * If the analyzed trace started after the navigation, and has meaningful work with that span, there is no
70
70
  * navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.
71
71
  */
72
- export type TraceInsightSets = Map<Types.Events.NavigationId, InsightSets>;
72
+ export type TraceInsightSets = Map<Types.Events.NavigationId, InsightSet>;
73
73
  /**
74
74
  * Represents the narrow set of dependencies defined by an insight's `deps()` function. `Meta` is always included regardless of `deps()`.
75
75
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmC7B,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\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 Handlers from '../handlers/handlers.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport type * as Types from '../types/types.js';\n\nimport type * as InsightsRunners from './InsightRunners.js';\n\n/**\n * Context for the portion of the trace an insight should look at.\n */\nexport type InsightSetContext = InsightSetContextWithoutNavigation|InsightSetContextWithNavigation;\n\nexport interface InsightSetContextWithoutNavigation {\n bounds: Types.Timing.TraceWindowMicroSeconds;\n frameId: string;\n navigation?: never;\n}\n\nexport interface InsightSetContextWithNavigation {\n bounds: Types.Timing.TraceWindowMicroSeconds;\n frameId: string;\n navigation: Types.Events.NavigationStart;\n navigationId: string;\n lantern?: LanternContext;\n}\n\nexport interface LanternContext {\n graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;\n simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;\n metrics: Record<string, Lantern.Metrics.MetricResult>;\n}\n\nexport type InsightRunnersType = typeof InsightsRunners;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n NO_LAYOUT = 'NO_LAYOUT',\n}\n\nexport interface MetricSavings {\n /* eslint-disable @typescript-eslint/naming-convention */\n FCP?: Types.Timing.MilliSeconds;\n LCP?: Types.Timing.MilliSeconds;\n TBT?: Types.Timing.MilliSeconds;\n CLS?: number;\n INP?: Types.Timing.MilliSeconds;\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport type InsightResult<R extends Record<string, unknown>> = R&{\n relatedEvents?: Types.Events.Event[],\n warnings?: InsightWarning[],\n metricSavings?: MetricSavings,\n};\n\n/**\n * Contains insights for a specific navigation. If a trace began after a navigation already started,\n * this could instead represent the duration from the beginning of the trace up to the first recorded\n * navigation (or the end of the trace).\n */\nexport type InsightSets = {\n /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */\n id: Types.Events.NavigationId,\n /** The URL to show in the accordion list. */\n url: URL,\n frameId: string,\n bounds: Types.Timing.TraceWindowMicroSeconds,\n data: InsightResults,\n navigation?: Types.Events.NavigationStart,\n};\n\n/**\n * Contains insights for a specific navigation.\n */\nexport type InsightResults = {\n [I in keyof InsightRunnersType]: ReturnType<InsightRunnersType[I]['generateInsight']>;\n};\n\n/**\n * Contains insights for the entire trace. Insights are mostly grouped by `navigationId`, with one exception:\n *\n * If the analyzed trace started after the navigation, and has meaningful work with that span, there is no\n * navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.\n */\nexport type TraceInsightSets = Map<Types.Events.NavigationId, InsightSets>;\n\n/**\n * Represents the narrow set of dependencies defined by an insight's `deps()` function. `Meta` is always included regardless of `deps()`.\n */\nexport type RequiredData<D extends() => Array<keyof typeof Handlers.ModelHandlers>> =\n Handlers.Types.EnabledHandlerDataWithMeta<Pick<typeof Handlers.ModelHandlers, ReturnType<D>[number]>>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/insights/types.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmC7B,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;AACzB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\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 Handlers from '../handlers/handlers.js';\nimport type * as Lantern from '../lantern/lantern.js';\nimport type * as Types from '../types/types.js';\n\nimport type * as Models from './Models.js';\n\n/**\n * Context for the portion of the trace an insight should look at.\n */\nexport type InsightSetContext = InsightSetContextWithoutNavigation|InsightSetContextWithNavigation;\n\nexport interface InsightSetContextWithoutNavigation {\n bounds: Types.Timing.TraceWindowMicroSeconds;\n frameId: string;\n navigation?: never;\n}\n\nexport interface InsightSetContextWithNavigation {\n bounds: Types.Timing.TraceWindowMicroSeconds;\n frameId: string;\n navigation: Types.Events.NavigationStart;\n navigationId: string;\n lantern?: LanternContext;\n}\n\nexport interface LanternContext {\n graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;\n simulator: Lantern.Simulation.Simulator<Types.Events.SyntheticNetworkRequest>;\n metrics: Record<string, Lantern.Metrics.MetricResult>;\n}\n\nexport type InsightModelsType = typeof Models;\n\nexport enum InsightWarning {\n NO_FP = 'NO_FP',\n NO_LCP = 'NO_LCP',\n // No network request could be identified as the primary HTML document.\n NO_DOCUMENT_REQUEST = 'NO_DOCUMENT_REQUEST',\n NO_LAYOUT = 'NO_LAYOUT',\n}\n\nexport interface MetricSavings {\n /* eslint-disable @typescript-eslint/naming-convention */\n FCP?: Types.Timing.MilliSeconds;\n LCP?: Types.Timing.MilliSeconds;\n TBT?: Types.Timing.MilliSeconds;\n CLS?: number;\n INP?: Types.Timing.MilliSeconds;\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nexport type InsightModel<R extends Record<string, unknown>> = R&{\n relatedEvents?: Types.Events.Event[],\n warnings?: InsightWarning[],\n metricSavings?: MetricSavings,\n};\n\n/**\n * Contains insights for a specific navigation. If a trace began after a navigation already started,\n * this could instead represent the duration from the beginning of the trace up to the first recorded\n * navigation (or the end of the trace).\n */\nexport type InsightSet = {\n /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */\n id: Types.Events.NavigationId,\n /** The URL to show in the accordion list. */\n url: URL,\n frameId: string,\n bounds: Types.Timing.TraceWindowMicroSeconds,\n model: InsightModels,\n navigation?: Types.Events.NavigationStart,\n};\n\n/**\n * Contains insights for a specific insight set.\n */\nexport type InsightModels = {\n [I in keyof InsightModelsType]: ReturnType<InsightModelsType[I]['generateInsight']>;\n};\n\n/**\n * Contains insights for the entire trace. Insights are mostly grouped by `navigationId`, with one exception:\n *\n * If the analyzed trace started after the navigation, and has meaningful work with that span, there is no\n * navigation to map it to. In this case `Types.Events.NO_NAVIGATION` is used for the key.\n */\nexport type TraceInsightSets = Map<Types.Events.NavigationId, InsightSet>;\n\n/**\n * Represents the narrow set of dependencies defined by an insight's `deps()` function. `Meta` is always included regardless of `deps()`.\n */\nexport type RequiredData<D extends() => Array<keyof typeof Handlers.ModelHandlers>> =\n Handlers.Types.EnabledHandlerDataWithMeta<Pick<typeof Handlers.ModelHandlers, ReturnType<D>[number]>>;\n"]}
@@ -47,6 +47,12 @@
47
47
  {
48
48
  "path": "../../core/sdk/bundle-tsconfig.json"
49
49
  },
50
+ {
51
+ "path": "../../generated/protocol-tsconfig.json"
52
+ },
53
+ {
54
+ "path": "../cpu_profile/bundle-tsconfig.json"
55
+ },
50
56
  {
51
57
  "path": "extras/bundle-tsconfig.json"
52
58
  },
@@ -26,6 +26,9 @@ export declare const enum Phase {
26
26
  MARK = "R",
27
27
  CLOCK_SYNC = "c"
28
28
  }
29
+ export type NonEmptyString = string & {
30
+ _tag: 'NonEmptyString';
31
+ };
29
32
  export declare function isNestableAsyncPhase(phase: Phase): boolean;
30
33
  export declare function isPhaseAsync(phase: Phase): boolean;
31
34
  export declare function isFlowPhase(phase: Phase): boolean;
@@ -188,28 +191,34 @@ export interface End extends Event {
188
191
  * the RendererHandler.
189
192
  */
190
193
  export type SyntheticComplete = Complete;
191
- export interface EventTiming extends Event {
192
- ph: Phase.ASYNC_NESTABLE_START | Phase.ASYNC_NESTABLE_END;
194
+ export type EventTimingBeginOrEnd = EventTimingBegin | EventTimingEnd;
195
+ export interface EventTimingBegin extends Event {
196
+ ph: Phase.ASYNC_NESTABLE_START;
193
197
  name: Name.EVENT_TIMING;
194
198
  id: string;
195
199
  args: Args & {
196
- frame: string;
197
- data?: ArgsData & {
200
+ data: ArgsData & {
198
201
  cancelable: boolean;
199
202
  duration: MilliSeconds;
200
- processingEnd: MilliSeconds;
201
- processingStart: MilliSeconds;
202
- timeStamp: MilliSeconds;
203
- interactionId?: number;
204
203
  type: string;
204
+ interactionId: number;
205
+ interactionOffset: number;
206
+ nodeId: Protocol.DOM.BackendNodeId;
207
+ frame?: string;
208
+ processingEnd?: MilliSeconds;
209
+ processingStart?: MilliSeconds;
210
+ timeStamp?: MilliSeconds;
211
+ enqueuedToMainThreadTime?: MilliSeconds;
212
+ commitFinishTime?: MilliSeconds;
205
213
  };
214
+ frame?: string;
206
215
  };
207
216
  }
208
- export interface EventTimingBegin extends EventTiming {
209
- ph: Phase.ASYNC_NESTABLE_START;
210
- }
211
- export interface EventTimingEnd extends EventTiming {
217
+ export interface EventTimingEnd extends Event {
212
218
  ph: Phase.ASYNC_NESTABLE_END;
219
+ name: Name.EVENT_TIMING;
220
+ id: string;
221
+ args: Args;
213
222
  }
214
223
  export interface GPUTask extends Complete {
215
224
  name: 'GPUTask';
@@ -446,11 +455,12 @@ export interface ProcessName extends Metadata {
446
455
  export interface Mark extends Event {
447
456
  ph: Phase.MARK;
448
457
  }
449
- export interface NavigationStart extends Mark {
458
+ export interface NavigationStartUnreliable extends Mark {
450
459
  name: 'navigationStart';
451
460
  args: Args & {
452
461
  data?: ArgsData & {
453
- documentLoaderURL: string;
462
+ /** An empty documentLoaderURL means this navigationStart is unreliable noise and can be ignored. */
463
+ documentLoaderURL: never;
454
464
  isLoadingMainFrame: boolean;
455
465
  isOutermostMainFrame?: boolean;
456
466
  navigationId: string;
@@ -462,6 +472,14 @@ export interface NavigationStart extends Mark {
462
472
  frame: string;
463
473
  };
464
474
  }
475
+ export interface NavigationStart extends NavigationStartUnreliable {
476
+ args: NavigationStartUnreliable['args'] & {
477
+ data: NavigationStartUnreliable['args']['data'] & {
478
+ /** This navigationStart is valid, as the documentLoaderURL isn't empty. */
479
+ documentLoaderURL: NonEmptyString;
480
+ };
481
+ };
482
+ }
465
483
  export interface FirstContentfulPaint extends Mark {
466
484
  name: Name.MARK_FCP;
467
485
  args: Args & {
@@ -746,8 +764,9 @@ export interface ResourceChangePriority extends Instant {
746
764
  };
747
765
  };
748
766
  }
767
+ /** Only sent for navigations. https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_instrumentation.cc;l=1612-1647;drc=ec7daf93d0479b758610c75f4e146fd4d2d6ed2b */
749
768
  export interface ResourceWillSendRequest extends Instant {
750
- name: 'ResourceWillSendRequest';
769
+ name: Name.RESOURCE_WILL_SEND_REQUEST;
751
770
  args: Args & {
752
771
  data: ArgsData & {
753
772
  requestId: string;
@@ -776,6 +795,7 @@ export interface ResourceReceivedData extends Instant {
776
795
  };
777
796
  };
778
797
  }
798
+ /** See https://mdn.github.io/shared-assets/images/diagrams/api/performance/timestamp-diagram.svg */
779
799
  interface ResourceReceiveResponseTimingData {
780
800
  connectEnd: MilliSeconds;
781
801
  connectStart: MilliSeconds;
@@ -787,6 +807,7 @@ interface ResourceReceiveResponseTimingData {
787
807
  pushStart: MilliSeconds;
788
808
  receiveHeadersEnd: MilliSeconds;
789
809
  receiveHeadersStart: MilliSeconds;
810
+ /** When the network service is about to handle a request, ie. just before going to the HTTP cache or going to the network for DNS/connection setup. */
790
811
  requestTime: Seconds;
791
812
  sendEnd: MilliSeconds;
792
813
  sendStart: MilliSeconds;
@@ -1148,7 +1169,7 @@ export type SyntheticPipelineReporterPair = SyntheticEventPair<PipelineReporter>
1148
1169
  export type SyntheticUserTimingPair = SyntheticEventPair<PerformanceMeasure>;
1149
1170
  export type SyntheticConsoleTimingPair = SyntheticEventPair<ConsoleTime>;
1150
1171
  export type SyntheticAnimationPair = SyntheticEventPair<Animation>;
1151
- export interface SyntheticInteractionPair extends SyntheticEventPair<EventTiming> {
1172
+ export interface SyntheticInteractionPair extends SyntheticEventPair<EventTimingBeginOrEnd> {
1152
1173
  interactionId: number;
1153
1174
  type: string;
1154
1175
  ts: MicroSeconds;
@@ -1442,7 +1463,8 @@ export declare function isProcessName(event: Event): event is ProcessName;
1442
1463
  export declare function isTracingStartedInBrowser(event: Event): event is TracingStartedInBrowser;
1443
1464
  export declare function isFrameCommittedInBrowser(event: Event): event is FrameCommittedInBrowser;
1444
1465
  export declare function isCommitLoad(event: Event): event is CommitLoad;
1445
- export declare function isNavigationStart(event: Event): event is NavigationStart;
1466
+ /** @deprecated You probably want `isNavigationStart` instead. */
1467
+ export declare function isNavigationStartUnreliable(event: Event): event is NavigationStartUnreliable;
1446
1468
  export declare function isAnimation(event: Event): event is Animation;
1447
1469
  export declare function isSyntheticAnimation(event: Event): event is SyntheticAnimationPair;
1448
1470
  export declare function isLayoutShift(event: Event): event is LayoutShift;
@@ -1455,7 +1477,7 @@ export declare function isMarkLoad(event: Event): event is MarkLoad;
1455
1477
  export declare function isFirstPaint(event: Event): event is FirstPaint;
1456
1478
  export declare function isMarkDOMContent(event: Event): event is MarkDOMContent;
1457
1479
  export declare function isInteractiveTime(event: Event): event is InteractiveTime;
1458
- export declare function isEventTiming(event: Event): event is EventTiming;
1480
+ export declare function isEventTiming(event: Event): event is EventTimingBeginOrEnd;
1459
1481
  export declare function isEventTimingEnd(event: Event): event is EventTimingEnd;
1460
1482
  export declare function isEventTimingStart(event: Event): event is EventTimingBegin;
1461
1483
  export declare function isGPUTask(event: Event): event is GPUTask;
@@ -1473,7 +1495,8 @@ export declare function isSyntheticNetworkRequest(event: Event): event is Synthe
1473
1495
  export declare function isSyntheticWebSocketConnection(event: Event): event is SyntheticWebSocketConnection;
1474
1496
  export declare function isNetworkTrackEntry(event: Event): event is SyntheticWebSocketConnection | SyntheticNetworkRequest;
1475
1497
  export declare function isPrePaint(event: Event): event is PrePaint;
1476
- export declare function isNavigationStartWithURL(event: Event): event is NavigationStart;
1498
+ /** A VALID navigation start (as it has a populated documentLoaderURL) */
1499
+ export declare function isNavigationStart(event: Event): event is NavigationStart;
1477
1500
  export declare function isMainFrameViewport(event: Event): event is MainFrameViewport;
1478
1501
  export declare function isSyntheticUserTiming(event: Event): event is SyntheticUserTimingPair;
1479
1502
  export declare function isSyntheticConsoleTiming(event: Event): event is SyntheticConsoleTimingPair;
@@ -246,7 +246,8 @@ export function isFrameCommittedInBrowser(event) {
246
246
  export function isCommitLoad(event) {
247
247
  return event.name === 'CommitLoad';
248
248
  }
249
- export function isNavigationStart(event) {
249
+ /** @deprecated You probably want `isNavigationStart` instead. */
250
+ export function isNavigationStartUnreliable(event) {
250
251
  return event.name === 'navigationStart';
251
252
  }
252
253
  export function isAnimation(event) {
@@ -347,8 +348,9 @@ export function isNetworkTrackEntry(event) {
347
348
  export function isPrePaint(event) {
348
349
  return event.name === 'PrePaint';
349
350
  }
350
- export function isNavigationStartWithURL(event) {
351
- return Boolean(isNavigationStart(event) && event.args.data && event.args.data.documentLoaderURL !== '');
351
+ /** A VALID navigation start (as it has a populated documentLoaderURL) */
352
+ export function isNavigationStart(event) {
353
+ return Boolean(isNavigationStartUnreliable(event) && event.args.data && event.args.data.documentLoaderURL !== '');
352
354
  }
353
355
  export function isMainFrameViewport(event) {
354
356
  return event.name === 'PaintTimingVisualizer::Viewport';