@atlaskit/react-ufo 4.4.4 → 4.4.5

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.
Files changed (22) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/interaction-metrics/index.js +11 -31
  3. package/dist/cjs/vc/vc-observer/index.js +32 -9
  4. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +4 -2
  5. package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +11 -2
  6. package/dist/es2019/interaction-metrics/index.js +11 -31
  7. package/dist/es2019/vc/vc-observer/index.js +42 -19
  8. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +4 -1
  9. package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +8 -1
  10. package/dist/esm/interaction-metrics/index.js +11 -31
  11. package/dist/esm/vc/vc-observer/index.js +32 -9
  12. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +4 -2
  13. package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +11 -2
  14. package/dist/types/common/vc/types.d.ts +1 -0
  15. package/dist/types/vc/vc-observer/getVCRevisionDebugDetails.d.ts +1 -0
  16. package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -0
  17. package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +1 -1
  18. package/dist/types-ts4.5/common/vc/types.d.ts +1 -0
  19. package/dist/types-ts4.5/vc/vc-observer/getVCRevisionDebugDetails.d.ts +1 -0
  20. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -0
  21. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +1 -1
  22. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b773a6a1dad0f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b773a6a1dad0f) -
8
+ add TTVC abort timestamp to payload
9
+ - [`80ff64c68bc70`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/80ff64c68bc70) -
10
+ Clean up feature gate platform_ufo_post_interaction_check_name
11
+
3
12
  ## 4.4.4
4
13
 
5
14
  ### Patch Changes
@@ -699,15 +699,9 @@ function finishInteraction(id, data) {
699
699
  data.hydration = (0, _config.getReactHydrationStats)();
700
700
 
701
701
  // By this time, stop the post interaction log observer if coinflip rate is 0
702
- if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
703
- var sanitisedUfoName = (0, _utils.sanitizeUfoName)(data.ufoName);
704
- if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(sanitisedUfoName, data.type))) {
705
- postInteractionLog.stopVCObserver();
706
- }
707
- } else {
708
- if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(data.routeName || data.ufoName, data.type))) {
709
- postInteractionLog.stopVCObserver();
710
- }
702
+ var sanitisedUfoName = (0, _utils.sanitizeUfoName)(data.ufoName);
703
+ if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(sanitisedUfoName, data.type))) {
704
+ postInteractionLog.stopVCObserver();
711
705
  }
712
706
  if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
713
707
  if (!data.hold3pActive || data.hold3pActive.size === 0) {
@@ -1021,13 +1015,7 @@ function addOnCancelCallback(id, cancelCallback) {
1021
1015
  }
1022
1016
  function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
1023
1017
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1024
- if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
1025
- postInteractionLog.reset();
1026
- } else {
1027
- if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
1028
- postInteractionLog.reset();
1029
- }
1030
- }
1018
+ postInteractionLog.reset();
1031
1019
  var vcObserver;
1032
1020
  var previousTime = startTime;
1033
1021
  var timeoutTime = (0, _platformFeatureFlags.fg)('platform_ufo_enable_timeout_config') ? (0, _config.getInteractionTimeout)(ufoName) : CLEANUP_TIMEOUT;
@@ -1138,6 +1126,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1138
1126
  addHoldByID(interactionId, [], ufoName, ufoName, true);
1139
1127
  }
1140
1128
  if (type === 'transition' || type === 'page_load') {
1129
+ var _getConfig11;
1141
1130
  // Use per-interaction VC observer if available, otherwise fall back to global
1142
1131
  var observer = vcObserver;
1143
1132
  if (observer) {
@@ -1146,21 +1135,12 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1146
1135
  experienceKey: ufoName
1147
1136
  });
1148
1137
  }
1149
- if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
1150
- var _getConfig11;
1151
- // Start post interaction observer for all if config is enabled
1152
- // in case ufoName is updated at later time
1153
- if ((_getConfig11 = (0, _config.getConfig)()) !== null && _getConfig11 !== void 0 && (_getConfig11 = _getConfig11.postInteractionLog) !== null && _getConfig11 !== void 0 && _getConfig11.enabled) {
1154
- postInteractionLog.startVCObserver({
1155
- startTime: startTime
1156
- });
1157
- }
1158
- } else {
1159
- if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
1160
- postInteractionLog.startVCObserver({
1161
- startTime: startTime
1162
- });
1163
- }
1138
+ // Start post interaction observer for all if config is enabled
1139
+ // in case ufoName is updated at later time
1140
+ if ((_getConfig11 = (0, _config.getConfig)()) !== null && _getConfig11 !== void 0 && (_getConfig11 = _getConfig11.postInteractionLog) !== null && _getConfig11 !== void 0 && _getConfig11.enabled) {
1141
+ postInteractionLog.startVCObserver({
1142
+ startTime: startTime
1143
+ });
1164
1144
  }
