@atlaskit/react-ufo 3.9.0 → 3.9.2

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#149337](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149337)
8
+ [`cf5be62e3c4a3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf5be62e3c4a3) -
9
+ clean up fg platform_ufo_vc_ttai_on_paint
10
+ - [#148259](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148259)
11
+ [`5504072998c27`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5504072998c27) -
12
+ Fixed a performance regression in SPA transitions when feature gate
13
+ 'platform_ufo_no_vc_on_aborted' is enabled. The issue was caused by not properly stopping the VC
14
+ observer when returning early for aborted/invisible interactions, which led to background observer
15
+ processes interfering with subsequent interactions. The fix ensures proper cleanup of the VC
16
+ observer in all code paths.
17
+
18
+ ## 3.9.1
19
+
20
+ ### Patch Changes
21
+
22
+ - [#147978](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147978)
23
+ [`af8b516786ee8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af8b516786ee8) -
24
+ FF cleanup ufo-calc-speed-index
25
+
3
26
  ## 3.9.0
4
27
 
5
28
  ### Minor Changes
@@ -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 = 9;
46
+ _context.next = 10;
47
47
  break;
48
48
  }
49
+ (0, _vc.getVCObserver)().stop();
49
50
  return _context.abrupt("return", {});
50
- case 9:
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 = 16;
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 16:
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 = 26;
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 = 23;
83
+ _context.next = 24;
83
84
  break;
84
85
  }
85
86
  return _context.abrupt("return", result);
86
- case 23:
87
+ case 24:
87
88
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
88
89
  'metric:vc90': ttvcV2Revision['metric:vc90']
89
90
  }));
90
- case 26:
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 = 29;
94
+ _context.next = 30;
94
95
  break;
95
96
  }
96
97
  return _context.abrupt("return", result);
97
- case 29:
98
+ case 30:
98
99
  if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
99
- _context.next = 31;
100
+ _context.next = 32;
100
101
  break;
101
102
  }
102
103
  return _context.abrupt("return", result);
103
- case 31:
104
+ case 32:
104
105
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
105
106
  'metric:vc90': VC['90']
106
107
  }));
107
- case 32:
108
+ case 33:
108
109
  case "end":
109
110
  return _context.stop();
110
111
  }
@@ -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
- if ((0, _platformFeatureFlags.fg)('platform_ufo_vc_ttai_on_paint')) {
238
- (0, _scheduleOnPaint.default)(function () {
239
- var paintedTime = performance.now();
240
- _this.complete(paintedTime);
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,
@@ -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: (0, _platformFeatureFlags.fg)('platform_ufo_vc_ttai_on_paint') ? param.stop : performance.now()
75
+ stop: param.stop
76
76
  });
77
77
  case 5:
78
78
  newResult = _context.sent;
@@ -107,7 +107,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
107
107
  (0, _defineProperty2.default)(this, "getVCResult", /*#__PURE__*/function () {
108
108
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
109
109
  var _getConfig, _getConfig2;
110
- var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, isCalcSpeedIndexEnabled, speedIndex, isTTVCv3Enabled;
110
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
111
111
  return _regenerator.default.wrap(function _callee$(_context) {
112
112
  while (1) switch (_context.prev = _context.next) {
113
113
  case 0:
@@ -283,20 +283,19 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
283
283
  VCBox: vcNext.VCBox
284
284
  },
285
285
  isEventAborted: isEventAborted
286
- }); // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
287
- isCalcSpeedIndexEnabled = (0, _platformFeatureFlags.fg)('ufo-calc-speed-index');
286
+ });
288
287
  speedIndex = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
289
288
  if (!isTTVCv1Disabled) {
290
- _context.next = 26;
289
+ _context.next = 25;
291
290
  break;
292
291
  }
293
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
294
- case 26:
292
+ return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
293
+ case 25:
295
294
  isTTVCv3Enabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') || ((_getConfig2 = (0, _config.getConfig)()) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.vc) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.enabledVCRevisions) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.includes('fy25.03'));
296
295
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
297
296
  'metrics:vc': VC
298
- }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
299
- case 28:
297
+ }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
298
+ case 27:
300
299
  case "end":
301
300
  return _context.stop();
302
301
  }
@@ -680,9 +679,6 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
680
679
  });
681
680
  var VC = VCObserver.makeVCReturnObj();
682
681
  var VCBox = VCObserver.makeVCReturnObj();
