@atlaskit/react-ufo 2.5.3 → 2.7.0
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 +40 -18
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +100 -0
- package/dist/cjs/create-payload/common/utils/index.js +66 -2
- package/dist/cjs/create-payload/index.js +55 -78
- package/dist/cjs/interaction-metrics/common/constants.js +8 -3
- package/dist/cjs/interaction-metrics/common/index.js +151 -0
- package/dist/cjs/interaction-metrics/index.js +166 -238
- package/dist/cjs/interaction-metrics-init/index.js +31 -9
- package/dist/cjs/load-hold/UFOLoadHold.js +5 -3
- package/dist/cjs/segment/segment.js +9 -8
- package/dist/es2019/config/index.js +22 -0
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +71 -0
- package/dist/es2019/create-payload/common/utils/index.js +68 -1
- package/dist/es2019/create-payload/index.js +48 -77
- package/dist/es2019/interaction-metrics/common/constants.js +7 -2
- package/dist/es2019/interaction-metrics/common/index.js +103 -0
- package/dist/es2019/interaction-metrics/index.js +91 -131
- package/dist/es2019/interaction-metrics-init/index.js +28 -8
- package/dist/es2019/load-hold/UFOLoadHold.js +5 -3
- package/dist/es2019/segment/segment.js +8 -11
- package/dist/esm/config/index.js +39 -18
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +90 -0
- package/dist/esm/create-payload/common/utils/index.js +63 -1
- package/dist/esm/create-payload/index.js +53 -78
- package/dist/esm/interaction-metrics/common/constants.js +7 -2
- package/dist/esm/interaction-metrics/common/index.js +132 -0
- package/dist/esm/interaction-metrics/index.js +86 -158
- package/dist/esm/interaction-metrics-init/index.js +28 -8
- package/dist/esm/load-hold/UFOLoadHold.js +5 -3
- package/dist/esm/segment/segment.js +9 -8
- package/dist/types/common/common/types.d.ts +6 -4
- package/dist/types/config/index.d.ts +7 -0
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +16 -0
- package/dist/types/create-payload/common/utils/index.d.ts +9 -0
- package/dist/types/create-payload/index.d.ts +13 -5660
- package/dist/types/interaction-context/index.d.ts +1 -0
- package/dist/types/interaction-metrics/common/constants.d.ts +32 -3
- package/dist/types/interaction-metrics/common/index.d.ts +16 -0
- package/dist/types/interaction-metrics/index.d.ts +1 -17
- 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 +7 -0
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +16 -0
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +9 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +13 -5660
- package/dist/types-ts4.5/interaction-context/index.d.ts +1 -0
- package/dist/types-ts4.5/interaction-metrics/common/constants.d.ts +32 -3
- package/dist/types-ts4.5/interaction-metrics/common/index.d.ts +16 -0
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +1 -17
- package/dist/types-ts4.5/load-hold/UFOLoadHold.d.ts +1 -2
- package/package.json +3 -2
|
@@ -79,15 +79,14 @@ export default function UFOSegment(_ref) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function _internalHold(labelStack, name
|
|
83
|
-
|
|
84
|
-
) {
|
|
82
|
+
function _internalHold(labelStack, name) {
|
|
83
|
+
var experimental = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
85
84
|
if (interactionId.current != null) {
|
|
86
85
|
if (parentContext) {
|
|
87
|
-
return parentContext._internalHold(labelStack, name);
|
|
86
|
+
return parentContext._internalHold(labelStack, name, experimental);
|
|
88
87
|
} else {
|
|
89
88
|
var capturedInteractionId = interactionId.current;
|
|
90
|
-
var disposeHold = addHold(interactionId.current, labelStack, name);
|
|
89
|
+
var disposeHold = addHold(interactionId.current, labelStack, name, experimental);
|
|
91
90
|
return function () {
|
|
92
91
|
if (capturedInteractionId === interactionId.current) {
|
|
93
92
|
disposeHold();
|
|
@@ -96,9 +95,7 @@ export default function UFOSegment(_ref) {
|
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
function _internalHoldByID(labelStack, id, name, remove
|
|
100
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
101
|
-
) {
|
|
98
|
+
function _internalHoldByID(labelStack, id, name, remove) {
|
|
102
99
|
if (interactionId.current != null) {
|
|
103
100
|
if (parentContext) {
|
|
104
101
|
parentContext._internalHoldByID(labelStack, name, id, remove);
|
|
@@ -123,6 +120,10 @@ export default function UFOSegment(_ref) {
|
|
|
123
120
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown';
|
|
124
121
|
return this._internalHold(this.labelStack, name);
|
|
125
122
|
},
|
|
123
|
+
holdExperimental: function holdExperimental() {
|
|
124
|
+
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown';
|
|
125
|
+
return this._internalHold(this.labelStack, name, true);
|
|
126
|
+
},
|
|
126
127
|
addHoldByID: function addHoldByID(labelStack, id) {
|
|
127
128
|
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'unknown';
|
|
128
129
|
this._internalHoldByID(labelStack, id, name, false);
|
|
@@ -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;
|
|
@@ -65,6 +65,7 @@ export type Config = {
|
|
|
65
65
|
readonly devToolsEnabled?: boolean;
|
|
66
66
|
readonly selectorConfig?: SelectorConfig;
|
|
67
67
|
readonly ssr?: boolean;
|
|
68
|
+
readonly ssrWhitelist?: string[];
|
|
68
69
|
readonly stopVCAtInteractionFinish?: boolean;
|
|
69
70
|
};
|
|
70
71
|
readonly postInteractionLog?: {
|
|
@@ -72,6 +73,11 @@ export type Config = {
|
|
|
72
73
|
readonly rates?: Rates;
|
|
73
74
|
readonly kind?: Record<InteractionType, number>;
|
|
74
75
|
};
|
|
76
|
+
readonly experimentalInteractionMetrics?: {
|
|
77
|
+
readonly enabled?: boolean;
|
|
78
|
+
readonly rates?: Rates;
|
|
79
|
+
readonly kind?: Record<InteractionType, number>;
|
|
80
|
+
};
|
|
75
81
|
readonly enableSegmentHighlighting?: boolean;
|
|
76
82
|
readonly enableAdditionalPerformanceMarks?: boolean;
|
|
77
83
|
readonly shouldCalculateLighthouseMetricsFromTTAI?: boolean;
|
|
@@ -85,6 +91,7 @@ export type Config = {
|
|
|
85
91
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
86
92
|
export declare function getConfig(): Config | undefined;
|
|
87
93
|
export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
|
|
94
|
+
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
88
95
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
89
96
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
90
97
|
declare const validTypingMethods: readonly ["timeout", "timeoutNoAlloc", "mutationObserver"];
|
|
@@ -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) => any;
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import type { InteractionMetrics } from '../../../common';
|
|
2
|
+
import { type Config } from '../../../config';
|
|
1
3
|
import type { LabelStack, SegmentLabel } from '../../../interaction-context';
|
|
4
|
+
import PostInteractionLog from '../../../interaction-metrics/post-interaction-log';
|
|
5
|
+
export declare const postInteractionLog: PostInteractionLog;
|
|
2
6
|
export type SegmentItem = {
|
|
3
7
|
n: string;
|
|
4
8
|
c?: Record<string, SegmentItem>;
|
|
@@ -15,3 +19,8 @@ export declare function optimizeLabelStack(labelStack: LabelStack): string | {
|
|
|
15
19
|
s?: string | undefined;
|
|
16
20
|
n: string;
|
|
17
21
|
}[];
|
|
22
|
+
export declare const getPageVisibilityUpToTTAI: (interaction: InteractionMetrics) => import("../../../hidden-timing").PageVisibility;
|
|
23
|
+
export declare const calculateVCMetrics: (interaction: InteractionMetrics, prefix: string, getVCResultFn: (props: any) => any) => any;
|
|
24
|
+
export declare function getSSRDoneTimeValue(config: Config | undefined): number | undefined;
|
|
25
|
+
export declare const getVCMetrics: (interaction: InteractionMetrics) => any;
|
|
26
|
+
export declare const getTTAI: (interaction: InteractionMetrics) => number | undefined;
|