1165
1145
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(ufoName, type))) {
1166
1146
  _createExperimentalInteractionMetricsPayload.experimentalVC.start({
@@ -13,6 +13,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _config = require("../../config");
17
18
  var _interactionMetrics = require("../../interaction-metrics");
18
19
  var _attachAbortListeners = require("./attachAbortListeners");
@@ -102,7 +103,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
102
103
  });
103
104
  (0, _defineProperty2.default)(this, "getVCResult", /*#__PURE__*/function () {
104
105
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
105
- var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, shouldCreateDebugDetails, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
106
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, _vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, shouldCreateDebugDetails, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
106
107
  return _regenerator.default.wrap(function _callee$(_context) {
107
108
  while (1) switch (_context.prev = _context.next) {
108
109
  case 0:
@@ -119,7 +120,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
119
120
  abortReason = rawData.abortReason, abortReasonInfo = rawData.abortReasonInfo, heatmap = rawData.heatmap, heatmapNext = rawData.heatmapNext, outOfBoundaryInfo = rawData.outOfBoundaryInfo, totalTime = rawData.totalTime, componentsLog = rawData.componentsLog, viewport = rawData.viewport, devToolsEnabled = rawData.devToolsEnabled, ratios = rawData.ratios;
120
121
  isTTVCv1Disabled = !(0, _config.isVCRevisionEnabled)('fy25.01', experienceKey);
121
122
  if (!(abortReasonInfo !== null)) {
122
- _context.next = 13;
123
+ _context.next = 19;
123
124
  break;
124
125
  }
125
126
  // exposing data to devtools
@@ -128,22 +129,44 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
128
129
  window.__vcNotAvailableReason = abortReasonInfo;
129
130
  }
130
131
  } catch (e) {}
131
- vcAbortedResultWithRevisions = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReason.reason), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), "".concat(fullPrefix, "vc:rev"), [{
132
+ if (!(0, _platformFeatureFlags.fg)('platform_ufo_abort_timestamp_by_revision')) {
133
+ _context.next = 16;
134
+ break;
135
+ }
136
+ vcAbortedResultWithRevisions = (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:rev"), [{
132
137
  revision: 'fy25.02',
133
138
  clean: false,
134
139
  'metric:vc90': null,
135
- abortReason: abortReason.reason
140
+ abortReason: abortReason.reason,
141
+ abortTimestamp: Math.round(abortReason.timestamp)
136
142
  }]);
137
143
  if (!isTTVCv1Disabled) {
138
144
  vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
139
145
  revision: 'fy25.01',
140
146
  clean: false,
141
147
  'metric:vc90': null,
142
- abortReason: abortReason.reason
148
+ abortReason: abortReason.reason,
149
+ abortTimestamp: Math.round(abortReason.timestamp)
143
150
  });
144
151
  }
145
152
  return _context.abrupt("return", vcAbortedResultWithRevisions);
