@atlaskit/react-ufo 3.9.1 → 3.9.3
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 +26 -0
- package/dist/cjs/create-payload/utils/get-interaction-status.js +6 -1
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +14 -13
- package/dist/cjs/custom-data/index.js +2 -3
- package/dist/cjs/segment/segment.js +4 -9
- package/dist/cjs/vc/index.js +1 -1
- package/dist/es2019/create-payload/utils/get-interaction-status.js +7 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +1 -0
- package/dist/es2019/custom-data/index.js +2 -3
- package/dist/es2019/segment/segment.js +4 -9
- package/dist/es2019/vc/index.js +1 -1
- package/dist/esm/create-payload/utils/get-interaction-status.js +6 -1
- package/dist/esm/create-payload/utils/get-vc-metrics.js +14 -13
- package/dist/esm/custom-data/index.js +2 -3
- package/dist/esm/segment/segment.js +4 -9
- package/dist/esm/vc/index.js +1 -1
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +2 -2
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#149225](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149225)
|
|
8
|
+
[`212d1bc6cd2a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/212d1bc6cd2a7) -
|
|
9
|
+
set the FAILED status client side, and ignore BM3 TTI event status
|
|
10
|
+
- [#148864](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148864)
|
|
11
|
+
[`93b2b5271da55`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/93b2b5271da55) -
|
|
12
|
+
FF cleanup: platform_ufo_custom_data_structured_clone
|
|
13
|
+
|
|
14
|
+
## 3.9.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#149337](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149337)
|
|
19
|
+
[`cf5be62e3c4a3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf5be62e3c4a3) -
|
|
20
|
+
clean up fg platform_ufo_vc_ttai_on_paint
|
|
21
|
+
- [#148259](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148259)
|
|
22
|
+
[`5504072998c27`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5504072998c27) -
|
|
23
|
+
Fixed a performance regression in SPA transitions when feature gate
|
|
24
|
+
'platform_ufo_no_vc_on_aborted' is enabled. The issue was caused by not properly stopping the VC
|
|
25
|
+
observer when returning early for aborted/invisible interactions, which led to background observer
|
|
26
|
+
processes interfering with subsequent interactions. The fix ensures proper cleanup of the VC
|
|
27
|
+
observer in all code paths.
|
|
28
|
+
|
|
3
29
|
## 3.9.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
/**
|
|
8
9
|
* Determines the interaction status based on abort reason and BM3 TTI presence.
|
|
9
10
|
*
|
|
@@ -28,8 +29,12 @@ exports.default = void 0;
|
|
|
28
29
|
*/
|
|
29
30
|
function getInteractionStatus(interaction) {
|
|
30
31
|
var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
|
|
32
|
+
var hasErrors = interaction.errors.length > 0;
|
|
33
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_set_event_failed_status_in_client')) {
|
|
34
|
+
originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
|
|
35
|
+
}
|
|
31
36
|
var hasBm3TTI = interaction.apdex.length > 0;
|
|
32
|
-
var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
|
|
37
|
+
var overrideStatus = hasBm3TTI && !(0, _platformFeatureFlags.fg)('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
|
|
33
38
|
return {
|
|
34
39
|
originalInteractionStatus: originalInteractionStatus,
|
|
35
40
|
overrideStatus: overrideStatus
|
|
@@ -43,11 +43,12 @@ function _getVCMetrics() {
|
|
|
43
43
|
interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
44
44
|
pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
45
45
|
if (!((interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible') && (0, _platformFeatureFlags.fg)('platform_ufo_no_vc_on_aborted'))) {
|
|
46
|
-
_context.next =
|
|
46
|
+
_context.next = 10;
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
|
+
(0, _vc.getVCObserver)().stop();
|
|
49
50
|
return _context.abrupt("return", {});
|
|
50
|
-
case
|
|
51
|
+
case 10:
|
|
51
52
|
isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
52
53
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
53
54
|
ssr: (0, _getSsrDoneTimeValue.default)(config)
|
|
@@ -55,7 +56,7 @@ function _getVCMetrics() {
|
|
|
55
56
|
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
56
57
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
57
58
|
prefix = 'ufo';
|
|
58
|
-
_context.next =
|
|
59
|
+
_context.next = 17;
|
|
59
60
|
return (0, _vc.getVCObserver)().getVCResult(_objectSpread({
|
|
60
61
|
start: interaction.start,
|
|
61
62
|
stop: interaction.end,
|
|
@@ -64,14 +65,14 @@ function _getVCMetrics() {
|
|
|
64
65
|
vc: interaction.vc,
|
|
65
66
|
isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED'
|
|
66
67
|
}, ssr));
|
|
67
|
-
case
|
|
68
|
+
case 17:
|
|
68
69
|
result = _context.sent;
|
|
69
70
|
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
70
71
|
(0, _vc.getVCObserver)().stop();
|
|
71
72
|
}
|
|
72
73
|
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
73
74
|
if (config !== null && config !== void 0 && (_config$vc2 = config.vc) !== null && _config$vc2 !== void 0 && (_config$vc2 = _config$vc2.enabledVCRevisions) !== null && _config$vc2 !== void 0 && _config$vc2.includes('fy25.01')) {
|
|
74
|
-
_context.next =
|
|
75
|
+
_context.next = 27;
|
|
75
76
|
break;
|
|
76
77
|
}
|
|
77
78
|
ttvcV2Revision = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
|
|
@@ -79,32 +80,32 @@ function _getVCMetrics() {
|
|
|
79
80
|
return revision === 'fy25.02';
|
|
80
81
|
});
|
|
81
82
|
if (ttvcV2Revision !== null && ttvcV2Revision !== void 0 && ttvcV2Revision.clean) {
|
|
82
|
-
_context.next =
|
|
83
|
+
_context.next = 24;
|
|
83
84
|
break;
|
|
84
85
|
}
|
|
85
86
|
return _context.abrupt("return", result);
|
|
86
|
-
case
|
|
87
|
+
case 24:
|
|
87
88
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
88
89
|
'metric:vc90': ttvcV2Revision['metric:vc90']
|
|
89
90
|
}));
|
|
90
|
-
case
|
|
91
|
+
case 27:
|
|
91
92
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
92
93
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
93
|
-
_context.next =
|
|
94
|
+
_context.next = 30;
|
|
94
95
|
break;
|
|
95
96
|
}
|
|
96
97
|
return _context.abrupt("return", result);
|
|
97
|
-
case
|
|
98
|
+
case 30:
|
|
98
99
|
if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
|
|
99
|
-
_context.next =
|
|
100
|
+
_context.next = 32;
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
102
103
|
return _context.abrupt("return", result);
|
|
103
|
-
case
|
|
104
|
+
case 32:
|
|
104
105
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
105
106
|
'metric:vc90': VC['90']
|
|
106
107
|
}));
|
|
107
|
-
case
|
|
108
|
+
case 33:
|
|
108
109
|
case "end":
|
|
109
110
|
return _context.stop();
|
|
110
111
|
}
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.addUFOCustomData = addUFOCustomData;
|
|
8
8
|
exports.default = UFOCustomData;
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _interactionContext = _interopRequireDefault(require("../interaction-context"));
|
|
12
11
|
var _interactionIdContext = require("../interaction-id-context");
|
|
13
12
|
var _interactionMetrics = require("../interaction-metrics");
|
|
@@ -18,7 +17,7 @@ function UFOCustomData(_ref) {
|
|
|
18
17
|
if (!interactionContext) {
|
|
19
18
|
return;
|
|
20
19
|
}
|
|
21
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function'
|
|
20
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
|
|
22
21
|
interactionContext.addCustomData(globalThis.structuredClone(data));
|
|
23
22
|
} else {
|
|
24
23
|
interactionContext.addCustomData(data);
|
|
@@ -32,7 +31,7 @@ function addUFOCustomData(data) {
|
|
|
32
31
|
if (!currentInteractionId) {
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function'
|
|
34
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
|
|
36
35
|
(0, _interactionMetrics.addCustomData)(currentInteractionId, [], globalThis.structuredClone(data));
|
|
37
36
|
} else {
|
|
38
37
|
(0, _interactionMetrics.addCustomData)(currentInteractionId, [], data);
|
|
@@ -11,7 +11,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _scheduler = require("scheduler");
|
|
13
13
|
var _uuid = require("uuid");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _coinflip = _interopRequireDefault(require("../coinflip"));
|
|
16
15
|
var _config = require("../config");
|
|
17
16
|
var _experienceTraceIdContext = require("../experience-trace-id-context");
|
|
@@ -234,14 +233,10 @@ function UFOSegment(_ref) {
|
|
|
234
233
|
var _this = this;
|
|
235
234
|
if (interactionId.current !== null) {
|
|
236
235
|
(0, _interactionMetrics.addProfilerTimings)(interactionId.current, this.labelStack, phase, actualDuration, baseDuration, startTime, commitTime);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
});
|
|
242
|
-
} else {
|
|
243
|
-
this.complete(commitTime);
|
|
244
|
-
}
|
|
236
|
+
(0, _scheduleOnPaint.default)(function () {
|
|
237
|
+
var paintedTime = performance.now();
|
|
238
|
+
_this.complete(paintedTime);
|
|
239
|
+
});
|
|
245
240
|
}
|
|
246
241
|
},
|
|
247
242
|
_internalHold: _internalHold,
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -72,7 +72,7 @@ var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
72
72
|
_context.next = 5;
|
|
73
73
|
return (_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
74
74
|
start: param.start,
|
|
75
|
-
stop:
|
|
75
|
+
stop: param.stop
|
|
76
76
|
});
|
|
77
77
|
case 5:
|
|
78
78
|
newResult = _context.sent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
/**
|
|
2
3
|
* Determines the interaction status based on abort reason and BM3 TTI presence.
|
|
3
4
|
*
|
|
@@ -21,9 +22,13 @@
|
|
|
21
22
|
* // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
|
|
22
23
|
*/
|
|
23
24
|
function getInteractionStatus(interaction) {
|
|
24
|
-
|
|
25
|
+
let originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
|
|
26
|
+
const hasErrors = interaction.errors.length > 0;
|
|
27
|
+
if (fg('platform_ufo_set_event_failed_status_in_client')) {
|
|
28
|
+
originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
|
|
29
|
+
}
|
|
25
30
|
const hasBm3TTI = interaction.apdex.length > 0;
|
|
26
|
-
const overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
|
|
31
|
+
const overrideStatus = hasBm3TTI && !fg('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
|
|
27
32
|
return {
|
|
28
33
|
originalInteractionStatus,
|
|
29
34
|
overrideStatus
|
|
@@ -17,6 +17,7 @@ async function getVCMetrics(interaction) {
|
|
|
17
17
|
const interactionStatus = getInteractionStatus(interaction);
|
|
18
18
|
const pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
19
19
|
if ((interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible') && fg('platform_ufo_no_vc_on_aborted')) {
|
|
20
|
+
getVCObserver().stop();
|
|
20
21
|
return {};
|
|
21
22
|
}
|
|
22
23
|
const isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 ? void 0 : (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import UFOInteractionContext from '../interaction-context';
|
|
4
3
|
import { getInteractionId } from '../interaction-id-context';
|
|
5
4
|
import { addCustomData } from '../interaction-metrics';
|
|
@@ -11,7 +10,7 @@ export default function UFOCustomData({
|
|
|
11
10
|
if (!interactionContext) {
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function'
|
|
13
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
|
|
15
14
|
interactionContext.addCustomData(globalThis.structuredClone(data));
|
|
16
15
|
} else {
|
|
17
16
|
interactionContext.addCustomData(data);
|
|
@@ -25,7 +24,7 @@ export function addUFOCustomData(data) {
|
|
|
25
24
|
if (!currentInteractionId) {
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function'
|
|
27
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
|
|
29
28
|
addCustomData(currentInteractionId, [], globalThis.structuredClone(data));
|
|
30
29
|
} else {
|
|
31
30
|
addCustomData(currentInteractionId, [], data);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { lazy, Profiler, Suspense, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { unstable_NormalPriority as NormalPriority, unstable_scheduleCallback as scheduleCallback } from 'scheduler';
|
|
3
3
|
import { v4 as createUUID } from 'uuid';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import coinflip from '../coinflip';
|
|
6
5
|
import { getConfig, getInteractionRate } from '../config';
|
|
7
6
|
import { getActiveTrace, setInteractionActiveTrace } from '../experience-trace-id-context';
|
|
@@ -207,14 +206,10 @@ export default function UFOSegment({
|
|
|
207
206
|
onRender(phase, actualDuration, baseDuration, startTime, commitTime) {
|
|
208
207
|
if (interactionId.current !== null) {
|
|
209
208
|
addProfilerTimings(interactionId.current, this.labelStack, phase, actualDuration, baseDuration, startTime, commitTime);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
});
|
|
215
|
-
} else {
|
|
216
|
-
this.complete(commitTime);
|
|
217
|
-
}
|
|
209
|
+
scheduleOnPaint(() => {
|
|
210
|
+
const paintedTime = performance.now();
|
|
211
|
+
this.complete(paintedTime);
|
|
212
|
+
});
|
|
218
213
|
}
|
|
219
214
|
},
|
|
220
215
|
_internalHold,
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -37,7 +37,7 @@ class VCObserverWrapper {
|
|
|
37
37
|
const oldResult = await ((_this$oldVCObserver4 = this.oldVCObserver) === null || _this$oldVCObserver4 === void 0 ? void 0 : _this$oldVCObserver4.getVCResult(param));
|
|
38
38
|
const newResult = await ((_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
39
39
|
start: param.start,
|
|
40
|
-
stop:
|
|
40
|
+
stop: param.stop
|
|
41
41
|
}));
|
|
42
42
|
if (oldResult && !newResult) {
|
|
43
43
|
return oldResult;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
/**
|
|
2
3
|
* Determines the interaction status based on abort reason and BM3 TTI presence.
|
|
3
4
|
*
|
|
@@ -22,8 +23,12 @@
|
|
|
22
23
|
*/
|
|
23
24
|
function getInteractionStatus(interaction) {
|
|
24
25
|
var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
|
|
26
|
+
var hasErrors = interaction.errors.length > 0;
|
|
27
|
+
if (fg('platform_ufo_set_event_failed_status_in_client')) {
|
|
28
|
+
originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
|
|
29
|
+
}
|
|
25
30
|
var hasBm3TTI = interaction.apdex.length > 0;
|
|
26
|
-
var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
|
|
31
|
+
var overrideStatus = hasBm3TTI && !fg('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
|
|
27
32
|
return {
|
|
28
33
|
originalInteractionStatus: originalInteractionStatus,
|
|
29
34
|
overrideStatus: overrideStatus
|
|
@@ -36,11 +36,12 @@ function _getVCMetrics() {
|
|
|
36
36
|
interactionStatus = getInteractionStatus(interaction);
|
|
37
37
|
pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
38
38
|
if (!((interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible') && fg('platform_ufo_no_vc_on_aborted'))) {
|
|
39
|
-
_context.next =
|
|
39
|
+
_context.next = 10;
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
|
+
getVCObserver().stop();
|
|
42
43
|
return _context.abrupt("return", {});
|
|
43
|
-
case
|
|
44
|
+
case 10:
|
|
44
45
|
isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
45
46
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
46
47
|
ssr: getSSRDoneTimeValue(config)
|
|
@@ -48,7 +49,7 @@ function _getVCMetrics() {
|
|
|
48
49
|
postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
49
50
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
50
51
|
prefix = 'ufo';
|
|
51
|
-
_context.next =
|
|
52
|
+
_context.next = 17;
|
|
52
53
|
return getVCObserver().getVCResult(_objectSpread({
|
|
53
54
|
start: interaction.start,
|
|
54
55
|
stop: interaction.end,
|
|
@@ -57,14 +58,14 @@ function _getVCMetrics() {
|
|
|
57
58
|
vc: interaction.vc,
|
|
58
59
|
isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED'
|
|
59
60
|
}, ssr));
|
|
60
|
-
case
|
|
61
|
+
case 17:
|
|
61
62
|
result = _context.sent;
|
|
62
63
|
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
63
64
|
getVCObserver().stop();
|
|
64
65
|
}
|
|
65
66
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
66
67
|
if (config !== null && config !== void 0 && (_config$vc2 = config.vc) !== null && _config$vc2 !== void 0 && (_config$vc2 = _config$vc2.enabledVCRevisions) !== null && _config$vc2 !== void 0 && _config$vc2.includes('fy25.01')) {
|
|
67
|
-
_context.next =
|
|
68
|
+
_context.next = 27;
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
71
|
ttvcV2Revision = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
|
|
@@ -72,32 +73,32 @@ function _getVCMetrics() {
|
|
|
72
73
|
return revision === 'fy25.02';
|
|
73
74
|
});
|
|
74
75
|
if (ttvcV2Revision !== null && ttvcV2Revision !== void 0 && ttvcV2Revision.clean) {
|
|
75
|
-
_context.next =
|
|
76
|
+
_context.next = 24;
|
|
76
77
|
break;
|
|
77
78
|
}
|
|
78
79
|
return _context.abrupt("return", result);
|
|
79
|
-
case
|
|
80
|
+
case 24:
|
|
80
81
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
81
82
|
'metric:vc90': ttvcV2Revision['metric:vc90']
|
|
82
83
|
}));
|
|
83
|
-
case
|
|
84
|
+
case 27:
|
|
84
85
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
85
86
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
86
|
-
_context.next =
|
|
87
|
+
_context.next = 30;
|
|
87
88
|
break;
|
|
88
89
|
}
|
|
89
90
|
return _context.abrupt("return", result);
|
|
90
|
-
case
|
|
91
|
+
case 30:
|
|
91
92
|
if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
|
|
92
|
-
_context.next =
|
|
93
|
+
_context.next = 32;
|
|
93
94
|
break;
|
|
94
95
|
}
|
|
95
96
|
return _context.abrupt("return", result);
|
|
96
|
-
case
|
|
97
|
+
case 32:
|
|
97
98
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
98
99
|
'metric:vc90': VC['90']
|
|
99
100
|
}));
|
|
100
|
-
case
|
|
101
|
+
case 33:
|
|
101
102
|
case "end":
|
|
102
103
|
return _context.stop();
|
|
103
104
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import UFOInteractionContext from '../interaction-context';
|
|
4
3
|
import { getInteractionId } from '../interaction-id-context';
|
|
5
4
|
import { addCustomData } from '../interaction-metrics';
|
|
@@ -10,7 +9,7 @@ export default function UFOCustomData(_ref) {
|
|
|
10
9
|
if (!interactionContext) {
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function'
|
|
12
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
|
|
14
13
|
interactionContext.addCustomData(globalThis.structuredClone(data));
|
|
15
14
|
} else {
|
|
16
15
|
interactionContext.addCustomData(data);
|
|
@@ -24,7 +23,7 @@ export function addUFOCustomData(data) {
|
|
|
24
23
|
if (!currentInteractionId) {
|
|
25
24
|
return;
|
|
26
25
|
}
|
|
27
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function'
|
|
26
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
|
|
28
27
|
addCustomData(currentInteractionId, [], globalThis.structuredClone(data));
|
|
29
28
|
} else {
|
|
30
29
|
addCustomData(currentInteractionId, [], data);
|
|
@@ -5,7 +5,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import React, { lazy, Profiler, Suspense, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
import { unstable_NormalPriority as NormalPriority, unstable_scheduleCallback as scheduleCallback } from 'scheduler';
|
|
7
7
|
import { v4 as createUUID } from 'uuid';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import coinflip from '../coinflip';
|
|
10
9
|
import { getConfig, getInteractionRate } from '../config';
|
|
11
10
|
import { getActiveTrace, setInteractionActiveTrace } from '../experience-trace-id-context';
|
|
@@ -222,14 +221,10 @@ export default function UFOSegment(_ref) {
|
|
|
222
221
|
var _this = this;
|
|
223
222
|
if (interactionId.current !== null) {
|
|
224
223
|
addProfilerTimings(interactionId.current, this.labelStack, phase, actualDuration, baseDuration, startTime, commitTime);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
});
|
|
230
|
-
} else {
|
|
231
|
-
this.complete(commitTime);
|
|
232
|
-
}
|
|
224
|
+
scheduleOnPaint(function () {
|
|
225
|
+
var paintedTime = performance.now();
|
|
226
|
+
_this.complete(paintedTime);
|
|
227
|
+
});
|
|
233
228
|
}
|
|
234
229
|
},
|
|
235
230
|
_internalHold: _internalHold,
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
64
64
|
_context.next = 5;
|
|
65
65
|
return (_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
66
66
|
start: param.start,
|
|
67
|
-
stop:
|
|
67
|
+
stop: param.stop
|
|
68
68
|
});
|
|
69
69
|
case 5:
|
|
70
70
|
newResult = _context.sent;
|
|
@@ -22,7 +22,7 @@ import type { InteractionMetrics } from '../../common';
|
|
|
22
22
|
* // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
|
|
23
23
|
*/
|
|
24
24
|
declare function getInteractionStatus(interaction: InteractionMetrics): {
|
|
25
|
-
readonly originalInteractionStatus:
|
|
26
|
-
readonly overrideStatus:
|
|
25
|
+
readonly originalInteractionStatus: string;
|
|
26
|
+
readonly overrideStatus: string;
|
|
27
27
|
};
|
|
28
28
|
export default getInteractionStatus;
|
|
@@ -22,7 +22,7 @@ import type { InteractionMetrics } from '../../common';
|
|
|
22
22
|
* // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
|
|
23
23
|
*/
|
|
24
24
|
declare function getInteractionStatus(interaction: InteractionMetrics): {
|
|
25
|
-
readonly originalInteractionStatus:
|
|
26
|
-
readonly overrideStatus:
|
|
25
|
+
readonly originalInteractionStatus: string;
|
|
26
|
+
readonly overrideStatus: string;
|
|
27
27
|
};
|
|
28
28
|
export default getInteractionStatus;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -139,16 +139,16 @@
|
|
|
139
139
|
"platform_ufo_vc_observer_new": {
|
|
140
140
|
"type": "boolean"
|
|
141
141
|
},
|
|
142
|
-
"
|
|
142
|
+
"enable_ufo_devtools_api_for_extra_events": {
|
|
143
143
|
"type": "boolean"
|
|
144
144
|
},
|
|
145
|
-
"
|
|
145
|
+
"platform_ufo_no_vc_on_aborted": {
|
|
146
146
|
"type": "boolean"
|
|
147
147
|
},
|
|
148
|
-
"
|
|
148
|
+
"platform_ufo_set_event_failed_status_in_client": {
|
|
149
149
|
"type": "boolean"
|
|
150
150
|
},
|
|
151
|
-
"
|
|
151
|
+
"platform_ufo_ignore_bm3_tti_event_status": {
|
|
152
152
|
"type": "boolean"
|
|
153
153
|
},
|
|
154
154
|
"ufo_payload_use_idle_callback": {
|