683
-
684
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
685
- var isCalcSpeedIndexEnabled = (0, _platformFeatureFlags.fg)('ufo-calc-speed-index');
686
682
  entries.reduce(function () {
687
683
  var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
688
684
  var v = arguments.length > 1 ? arguments[1] : undefined;
@@ -719,10 +715,8 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
719
715
  return v.targetName;
720
716
  })));
721
717
  var ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
722
- if (isCalcSpeedIndexEnabled) {
723
- var speedIndex = timestamp * ratioDelta;
724
- acc.speedIndex += speedIndex;
725
- }
718
+ var speedIndex = timestamp * ratioDelta;
719
+ acc.speedIndex += speedIndex;
726
720
  acc.abs.push([timestamp, currentlyPainted]);
727
721
  acc.rel.push({
728
722
  time: timestamp,
@@ -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,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
- if (fg('platform_ufo_vc_ttai_on_paint')) {
211
- scheduleOnPaint(() => {
212
- const paintedTime = performance.now();
213
- this.complete(paintedTime);
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,
@@ -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: fg('platform_ufo_vc_ttai_on_paint') ? param.stop : performance.now()
40
+ stop: param.stop
41
41
  }));
42
42
  if (oldResult && !newResult) {
43
43
  return oldResult;
@@ -291,8 +291,6 @@ export class VCObserver {
291
291
  },
292
292
  isEventAborted
293
293
  });
294
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
295
- const isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
296
294
  const speedIndex = {
297
295
  [`ufo:speedIndex`]: isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex,
298
296
  [`ufo:next:speedIndex`]: vcNext.VCEntries.speedIndex
@@ -305,7 +303,7 @@ export class VCObserver {
305
303
  ...outOfBoundary,
306
304
  [`${fullPrefix}vc:ignored`]: this.getIgnoredElements(componentsLog),
307
305
  ...revisionsData,
308
- ...(isCalcSpeedIndexEnabled ? speedIndex : {})
306
+ ...speedIndex
309
307
  };
310
308
  }
311
309
  const isTTVCv3Enabled = fg('platform_ufo_vc_observer_new') || ((_getConfig2 = getConfig()) === null || _getConfig2 === void 0 ? void 0 : (_getConfig2$vc = _getConfig2.vc) === null || _getConfig2$vc === void 0 ? void 0 : (_getConfig2$vc$enable = _getConfig2$vc.enabledVCRevisions) === null || _getConfig2$vc$enable === void 0 ? void 0 : _getConfig2$vc$enable.includes('fy25.03'));
@@ -327,7 +325,7 @@ export class VCObserver {
327
325
  [`${fullPrefix}vc:next:dom`]: vcNext.VCBox,
328
326
  [`${fullPrefix}vc:ignored`]: this.getIgnoredElements(componentsLog),
329
327
  ...revisionsData,
330
- ...(isCalcSpeedIndexEnabled ? speedIndex : {})
328
+ ...speedIndex
331
329
  };
332
330
  });
333
331
  _defineProperty(this, "handleUpdate", (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) => {
@@ -580,9 +578,6 @@ export class VCObserver {
580
578
  const entries = Object.entries(lastUpdate).map(a => [parseInt(a[0], 10), a[1]]).sort((a, b) => a[0] > b[0] ? 1 : -1);
581
579
  const VC = VCObserver.makeVCReturnObj();
582
580
  const VCBox = VCObserver.makeVCReturnObj();
583
-
584
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
585
- const isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
586
581
  entries.reduce((acc = 0, v) => {
587
582
  const currRatio = v[1] / totalPainted;
588
583
  let VCRatio = currRatio + acc;
@@ -606,10 +601,8 @@ export class VCObserver {
606
601
  const currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
607
602
  const logEntry = [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(v => !v.ignoreReason).map(v => v.targetName))];
608
603
  const ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
609
- if (isCalcSpeedIndexEnabled) {
610
- const speedIndex = timestamp * ratioDelta;
611
- acc.speedIndex += speedIndex;
612
- }
604
+ const speedIndex = timestamp * ratioDelta;
605
+ acc.speedIndex += speedIndex;
613
606
  acc.abs.push([timestamp, currentlyPainted]);
614
607
  acc.rel.push({
615
608
  time: timestamp,
@@ -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 = 9;
39
+ _context.next = 10;
40
40
  break;
41
41
  }
42
+ getVCObserver().stop();
42
43
  return _context.abrupt("return", {});
43
- case 9:
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 = 16;
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 16:
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 = 26;
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 = 23;
76
+ _context.next = 24;
76
77
  break;
77
78
  }
78
79
  return _context.abrupt("return", result);
79
- case 23:
80
+ case 24:
80
81
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
81
82
  'metric:vc90': ttvcV2Revision['metric:vc90']
82
83
  }));
83
- case 26:
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 = 29;
87
+ _context.next = 30;
87
88
  break;
88
89
  }
89
90
  return _context.abrupt("return", result);
90
- case 29:
91
+ case 30:
91
92
  if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
92
- _context.next = 31;
93
+ _context.next = 32;
93
94
  break;
94
95
  }
