@atlaskit/react-ufo 2.11.0 → 2.12.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.
- package/CHANGELOG.md +20 -0
- package/create-experimental-interaction-metrics-payload/package.json +15 -0
- package/dist/cjs/config/index.js +42 -20
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +114 -0
- package/dist/cjs/create-payload/index.js +51 -10
- package/dist/cjs/interaction-metrics/common/constants.js +2 -3
- package/dist/cjs/interaction-metrics/index.js +130 -55
- package/dist/cjs/interaction-metrics/post-interaction-log.js +20 -10
- package/dist/cjs/interaction-metrics-init/index.js +28 -7
- package/dist/cjs/load-hold/UFOLoadHold.js +5 -3
- package/dist/cjs/segment/segment.js +9 -8
- package/dist/cjs/vc/vc-observer/index.js +1 -1
- package/dist/es2019/config/index.js +22 -0
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +85 -0
- package/dist/es2019/create-payload/index.js +50 -8
- package/dist/es2019/interaction-metrics/common/constants.js +1 -2
- package/dist/es2019/interaction-metrics/index.js +109 -28
- package/dist/es2019/interaction-metrics/post-interaction-log.js +21 -11
- package/dist/es2019/interaction-metrics-init/index.js +26 -7
- package/dist/es2019/load-hold/UFOLoadHold.js +5 -3
- package/dist/es2019/segment/segment.js +8 -11
- package/dist/es2019/vc/vc-observer/index.js +1 -0
- package/dist/esm/config/index.js +41 -20
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +104 -0
- package/dist/esm/create-payload/index.js +51 -11
- package/dist/esm/interaction-metrics/common/constants.js +1 -2
- package/dist/esm/interaction-metrics/index.js +102 -27
- package/dist/esm/interaction-metrics/post-interaction-log.js +20 -10
- package/dist/esm/interaction-metrics-init/index.js +26 -7
- package/dist/esm/load-hold/UFOLoadHold.js +5 -3
- package/dist/esm/segment/segment.js +9 -8
- package/dist/esm/vc/vc-observer/index.js +1 -1
- package/dist/types/common/common/types.d.ts +6 -4
- package/dist/types/config/index.d.ts +6 -0
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +16 -0
- package/dist/types/create-payload/index.d.ts +5922 -0
- package/dist/types/interaction-context/index.d.ts +1 -0
- package/dist/types/interaction-metrics/common/constants.d.ts +1 -2
- package/dist/types/interaction-metrics/index.d.ts +1 -1
- package/dist/types/load-hold/UFOLoadHold.d.ts +1 -2
- package/dist/types-ts4.5/common/common/types.d.ts +6 -4
- package/dist/types-ts4.5/config/index.d.ts +6 -0
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +16 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +5922 -0
- package/dist/types-ts4.5/interaction-context/index.d.ts +1 -0
- package/dist/types-ts4.5/interaction-metrics/common/constants.d.ts +1 -2
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +1 -1
- package/dist/types-ts4.5/load-hold/UFOLoadHold.d.ts +1 -2
- package/package.json +3 -2
|
@@ -27,6 +27,7 @@ export interface UFOInteractionContextType extends InteractionContextType {
|
|
|
27
27
|
startTime?: number;
|
|
28
28
|
stopTime: number;
|
|
29
29
|
}): void;
|
|
30
|
+
holdExperimental?(name: string): void | (() => void);
|
|
30
31
|
}
|
|
31
32
|
declare const _default: Context<UFOInteractionContextType | null>;
|
|
32
33
|
export default _default;
|
|
@@ -18,7 +18,7 @@ export declare function addSpanToAll(type: SpanType, name: string, labelStack: L
|
|
|
18
18
|
export declare function addPreload(moduleId: string, timestamp: number): void;
|
|
19
19
|
export declare function addLoad(identifier: string, start: number, end: number): void;
|
|
20
20
|
export declare function extractModuleName(input: string): string;
|
|
21
|
-
export declare function addHold(interactionId: string, labelStack: LabelStack, name: string): () => void;
|
|
21
|
+
export declare function addHold(interactionId: string, labelStack: LabelStack, name: string, experimental: boolean): () => void;
|
|
22
22
|
export declare function addHoldByID(interactionId: string, labelStack: LabelStack, name: string, id: string, ignoreOnSubmit?: boolean): () => void;
|
|
23
23
|
export declare function removeHoldByID(interactionId: string, id: string): void;
|
|
24
24
|
export declare function getCurrentInteractionType(interactionId: string): InteractionType | null;
|
|
@@ -63,7 +63,7 @@ export interface SegmentInfo {
|
|
|
63
63
|
labelStack: LabelStack;
|
|
64
64
|
}
|
|
65
65
|
export interface CustomData {
|
|
66
|
-
[key: string]: null |
|
|
66
|
+
[key: string]: null | string | number | boolean | undefined | CustomData | Record<string, CustomData>;
|
|
67
67
|
}
|
|
68
68
|
export type CustomTiming = Record<string, {
|
|
69
69
|
startTime: number;
|
|
@@ -104,7 +104,9 @@ export interface InteractionMetrics {
|
|
|
104
104
|
labelStack: LabelStack;
|
|
105
105
|
})[];
|
|
106
106
|
holdInfo: HoldInfo[];
|
|
107
|
+
holdExpInfo: HoldInfo[];
|
|
107
108
|
holdActive: Map<string, HoldActive>;
|
|
109
|
+
holdExpActive: Map<string, HoldActive>;
|
|
108
110
|
reactProfilerTimings: ReactProfilerTiming[];
|
|
109
111
|
measureStart: number;
|
|
110
112
|
rate: number;
|
|
@@ -115,11 +117,11 @@ export interface InteractionMetrics {
|
|
|
115
117
|
abortReason?: AbortReasonType;
|
|
116
118
|
abortedByInteractionName?: string;
|
|
117
119
|
/**
|
|
118
|
-
* Apdex is legacy performance measurement where it is
|
|
120
|
+
* Apdex is a legacy performance measurement where it is
|
|
119
121
|
* capturing TTI at arbitrary point in the code (bm3/UFOv1)
|
|
120
122
|
*
|
|
121
123
|
* We are intercepting its values now just so we can use it for
|
|
122
|
-
* topline metric, but should encourage teams adopt TTAI
|
|
124
|
+
* topline metric, but should encourage teams to adopt TTAI
|
|
123
125
|
*
|
|
124
126
|
* This field might be ignored/dropped in the future.
|
|
125
127
|
*/
|
|
@@ -164,7 +166,7 @@ export interface LazyLoadProfilerContext {
|
|
|
164
166
|
addLoad(identifier: string, start: number, end: number): void;
|
|
165
167
|
}
|
|
166
168
|
export interface EnhancedUFOInteractionContextType extends UFOInteractionContextType, RelayMetricsRecorder, LazyLoadProfilerContext {
|
|
167
|
-
_internalHold(labelStack: LabelStack, name: string): void | (() => void);
|
|
169
|
+
_internalHold(labelStack: LabelStack, name: string, experimental?: boolean): void | (() => void);
|
|
168
170
|
_internalHoldByID(labelStack: LabelStack, id: string, name: string, remove: boolean): void | (() => void);
|
|
169
171
|
addHoldByID(labelStack: LabelStack, id: string, name?: string): void;
|
|
170
172
|
removeHoldByID(labelStack: LabelStack, id: string, name?: string): void;
|
|
@@ -73,6 +73,11 @@ export type Config = {
|
|
|
73
73
|
readonly rates?: Rates;
|
|
74
74
|
readonly kind?: Record<InteractionType, number>;
|
|
75
75
|
};
|
|
76
|
+
readonly experimentalInteractionMetrics?: {
|
|
77
|
+
readonly enabled?: boolean;
|
|
78
|
+
readonly rates?: Rates;
|
|
79
|
+
readonly kind?: Record<InteractionType, number>;
|
|
80
|
+
};
|
|
76
81
|
readonly enableSegmentHighlighting?: boolean;
|
|
77
82
|
readonly enableAdditionalPerformanceMarks?: boolean;
|
|
78
83
|
readonly shouldCalculateLighthouseMetricsFromTTAI?: boolean;
|
|
@@ -87,6 +92,7 @@ export type Config = {
|
|
|
87
92
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
88
93
|
export declare function getConfig(): Config | undefined;
|
|
89
94
|
export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
|
|
95
|
+
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
90
96
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
91
97
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
92
98
|
declare const validTypingMethods: readonly [
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { InteractionMetrics } from '../common';
|
|
2
|
+
import { VCObserver, type VCObserverOptions } from '../vc/vc-observer';
|
|
3
|
+
type InteractionMetricsHandler = (interactionId: string, interaction: InteractionMetrics) => void | Promise<void>;
|
|
4
|
+
export declare function installInteractionSink(handler: InteractionMetricsHandler): void;
|
|
5
|
+
export declare function sinkExperimentalHandler(sinkFn: (interactionId: string, interaction: InteractionMetrics) => void | Promise<void>): void;
|
|
6
|
+
export declare function onExperimentalInteractionComplete(interactionId: string, data: InteractionMetrics, endTime?: number): void;
|
|
7
|
+
export declare class ExperimentalVCMetrics {
|
|
8
|
+
vcObserver: VCObserver | null;
|
|
9
|
+
initialize(options: VCObserverOptions): this;
|
|
10
|
+
start({ startTime }: {
|
|
11
|
+
startTime: number;
|
|
12
|
+
}): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const experimentalVC: ExperimentalVCMetrics;
|
|
15
|
+
export declare const getExperimentalVCMetrics: (interaction: InteractionMetrics) => import("../common/vc/types").VCResult | null;
|
|
16
|
+
export {};
|