146
- case 13:
153
+ case 16:
154
+ _vcAbortedResultWithRevisions = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReason.reason), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), "".concat(fullPrefix, "vc:rev"), [{
155
+ revision: 'fy25.02',
156
+ clean: false,
157
+ 'metric:vc90': null,
158
+ abortReason: abortReason.reason
159
+ }]);
160
+ if (!isTTVCv1Disabled) {
161
+ _vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
162
+ revision: 'fy25.01',
163
+ clean: false,
164
+ 'metric:vc90': null,
165
+ abortReason: abortReason.reason
166
+ });
167
+ }
168
+ return _context.abrupt("return", _vcAbortedResultWithRevisions);
169
+ case 19:
147
170
  ttvcV1Result = isTTVCv1Disabled ? {
148
171
  VC: {},
149
172
  VCBox: {},
@@ -301,16 +324,16 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
301
324
  SSRRatioNext = VCObserver.getSSRRatio(vcNext.VCEntries.rel, ssr);
302
325
  SSRRatioPayload = includeSSRRatio ? (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ssrRatio"), isTTVCv1Disabled ? SSRRatioNext : SSRRatio), "".concat(fullPrefix, "vc:next:ssrRatio"), SSRRatioNext) : {};
303
326
  if (!isTTVCv1Disabled) {
304
- _context.next = 29;
327
+ _context.next = 35;
305
328
  break;
306
329
  }
307
330
  return _context.abrupt("return", _objectSpread(_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)), SSRRatioPayload), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ssrRatio"), SSRRatioNext), revisionsData), speedIndex));
308
- case 29:
331
+ case 35:
309
332
  isTTVCv3Enabled = (0, _config.isVCRevisionEnabled)('fy25.03', experienceKey);
310
333
  return _context.abrupt("return", _objectSpread(_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)((0, _defineProperty2.default)({
311
334
  'metrics:vc': VC
312
335
  }, "".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), "".concat(fullPrefix, "vc:ssrRatio"), SSRRatio), outOfBoundary), {}, (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), SSRRatioPayload), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
313
- case 31:
336
+ case 37:
314
337
  case "end":
315
338
  return _context.stop();
316
339
  }
@@ -338,12 +338,14 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
338
338
  _context2.next = 7;
339
339
  break;
340
340
  }
341
- return _context2.abrupt("return", {
341
+ return _context2.abrupt("return", _objectSpread({
342
342
  revision: this.revisionNo,
343
343
  'metric:vc90': null,
344
344
  clean: false,
345
345
  abortReason: dirtyReason
346
- });
346
+ }, (0, _platformFeatureFlags.fg)('platform_ufo_abort_timestamp_by_revision') ? {
347
+ abortTimestamp: getVCCleanStatusResult.abortTimestamp
348
+ } : {}));
347
349
  case 7:
348
350
  _context2.next = 9;
349
351
  return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries);
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = exports.NON_VISUAL_ARIA_ATTRIBUTES = exports.KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
@@ -13,6 +14,8 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _abstractBaseVcCalculator = _interopRequireDefault(require("../abstract-base-vc-calculator"));
15
16
  var _isViewportEntryData = _interopRequireDefault(require("../utils/is-viewport-entry-data"));
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
19
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
17
20
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
21
  var ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
@@ -70,21 +73,27 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
70
73
  key: "getVCCleanStatus",
71
74
  value: function getVCCleanStatus(filteredEntries) {
72
75
  var dirtyReason = '';
76
+ var abortTimestamp = -1;
73
77
  var hasAbortEvent = filteredEntries.some(function (entry) {
74
78
  if (entry.data.type === 'window:event') {
75
79
  var data = entry.data;
76
80
  if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
77
81
  dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
82
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_abort_timestamp_by_revision')) {
83
+ abortTimestamp = Math.round(entry.time);
84
+ }
78
85
  return true;
79
86
  }
80
87
  }
81
88
  return false;
82
89
  });
83
90
  if (hasAbortEvent && dirtyReason) {
84
- return {
91
+ return _objectSpread({
85
92
  isVCClean: false,
86
93
  dirtyReason: dirtyReason
87
- };
94
+ }, (0, _platformFeatureFlags.fg)('platform_ufo_abort_timestamp_by_revision') ? {
95
+ abortTimestamp: abortTimestamp
96
+ } : {});
88
97
  }
