@atlaskit/react-ufo 3.13.17 → 3.13.18

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.18
4
+
5
+ ### Patch Changes
6
+
7
+ - [#167243](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/167243)
8
+ [`63819af8c6eca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/63819af8c6eca) -
9
+ emit TTVC debug data from UFO
10
+
3
11
  ## 3.13.17
4
12
 
5
13
  ### Patch Changes
@@ -9,16 +9,22 @@ exports.getSSRDoneTime = getSSRDoneTime;
9
9
  exports.getSSRFeatureFlags = getSSRFeatureFlags;
10
10
  exports.getSSRSuccess = getSSRSuccess;
11
11
  exports.getSSRTimings = getSSRTimings;
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
13
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ 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; }
16
+ 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; }
13
17
  var NESTED_METRIC_SEPARATOR = '/';
14
18
  function filterEntry(entry) {
15
19
  return !(!entry || (0, _typeof2.default)(entry) !== 'object' || entry.startTime < 0 || entry.duration < 0);
16
20
  }
17
21
  function mapEntry(entry) {
18
- return {
22
+ return _objectSpread({
19
23
  startTime: Math.round(entry.startTime),
20
24
  duration: Math.round(entry.duration)
21
- };
25
+ }, entry.size && (0, _platformFeatureFlags.fg)('platform_ufo_ssr_size_field') ? {
26
+ size: Math.round(entry.size)
27
+ } : {});
22
28
  }
23
29
  var SSR_PREFIX = 'ssr';
24
30
  function mapKey(key) {
@@ -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, _ufo_devtool_onVCRev2, _ref9, _ufo_devtool_onVCRev, _ref8, 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, 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:
@@ -271,30 +272,36 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
271
272
  entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
272
273
  }
273
274
  }));
274
-
275
- // Add devtool callback for both v1 and v2
275
+ v1RevisionDebugDetails = (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
276
+ revision: 'fy25.01',
277
+ isClean: !abortReasonInfo,
278
+ abortReason: abortReason.reason,
279
+ VCEntries: VCEntries.rel,
280
+ componentsLog: componentsLog,
281
+ interactionId: interactionId
282
+ });
283
+ v2RevisionDebugDetails = (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
284
+ revision: 'fy25.02',
285
+ isClean: !abortReasonInfo,
286
+ abortReason: abortReason.reason,
287
+ VCEntries: vcNext.VCEntries.rel,
288
+ componentsLog: componentsLog,
289
+ interactionId: interactionId
290
+ }); // Add devtool callback for both v1 and v2
276
291
  if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
277
292
  // Handle v1 if not disabled
278
293
  if (!isTTVCv1Disabled) {
279
- (_ufo_devtool_onVCRev = (_ref8 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref8, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
280
- revision: 'fy25.01',
281
- isClean: !abortReasonInfo,
282
- abortReason: abortReason.reason,
283
- VCEntries: VCEntries.rel,
284
- componentsLog: componentsLog,
285
- interactionId: interactionId
286
- }));
294
+ (_window$__ufo_devtool = (_window = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool === void 0 || _window$__ufo_devtool.call(_window, v1RevisionDebugDetails);
287
295
  }
288
296
 
289
297
  // Handle v2
290
- (_ufo_devtool_onVCRev2 = (_ref9 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 || _ufo_devtool_onVCRev2.call(_ref9, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
291
- revision: 'fy25.02',
292
- isClean: !abortReasonInfo,
293
- abortReason: abortReason.reason,
294
- VCEntries: vcNext.VCEntries.rel,
295
- componentsLog: componentsLog,
296
- interactionId: interactionId
297
- }));
298
+ (_window$__ufo_devtool2 = (_window2 = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool2 === void 0 || _window$__ufo_devtool2.call(_window2, v2RevisionDebugDetails);
299
+ }
300
+ if (typeof window.__on_ufo_vc_debug_data_ready === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_emit_vc_debug_data')) {
301
+ if (!isTTVCv1Disabled) {
302
+ (_window$__on_ufo_vc_d = (_window3 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d === void 0 || _window$__on_ufo_vc_d.call(_window3, v1RevisionDebugDetails);
303
+ }
304
+ (_window$__on_ufo_vc_d2 = (_window4 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d2 === void 0 || _window$__on_ufo_vc_d2.call(_window4, v2RevisionDebugDetails);
298
305
  }
299
306
  }
300
307
  } catch (e) {
@@ -423,14 +430,14 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
423
430
  }
424
431
  });
425
432
  (0, _defineProperty2.default)(this, "attachAbortListeners", function () {
426
- var _window;
433
+ var _window5;
427
434
  _this.detachAbortListeners();
428
435
  var unbinds = (0, _attachAbortListeners.attachAbortListeners)(window, _this.viewport, _this.abortReasonCallback);
429
- if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
430
- Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref1) {
431
- var _ref10 = (0, _slicedToArray2.default)(_ref1, 2),
432
- key = _ref10[0],
433
- time = _ref10[1];
436
+ if ((_window5 = window) !== null && _window5 !== void 0 && _window5.__SSR_ABORT_LISTENERS__) {
437
+ Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref9) {
438
+ var _ref0 = (0, _slicedToArray2.default)(_ref9, 2),
439
+ key = _ref0[0],
440
+ time = _ref0[1];
434
441
  if (time) {
435
442
  _this.abortReasonCallback(key, time);
436
443
  }
@@ -460,8 +467,8 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
460
467
  }
461
468
  return (0, _createClass2.default)(VCObserver, [{
462
469
  key: "start",
463
- value: function start(_ref11) {
464
- var startTime = _ref11.startTime;
470
+ value: function start(_ref1) {
471
+ var startTime = _ref1.startTime;
465
472
  this.active = true;
466
473
  if (this.observers.isBrowserSupported()) {
467
474
  this.setViewportSize();
@@ -483,12 +490,12 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
483
490
  }, {
484
491
  key: "getIgnoredElements",
485
492
  value: function getIgnoredElements(componentsLog) {
486
- return Object.values(componentsLog).flat().filter(function (_ref12) {
487
- var ignoreReason = _ref12.ignoreReason;
493
+ return Object.values(componentsLog).flat().filter(function (_ref10) {
494
+ var ignoreReason = _ref10.ignoreReason;
488
495
  return Boolean(ignoreReason);
489
- }).map(function (_ref13) {
490
- var targetName = _ref13.targetName,
491
- ignoreReason = _ref13.ignoreReason;
496
+ }).map(function (_ref11) {
497
+ var targetName = _ref11.targetName,
498
+ ignoreReason = _ref11.ignoreReason;
492
499
  return {
493
500
  targetName: targetName,
494
501
  ignoreReason: ignoreReason
@@ -618,13 +625,13 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
618
625
  }
619
626
  }, {
620
627
  key: "calculateVC",
621
- value: function calculateVC(_ref14) {
622
- var heatmap = _ref14.heatmap,
623
- _ref14$ssr = _ref14.ssr,
624
- ssr = _ref14$ssr === void 0 ? UNUSED_SECTOR : _ref14$ssr,
625
- componentsLog = _ref14.componentsLog,
626
- viewport = _ref14.viewport,
627
- fixSSRAttribution = _ref14.fixSSRAttribution;
628
+ value: function calculateVC(_ref12) {
629
+ var heatmap = _ref12.heatmap,
630
+ _ref12$ssr = _ref12.ssr,
631
+ ssr = _ref12$ssr === void 0 ? UNUSED_SECTOR : _ref12$ssr,
632
+ componentsLog = _ref12.componentsLog,
633
+ viewport = _ref12.viewport,
634
+ fixSSRAttribution = _ref12.fixSSRAttribution;
628
635
  var lastUpdate = {};
629
636
  var totalPainted = 0;
630
637
  var ssrTime = fixSSRAttribution ? Math.floor(ssr) : ssr;
@@ -691,11 +698,11 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
691
698
  });
692
699
  return VCRatio;
693
700
  }, 0);
694
- var VCEntries = entries.reduce(function (acc, _ref15, i) {
701
+ var VCEntries = entries.reduce(function (acc, _ref13, i) {
695
702
  var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
696
- var _ref16 = (0, _slicedToArray2.default)(_ref15, 2),
697
- timestamp = _ref16[0],
698
- entryPainted = _ref16[1];
703
+ var _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
704
+ timestamp = _ref14[0],
705
+ entryPainted = _ref14[1];
699
706
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
700
707
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
701
708
  var logEntry = (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
@@ -80,7 +80,8 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
80
80
  key: "calculateWithDebugInfo",
81
81
  value: function () {
82
82
  var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
83
- var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, _ufo_devtool_onVCRev, _ref;
83
+ var _window, _window3;
84
+ var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, v3RevisionDebugDetails, _window2, _window2$__ufo_devtoo, _window4, _window4$__on_ufo_vc_;
84
85
  return _regenerator.default.wrap(function _callee$(_context) {
85
86
  while (1) switch (_context.prev = _context.next) {
86
87
  case 0:
@@ -170,25 +171,32 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
170
171
  previousResult = vcDetails["".concat(percentile)];
171
172
  }
172
173
  }
173
-
174
- // Handle devtool callback
175
- if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
174
+ v3RevisionDebugDetails = {
175
+ revision: this.revisionNo,
176
+ isClean: isVCClean,
177
+ abortReason: dirtyReason,
178
+ vcLogs: vcLogs,
179
+ interactionId: interactionId
180
+ }; // Handle devtool callback
181
+ if (!isPostInteraction && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function') {
176
182
  try {
177
- (_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref, {
178
- revision: this.revisionNo,
179
- isClean: isVCClean,
180
- abortReason: dirtyReason,
181
- vcLogs: vcLogs,
182
- interactionId: interactionId
183
- });
183
+ (_window2 = window) === null || _window2 === void 0 || (_window2$__ufo_devtoo = _window2.__ufo_devtool_onVCRevisionReady__) === null || _window2$__ufo_devtoo === void 0 || _window2$__ufo_devtoo.call(_window2, v3RevisionDebugDetails);
184
184
  } catch (e) {
185
185
  // if any error communicating with devtool, we don't want to break the app
186
186
  // eslint-disable-next-line no-console
187
187
  console.error('Error in onVCRevisionReady', e);
188
188
  }
189
189
  }
190
+ if (!isPostInteraction && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__on_ufo_vc_debug_data_ready) === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_emit_vc_debug_data')) {
191
+ try {
192
+ (_window4 = window) === null || _window4 === void 0 || (_window4$__on_ufo_vc_ = _window4.__on_ufo_vc_debug_data_ready) === null || _window4$__on_ufo_vc_ === void 0 || _window4$__on_ufo_vc_.call(_window4, v3RevisionDebugDetails);
193
+ } catch (e) {
194
+ // eslint-disable-next-line no-console
195
+ console.error('Error in onVCRevisionReady', e);
196
+ }
197
+ }
190
198
  return _context.abrupt("return", vcDetails);
191
- case 32:
199
+ case 34:
192
200
  case "end":
193
201
  return _context.stop();
194
202
  }
@@ -202,7 +210,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
202
210
  }, {
203
211
  key: "calculate",
204
212
  value: function () {
205
- var _calculate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref2) {
213
+ var _calculate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref) {
206
214
  var _this = this,
207
215
  _vcDetails$90$t,
208
216
  _vcDetails$;
@@ -210,7 +218,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
210
218
  return _regenerator.default.wrap(function _callee2$(_context2) {
211
219
  while (1) switch (_context2.prev = _context2.next) {
212
220
  case 0:
213
- startTime = _ref2.startTime, stopTime = _ref2.stopTime, orderedEntries = _ref2.orderedEntries, interactionId = _ref2.interactionId, isPostInteraction = _ref2.isPostInteraction;
221
+ startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction;
214
222
  filteredEntries = orderedEntries.filter(function (entry) {
215
223
  return _this.isEntryIncluded(entry);
216
224
  });
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  const NESTED_METRIC_SEPARATOR = '/';
2
3
  function filterEntry(entry) {
3
4
  return !(!entry || typeof entry !== 'object' || entry.startTime < 0 || entry.duration < 0);
@@ -5,7 +6,10 @@ function filterEntry(entry) {
5
6
  function mapEntry(entry) {
6
7
  return {
7
8
  startTime: Math.round(entry.startTime),
8
- duration: Math.round(entry.duration)
9
+ duration: Math.round(entry.duration),
10
+ ...(entry.size && fg('platform_ufo_ssr_size_field') ? {
11
+ size: Math.round(entry.size)
12
+ } : {})
9
13
  };
10
14
  }
11
15
  const SSR_PREFIX = 'ssr';
@@ -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';
@@ -281,32 +282,42 @@ export class VCObserver {
281
282
  entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
282
283
  }
283
284
  }));
285
+ const v1RevisionDebugDetails = getVCRevisionDebugDetails({
286
+ revision: 'fy25.01',
287
+ isClean: !abortReasonInfo,
288
+ abortReason: abortReason.reason,
289
+ VCEntries: VCEntries.rel,
290
+ componentsLog,
291
+ interactionId
292
+ });
293
+ const v2RevisionDebugDetails = getVCRevisionDebugDetails({
294
+ revision: 'fy25.02',
295
+ isClean: !abortReasonInfo,
296
+ abortReason: abortReason.reason,
297
+ VCEntries: vcNext.VCEntries.rel,
298
+ componentsLog,
299
+ interactionId
300
+ });
284
301
 
285
302
  // Add devtool callback for both v1 and v2
286
303
  if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
287
- var _ufo_devtool_onVCRev2, _ref2;
304
+ var _window$__ufo_devtool2, _window2;
288
305
  // Handle v1 if not disabled
289
306
  if (!isTTVCv1Disabled) {
290
- var _ufo_devtool_onVCRev, _ref;
291
- (_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 ? void 0 : _ufo_devtool_onVCRev.call(_ref, getVCRevisionDebugDetails({
292
- revision: 'fy25.01',
293
- isClean: !abortReasonInfo,
294
- abortReason: abortReason.reason,
295
- VCEntries: VCEntries.rel,
296
- componentsLog,
297
- interactionId
298
- }));
307
+ var _window$__ufo_devtool, _window;
308
+ (_window$__ufo_devtool = (_window = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool === void 0 ? void 0 : _window$__ufo_devtool.call(_window, v1RevisionDebugDetails);
299
309
  }
300
310
 
301
311
  // Handle v2
302
- (_ufo_devtool_onVCRev2 = (_ref2 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 ? void 0 : _ufo_devtool_onVCRev2.call(_ref2, getVCRevisionDebugDetails({
303
- revision: 'fy25.02',
304
- isClean: !abortReasonInfo,
305
- abortReason: abortReason.reason,
306
- VCEntries: vcNext.VCEntries.rel,
307
- componentsLog,
308
- interactionId
309
- }));
312
+ (_window$__ufo_devtool2 = (_window2 = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool2 === void 0 ? void 0 : _window$__ufo_devtool2.call(_window2, v2RevisionDebugDetails);
313
+ }
314
+ if (typeof window.__on_ufo_vc_debug_data_ready === 'function' && fg('platform_ufo_emit_vc_debug_data')) {
315
+ var _window$__on_ufo_vc_d2, _window4;
316
+ if (!isTTVCv1Disabled) {
317
+ var _window$__on_ufo_vc_d, _window3;
318
+ (_window$__on_ufo_vc_d = (_window3 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d === void 0 ? void 0 : _window$__on_ufo_vc_d.call(_window3, v1RevisionDebugDetails);
319
+ }
320
+ (_window$__on_ufo_vc_d2 = (_window4 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d2 === void 0 ? void 0 : _window$__on_ufo_vc_d2.call(_window4, v2RevisionDebugDetails);
310
321
  }
311
322
  }
312
323
  } catch (e) {
@@ -461,10 +472,10 @@ export class VCObserver {
461
472
  }
462
473
  });
463
474
  _defineProperty(this, "attachAbortListeners", () => {
464
- var _window;
475
+ var _window5;
465
476
  this.detachAbortListeners();
466
477
  let unbinds = attachAbortListeners(window, this.viewport, this.abortReasonCallback);
467
- if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
478
+ if ((_window5 = window) !== null && _window5 !== void 0 && _window5.__SSR_ABORT_LISTENERS__) {
468
479
  Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(([key, time]) => {
469
480
  if (time) {
470
481
  this.abortReasonCallback(key, time);
@@ -37,6 +37,7 @@ export default class AbstractVCCalculatorBase {
37
37
  return ratios;
38
38
  }
39
39
  async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
40
+ var _window, _window3;
40
41
  const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
41
42
  const viewportEntries = this.filterViewportEntries(filteredEntries);
42
43
  const vcLogs = await calculateTTVCPercentilesWithDebugInfo({
@@ -99,24 +100,34 @@ export default class AbstractVCCalculatorBase {
99
100
  previousResult = vcDetails[`${percentile}`];
100
101
  }
101
102
  }
103
+ const v3RevisionDebugDetails = {
104
+ revision: this.revisionNo,
105
+ isClean: isVCClean,
106
+ abortReason: dirtyReason,
107
+ vcLogs,
108
+ interactionId
109
+ };
102
110
 
103
111
  // Handle devtool callback
104
- if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
112
+ if (!isPostInteraction && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function') {
105
113
  try {
106
- var _ufo_devtool_onVCRev, _ref;
107
- (_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 ? void 0 : _ufo_devtool_onVCRev.call(_ref, {
108
- revision: this.revisionNo,
109
- isClean: isVCClean,
110
- abortReason: dirtyReason,
111
- vcLogs,
112
- interactionId
113
- });
114
+ var _window2, _window2$__ufo_devtoo;
115
+ (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$__ufo_devtoo = _window2.__ufo_devtool_onVCRevisionReady__) === null || _window2$__ufo_devtoo === void 0 ? void 0 : _window2$__ufo_devtoo.call(_window2, v3RevisionDebugDetails);
114
116
  } catch (e) {
115
117
  // if any error communicating with devtool, we don't want to break the app
116
118
  // eslint-disable-next-line no-console
117
119
  console.error('Error in onVCRevisionReady', e);
118
120
  }
119
121
  }
122
+ if (!isPostInteraction && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__on_ufo_vc_debug_data_ready) === 'function' && fg('platform_ufo_emit_vc_debug_data')) {
123
+ try {
124
+ var _window4, _window4$__on_ufo_vc_;
125
+ (_window4 = window) === null || _window4 === void 0 ? void 0 : (_window4$__on_ufo_vc_ = _window4.__on_ufo_vc_debug_data_ready) === null || _window4$__on_ufo_vc_ === void 0 ? void 0 : _window4$__on_ufo_vc_.call(_window4, v3RevisionDebugDetails);
126
+ } catch (e) {
127
+ // eslint-disable-next-line no-console
128
+ console.error('Error in onVCRevisionReady', e);
129
+ }
130
+ }
120
131
  return vcDetails;
121
132
  }
122
133
  async calculate({
@@ -1,13 +1,19 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _typeof from "@babel/runtime/helpers/typeof";
3
+ 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; }
4
+ 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; }
5
+ import { fg } from '@atlaskit/platform-feature-flags';
2
6
  var NESTED_METRIC_SEPARATOR = '/';
3
7
  function filterEntry(entry) {
4
8
  return !(!entry || _typeof(entry) !== 'object' || entry.startTime < 0 || entry.duration < 0);
5
9
  }
6
10
  function mapEntry(entry) {
7
- return {
11
+ return _objectSpread({
8
12
  startTime: Math.round(entry.startTime),
9
13
  duration: Math.round(entry.duration)
10
- };
14
+ }, entry.size && fg('platform_ufo_ssr_size_field') ? {
15
+ size: Math.round(entry.size)
16
+ } : {});
11
17
  }
12
18
  var SSR_PREFIX = 'ssr';
13
19
  function mapKey(key) {
@@ -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, _ufo_devtool_onVCRev2, _ref9, _ufo_devtool_onVCRev, _ref8, 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, 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:
@@ -264,30 +265,36 @@ export var VCObserver = /*#__PURE__*/function () {
264
265
  entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
265
266
  }
266
267
  }));
267
-
268
- // Add devtool callback for both v1 and v2
268
+ v1RevisionDebugDetails = getVCRevisionDebugDetails({
269
+ revision: 'fy25.01',
270
+ isClean: !abortReasonInfo,
271
+ abortReason: abortReason.reason,
272
+ VCEntries: VCEntries.rel,
273
+ componentsLog: componentsLog,
274
+ interactionId: interactionId
275
+ });
276
+ v2RevisionDebugDetails = getVCRevisionDebugDetails({
277
+ revision: 'fy25.02',
278
+ isClean: !abortReasonInfo,
279
+ abortReason: abortReason.reason,
280
+ VCEntries: vcNext.VCEntries.rel,
281
+ componentsLog: componentsLog,
282
+ interactionId: interactionId
283
+ }); // Add devtool callback for both v1 and v2
269
284
  if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
270
285
  // Handle v1 if not disabled
271
286
  if (!isTTVCv1Disabled) {
272
- (_ufo_devtool_onVCRev = (_ref8 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref8, getVCRevisionDebugDetails({
273
- revision: 'fy25.01',
274
- isClean: !abortReasonInfo,
275
- abortReason: abortReason.reason,
276
- VCEntries: VCEntries.rel,
277
- componentsLog: componentsLog,
278
- interactionId: interactionId
279
- }));
287
+ (_window$__ufo_devtool = (_window = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool === void 0 || _window$__ufo_devtool.call(_window, v1RevisionDebugDetails);
280
288
  }
281
289
 
282
290
  // Handle v2
283
- (_ufo_devtool_onVCRev2 = (_ref9 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev2 === void 0 || _ufo_devtool_onVCRev2.call(_ref9, getVCRevisionDebugDetails({
284
- revision: 'fy25.02',
285
- isClean: !abortReasonInfo,
286
- abortReason: abortReason.reason,
287
- VCEntries: vcNext.VCEntries.rel,
288
- componentsLog: componentsLog,
289
- interactionId: interactionId
290
- }));
291
+ (_window$__ufo_devtool2 = (_window2 = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool2 === void 0 || _window$__ufo_devtool2.call(_window2, v2RevisionDebugDetails);
292
+ }
293
+ if (typeof window.__on_ufo_vc_debug_data_ready === 'function' && fg('platform_ufo_emit_vc_debug_data')) {
294
+ if (!isTTVCv1Disabled) {
295
+ (_window$__on_ufo_vc_d = (_window3 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d === void 0 || _window$__on_ufo_vc_d.call(_window3, v1RevisionDebugDetails);
296
+ }
297
+ (_window$__on_ufo_vc_d2 = (_window4 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d2 === void 0 || _window$__on_ufo_vc_d2.call(_window4, v2RevisionDebugDetails);
291
298
  }
292
299
  }
293
300
  } catch (e) {
@@ -416,14 +423,14 @@ export var VCObserver = /*#__PURE__*/function () {
416
423
  }
417
424
  });
418
425
  _defineProperty(this, "attachAbortListeners", function () {
419
- var _window;
426
+ var _window5;
420
427
  _this.detachAbortListeners();
421
428
  var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
422
- if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
423
- Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref1) {
424
- var _ref10 = _slicedToArray(_ref1, 2),
425
- key = _ref10[0],
426
- time = _ref10[1];
429
+ if ((_window5 = window) !== null && _window5 !== void 0 && _window5.__SSR_ABORT_LISTENERS__) {
430
+ Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref9) {
431
+ var _ref0 = _slicedToArray(_ref9, 2),
432
+ key = _ref0[0],
433
+ time = _ref0[1];
427
434
  if (time) {
428
435
  _this.abortReasonCallback(key, time);
429
436
  }
@@ -453,8 +460,8 @@ export var VCObserver = /*#__PURE__*/function () {
453
460
  }
454
461
  return _createClass(VCObserver, [{
455
462
  key: "start",
456
- value: function start(_ref11) {
457
- var startTime = _ref11.startTime;
463
+ value: function start(_ref1) {
464
+ var startTime = _ref1.startTime;
458
465
  this.active = true;
459
466
  if (this.observers.isBrowserSupported()) {
460
467
  this.setViewportSize();
@@ -476,12 +483,12 @@ export var VCObserver = /*#__PURE__*/function () {
476
483
  }, {
477
484
  key: "getIgnoredElements",
478
485
  value: function getIgnoredElements(componentsLog) {
479
- return Object.values(componentsLog).flat().filter(function (_ref12) {
480
- var ignoreReason = _ref12.ignoreReason;
486
+ return Object.values(componentsLog).flat().filter(function (_ref10) {
487
+ var ignoreReason = _ref10.ignoreReason;
481
488
  return Boolean(ignoreReason);
482
- }).map(function (_ref13) {
483
- var targetName = _ref13.targetName,
484
- ignoreReason = _ref13.ignoreReason;
489
+ }).map(function (_ref11) {
490
+ var targetName = _ref11.targetName,
491
+ ignoreReason = _ref11.ignoreReason;
485
492
  return {
486
493
  targetName: targetName,
487
494
  ignoreReason: ignoreReason
@@ -611,13 +618,13 @@ export var VCObserver = /*#__PURE__*/function () {
611
618
  }
612
619
  }, {
613
620
  key: "calculateVC",
614
- value: function calculateVC(_ref14) {
615
- var heatmap = _ref14.heatmap,
616
- _ref14$ssr = _ref14.ssr,
617
- ssr = _ref14$ssr === void 0 ? UNUSED_SECTOR : _ref14$ssr,
618
- componentsLog = _ref14.componentsLog,
619
- viewport = _ref14.viewport,
620
- fixSSRAttribution = _ref14.fixSSRAttribution;
621
+ value: function calculateVC(_ref12) {
622
+ var heatmap = _ref12.heatmap,
623
+ _ref12$ssr = _ref12.ssr,
624
+ ssr = _ref12$ssr === void 0 ? UNUSED_SECTOR : _ref12$ssr,
625
+ componentsLog = _ref12.componentsLog,
626
+ viewport = _ref12.viewport,
627
+ fixSSRAttribution = _ref12.fixSSRAttribution;
621
628
  var lastUpdate = {};
622
629
  var totalPainted = 0;
623
630
  var ssrTime = fixSSRAttribution ? Math.floor(ssr) : ssr;
@@ -684,11 +691,11 @@ export var VCObserver = /*#__PURE__*/function () {
684
691
  });
685
692
  return VCRatio;
686
693
  }, 0);
687
- var VCEntries = entries.reduce(function (acc, _ref15, i) {
694
+ var VCEntries = entries.reduce(function (acc, _ref13, i) {
688
695
  var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
689
- var _ref16 = _slicedToArray(_ref15, 2),
690
- timestamp = _ref16[0],
691
- entryPainted = _ref16[1];
696
+ var _ref14 = _slicedToArray(_ref13, 2),
697
+ timestamp = _ref14[0],
698
+ entryPainted = _ref14[1];
692
699
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
693
700
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
694
701
  var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
@@ -73,7 +73,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
73
73
  key: "calculateWithDebugInfo",
74
74
  value: function () {
75
75
  var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
76
- var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, _ufo_devtool_onVCRev, _ref;
76
+ var _window, _window3;
77
+ var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, v3RevisionDebugDetails, _window2, _window2$__ufo_devtoo, _window4, _window4$__on_ufo_vc_;
77
78
  return _regeneratorRuntime.wrap(function _callee$(_context) {
78
79
  while (1) switch (_context.prev = _context.next) {
79
80
  case 0:
@@ -163,25 +164,32 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
163
164
  previousResult = vcDetails["".concat(percentile)];
164
165
  }
165
166
  }
166
-
167
- // Handle devtool callback
168
- if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
167
+ v3RevisionDebugDetails = {
168
+ revision: this.revisionNo,
169
+ isClean: isVCClean,
170
+ abortReason: dirtyReason,
171
+ vcLogs: vcLogs,
172
+ interactionId: interactionId
173
+ }; // Handle devtool callback
174
+ if (!isPostInteraction && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function') {
169
175
  try {
170
- (_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref, {
171
- revision: this.revisionNo,
172
- isClean: isVCClean,
173
- abortReason: dirtyReason,
174
- vcLogs: vcLogs,
175
- interactionId: interactionId
176
- });
176
+ (_window2 = window) === null || _window2 === void 0 || (_window2$__ufo_devtoo = _window2.__ufo_devtool_onVCRevisionReady__) === null || _window2$__ufo_devtoo === void 0 || _window2$__ufo_devtoo.call(_window2, v3RevisionDebugDetails);
177
177
  } catch (e) {
178
178
  // if any error communicating with devtool, we don't want to break the app
179
179
  // eslint-disable-next-line no-console
180
180
  console.error('Error in onVCRevisionReady', e);
181
181
  }
182
182
  }
183
+ if (!isPostInteraction && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__on_ufo_vc_debug_data_ready) === 'function' && fg('platform_ufo_emit_vc_debug_data')) {
184
+ try {
185
+ (_window4 = window) === null || _window4 === void 0 || (_window4$__on_ufo_vc_ = _window4.__on_ufo_vc_debug_data_ready) === null || _window4$__on_ufo_vc_ === void 0 || _window4$__on_ufo_vc_.call(_window4, v3RevisionDebugDetails);
186
+ } catch (e) {
187
+ // eslint-disable-next-line no-console
188
+ console.error('Error in onVCRevisionReady', e);
189
+ }
190
+ }
183
191
  return _context.abrupt("return", vcDetails);
184
- case 32:
192
+ case 34:
185
193
  case "end":
186
194
  return _context.stop();
187
195
  }
@@ -195,7 +203,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
195
203
  }, {
196
204
  key: "calculate",
197
205
  value: function () {
198
- var _calculate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
206
+ var _calculate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref) {
199
207
  var _this = this,
200
208
  _vcDetails$90$t,
201
209
  _vcDetails$;
@@ -203,7 +211,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
203
211
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
204
212
  while (1) switch (_context2.prev = _context2.next) {
205
213
  case 0:
206
- startTime = _ref2.startTime, stopTime = _ref2.stopTime, orderedEntries = _ref2.orderedEntries, interactionId = _ref2.interactionId, isPostInteraction = _ref2.isPostInteraction;
214
+ startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction;
207
215
  filteredEntries = orderedEntries.filter(function (entry) {
208
216
  return _this.isEntryIncluded(entry);
209
217
  });
@@ -2,6 +2,7 @@ export type FeatureFlagValue = boolean | string | number | Record<any, any>;
2
2
  export type ReportedTiming = {
3
3
  startTime: number;
4
4
  duration: number;
5
+ size?: number;
5
6
  };
6
7
  export type ReportedTimings = {
7
8
  [key: string]: ReportedTiming;
@@ -1,5 +1,6 @@
1
1
  import type { VCRawDataType, VCResult } from '../common/vc/types';
2
2
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from './types';
3
+ export type { VCRevisionDebugDetails } from './vc-observer/getVCRevisionDebugDetails';
3
4
  declare global {
4
5
  var __vcObserver: VCObserverInterface;
5
6
  }
@@ -1,9 +1,9 @@
1
- import type { ComponentsLogType, VCEntryType } from '../../common/vc/types';
1
+ import type { ComponentsLogType, VCAbortReason, VCEntryType } from '../../common/vc/types';
2
2
  import type { VCObserverEntryType } from '../vc-observer-new/types';
3
- interface VCRevisionDebugDetails {
3
+ export interface VCRevisionDebugDetails {
4
4
  revision: string;
5
5
  isClean: boolean;
6
- abortReason: string | null;
6
+ abortReason?: VCAbortReason | null;
7
7
  vcLogs: Array<{
8
8
  time: number;
9
9
  viewportPercentage: number;
@@ -22,9 +22,8 @@ interface VCRevisionDebugDetails {
22
22
  export declare function getVCRevisionDebugDetails({ revision, isClean, abortReason, VCEntries, componentsLog, interactionId, }: {
23
23
  revision: string;
24
24
  isClean: boolean;
25
- abortReason: string | null;
25
+ abortReason?: VCAbortReason | null;
26
26
  VCEntries: VCEntryType[];
27
27
  componentsLog: ComponentsLogType;
28
28
  interactionId?: string;
29
29
  }): VCRevisionDebugDetails;
30
- export {};
@@ -1,7 +1,14 @@
1
1
  import { type UnbindFn } from 'bind-event-listener';
2
2
  import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
3
3
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
4
+ import { VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
4
5
  import { Observers } from './observers';
6
+ declare global {
7
+ interface Window {
8
+ __ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
9
+ __on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
10
+ }
11
+ }
5
12
  export declare class VCObserver implements VCObserverInterface {
6
13
  abortReason: VCAbortReasonType;
7
14
  outOfBoundaryInfo: string;
@@ -1,6 +1,13 @@
1
1
  import type { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
2
+ import { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
2
3
  import type { VCObserverEntry } from '../types';
3
4
  import type { VCCalculator, VCCalculatorParam } from './types';
5
+ declare global {
6
+ interface Window {
7
+ __ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
8
+ __on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
9
+ }
10
+ }
4
11
  export default abstract class AbstractVCCalculatorBase implements VCCalculator {
5
12
  private revisionNo;
6
13
  constructor(revisionNo: string);
@@ -2,6 +2,7 @@ export type FeatureFlagValue = boolean | string | number | Record<any, any>;
2
2
  export type ReportedTiming = {
3
3
  startTime: number;
4
4
  duration: number;
5
+ size?: number;
5
6
  };
6
7
  export type ReportedTimings = {
7
8
  [key: string]: ReportedTiming;
@@ -1,5 +1,6 @@
1
1
  import type { VCRawDataType, VCResult } from '../common/vc/types';
2
2
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from './types';
3
+ export type { VCRevisionDebugDetails } from './vc-observer/getVCRevisionDebugDetails';
3
4
  declare global {
4
5
  var __vcObserver: VCObserverInterface;
5
6
  }
@@ -1,9 +1,9 @@
1
- import type { ComponentsLogType, VCEntryType } from '../../common/vc/types';
1
+ import type { ComponentsLogType, VCAbortReason, VCEntryType } from '../../common/vc/types';
2
2
  import type { VCObserverEntryType } from '../vc-observer-new/types';
3
- interface VCRevisionDebugDetails {
3
+ export interface VCRevisionDebugDetails {
4
4
  revision: string;
5
5
  isClean: boolean;
6
- abortReason: string | null;
6
+ abortReason?: VCAbortReason | null;
7
7
  vcLogs: Array<{
8
8
  time: number;
9
9
  viewportPercentage: number;
@@ -22,9 +22,8 @@ interface VCRevisionDebugDetails {
22
22
  export declare function getVCRevisionDebugDetails({ revision, isClean, abortReason, VCEntries, componentsLog, interactionId, }: {
23
23
  revision: string;
24
24
  isClean: boolean;
25
- abortReason: string | null;
25
+ abortReason?: VCAbortReason | null;
26
26
  VCEntries: VCEntryType[];
27
27
  componentsLog: ComponentsLogType;
28
28
  interactionId?: string;
29
29
  }): VCRevisionDebugDetails;
30
- export {};
@@ -1,7 +1,14 @@
1
1
  import { type UnbindFn } from 'bind-event-listener';
2
2
  import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
3
3
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
4
+ import { VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
4
5
  import { Observers } from './observers';
6
+ declare global {
7
+ interface Window {
8
+ __ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
9
+ __on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
10
+ }
11
+ }
5
12
  export declare class VCObserver implements VCObserverInterface {
6
13
  abortReason: VCAbortReasonType;
7
14
  outOfBoundaryInfo: string;
@@ -1,6 +1,13 @@
1
1
  import type { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
2
+ import { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
2
3
  import type { VCObserverEntry } from '../types';
3
4
  import type { VCCalculator, VCCalculatorParam } from './types';
5
+ declare global {
6
+ interface Window {
7
+ __ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
8
+ __on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
9
+ }
10
+ }
4
11
  export default abstract class AbstractVCCalculatorBase implements VCCalculator {
5
12
  private revisionNo;
6
13
  constructor(revisionNo: string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.13.17",
3
+ "version": "3.13.18",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -133,6 +133,9 @@
133
133
  "platform_ufo_report_cpu_usage": {
134
134
  "type": "boolean"
135
135
  },
136
+ "platform_ufo_emit_vc_debug_data": {
137
+ "type": "boolean"
138
+ },
136
139
  "ufo_return_relative_request_start": {
137
140
  "type": "boolean"
138
141
  },
@@ -159,6 +162,9 @@
159
162
  },
160
163
  "platform_ufo_rev_ratios": {
161
164
  "type": "boolean"
165
+ },
166
+ "platform_ufo_ssr_size_field": {
167
+ "type": "boolean"
162
168
  }
163
169
  }
164
170
  }