@atlaskit/react-ufo 3.13.12 → 3.13.13

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,13 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.13.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [#162094](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/162094)
8
+ [`c755719e1423d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c755719e1423d) -
9
+ FG cleanup - platform_ufo_add_vc_abort_reason_by_revisions
10
+
3
11
  ## 3.13.12
4
12
 
5
13
  ### Patch Changes
@@ -103,7 +103,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
103
103
  });
104
104
  (0, _defineProperty2.default)(this, "getVCResult", /*#__PURE__*/function () {
105
105
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
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, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, _ufo_devtool_onVCRev2, _ref10, _ufo_devtool_onVCRev, _ref9, 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, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, _ufo_devtool_onVCRev2, _ref9, _ufo_devtool_onVCRev, _ref8, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
107
107
  return _regenerator.default.wrap(function _callee$(_context) {
108
108
  while (1) switch (_context.prev = _context.next) {
109
109
  case 0:
@@ -118,11 +118,9 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
118
118
  return _context.abrupt("return", {});
119
119
  case 6:
120
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;
121
- isTTVCv1Disabled = !(0, _config.isVCRevisionEnabled)('fy25.01', experienceKey); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
122
- // we want to report abort by scroll events the same way as other abort reasons
123
- // i.e. not have the concept of `abortReason.blocking` anymore
124
- if (!(abortReasonInfo !== null && (0, _platformFeatureFlags.fg)('platform_ufo_add_vc_abort_reason_by_revisions'))) {
125
- _context.next = 15;
121
+ isTTVCv1Disabled = !(0, _config.isVCRevisionEnabled)('fy25.01', experienceKey);
122
+ if (!(abortReasonInfo !== null)) {
123
+ _context.next = 13;
126
124
  break;
127
125
  }
128
126
  // exposing data to devtools
@@ -146,19 +144,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
146
144
  });
147
145
  }
148
146
  return _context.abrupt("return", vcAbortedResultWithRevisions);
149
- case 15:
150
- if (!(abortReasonInfo !== null && abortReason.blocking)) {
151
- _context.next = 18;
152
- break;
153
- }
154
- // exposing data to devtools
155
- try {
156
- if (devToolsEnabled && !_this.isPostInteraction) {
157
- window.__vcNotAvailableReason = abortReasonInfo;
158
- }
159
- } catch (e) {}
160
- return _context.abrupt("return", (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp));
161
- case 18:
147
+ case 13:
162
148
  ttvcV1Result = isTTVCv1Disabled ? {
163
149
  VC: {},
164
150
  VCBox: {},
@@ -177,10 +163,10 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
177
163
  });
178
164
  VC = ttvcV1Result.VC, VCBox = ttvcV1Result.VCBox, VCEntries = ttvcV1Result.VCEntries, totalPainted = ttvcV1Result.totalPainted;
179
165
  _componentsLog = {};
180
- Object.entries(_this.componentsLog).forEach(function (_ref6) {
181
- var _ref7 = (0, _slicedToArray2.default)(_ref6, 2),
182
- _timestamp = _ref7[0],
183
- value = _ref7[1];
166
+ Object.entries(_this.componentsLog).forEach(function (_ref5) {
167
+ var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
168
+ _timestamp = _ref6[0],
169
+ value = _ref6[1];
184
170
  var timestamp = Number(_timestamp);
185
171
  if (stop > timestamp) {
186
172
  _componentsLog[timestamp] = value;
@@ -291,7 +277,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
291
277
  if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_ttvc_v3_devtool')) {
292
278
  // Handle v1 if not disabled
293
279
  if (!isTTVCv1Disabled) {
294
- (_ufo_devtool_onVCRev = (_ref9 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref9, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
280
+ (_ufo_devtool_onVCRev = (_ref8 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref8, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
295
281
  revision: 'fy25.01',
296
282
  isClean: !abortReasonInfo,
297
283
  abortReason: abortReason.reason,
@@ -302,7 +288,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
302
288
  }
303
289
 
304
290
  // Handle v2
305
- (_ufo_devtool_onVCRev2 = (_ref10 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 || _ufo_devtool_onVCRev2.call(_ref10, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
291
+ (_ufo_devtool_onVCRev2 = (_ref9 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 || _ufo_devtool_onVCRev2.call(_ref9, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
306
292
  revision: 'fy25.02',
307
293
  isClean: !abortReasonInfo,
308
294
  abortReason: abortReason.reason,
@@ -339,16 +325,16 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
339
325
  SSRRatioNext = VCObserver.getSSRRatio(vcNext.VCEntries.rel, ssr);
340
326
  SSRRatioPayload = includeSSRRatio ? (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ssrRatio"), isTTVCv1Disabled ? SSRRatioNext : SSRRatio), "".concat(fullPrefix, "vc:next:ssrRatio"), SSRRatioNext) : {};
341
327
  if (!isTTVCv1Disabled) {
342
- _context.next = 35;
328
+ _context.next = 30;
343
329
  break;
344
330
  }
345
331
  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));
346
- case 35:
332
+ case 30:
347
333
  isTTVCv3Enabled = (0, _config.isVCRevisionEnabled)('fy25.03', experienceKey);
348
334
  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)({
349
335
  'metrics:vc': VC
350
336
  }, "".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));
351
- case 37:
337
+ case 32:
352
338
  case "end":
353
339
  return _context.stop();
354
340
  }
@@ -441,10 +427,10 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
441
427
  _this.detachAbortListeners();
442
428
  var unbinds = (0, _attachAbortListeners.attachAbortListeners)(window, _this.viewport, _this.abortReasonCallback);
443
429
  if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
444
- Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref12) {
445
- var _ref13 = (0, _slicedToArray2.default)(_ref12, 2),
446
- key = _ref13[0],
447
- time = _ref13[1];
430
+ Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref11) {
431
+ var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
432
+ key = _ref12[0],
433
+ time = _ref12[1];
448
434
  if (time) {
449
435
  _this.abortReasonCallback(key, time);
450
436
  }
@@ -474,8 +460,8 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
474
460
  }
475
461
  return (0, _createClass2.default)(VCObserver, [{
476
462
  key: "start",
477
- value: function start(_ref14) {
478
- var startTime = _ref14.startTime;
463
+ value: function start(_ref13) {
464
+ var startTime = _ref13.startTime;
479
465
  this.active = true;
480
466
  if (this.observers.isBrowserSupported()) {
481
467
  this.setViewportSize();
@@ -497,12 +483,12 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
497
483
  }, {
498
484
  key: "getIgnoredElements",
499
485
  value: function getIgnoredElements(componentsLog) {
500
- return Object.values(componentsLog).flat().filter(function (_ref15) {
501
- var ignoreReason = _ref15.ignoreReason;
486
+ return Object.values(componentsLog).flat().filter(function (_ref14) {
487
+ var ignoreReason = _ref14.ignoreReason;
502
488
  return Boolean(ignoreReason);
503
- }).map(function (_ref16) {
504
- var targetName = _ref16.targetName,
505
- ignoreReason = _ref16.ignoreReason;
489
+ }).map(function (_ref15) {
490
+ var targetName = _ref15.targetName,
491
+ ignoreReason = _ref15.ignoreReason;
506
492
  return {
507
493
  targetName: targetName,
508
494
  ignoreReason: ignoreReason
@@ -632,13 +618,13 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
632
618
  }
633
619
  }, {
634
620
  key: "calculateVC",
635
- value: function calculateVC(_ref17) {
636
- var heatmap = _ref17.heatmap,
637
- _ref17$ssr = _ref17.ssr,
638
- ssr = _ref17$ssr === void 0 ? UNUSED_SECTOR : _ref17$ssr,
639
- componentsLog = _ref17.componentsLog,
640
- viewport = _ref17.viewport,
641
- fixSSRAttribution = _ref17.fixSSRAttribution;
621
+ value: function calculateVC(_ref16) {
622
+ var heatmap = _ref16.heatmap,
623
+ _ref16$ssr = _ref16.ssr,
624
+ ssr = _ref16$ssr === void 0 ? UNUSED_SECTOR : _ref16$ssr,
625
+ componentsLog = _ref16.componentsLog,
626
+ viewport = _ref16.viewport,
627
+ fixSSRAttribution = _ref16.fixSSRAttribution;
642
628
  var lastUpdate = {};
643
629
  var totalPainted = 0;
644
630
  var ssrTime = fixSSRAttribution ? Math.floor(ssr) : ssr;
@@ -705,11 +691,11 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
705
691
  });
706
692
  return VCRatio;
707
693
  }, 0);
708
- var VCEntries = entries.reduce(function (acc, _ref18, i) {
694
+ var VCEntries = entries.reduce(function (acc, _ref17, i) {
709
695
  var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
710
- var _ref19 = (0, _slicedToArray2.default)(_ref18, 2),
711
- timestamp = _ref19[0],
712
- entryPainted = _ref19[1];
696
+ var _ref18 = (0, _slicedToArray2.default)(_ref17, 2),
697
+ timestamp = _ref18[0],
698
+ entryPainted = _ref18[1];
713
699
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
714
700
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
715
701
  var logEntry = (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
@@ -201,15 +201,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
201
201
  filteredEntries = orderedEntries.filter(function (entry) {
202
202
  return _this.isEntryIncluded(entry);
203
203
  });
204
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_add_vc_abort_reason_by_revisions')) {
205
- _context3.next = 10;
206
- break;
207
- }
208
204
  getVCCleanStatusResult = this.getVCCleanStatus(filteredEntries);
209
205
  isVCClean = getVCCleanStatusResult.isVCClean;
210
206
  dirtyReason = getVCCleanStatusResult.dirtyReason;
211
207
  if (isVCClean) {
212
- _context3.next = 8;
208
+ _context3.next = 7;
213
209
  break;
214
210
  }
215
211
  return _context3.abrupt("return", {
@@ -218,38 +214,24 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
218
214
  clean: false,
219
215
  abortReason: dirtyReason
220
216
  });
221
- case 8:
222
- _context3.next = 13;
223
- break;
224
- case 10:
225
- isVCClean = this.isVCClean(filteredEntries);
226
- if (isVCClean) {
227
- _context3.next = 13;
228
- break;
229
- }
230
- return _context3.abrupt("return", {
231
- revision: this.revisionNo,
232
- 'metric:vc90': null,
233
- clean: false
234
- });
235
- case 13:
217
+ case 7:
236
218
  useDebugInfo = (0, _platformFeatureFlags.fg)('platform_ufo_ttvc_v3_devtool');
237
219
  if (!useDebugInfo) {
238
- _context3.next = 20;
220
+ _context3.next = 14;
239
221
  break;
240
222
  }
241
- _context3.next = 17;
223
+ _context3.next = 11;
242
224
  return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason);
243
- case 17:
225
+ case 11:
244
226
  _context3.t0 = _context3.sent;
245
- _context3.next = 23;
227
+ _context3.next = 17;
246
228
  break;
247
- case 20:
248
- _context3.next = 22;
229
+ case 14:
230
+ _context3.next = 16;
249
231
  return this.calculateBasic(filteredEntries, startTime, stopTime);
250
- case 22:
232
+ case 16:
251
233
  _context3.t0 = _context3.sent;
252
- case 23:
234
+ case 17:
253
235
  vcDetails = _context3.t0;
254
236
  return _context3.abrupt("return", {
255
237
  revision: this.revisionNo,
@@ -257,7 +239,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
257
239
  'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null,
258
240
  vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
259
241
  });
260
- case 25:
242
+ case 19:
261
243
  case "end":
262
244
  return _context3.stop();
263
245
  }
@@ -57,20 +57,6 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
57
57
  }
58
58
  return true;
59
59
  }
60
- }, {
61
- key: "isVCClean",
62
- value: function isVCClean(filteredEntries) {
63
- var hasAbortEvent = filteredEntries.some(function (entry) {
64
- if (entry.data.type === 'window:event') {
65
- var data = entry.data;
66
- if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
67
- return true;
68
- }
69
- }
70
- return false;
71
- });
72
- return !hasAbortEvent;
73
- }
74
60
  }, {
75
61
  key: "getVCCleanStatus",
76
62
  value: function getVCCleanStatus(filteredEntries) {
@@ -117,11 +117,7 @@ export class VCObserver {
117
117
  ratios
118
118
  } = rawData;
119
119
  const isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', experienceKey);
120
-
121
- // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
122
- // we want to report abort by scroll events the same way as other abort reasons
123
- // i.e. not have the concept of `abortReason.blocking` anymore
124
- if (abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
120
+ if (abortReasonInfo !== null) {
125
121
  // exposing data to devtools
126
122
  try {
127
123
  if (devToolsEnabled && !this.isPostInteraction) {
@@ -148,18 +144,6 @@ export class VCObserver {
148
144
  });
149
145
  }
150
146
  return vcAbortedResultWithRevisions;
151
- } else if (abortReasonInfo !== null && abortReason.blocking) {
152
- // exposing data to devtools
153
- try {
154
- if (devToolsEnabled && !this.isPostInteraction) {
155
- window.__vcNotAvailableReason = abortReasonInfo;
156
- }
157
- } catch (e) {}
158
- return {
159
- [`${fullPrefix}vc:state`]: false,
160
- [`${fullPrefix}vc:abort:reason`]: abortReasonInfo,
161
- [`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp
162
- };
163
147
  }
