@atlaskit/react-ufo 5.1.2 → 5.1.4

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 (30) hide show
  1. package/AGENTS.md +426 -0
  2. package/CHANGELOG.md +16 -0
  3. package/dist/cjs/interaction-metrics/index.js +11 -3
  4. package/dist/cjs/set-terminal-error/index.js +11 -3
  5. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +39 -27
  6. package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -3
  7. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +22 -7
  8. package/dist/es2019/interaction-metrics/index.js +10 -2
  9. package/dist/es2019/set-terminal-error/index.js +12 -4
  10. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +17 -4
  11. package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -3
  12. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +22 -7
  13. package/dist/esm/interaction-metrics/index.js +10 -2
  14. package/dist/esm/set-terminal-error/index.js +12 -4
  15. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +39 -27
  16. package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -3
  17. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +22 -7
  18. package/dist/types/common/vc/types.d.ts +2 -0
  19. package/dist/types/create-terminal-error-payload/index.d.ts +4 -0
  20. package/dist/types/interaction-metrics/index.d.ts +8 -0
  21. package/dist/types/set-terminal-error/index.d.ts +4 -0
  22. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -3
  23. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/types.d.ts +12 -0
  24. package/dist/types-ts4.5/common/vc/types.d.ts +2 -0
  25. package/dist/types-ts4.5/create-terminal-error-payload/index.d.ts +4 -0
  26. package/dist/types-ts4.5/interaction-metrics/index.d.ts +8 -0
  27. package/dist/types-ts4.5/set-terminal-error/index.d.ts +4 -0
  28. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -3
  29. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/types.d.ts +12 -0
  30. package/package.json +4 -4