89
98
  return {
90
99
  isVCClean: true
@@ -617,15 +617,9 @@ function finishInteraction(id, data, endTime = performance.now()) {
617
617
  data.hydration = getReactHydrationStats();
618
618
 
619
619
  // By this time, stop the post interaction log observer if coinflip rate is 0
620
- if (fg('platform_ufo_post_interaction_check_name')) {
621
- const sanitisedUfoName = sanitizeUfoName(data.ufoName);
622
- if (!coinflip(getPostInteractionRate(sanitisedUfoName, data.type))) {
623
- postInteractionLog.stopVCObserver();
624
- }
625
- } else {
626
- if (!coinflip(getPostInteractionRate(data.routeName || data.ufoName, data.type))) {
627
- postInteractionLog.stopVCObserver();
628
- }
620
+ const sanitisedUfoName = sanitizeUfoName(data.ufoName);
621
+ if (!coinflip(getPostInteractionRate(sanitisedUfoName, data.type))) {
622
+ postInteractionLog.stopVCObserver();
629
623
  }
630
624
  if (fg('platform_ufo_enable_ttai_with_3p')) {
631
625
  if (!data.hold3pActive || data.hold3pActive.size === 0) {
@@ -899,13 +893,7 @@ export function addOnCancelCallback(id, cancelCallback) {
899
893
  interaction === null || interaction === void 0 ? void 0 : interaction.cancelCallbacks.push(cancelCallback);
900
894
  }
901
895
  export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName, trace = null) {
902
- if (fg('platform_ufo_post_interaction_check_name')) {
903
- postInteractionLog.reset();
904
- } else {
905
- if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
906
- postInteractionLog.reset();
907
- }
908
- }
896
+ postInteractionLog.reset();
909
897
  let vcObserver;
910
898
  let previousTime = startTime;
911
899
  let timeoutTime = fg('platform_ufo_enable_timeout_config') ? getInteractionTimeout(ufoName) : CLEANUP_TIMEOUT;
@@ -1016,6 +1004,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1016
1004
  addHoldByID(interactionId, [], ufoName, ufoName, true);
1017
1005
  }
1018
1006
  if (type === 'transition' || type === 'page_load') {
1007
+ var _getConfig11, _getConfig11$postInte;
1019
1008
  // Use per-interaction VC observer if available, otherwise fall back to global
1020
1009
  const observer = vcObserver;
1021
1010
  if (observer) {
@@ -1024,21 +1013,12 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1024
1013
  experienceKey: ufoName
1025
1014
  });
1026
1015
  }
1027
- if (fg('platform_ufo_post_interaction_check_name')) {
1028
- var _getConfig11, _getConfig11$postInte;
1029
- // Start post interaction observer for all if config is enabled
1030
- // in case ufoName is updated at later time
1031
- if ((_getConfig11 = getConfig()) !== null && _getConfig11 !== void 0 && (_getConfig11$postInte = _getConfig11.postInteractionLog) !== null && _getConfig11$postInte !== void 0 && _getConfig11$postInte.enabled) {
1032
- postInteractionLog.startVCObserver({
1033
- startTime
1034
- });
1035
- }
1036
- } else {
1037
- if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
1038
- postInteractionLog.startVCObserver({
1039
- startTime
1040
- });
1041
- }
1016
+ // Start post interaction observer for all if config is enabled
1017
+ // in case ufoName is updated at later time
1018
+ if ((_getConfig11 = getConfig()) !== null && _getConfig11 !== void 0 && (_getConfig11$postInte = _getConfig11.postInteractionLog) !== null && _getConfig11$postInte !== void 0 && _getConfig11$postInte.enabled) {
1019
+ postInteractionLog.startVCObserver({
1020
+ startTime
1021
+ });
1042
1022
  }
1043
1023
  if (coinflip(getExperimentalInteractionRate(ufoName, type))) {
1044
1024
  experimentalVC.start({
@@ -1,4 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { isVCRevisionEnabled } from '../../config';
3
4
  import { getActiveInteraction } from '../../interaction-metrics';
4
5
  import { attachAbortListeners } from './attachAbortListeners';
@@ -123,26 +124,48 @@ export class VCObserver {
123
124
  window.__vcNotAvailableReason = abortReasonInfo;
124
125
  }
125
126
  } catch (e) {}
126
- const vcAbortedResultWithRevisions = {
127
- [`${fullPrefix}vc:state`]: false,
128
- [`${fullPrefix}vc:abort:reason`]: abortReason.reason,
129
- [`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp,
130
- [`${fullPrefix}vc:rev`]: [{
131
- revision: 'fy25.02',
132
- clean: false,
133
- 'metric:vc90': null,
134
- abortReason: abortReason.reason
135
- }]
136
- };
137
- if (!isTTVCv1Disabled) {
138
- vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
139
- revision: 'fy25.01',
140
- clean: false,
141
- 'metric:vc90': null,
142
- abortReason: abortReason.reason
143
- });
127
+ if (fg('platform_ufo_abort_timestamp_by_revision')) {
128
+ const vcAbortedResultWithRevisions = {
129
+ [`${fullPrefix}vc:rev`]: [{
130
+ revision: 'fy25.02',
131
+ clean: false,
132
+ 'metric:vc90': null,
133
+ abortReason: abortReason.reason,
134
+ abortTimestamp: Math.round(abortReason.timestamp)
135
+ }]
136
+ };
137
+ if (!isTTVCv1Disabled) {
138
+ vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
139
+ revision: 'fy25.01',
140
+ clean: false,
141
+ 'metric:vc90': null,
142
+ abortReason: abortReason.reason,
143
+ abortTimestamp: Math.round(abortReason.timestamp)
144
+ });
145
+ }
146
+ return vcAbortedResultWithRevisions;
147
+ } else {
148
+ const vcAbortedResultWithRevisions = {
149
+ [`${fullPrefix}vc:state`]: false,
150
+ [`${fullPrefix}vc:abort:reason`]: abortReason.reason,
151
+ [`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp,
152
+ [`${fullPrefix}vc:rev`]: [{
153
+ revision: 'fy25.02',
154
+ clean: false,
155
+ 'metric:vc90': null,
156
+ abortReason: abortReason.reason
157
+ }]
158
+ };
159
+ if (!isTTVCv1Disabled) {
160
+ vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
161
+ revision: 'fy25.01',
162
+ clean: false,
163
+ 'metric:vc90': null,
164
+ abortReason: abortReason.reason
165
+ });
166
+ }
167
+ return vcAbortedResultWithRevisions;
144
168
  }
145
- return vcAbortedResultWithRevisions;
146
169
  }
147
170
  const ttvcV1Result = isTTVCv1Disabled ? {
148
171
  VC: {},
@@ -236,7 +236,10 @@ export default class AbstractVCCalculatorBase {
236
236
  revision: this.revisionNo,
237
237
  'metric:vc90': null,
238
238
  clean: false,
239
- abortReason: dirtyReason
239
+ abortReason: dirtyReason,
240
+ ...(fg('platform_ufo_abort_timestamp_by_revision') ? {
241
+ abortTimestamp: getVCCleanStatusResult.abortTimestamp
242
+ } : {})
240
243
  };
241
244
  }
242
245
  const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries);