164
148
  const ttvcV1Result = isTTVCv1Disabled ? {
165
149
  VC: {},
@@ -122,27 +122,16 @@ export default class AbstractVCCalculatorBase {
122
122
  });
123
123
  let isVCClean;
124
124
  let dirtyReason;
125
- if (fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
126
- const getVCCleanStatusResult = this.getVCCleanStatus(filteredEntries);
127
- isVCClean = getVCCleanStatusResult.isVCClean;
128
- dirtyReason = getVCCleanStatusResult.dirtyReason;
129
- if (!isVCClean) {
130
- return {
131
- revision: this.revisionNo,
132
- 'metric:vc90': null,
133
- clean: false,
134
- abortReason: dirtyReason
135
- };
136
- }
137
- } else {
138
- isVCClean = this.isVCClean(filteredEntries);
139
- if (!isVCClean) {
140
- return {
141
- revision: this.revisionNo,
142
- 'metric:vc90': null,
143
- clean: false
144
- };
145
- }
125
+ const getVCCleanStatusResult = this.getVCCleanStatus(filteredEntries);
126
+ isVCClean = getVCCleanStatusResult.isVCClean;
127
+ dirtyReason = getVCCleanStatusResult.dirtyReason;
128
+ if (!isVCClean) {
129
+ return {
130
+ revision: this.revisionNo,
131
+ 'metric:vc90': null,
132
+ clean: false,
133
+ abortReason: dirtyReason
134
+ };
146
135
  }
147
136
  const useDebugInfo = fg('platform_ufo_ttvc_v3_devtool');
148
137
  const vcDetails = useDebugInfo ? await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) : await this.calculateBasic(filteredEntries, startTime, stopTime);
