@atlaskit/react-ufo 4.14.3 → 4.14.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.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/config/index.js +4 -0
- package/dist/cjs/create-payload/index.js +22 -2
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +10 -6
- package/dist/cjs/vc/index.js +4 -3
- package/dist/cjs/vc/vc-observer-new/index.js +31 -7
- package/dist/cjs/vc/vc-observer-new/raw-data-handler/index.js +237 -0
- package/dist/es2019/config/index.js +3 -0
- package/dist/es2019/create-payload/index.js +17 -1
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +5 -2
- package/dist/es2019/vc/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/index.js +20 -1
- package/dist/es2019/vc/vc-observer-new/raw-data-handler/index.js +173 -0
- package/dist/esm/config/index.js +3 -0
- package/dist/esm/create-payload/index.js +22 -2
- package/dist/esm/create-payload/utils/get-vc-metrics.js +11 -7
- package/dist/esm/vc/index.js +4 -3
- package/dist/esm/vc/vc-observer-new/index.js +31 -7
- package/dist/esm/vc/vc-observer-new/raw-data-handler/index.js +231 -0
- package/dist/types/common/vc/types.d.ts +20 -1
- package/dist/types/config/index.d.ts +6 -0
- package/dist/types/vc/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/raw-data-handler/index.d.ts +20 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +2 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +25 -1
- package/dist/types-ts4.5/config/index.d.ts +6 -0
- package/dist/types-ts4.5/vc/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/raw-data-handler/index.d.ts +20 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +2 -0
- package/package.json +4 -1
|
@@ -4,7 +4,7 @@ export declare const AbortEvent: {
|
|
|
4
4
|
readonly keydown: "keydown";
|
|
5
5
|
readonly resize: "resize";
|
|
6
6
|
};
|
|
7
|
-
export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported' | 'wheel';
|
|
7
|
+
export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported' | 'wheel' | 'browser_backgrounded';
|
|
8
8
|
export type VCAbortReasonType = {
|
|
9
9
|
reason: null | VCAbortReason;
|
|
10
10
|
info: string;
|
|
@@ -118,6 +118,13 @@ export type CalculateTTVCResult = {
|
|
|
118
118
|
vcDetails: RevisionPayloadVCDetails;
|
|
119
119
|
ssrRatio: number;
|
|
120
120
|
};
|
|
121
|
+
export type RawObservation = {
|
|
122
|
+
t: number;
|
|
123
|
+
r: [number, number, number, number];
|
|
124
|
+
chg: number | string;
|
|
125
|
+
eid: number;
|
|
126
|
+
att?: number;
|
|
127
|
+
};
|
|
121
128
|
export type RevisionPayloadEntry = {
|
|
122
129
|
'metric:vc90': number | null;
|
|
123
130
|
revision: string;
|
|
@@ -128,6 +135,18 @@ export type RevisionPayloadEntry = {
|
|
|
128
135
|
labelStacks?: VCLabelStacks;
|
|
129
136
|
abortReason?: VCAbortReason | null;
|
|
130
137
|
abortTimestamp?: number;
|
|
138
|
+
rawData?: {
|
|
139
|
+
obs?: Array<RawObservation>;
|
|
140
|
+
eid?: Record<number, string>;
|
|
141
|
+
chg?: Record<number, string>;
|
|
142
|
+
att?: Record<number, string>;
|
|
143
|
+
};
|
|
144
|
+
viewport?: {
|
|
145
|
+
w: number;
|
|
146
|
+
h: number;
|
|
147
|
+
};
|
|
148
|
+
feVCTime?: number;
|
|
149
|
+
rawVCTime?: number;
|
|
131
150
|
};
|
|
132
151
|
export type RevisionPayload = RevisionPayloadEntry[];
|
|
133
152
|
export {};
|
|
@@ -161,6 +161,11 @@ export type Config = {
|
|
|
161
161
|
readonly enabled: boolean;
|
|
162
162
|
readonly searchPageMetricName: string;
|
|
163
163
|
};
|
|
164
|
+
readonly enableVCRawDataRates?: {
|
|
165
|
+
readonly enabled?: boolean;
|
|
166
|
+
readonly rates?: Rates;
|
|
167
|
+
readonly kind?: Record<InteractionType, number>;
|
|
168
|
+
};
|
|
164
169
|
};
|
|
165
170
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
166
171
|
export declare function getConfig(): Config | undefined;
|
|
@@ -170,6 +175,7 @@ export declare function getMostRecentVCRevision(experienceKey?: string): TTVCRev
|
|
|
170
175
|
export declare function getReactHydrationStats(): ReactHydrationStats | undefined;
|
|
171
176
|
export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
|
|
172
177
|
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
178
|
+
export declare function getVCRawDataInteractionRate(name: string, interactionType: InteractionType): number;
|
|
173
179
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
174
180
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
175
181
|
export declare function getExtraInteractionRate(name: string, interactionType: InteractionType): number;
|
package/dist/types/vc/types.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RevisionPayloadEntry } from '../../../common/vc/types';
|
|
2
|
+
import type { VCObserverEntry } from '../types';
|
|
3
|
+
export default class RawDataHandler {
|
|
4
|
+
private readonly revisionNo;
|
|
5
|
+
protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
|
|
6
|
+
isVCClean: boolean;
|
|
7
|
+
dirtyReason: never;
|
|
8
|
+
abortTimestamp: number;
|
|
9
|
+
} | {
|
|
10
|
+
isVCClean: boolean;
|
|
11
|
+
dirtyReason?: undefined;
|
|
12
|
+
abortTimestamp?: undefined;
|
|
13
|
+
};
|
|
14
|
+
getRawData({ entries, startTime, stopTime, isPageVisible, }: {
|
|
15
|
+
entries: ReadonlyArray<VCObserverEntry>;
|
|
16
|
+
startTime: number;
|
|
17
|
+
stopTime: number;
|
|
18
|
+
isPageVisible: boolean;
|
|
19
|
+
}): Promise<RevisionPayloadEntry | undefined>;
|
|
20
|
+
}
|
|
@@ -23,6 +23,7 @@ export type WindowEventEntryData = {
|
|
|
23
23
|
export type VCObserverEntry = {
|
|
24
24
|
readonly time: DOMHighResTimeStamp;
|
|
25
25
|
readonly data: ViewportEntryData | WindowEventEntryData;
|
|
26
|
+
ignoredInRevision?: string[];
|
|
26
27
|
};
|
|
27
28
|
export type VCObserverGetVCResultParam = {
|
|
28
29
|
start: number;
|
|
@@ -35,4 +36,5 @@ export type VCObserverGetVCResultParam = {
|
|
|
35
36
|
interactionType: InteractionType;
|
|
36
37
|
isPageVisible: boolean;
|
|
37
38
|
interactionAbortReason?: AbortReasonType;
|
|
39
|
+
includeRawData?: boolean;
|
|
38
40
|
};
|
|
@@ -4,7 +4,7 @@ export declare const AbortEvent: {
|
|
|
4
4
|
readonly keydown: "keydown";
|
|
5
5
|
readonly resize: "resize";
|
|
6
6
|
};
|
|
7
|
-
export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported' | 'wheel';
|
|
7
|
+
export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported' | 'wheel' | 'browser_backgrounded';
|
|
8
8
|
export type VCAbortReasonType = {
|
|
9
9
|
reason: null | VCAbortReason;
|
|
10
10
|
info: string;
|
|
@@ -118,6 +118,18 @@ export type CalculateTTVCResult = {
|
|
|
118
118
|
vcDetails: RevisionPayloadVCDetails;
|
|
119
119
|
ssrRatio: number;
|
|
120
120
|
};
|
|
121
|
+
export type RawObservation = {
|
|
122
|
+
t: number;
|
|
123
|
+
r: [
|
|
124
|
+
number,
|
|
125
|
+
number,
|
|
126
|
+
number,
|
|
127
|
+
number
|
|
128
|
+
];
|
|
129
|
+
chg: number | string;
|
|
130
|
+
eid: number;
|
|
131
|
+
att?: number;
|
|
132
|
+
};
|
|
121
133
|
export type RevisionPayloadEntry = {
|
|
122
134
|
'metric:vc90': number | null;
|
|
123
135
|
revision: string;
|
|
@@ -128,6 +140,18 @@ export type RevisionPayloadEntry = {
|
|
|
128
140
|
labelStacks?: VCLabelStacks;
|
|
129
141
|
abortReason?: VCAbortReason | null;
|
|
130
142
|
abortTimestamp?: number;
|
|
143
|
+
rawData?: {
|
|
144
|
+
obs?: Array<RawObservation>;
|
|
145
|
+
eid?: Record<number, string>;
|
|
146
|
+
chg?: Record<number, string>;
|
|
147
|
+
att?: Record<number, string>;
|
|
148
|
+
};
|
|
149
|
+
viewport?: {
|
|
150
|
+
w: number;
|
|
151
|
+
h: number;
|
|
152
|
+
};
|
|
153
|
+
feVCTime?: number;
|
|
154
|
+
rawVCTime?: number;
|
|
131
155
|
};
|
|
132
156
|
export type RevisionPayload = RevisionPayloadEntry[];
|
|
133
157
|
export {};
|
|
@@ -161,6 +161,11 @@ export type Config = {
|
|
|
161
161
|
readonly enabled: boolean;
|
|
162
162
|
readonly searchPageMetricName: string;
|
|
163
163
|
};
|
|
164
|
+
readonly enableVCRawDataRates?: {
|
|
165
|
+
readonly enabled?: boolean;
|
|
166
|
+
readonly rates?: Rates;
|
|
167
|
+
readonly kind?: Record<InteractionType, number>;
|
|
168
|
+
};
|
|
164
169
|
};
|
|
165
170
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
166
171
|
export declare function getConfig(): Config | undefined;
|
|
@@ -170,6 +175,7 @@ export declare function getMostRecentVCRevision(experienceKey?: string): TTVCRev
|
|
|
170
175
|
export declare function getReactHydrationStats(): ReactHydrationStats | undefined;
|
|
171
176
|
export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
|
|
172
177
|
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
178
|
+
export declare function getVCRawDataInteractionRate(name: string, interactionType: InteractionType): number;
|
|
173
179
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
174
180
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
175
181
|
export declare function getExtraInteractionRate(name: string, interactionType: InteractionType): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RevisionPayloadEntry } from '../../../common/vc/types';
|
|
2
|
+
import type { VCObserverEntry } from '../types';
|
|
3
|
+
export default class RawDataHandler {
|
|
4
|
+
private readonly revisionNo;
|
|
5
|
+
protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
|
|
6
|
+
isVCClean: boolean;
|
|
7
|
+
dirtyReason: never;
|
|
8
|
+
abortTimestamp: number;
|
|
9
|
+
} | {
|
|
10
|
+
isVCClean: boolean;
|
|
11
|
+
dirtyReason?: undefined;
|
|
12
|
+
abortTimestamp?: undefined;
|
|
13
|
+
};
|
|
14
|
+
getRawData({ entries, startTime, stopTime, isPageVisible, }: {
|
|
15
|
+
entries: ReadonlyArray<VCObserverEntry>;
|
|
16
|
+
startTime: number;
|
|
17
|
+
stopTime: number;
|
|
18
|
+
isPageVisible: boolean;
|
|
19
|
+
}): Promise<RevisionPayloadEntry | undefined>;
|
|
20
|
+
}
|
|
@@ -23,6 +23,7 @@ export type WindowEventEntryData = {
|
|
|
23
23
|
export type VCObserverEntry = {
|
|
24
24
|
readonly time: DOMHighResTimeStamp;
|
|
25
25
|
readonly data: ViewportEntryData | WindowEventEntryData;
|
|
26
|
+
ignoredInRevision?: string[];
|
|
26
27
|
};
|
|
27
28
|
export type VCObserverGetVCResultParam = {
|
|
28
29
|
start: number;
|
|
@@ -35,4 +36,5 @@ export type VCObserverGetVCResultParam = {
|
|
|
35
36
|
interactionType: InteractionType;
|
|
36
37
|
isPageVisible: boolean;
|
|
37
38
|
interactionAbortReason?: AbortReasonType;
|
|
39
|
+
includeRawData?: boolean;
|
|
38
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.4",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -169,6 +169,9 @@
|
|
|
169
169
|
},
|
|
170
170
|
"platform_ufo_exclude_3p_attribute_changes": {
|
|
171
171
|
"type": "boolean"
|
|
172
|
+
},
|
|
173
|
+
"platform_ufo_enable_vc_raw_data": {
|
|
174
|
+
"type": "boolean"
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
177
|
}
|