@@ -50,11 +50,15 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
50
50
  }
51
51
  getVCCleanStatus(filteredEntries) {
52
52
  let dirtyReason = '';
53
+ let abortTimestamp = -1;
53
54
  const hasAbortEvent = filteredEntries.some(entry => {
54
55
  if (entry.data.type === 'window:event') {
55
56
  const data = entry.data;
56
57
  if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
57
58
  dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
59
+ if (fg('platform_ufo_abort_timestamp_by_revision')) {
60
+ abortTimestamp = Math.round(entry.time);
61
+ }
58
62
  return true;
59
63
  }
60
64
  }
@@ -63,7 +67,10 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
63
67
  if (hasAbortEvent && dirtyReason) {
64
68
  return {
65
69
  isVCClean: false,
66
- dirtyReason
70
+ dirtyReason,
71
+ ...(fg('platform_ufo_abort_timestamp_by_revision') ? {
72
+ abortTimestamp
73
+ } : {})
67
74
  };
68
75
  }
69
76
  return {
@@ -653,15 +653,9 @@ function finishInteraction(id, data) {
653
653
  data.hydration = getReactHydrationStats();
654
654
 
655
655
  // By this time, stop the post interaction log observer if coinflip rate is 0
656
- if (fg('platform_ufo_post_interaction_check_name')) {
657
- var sanitisedUfoName = sanitizeUfoName(data.ufoName);
658
- if (!coinflip(getPostInteractionRate(sanitisedUfoName, data.type))) {
659
- postInteractionLog.stopVCObserver();
660
- }
661
- } else {
662
- if (!coinflip(getPostInteractionRate(data.routeName || data.ufoName, data.type))) {
663
- postInteractionLog.stopVCObserver();
664
- }
656
+ var sanitisedUfoName = sanitizeUfoName(data.ufoName);
657
+ if (!coinflip(getPostInteractionRate(sanitisedUfoName, data.type))) {
658
+ postInteractionLog.stopVCObserver();
665
659
  }
666
660
  if (fg('platform_ufo_enable_ttai_with_3p')) {
667
661
  if (!data.hold3pActive || data.hold3pActive.size === 0) {
@@ -975,13 +969,7 @@ export function addOnCancelCallback(id, cancelCallback) {
975
969
  }
976
970
  export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
977
971
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
978
- if (fg('platform_ufo_post_interaction_check_name')) {
979
- postInteractionLog.reset();
980
- } else {
981
- if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
982
- postInteractionLog.reset();
983
- }
984
- }
972
+ postInteractionLog.reset();
985
973
  var vcObserver;
986
974
  var previousTime = startTime;
987
975
  var timeoutTime = fg('platform_ufo_enable_timeout_config') ? getInteractionTimeout(ufoName) : CLEANUP_TIMEOUT;
@@ -1092,6 +1080,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1092
1080
  addHoldByID(interactionId, [], ufoName, ufoName, true);
1093
1081
  }
1094
1082
  if (type === 'transition' || type === 'page_load') {
1083
+ var _getConfig11;
1095
1084
  // Use per-interaction VC observer if available, otherwise fall back to global
1096
1085
  var observer = vcObserver;
1097
1086
  if (observer) {
@@ -1100,21 +1089,12 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1100
1089
  experienceKey: ufoName
1101
1090
  });
1102
1091
  }
1103
- if (fg('platform_ufo_post_interaction_check_name')) {
1104
- var _getConfig11;
1105
- // Start post interaction observer for all if config is enabled
1106
- // in case ufoName is updated at later time
1107
- if ((_getConfig11 = getConfig()) !== null && _getConfig11 !== void 0 && (_getConfig11 = _getConfig11.postInteractionLog) !== null && _getConfig11 !== void 0 && _getConfig11.enabled) {
1108
- postInteractionLog.startVCObserver({
1109
- startTime: startTime
1110
- });
1111
- }
1112
- } else {
1113
- if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
1114
- postInteractionLog.startVCObserver({
1115
- startTime: startTime
1116
- });
1117
- }
1092
+ // Start post interaction observer for all if config is enabled
1093
+ // in case ufoName is updated at later time
1094
+ if ((_getConfig11 = getConfig()) !== null && _getConfig11 !== void 0 && (_getConfig11 = _getConfig11.postInteractionLog) !== null && _getConfig11 !== void 0 && _getConfig11.enabled) {
1095
+ postInteractionLog.startVCObserver({
1096
+ startTime: startTime
1097
+ });
1118
1098
  }
1119
1099
  if (coinflip(getExperimentalInteractionRate(ufoName, type))) {
1120
1100
  experimentalVC.start({
@@ -9,6 +9,7 @@ var _excluded = ["__debug__element"];
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
11
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { isVCRevisionEnabled } from '../../config';
13
14
  import { getActiveInteraction } from '../../interaction-metrics';
14
15
  import { attachAbortListeners } from './attachAbortListeners';
@@ -95,7 +96,7 @@ export var VCObserver = /*#__PURE__*/function () {
95
96
  });
96
97
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
97
98
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
98
- var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, shouldCreateDebugDetails, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
99
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, _vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, shouldCreateDebugDetails, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
99
100
  return _regeneratorRuntime.wrap(function _callee$(_context) {
100
101
  while (1) switch (_context.prev = _context.next) {
101
102
  case 0:
@@ -112,7 +113,7 @@ export var VCObserver = /*#__PURE__*/function () {
112
113
  abortReason = rawData.abortReason, abortReasonInfo = rawData.abortReasonInfo, heatmap = rawData.heatmap, heatmapNext = rawData.heatmapNext, outOfBoundaryInfo = rawData.outOfBoundaryInfo, totalTime = rawData.totalTime, componentsLog = rawData.componentsLog, viewport = rawData.viewport, devToolsEnabled = rawData.devToolsEnabled, ratios = rawData.ratios;
113
114
  isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', experienceKey);
114
115
  if (!(abortReasonInfo !== null)) {
115
- _context.next = 13;
116
+ _context.next = 19;
116
117
  break;
117
118
  }
118
119
  // exposing data to devtools
@@ -121,22 +122,44 @@ export var VCObserver = /*#__PURE__*/function () {
121
122
  window.__vcNotAvailableReason = abortReasonInfo;
122
123
  }
123
124
  } catch (e) {}
124
- vcAbortedResultWithRevisions = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReason.reason), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), "".concat(fullPrefix, "vc:rev"), [{
125
+ if (!fg('platform_ufo_abort_timestamp_by_revision')) {
126
+ _context.next = 16;
127
+ break;
128
+ }
129
+ vcAbortedResultWithRevisions = _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [{
125
130
  revision: 'fy25.02',
126
131
  clean: false,
127
132
  'metric:vc90': null,
128
- abortReason: abortReason.reason
133
+ abortReason: abortReason.reason,
134
+ abortTimestamp: Math.round(abortReason.timestamp)
129
135
  }]);
130
136
  if (!isTTVCv1Disabled) {
131
137
  vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
132
138
  revision: 'fy25.01',
133
139
  clean: false,
134
140
  'metric:vc90': null,
135
- abortReason: abortReason.reason
141
+ abortReason: abortReason.reason,
142
+ abortTimestamp: Math.round(abortReason.timestamp)
136
143
  });
137
144
  }
138
145
  return _context.abrupt("return", vcAbortedResultWithRevisions);
139
- case 13:
146
+ case 16:
147
+ _vcAbortedResultWithRevisions = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReason.reason), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), "".concat(fullPrefix, "vc:rev"), [{
148
+ revision: 'fy25.02',
149
+ clean: false,
150
+ 'metric:vc90': null,
151
+ abortReason: abortReason.reason
152
+ }]);
153
+ if (!isTTVCv1Disabled) {
154
+ _vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
155
+ revision: 'fy25.01',
156
+ clean: false,
157
+ 'metric:vc90': null,
158
+ abortReason: abortReason.reason
159
+ });
160
+ }
161
+ return _context.abrupt("return", _vcAbortedResultWithRevisions);
162
+ case 19:
140
163
  ttvcV1Result = isTTVCv1Disabled ? {
141
164
  VC: {},
142
165
  VCBox: {},
@@ -294,16 +317,16 @@ export var VCObserver = /*#__PURE__*/function () {
294
317
  SSRRatioNext = VCObserver.getSSRRatio(vcNext.VCEntries.rel, ssr);
295
318
  SSRRatioPayload = includeSSRRatio ? _defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:ssrRatio"), isTTVCv1Disabled ? SSRRatioNext : SSRRatio), "".concat(fullPrefix, "vc:next:ssrRatio"), SSRRatioNext) : {};
296
319
  if (!isTTVCv1Disabled) {
297
- _context.next = 29;
320
+ _context.next = 35;
298
321
  break;
299
322
  }
300
323
  return _context.abrupt("return", _objectSpread(_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)), SSRRatioPayload), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ssrRatio"), SSRRatioNext), revisionsData), speedIndex));
301
- case 29:
324
+ case 35:
302
325
  isTTVCv3Enabled = isVCRevisionEnabled('fy25.03', experienceKey);
303
326
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
304
327
  'metrics:vc': VC
305
328
  }, "".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), "".concat(fullPrefix, "vc:ssrRatio"), SSRRatio), outOfBoundary), {}, _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), SSRRatioPayload), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