@@ -39,18 +39,6 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
39
39
  }
40
40
  return true;
41
41
  }
42
- isVCClean(filteredEntries) {
43
- const hasAbortEvent = filteredEntries.some(entry => {
44
- if (entry.data.type === 'window:event') {
45
- const data = entry.data;
46
- if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
47
- return true;
48
- }
49
- }
50
- return false;
51
- });
52
- return !hasAbortEvent;
53
- }
54
42
  getVCCleanStatus(filteredEntries) {
55
43
  let dirtyReason = '';
56
44
  const hasAbortEvent = filteredEntries.some(entry => {
@@ -96,7 +96,7 @@ export var VCObserver = /*#__PURE__*/function () {
96
96
  });
97
97
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
98
98
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
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, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, _ufo_devtool_onVCRev2, _ref10, _ufo_devtool_onVCRev, _ref9, 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, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, _ufo_devtool_onVCRev2, _ref9, _ufo_devtool_onVCRev, _ref8, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
100
100
  return _regeneratorRuntime.wrap(function _callee$(_context) {
101
101
  while (1) switch (_context.prev = _context.next) {
102
102
  case 0:
@@ -111,11 +111,9 @@ export var VCObserver = /*#__PURE__*/function () {
111
111
  return _context.abrupt("return", {});
112
112
  case 6:
113
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;
114
- isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', experienceKey); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
115
- // we want to report abort by scroll events the same way as other abort reasons
116
- // i.e. not have the concept of `abortReason.blocking` anymore
117
- if (!(abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions'))) {
118
- _context.next = 15;
114
+ isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', experienceKey);
115
+ if (!(abortReasonInfo !== null)) {
116
+ _context.next = 13;
119
117
  break;
120
118
  }
121
119
  // exposing data to devtools
@@ -139,19 +137,7 @@ export var VCObserver = /*#__PURE__*/function () {
139
137
  });
140
138
  }
141
139
  return _context.abrupt("return", vcAbortedResultWithRevisions);
142
- case 15:
143
- if (!(abortReasonInfo !== null && abortReason.blocking)) {
144
- _context.next = 18;
145
- break;
146
- }
147
- // exposing data to devtools
148
- try {
149
- if (devToolsEnabled && !_this.isPostInteraction) {
150
- window.__vcNotAvailableReason = abortReasonInfo;
151
- }
152
- } catch (e) {}
153
- return _context.abrupt("return", _defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp));
154
- case 18:
140
+ case 13:
155
141
  ttvcV1Result = isTTVCv1Disabled ? {
156
142
  VC: {},
157
143
  VCBox: {},
@@ -170,10 +156,10 @@ export var VCObserver = /*#__PURE__*/function () {
170
156
  });
171
157
  VC = ttvcV1Result.VC, VCBox = ttvcV1Result.VCBox, VCEntries = ttvcV1Result.VCEntries, totalPainted = ttvcV1Result.totalPainted;
172
158
  _componentsLog = {};
173
- Object.entries(_this.componentsLog).forEach(function (_ref6) {
174
- var _ref7 = _slicedToArray(_ref6, 2),
175
- _timestamp = _ref7[0],
176
- value = _ref7[1];
159
+ Object.entries(_this.componentsLog).forEach(function (_ref5) {
160
+ var _ref6 = _slicedToArray(_ref5, 2),
161
+ _timestamp = _ref6[0],
162
+ value = _ref6[1];
177
163
  var timestamp = Number(_timestamp);
178
164
  if (stop > timestamp) {
179
165
  _componentsLog[timestamp] = value;
@@ -284,7 +270,7 @@ export var VCObserver = /*#__PURE__*/function () {
284
270
  if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function' && fg('platform_ufo_ttvc_v3_devtool')) {
285
271
  // Handle v1 if not disabled
286
272
  if (!isTTVCv1Disabled) {
287
- (_ufo_devtool_onVCRev = (_ref9 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref9, getVCRevisionDebugDetails({
273
+ (_ufo_devtool_onVCRev = (_ref8 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref8, getVCRevisionDebugDetails({
288
274
  revision: 'fy25.01',
289
275
  isClean: !abortReasonInfo,
290
276
  abortReason: abortReason.reason,
@@ -295,7 +281,7 @@ export var VCObserver = /*#__PURE__*/function () {
295
281
  }
296
282
 
297
283
  // Handle v2
298
- (_ufo_devtool_onVCRev2 = (_ref10 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 || _ufo_devtool_onVCRev2.call(_ref10, getVCRevisionDebugDetails({
284
+ (_ufo_devtool_onVCRev2 = (_ref9 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 || _ufo_devtool_onVCRev2.call(_ref9, getVCRevisionDebugDetails({
299
285
  revision: 'fy25.02',
300
286
  isClean: !abortReasonInfo,
301
287
  abortReason: abortReason.reason,
@@ -332,16 +318,16 @@ export var VCObserver = /*#__PURE__*/function () {
332
318
  SSRRatioNext = VCObserver.getSSRRatio(vcNext.VCEntries.rel, ssr);
333
319
  SSRRatioPayload = includeSSRRatio ? _defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:ssrRatio"), isTTVCv1Disabled ? SSRRatioNext : SSRRatio), "".concat(fullPrefix, "vc:next:ssrRatio"), SSRRatioNext) : {};
334
320
  if (!isTTVCv1Disabled) {
335
- _context.next = 35;
321
+ _context.next = 30;
336
322
  break;
337
323
  }
338
324
  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));
339
- case 35:
325
+ case 30:
340
326
  isTTVCv3Enabled = isVCRevisionEnabled('fy25.03', experienceKey);
341
327
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
342
328
  'metrics:vc': VC
343
329
  }, "".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));
344
- case 37:
330
+ case 32:
345
331
  case "end":
346
332
  return _context.stop();
347
333
  }
@@ -434,10 +420,10 @@ export var VCObserver = /*#__PURE__*/function () {
434
420
  _this.detachAbortListeners();
435
421
  var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
436
422
  if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
437
- Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref12) {
438
- var _ref13 = _slicedToArray(_ref12, 2),
439
- key = _ref13[0],
440
- time = _ref13[1];
423
+ Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref11) {
424
+ var _ref12 = _slicedToArray(_ref11, 2),
425
+ key = _ref12[0],
426
+ time = _ref12[1];
441
427
  if (time) {
442
428
  _this.abortReasonCallback(key, time);
443
429
  }
@@ -467,8 +453,8 @@ export var VCObserver = /*#__PURE__*/function () {
467
453
  }
468
454
  return _createClass(VCObserver, [{
469
455
  key: "start",
470
- value: function start(_ref14) {
471
- var startTime = _ref14.startTime;
456
+ value: function start(_ref13) {
457
+ var startTime = _ref13.startTime;
472
458
  this.active = true;
473
459
  if (this.observers.isBrowserSupported()) {
474
460
  this.setViewportSize();
@@ -490,12 +476,12 @@ export var VCObserver = /*#__PURE__*/function () {
490
476
  }, {
491
477
  key: "getIgnoredElements",
492
478
  value: function getIgnoredElements(componentsLog) {
493
- return Object.values(componentsLog).flat().filter(function (_ref15) {
494
- var ignoreReason = _ref15.ignoreReason;
479
+ return Object.values(componentsLog).flat().filter(function (_ref14) {
480
+ var ignoreReason = _ref14.ignoreReason;
495
481
  return Boolean(ignoreReason);
496
- }).map(function (_ref16) {
497
- var targetName = _ref16.targetName,
498
- ignoreReason = _ref16.ignoreReason;
482
+ }).map(function (_ref15) {
483
+ var targetName = _ref15.targetName,
484
+ ignoreReason = _ref15.ignoreReason;
499
485
  return {
500
486
  targetName: targetName,
501
487
  ignoreReason: ignoreReason
@@ -625,13 +611,13 @@ export var VCObserver = /*#__PURE__*/function () {
625
611
  }
626
612
  }, {
627
613
  key: "calculateVC",
628
- value: function calculateVC(_ref17) {
629
- var heatmap = _ref17.heatmap,
630
- _ref17$ssr = _ref17.ssr,
631
- ssr = _ref17$ssr === void 0 ? UNUSED_SECTOR : _ref17$ssr,
632
- componentsLog = _ref17.componentsLog,
633
- viewport = _ref17.viewport,
634
- fixSSRAttribution = _ref17.fixSSRAttribution;
614
+ value: function calculateVC(_ref16) {
615
+ var heatmap = _ref16.heatmap,
616
+ _ref16$ssr = _ref16.ssr,
617
+ ssr = _ref16$ssr === void 0 ? UNUSED_SECTOR : _ref16$ssr,
618
+ componentsLog = _ref16.componentsLog,
619
+ viewport = _ref16.viewport,
620
+ fixSSRAttribution = _ref16.fixSSRAttribution;
635
621
  var lastUpdate = {};
636
622
  var totalPainted = 0;
637
623
  var ssrTime = fixSSRAttribution ? Math.floor(ssr) : ssr;
@@ -698,11 +684,11 @@ export var VCObserver = /*#__PURE__*/function () {
698
684
  });
699
685
  return VCRatio;
700
686
  }, 0);
701
- var VCEntries = entries.reduce(function (acc, _ref18, i) {
687
+ var VCEntries = entries.reduce(function (acc, _ref17, i) {
702
688
  var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
703
- var _ref19 = _slicedToArray(_ref18, 2),
704
- timestamp = _ref19[0],
705
- entryPainted = _ref19[1];
689
+ var _ref18 = _slicedToArray(_ref17, 2),
690
+ timestamp = _ref18[0],
691
+ entryPainted = _ref18[1];
706
692
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
707
693
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
708
694
  var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
@@ -194,15 +194,11 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
194
194
  filteredEntries = orderedEntries.filter(function (entry) {
195
195
  return _this.isEntryIncluded(entry);
196
196
  });
197
- if (!fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
198
- _context3.next = 10;
199
- break;
200
- }
201
197
  getVCCleanStatusResult = this.getVCCleanStatus(filteredEntries);
202
198
  isVCClean = getVCCleanStatusResult.isVCClean;
203
199
  dirtyReason = getVCCleanStatusResult.dirtyReason;
204
200
  if (isVCClean) {
205
- _context3.next = 8;
201
+ _context3.next = 7;
206
202
  break;
207
203
  }
208
204
  return _context3.abrupt("return", {
@@ -211,38 +207,24 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
211
207
  clean: false,
212
208
  abortReason: dirtyReason
213
209
  });
214
- case 8:
215
- _context3.next = 13;
216
- break;
217
- case 10:
218
- isVCClean = this.isVCClean(filteredEntries);
219
- if (isVCClean) {
220
- _context3.next = 13;
221
- break;
222
- }
223
- return _context3.abrupt("return", {
224
- revision: this.revisionNo,
225
- 'metric:vc90': null,
226
- clean: false
227
- });
228
- case 13:
210
+ case 7:
229
211
  useDebugInfo = fg('platform_ufo_ttvc_v3_devtool');
230
212
  if (!useDebugInfo) {
231
- _context3.next = 20;
213
+ _context3.next = 14;
232
214
  break;
233
215
  }
234
- _context3.next = 17;
216
+ _context3.next = 11;
235
217
  return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason);
236
- case 17:
218
+ case 11:
237
219
  _context3.t0 = _context3.sent;
238
- _context3.next = 23;
220
+ _context3.next = 17;
239
221
  break;
240
- case 20:
241
- _context3.next = 22;
222
+ case 14:
223
+ _context3.next = 16;
242
224
  return this.calculateBasic(filteredEntries, startTime, stopTime);
243
- case 22:
225
+ case 16:
244
226
  _context3.t0 = _context3.sent;
245
- case 23:
227
+ case 17:
246
228
  vcDetails = _context3.t0;
247
229
  return _context3.abrupt("return", {
248
230
  revision: this.revisionNo,
@@ -250,7 +232,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
250
232
  'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null,
251
233
  vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
252
234
  });
253
- case 25:
235
+ case 19:
254
236
  case "end":
255
237
  return _context3.stop();
256
238
  }
@@ -50,20 +50,6 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
50
50
  }
51
51
  return true;
52
52
  }
53
- }, {
54
- key: "isVCClean",
55
- value: function isVCClean(filteredEntries) {
56
- var hasAbortEvent = filteredEntries.some(function (entry) {
57
- if (entry.data.type === 'window:event') {
58
- var data = entry.data;
59
- if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
60
- return true;
61
- }
62
- }
63
- return false;
64
- });
65
- return !hasAbortEvent;
66
- }
67
53
  }, {
68
54
  key: "getVCCleanStatus",
69
55
  value: function getVCCleanStatus(filteredEntries) {
@@ -5,7 +5,6 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
5
5
  private revisionNo;
6
6
  constructor(revisionNo: string);
7
7
  protected abstract isEntryIncluded(entry: VCObserverEntry): boolean;
8
- protected abstract isVCClean(filteredEntries: ReadonlyArray<VCObserverEntry>): boolean;
9
8
  protected abstract getVCCleanStatus(filteredEntries: ReadonlyArray<VCObserverEntry>): {
10
9
  isVCClean: boolean;
11
10
  dirtyReason?: VCAbortReason;
@@ -5,7 +5,6 @@ export declare const NON_VISUAL_ARIA_ATTRIBUTES: string[];
5
5
  export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
6
6
  constructor();
7
7
  protected isEntryIncluded(entry: VCObserverEntry): boolean;
8
- protected isVCClean(filteredEntries: readonly VCObserverEntry[]): boolean;
9
8
  protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
10
9
  isVCClean: boolean;
11
10
  dirtyReason: never;
@@ -5,7 +5,6 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
5
5
  private revisionNo;
6
6
  constructor(revisionNo: string);
7
7
  protected abstract isEntryIncluded(entry: VCObserverEntry): boolean;
8
- protected abstract isVCClean(filteredEntries: ReadonlyArray<VCObserverEntry>): boolean;
9
8
  protected abstract getVCCleanStatus(filteredEntries: ReadonlyArray<VCObserverEntry>): {
10
9
  isVCClean: boolean;
11
10
  dirtyReason?: VCAbortReason;
@@ -5,7 +5,6 @@ export declare const NON_VISUAL_ARIA_ATTRIBUTES: string[];
5
5
  export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
6
6
  constructor();
7
7
  protected isEntryIncluded(entry: VCObserverEntry): boolean;
8
- protected isVCClean(filteredEntries: readonly VCObserverEntry[]): boolean;
9
8
  protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
10
9
  isVCClean: boolean;
11
10
  dirtyReason: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.13.12",
3
+ "version": "3.13.13",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -136,9 +136,6 @@
136
136
  "ufo_return_relative_request_start": {
137
137
  "type": "boolean"
138
138
  },
139
- "platform_ufo_add_vc_abort_reason_by_revisions": {
140
- "type": "boolean"
141
- },
142
139
  "enable_ufo_devtools_api_for_extra_events": {
143
140
  "type": "boolean"
144
141
  },