@atlaskit/react-ufo 2.5.3 → 2.6.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 +12 -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 +65 -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 +67 -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 +62 -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 +6 -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 +6 -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
|
@@ -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;
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
import type { InteractionMetrics } from '../../common';
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import type { InteractionMetrics, SegmentInfo } from '../../common';
|
|
2
|
+
import type { FeatureFlagValue } from '../../feature-flags-accessed';
|
|
3
|
+
export declare const interactions: Map<string, InteractionMetrics>;
|
|
4
|
+
export declare const CLEANUP_TIMEOUT: number;
|
|
5
|
+
export declare const CLEANUP_TIMEOUT_AFTER_APDEX: number;
|
|
6
|
+
export type SegmentObserver = {
|
|
7
|
+
onAdd: (segment: SegmentInfo) => void;
|
|
8
|
+
onRemove: (segment: SegmentInfo) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const interactionQueue: {
|
|
11
|
+
id: string;
|
|
12
|
+
data: InteractionMetrics;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const segmentCache: Map<string, SegmentInfo>;
|
|
15
|
+
export declare const segmentObservers: SegmentObserver[];
|
|
16
|
+
export declare const moduleLoadingRequests: Record<string, {
|
|
17
|
+
start: number;
|
|
18
|
+
timeoutId: ReturnType<typeof setTimeout> | number | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
declare global {
|
|
21
|
+
interface Window {
|
|
22
|
+
__REACT_UFO_ENABLE_PERF_TRACING?: boolean;
|
|
23
|
+
__UFO_COMPACT_PAYLOAD__?: boolean;
|
|
24
|
+
__CRITERION__?: {
|
|
25
|
+
addFeatureFlagAccessed?: (flagName: string, flagValue: FeatureFlagValue) => void;
|
|
26
|
+
addUFOHold?: (id: string, name: string, labelStack: string, startTime: number) => void;
|
|
27
|
+
removeUFOHold?: (id: string) => void;
|
|
28
|
+
getFeatureFlagOverride?: (flagName: string) => boolean | undefined;
|
|
29
|
+
getExperimentValueOverride?: <T>(experimentName: string, parameterName: string) => T;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { InteractionMetrics } from '../../common';
|
|
2
|
+
import type { LabelStack, SegmentLabel } from '../../interaction-context';
|
|
3
|
+
import { type SegmentObserver } from './constants';
|
|
4
|
+
export declare function isPerformanceTracingEnabled(): boolean;
|
|
5
|
+
export declare function labelStackToString(labelStack: LabelStack | null | undefined, name?: string): string;
|
|
6
|
+
export declare function labelStackToIdString(labelStack: LabelStack | null | undefined): string | undefined;
|
|
7
|
+
export declare function addSegmentObserver(observer: SegmentObserver): void;
|
|
8
|
+
export declare function removeSegmentObserver(observer: SegmentObserver): void;
|
|
9
|
+
export declare function addHoldCriterion(id: string, labelStack: LabelStack, name: string, startTime: number): void;
|
|
10
|
+
export declare function removeHoldCriterion(id: string): void;
|
|
11
|
+
export declare const pushToQueue: (id: string, data: InteractionMetrics) => void;
|
|
12
|
+
export declare function callCleanUpCallbacks(interaction: InteractionMetrics): void;
|
|
13
|
+
export declare function reactProfilerTimingMap(data: InteractionMetrics): void;
|
|
14
|
+
export declare function callCancelCallbacks(interaction: InteractionMetrics): void;
|
|
15
|
+
export declare function isSegmentLabel(obj: any): obj is SegmentLabel;
|
|
16
|
+
export declare function getSegmentCacheKey(labelStack: LabelStack): string;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { AbortReasonType, ApdexType, BM3Event, CustomData, CustomTiming, InteractionError, InteractionMetrics, InteractionType, LifecycleMarkType, LoadProfilerEventInfo, Mark, MarkType, PostInteractionLogOutput, ReactProfilerTiming, RequestInfo, Span, SpanType } from '../common';
|
|
2
2
|
import { type TraceIdContext } from '../experience-trace-id-context';
|
|
3
|
-
import { type FeatureFlagValue } from '../feature-flags-accessed';
|
|
4
3
|
import type { LabelStack } from '../interaction-context';
|
|
5
|
-
import PostInteractionLog from './post-interaction-log';
|
|
6
4
|
export type { InteractionMetrics, LifecycleMarkType, Span, Mark, MarkType, InteractionType, AbortReasonType, ReactProfilerTiming, RequestInfo, ApdexType, CustomData, CustomTiming, InteractionError, };
|
|
7
|
-
export declare const postInteractionLog: PostInteractionLog;
|
|
8
5
|
export declare function getActiveInteraction(): InteractionMetrics | undefined;
|
|
9
6
|
export declare function remove(interactionId: string): void;
|
|
10
7
|
export declare function updatePageLoadInteractionName(ufoName: string, routeName?: string | null | undefined): void;
|
|
@@ -18,7 +15,7 @@ export declare function addSpanToAll(type: SpanType, name: string, labelStack: L
|
|
|
18
15
|
export declare function addPreload(moduleId: string, timestamp: number): void;
|
|
19
16
|
export declare function addLoad(identifier: string, start: number, end: number): void;
|
|
20
17
|
export declare function extractModuleName(input: string): string;
|
|
21
|
-
export declare function addHold(interactionId: string, labelStack: LabelStack, name: string): () => void;
|
|
18
|
+
export declare function addHold(interactionId: string, labelStack: LabelStack, name: string, experimental: boolean): () => void;
|
|
22
19
|
export declare function addHoldByID(interactionId: string, labelStack: LabelStack, name: string, id: string, ignoreOnSubmit?: boolean): () => void;
|
|
23
20
|
export declare function removeHoldByID(interactionId: string, id: string): void;
|
|
24
21
|
export declare function getCurrentInteractionType(interactionId: string): InteractionType | null;
|
|
@@ -52,18 +49,5 @@ export declare function addRequestInfo(interactionId: string, labelStack: LabelS
|
|
|
52
49
|
export declare function addSegment(labelStack: LabelStack): void;
|
|
53
50
|
export declare function removeSegment(labelStack: LabelStack): void;
|
|
54
51
|
export declare function addRedirect(interactionId: string, fromUfoName: string, nextUfoName: string, nextRouteName: string, time: number): void;
|
|
55
|
-
declare global {
|
|
56
|
-
interface Window {
|
|
57
|
-
__REACT_UFO_ENABLE_PERF_TRACING?: boolean;
|
|
58
|
-
__UFO_COMPACT_PAYLOAD__?: boolean;
|
|
59
|
-
__CRITERION__?: {
|
|
60
|
-
addFeatureFlagAccessed?: (flagName: string, flagValue: FeatureFlagValue) => void;
|
|
61
|
-
addUFOHold?: (id: string, name: string, labelStack: string, startTime: number) => void;
|
|
62
|
-
removeUFOHold?: (id: string) => void;
|
|
63
|
-
getFeatureFlagOverride?: (flagName: string) => boolean | undefined;
|
|
64
|
-
getExperimentValueOverride?: <T>(experimentName: string, parameterName: string) => T;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
52
|
export declare const interactionSpans: Span[];
|
|
69
53
|
export declare function addCustomSpans(name: string, start: number, end?: number, size?: number, labelStack?: LabelStack): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"./coinflip": "./src/coinflip/index.ts",
|
|
33
33
|
"./common": "./src/common/index.ts",
|
|
34
34
|
"./config": "./src/config/index.ts",
|
|
35
|
+
"./create-experimental-interaction-metrics-payload": "./src/create-experimental-interaction-metrics-payload/index.ts",
|
|
35
36
|
"./create-payload": "./src/create-payload/index.ts",
|
|
36
37
|
"./create-post-interaction-log-payload": "./src/create-post-interaction-log-payload/index.ts",
|
|
37
38
|
"./custom-data": "./src/custom-data/index.ts",
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
".": "./src/index.ts"
|
|
74
75
|
},
|
|
75
76
|
"dependencies": {
|
|
76
|
-
"@atlaskit/interaction-context": "^2.
|
|
77
|
+
"@atlaskit/interaction-context": "^2.3.0",
|
|
77
78
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
78
79
|
"@babel/runtime": "^7.0.0",
|
|
79
80
|
"bind-event-listener": "^3.0.0",
|