306
- case 31:
329
+ case 37:
307
330
  case "end":
308
331
  return _context.stop();
309
332
  }
@@ -332,12 +332,14 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
332
332
  _context2.next = 7;
333
333
  break;
334
334
  }
335
- return _context2.abrupt("return", {
335
+ return _context2.abrupt("return", _objectSpread({
336
336
  revision: this.revisionNo,
337
337
  'metric:vc90': null,
338
338
  clean: false,
339
339
  abortReason: dirtyReason
340
- });
340
+ }, fg('platform_ufo_abort_timestamp_by_revision') ? {
341
+ abortTimestamp: getVCCleanStatusResult.abortTimestamp
342
+ } : {}));
341
343
  case 7:
342
344
  _context2.next = 9;
343
345
  return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries);
@@ -1,8 +1,11 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _createClass from "@babel/runtime/helpers/createClass";
3
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
6
  import _inherits from "@babel/runtime/helpers/inherits";
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
11
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -63,21 +66,27 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
63
66
  key: "getVCCleanStatus",
64
67
  value: function getVCCleanStatus(filteredEntries) {
65
68
  var dirtyReason = '';
69
+ var abortTimestamp = -1;
66
70
  var hasAbortEvent = filteredEntries.some(function (entry) {
67
71
  if (entry.data.type === 'window:event') {
68
72
  var data = entry.data;
69
73
  if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
70
74
  dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
75
+ if (fg('platform_ufo_abort_timestamp_by_revision')) {
76
+ abortTimestamp = Math.round(entry.time);
77
+ }
71
78
  return true;
72
79
  }
73
80
  }
74
81
  return false;
75
82
  });