95
96
  return _context.abrupt("return", result);
96
- case 31:
97
+ case 32:
97
98
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
98
99
  'metric:vc90': VC['90']
99
100
  }));
100
- case 32:
101
+ case 33:
101
102
  case "end":
102
103
  return _context.stop();
103
104
  }
@@ -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
- if (fg('platform_ufo_vc_ttai_on_paint')) {
226
- scheduleOnPaint(function () {
227
- var paintedTime = performance.now();
228
- _this.complete(paintedTime);
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,
@@ -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: fg('platform_ufo_vc_ttai_on_paint') ? param.stop : performance.now()
67
+ stop: param.stop
68
68
  });
69
69
  case 5:
70
70
  newResult = _context.sent;
@@ -100,7 +100,7 @@ export var VCObserver = /*#__PURE__*/function () {
100
100
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
101
101
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
102
102
  var _getConfig, _getConfig2;
103
- var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, isCalcSpeedIndexEnabled, speedIndex, isTTVCv3Enabled;
103
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
104
104
  return _regeneratorRuntime.wrap(function _callee$(_context) {
105
105
  while (1) switch (_context.prev = _context.next) {
106
106
  case 0:
@@ -276,20 +276,19 @@ export var VCObserver = /*#__PURE__*/function () {
276
276
  VCBox: vcNext.VCBox
277
277
  },
278
278
  isEventAborted: isEventAborted
279
- }); // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
280
- isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
279
+ });
281
280
  speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
282
281
  if (!isTTVCv1Disabled) {
283
- _context.next = 26;
282
+ _context.next = 25;
284
283
  break;
285
284
  }
286
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
287
- case 26:
285
+ return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
286
+ case 25:
288
287
  isTTVCv3Enabled = fg('platform_ufo_vc_observer_new') || ((_getConfig2 = getConfig()) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.vc) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.enabledVCRevisions) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.includes('fy25.03'));
289
288
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
290
289
  'metrics:vc': VC
291
- }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
292
- case 28:
290
+ }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
291
+ case 27:
293
292
  case "end":
294
293
  return _context.stop();
295
294
  }
@@ -673,9 +672,6 @@ export var VCObserver = /*#__PURE__*/function () {
673
672
  });
674
673
  var VC = VCObserver.makeVCReturnObj();
675
674
  var VCBox = VCObserver.makeVCReturnObj();
676
-
677
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
678
- var isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
679
675
  entries.reduce(function () {
680
676
  var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
681
677
  var v = arguments.length > 1 ? arguments[1] : undefined;
@@ -712,10 +708,8 @@ export var VCObserver = /*#__PURE__*/function () {
712
708
  return v.targetName;
713
709
  })));
714
710
  var ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
715
- if (isCalcSpeedIndexEnabled) {
716
- var speedIndex = timestamp * ratioDelta;
717
- acc.speedIndex += speedIndex;
718
- }
711
+ var speedIndex = timestamp * ratioDelta;
712
+ acc.speedIndex += speedIndex;
719
713
  acc.abs.push([timestamp, currentlyPainted]);
720
714
  acc.rel.push({
721
715
  time: timestamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -133,9 +133,6 @@
133
133
  "ufo_capture_stylesheet_metrics": {
134
134
  "type": "boolean"
135
135
  },
136
- "ufo-calc-speed-index": {
137
- "type": "boolean"
138
- },
139
136
  "ufo_return_relative_request_start": {
140
137
  "type": "boolean"
141
138
  },
@@ -145,9 +142,6 @@
145
142
  "platform_ufo_custom_data_structured_clone": {
146
143
  "type": "boolean"
147
144
  },
148
- "platform_ufo_vc_ttai_on_paint": {
149
- "type": "boolean"
150
- },
151
145
  "enable_ufo_devtools_api_for_extra_events": {
152
146
  "type": "boolean"
153
147
  },