@@ -117,6 +117,7 @@ export type RevisionPayloadVCDetails = Record<string, {
117
117
  export type CalculateTTVCResult = {
118
118
  vcDetails: RevisionPayloadVCDetails;
119
119
  ssrRatio: number;
120
+ speedIndex: number;
120
121
  };
121
122
  export type RawObservation = {
122
123
  t: number;
@@ -141,6 +142,7 @@ export type RevisionPayloadEntry = {
141
142
  vcDetails?: RevisionPayloadVCDetails;
142
143
  ratios?: VCRatioType;
143
144
  ssrRatio?: number;
145
+ speedIndex?: number;
144
146
  labelStacks?: VCLabelStacks;
145
147
  abortReason?: VCAbortReason | null;
146
148
  abortTimestamp?: number;
@@ -21,6 +21,10 @@ export interface TerminalErrorPayload {
21
21
  activeInteractionName: string | null;
22
22
  activeInteractionId: string | null;
23
23
  activeInteractionType: string | null;
24
+ previousInteractionId: string | null;
25
+ previousInteractionName: string | null;
26
+ previousInteractionType: string | null;
27
+ timeSincePreviousInteraction: number | null;
24
28
  labelStack: LabelStack | null;
25
29
  };
26
30
  };
@@ -5,6 +5,14 @@ import type { LabelStack } from '../interaction-context';
5
5
  import InteractionExtraMetrics from './interaction-extra-metrics';
6
6
  import PostInteractionLog from './post-interaction-log';
7
7
  export type { InteractionMetrics, LifecycleMarkType, Span, Mark, MarkType, InteractionType, AbortReasonType, ReactProfilerTiming, RequestInfo, ApdexType, CustomData, CustomTiming, InteractionError, };
8
+ export type PreviousInteractionLogType = {
9
+ id: string | undefined;
10
+ name: string | undefined;
11
+ type: string | undefined;
12
+ isAborted: boolean | undefined;
13
+ timestamp: number | undefined;
14
+ };
15
+ export declare const PreviousInteractionLog: PreviousInteractionLogType;
8
16
  export declare const postInteractionLog: PostInteractionLog;
9
17
  export declare const interactionExtraMetrics: InteractionExtraMetrics;
10
18
  export declare const segmentUnmountCache: Map<string, number>;
@@ -18,6 +18,10 @@ export interface TerminalErrorContext {
18
18
  activeInteractionName: string | null;
19
19
  activeInteractionId: string | null;
20
20
  activeInteractionType: string | null;
21
+ previousInteractionId: string | null;
22
+ previousInteractionName: string | null;
23
+ previousInteractionType: string | null;
24
+ timeSincePreviousInteraction: number | null;
21
25
  }
22
26
  export declare function sinkTerminalErrorHandler(fn: (errorData: TerminalErrorData, context: TerminalErrorContext) => void | Promise<void>): void;
23
27
  export declare function setTerminalError(error: Error, additionalAttributes?: TerminalErrorAdditionalAttributes, labelStack?: LabelStack): void;
@@ -1,9 +1,9 @@
1
1
  import type { RevisionPayloadVCDetails } from '../../../../../common/vc/types';
2
2
  import type { ViewportEntryData } from '../../../types';
3
- import type { CalcTTVCPercentilesArg, CalcTTVCPercentilesArgWithDebugInfo, PercentileCalcResult } from '../types';
3
+ import type { CalcTTVCPercentilesArg, CalcTTVCPercentilesArgWithDebugInfo, PercentileCalcResultWithSpeedIndex } from '../types';
4
4
  declare function calculateTTVCPercentiles({ viewport, orderedEntries, percentiles, startTime, }: CalcTTVCPercentilesArg): Promise<RevisionPayloadVCDetails>;
5
- declare function calculateTTVCPercentilesWithDebugInfo({ viewport, orderedEntries, startTime, }: CalcTTVCPercentilesArgWithDebugInfo): Promise<PercentileCalcResult>;
5
+ declare function calculateTTVCPercentilesWithDebugInfo({ viewport, orderedEntries, startTime, calculateSpeedIndex, }: CalcTTVCPercentilesArgWithDebugInfo): Promise<PercentileCalcResultWithSpeedIndex>;
6
6
  export default calculateTTVCPercentiles;
7
7
  export declare function calculatePercentiles(timePixelCounts: Map<DOMHighResTimeStamp, number>, elementMap: ReadonlyMap<DOMHighResTimeStamp, Set<string>>, unorderedPercentiles: number[], totalPixels: number, startTime: DOMHighResTimeStamp): RevisionPayloadVCDetails;
8
- export declare function calculatePercentilesWithDebugInfo(timePixelCounts: Map<DOMHighResTimeStamp, number>, elementMap: ReadonlyMap<DOMHighResTimeStamp, ViewportEntryData[]>, totalPixels: number, startTime: DOMHighResTimeStamp): PercentileCalcResult;
8
+ export declare function calculatePercentilesWithDebugInfo(timePixelCounts: Map<DOMHighResTimeStamp, number>, elementMap: ReadonlyMap<DOMHighResTimeStamp, ViewportEntryData[]>, totalPixels: number, startTime: DOMHighResTimeStamp, calculateSpeedIndex?: boolean): PercentileCalcResultWithSpeedIndex;
9
9
  export { calculateTTVCPercentilesWithDebugInfo };
@@ -17,6 +17,11 @@ export type CalcTTVCPercentilesArgWithDebugInfo = {
17
17
  orderedEntries: ReadonlyArray<VCObserverEntry>;
18
18
  startTime: DOMHighResTimeStamp;
19
19
  stopTime: DOMHighResTimeStamp;
20
+ /**
21
+ * Whether to calculate speed index metric.
22
+ * Controlled by platform_ufo_ttvc_v4_speed_index feature flag.
23
+ */
24
+ calculateSpeedIndex?: boolean;
20
25
  };
21
26
  export interface PercentileCalcResultItem {
22
27
  time: number;
@@ -27,3 +32,10 @@ export interface PercentileCalcResultItem {
27
32
  * Ordered by time
28
33
  */
29
34
  export type PercentileCalcResult = PercentileCalcResultItem[];
35
+ /**
36
+ * Result of percentile calculation with debug info, including speed index
37
+ */
38
+ export type PercentileCalcResultWithSpeedIndex = {
39
+ entries: PercentileCalcResult;
40
+ speedIndex: number;
41
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -89,9 +89,6 @@
89
89
  "platform_ufo_canvas_heatmap_full_precision": {
90
90
  "type": "boolean"
91
91
  },
92
- "platform_ufo_enable_media_for_ttvc_v3": {
93
- "type": "boolean"
94
- },
95
92
  "platform_ufo_remove_deprecated_config_fields": {
96
93
  "type": "boolean"
97
94
  },
@@ -205,6 +202,9 @@
205
202
  },
206
203
  "platform_ufo_enable_terminal_errors": {
207
204
  "type": "boolean"
205
+ },
206
+ "platform_ufo_ttvc_v4_speed_index": {
207
+ "type": "boolean"
208
208
  }
209
209
  }
210
210
  }