76
83
  if (hasAbortEvent && dirtyReason) {
77
- return {
84
+ return _objectSpread({
78
85
  isVCClean: false,
79
86
  dirtyReason: dirtyReason
80
- };
87
+ }, fg('platform_ufo_abort_timestamp_by_revision') ? {
88
+ abortTimestamp: abortTimestamp
89
+ } : {});
81
90
  }
82
91
  return {
83
92
  isVCClean: true
@@ -115,6 +115,7 @@ export type RevisionPayloadEntry = {
115
115
  vcDetails?: RevisionPayloadVCDetails;
116
116
  ratios?: VCRatioType;
117
117
  abortReason?: VCAbortReason | null;
118
+ abortTimestamp?: number;
118
119
  childrenIgnoredCount?: number;
119
120
  };
120
121
  export type RevisionPayload = RevisionPayloadEntry[];
@@ -18,6 +18,7 @@ export interface VCRevisionDebugDetails {
18
18
  revision: string;
19
19
  isClean: boolean;
20
20
  abortReason?: VCAbortReason | null;
21
+ abortTimestamp?: number;
21
22
  vcLogs: VCLogEntry[];
22
23
  interactionId?: string;
23
24
  }
@@ -15,6 +15,7 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
15
15
  protected abstract getVCCleanStatus(filteredEntries: ReadonlyArray<VCObserverEntry>): {
16
16
  isVCClean: boolean;
17
17
  dirtyReason?: VCAbortReason;
18
+ abortTimestamp?: number;
18
19
  };
19
20
  private filterViewportEntries;
20
21
  /**
@@ -6,10 +6,10 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
6
6
  constructor();
7
7
  protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
8
8
  protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
9
+ abortTimestamp?: number | undefined;
9
10
  isVCClean: boolean;
10
11
  dirtyReason: never;
11
12
  } | {
12
13
  isVCClean: boolean;
13
- dirtyReason?: undefined;
14
14
  };
15
15
  }
@@ -115,6 +115,7 @@ export type RevisionPayloadEntry = {
115
115
  vcDetails?: RevisionPayloadVCDetails;
116
116
  ratios?: VCRatioType;
117
117
  abortReason?: VCAbortReason | null;
118
+ abortTimestamp?: number;
118
119
  childrenIgnoredCount?: number;
119
120
  };
120
121
  export type RevisionPayload = RevisionPayloadEntry[];
@@ -18,6 +18,7 @@ export interface VCRevisionDebugDetails {
18
18
  revision: string;
19
19
  isClean: boolean;
20
20
  abortReason?: VCAbortReason | null;
21
+ abortTimestamp?: number;
21
22
  vcLogs: VCLogEntry[];
22
23
  interactionId?: string;
23
24
  }
@@ -15,6 +15,7 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
15
15
  protected abstract getVCCleanStatus(filteredEntries: ReadonlyArray<VCObserverEntry>): {
16
16
  isVCClean: boolean;
17
17
  dirtyReason?: VCAbortReason;
18
+ abortTimestamp?: number;
18
19
  };
19
20
  private filterViewportEntries;
20
21
  /**
@@ -6,10 +6,10 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
6
6
  constructor();
7
7
  protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
8
8
  protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
9
+ abortTimestamp?: number | undefined;
9
10
  isVCClean: boolean;
10
11
  dirtyReason: never;
11
12
  } | {
12
13
  isVCClean: boolean;
13
- dirtyReason?: undefined;
14
14
  };
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -145,6 +145,9 @@
145
145
  "enable_ufo_devtools_api_for_extra_events": {
146
146
  "type": "boolean"
147
147
  },
148
+ "platform_ufo_abort_timestamp_by_revision": {
149
+ "type": "boolean"
150
+ },
148
151
  "platform_ufo_no_vc_on_aborted": {
149
152
  "type": "boolean"
150
153
  },
@@ -178,9 +181,6 @@
178
181
  "platform_ufo_segment_critical_metrics": {
179
182
  "type": "boolean"
180
183
  },
181
- "platform_ufo_post_interaction_check_name": {
182
- "type": "boolean"
183
- },
184
184
  "platform_ufo_report_non_htmlelement_selectors": {
185
185
  "type": "boolean"
186
186
  },