@atlaskit/react-ufo 3.9.4 → 3.10.0

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 (33) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +26 -5
  3. package/dist/cjs/vc/vc-observer/index.js +41 -11
  4. package/dist/cjs/vc/vc-observer/observers/index.js +8 -17
  5. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +29 -9
  6. package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +24 -0
  7. package/dist/es2019/vc/vc-observer/index.js +37 -4
  8. package/dist/es2019/vc/vc-observer/observers/index.js +8 -17
  9. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +24 -8
  10. package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +22 -0
  11. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -2
  12. package/dist/esm/vc/vc-observer/index.js +41 -11
  13. package/dist/esm/vc/vc-observer/observers/index.js +8 -17
  14. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +29 -9
  15. package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +24 -0
  16. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -2
  17. package/dist/types/common/vc/types.d.ts +2 -1
  18. package/dist/types/vc/vc-observer-new/index.d.ts +1 -1
  19. package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +6 -1
  20. package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +7 -0
  21. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +1 -1
  22. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +1 -1
  23. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
  24. package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +1 -13
  25. package/dist/types-ts4.5/common/vc/types.d.ts +2 -1
  26. package/dist/types-ts4.5/vc/vc-observer-new/index.d.ts +1 -1
  27. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +6 -1
  28. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +7 -0
  29. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +1 -1
  30. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +1 -1
  31. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
  32. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +1 -13
  33. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#150556](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150556)
8
+ [`b6a8637092517`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6a8637092517) -
9
+ Add VC abort reason per TTVC revision
10
+
11
+ ## 3.9.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [#149485](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149485)
16
+ [`e496da2bdb127`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e496da2bdb127) -
17
+ AFO-3615 cleanup fg platform_ufo_log_attr_mutation_values
18
+
3
19
  ## 3.9.4
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -6,14 +6,35 @@ Parts of React UFO that need to be scoped within @atlaskit
6
6
 
7
7
  <https://hello.atlassian.net/wiki/spaces/UFO/pages/2305847386/react-ufo+UFO+v2>
8
8
 
9
-
10
9
  # Running integration test
10
+
11
+ In one terminal:
12
+
11
13
  ```
12
14
  cd platform && nvm use && yarn
13
-
14
15
  yarn start:rspack react-ufo
16
+ ```
17
+
18
+ This will start the dev server, accessible via http://localhost:9000.
15
19
 
16
- # in a separate terminal
20
+ Then in a separate terminal:
21
+
22
+ ```
17
23
  cd platform && nvm use
18
- yarn test:integration packages/react-ufo/atlaskit/__tests__/ --retries 0 --reporter list --reuse-dev-server --project=desktop-chromium --max-failures=0
19
- ```
24
+ yarn test:integration packages/react-ufo/atlaskit/__tests__/ --retries 0 --reporter list --reuse-dev-server --project=desktop-chromium --max-failures=0
25
+ ```
26
+
27
+ To ensure the test is not flaky, refer to the following page:
28
+ [HOWTO: Fix & remove flaky tests](https://hello.atlassian.net/wiki/spaces/afm/pages/3153691982/HOWTO+Fix+remove+flaky+tests#3.-How-can-I-verify-/-reproduce-flakiness?)
29
+
30
+ Essentially, to simulate CI-like environment in local for Playwright to parallelise load, we can
31
+ increase the following:
32
+
33
+ - The number of times to repeat each test
34
+ - The number of workers
35
+
36
+ Example:
37
+
38
+ ```
39
+ yarn test:integration packages/react-ufo/atlaskit/__tests__/playwright/base.spec.ts --retries 0 --reporter list --reuse-dev-server --project=desktop-chromium --max-failures=0 --repeat-each 50 --workers 50
40
+ ```
@@ -107,7 +107,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
107
107
  (0, _defineProperty2.default)(this, "getVCResult", /*#__PURE__*/function () {
108
108
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
109
109
  var _getConfig, _getConfig2;
110
- var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
110
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
111
111
  return _regenerator.default.wrap(function _callee$(_context) {
112
112
  while (1) switch (_context.prev = _context.next) {
113
113
  case 0:
@@ -122,8 +122,37 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
122
122
  return _context.abrupt("return", {});
123
123
  case 6:
124
124
  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, multiHeatmap = rawData.multiHeatmap;
125
+ isTTVCv1Disabled = !((_getConfig = (0, _config.getConfig)()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01')); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
126
+ // we want to report abort by scroll events the same way as other abort reasons
127
+ // i.e. not have the concept of `abortReason.blocking` anymore
128
+ if (!(abortReasonInfo !== null && (0, _platformFeatureFlags.fg)('platform_ufo_add_vc_abort_reason_by_revisions'))) {
129
+ _context.next = 15;
130
+ break;
131
+ }
132
+ // exposing data to devtools
133
+ try {
134
+ if (devToolsEnabled && !_this.isPostInteraction) {
135
+ window.__vcNotAvailableReason = abortReasonInfo;
136
+ }
137
+ } catch (e) {}
138
+ 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"), [{
139
+ revision: 'fy25.02',
140
+ clean: false,
141
+ 'metric:vc90': null,
142
+ abortReason: abortReason.reason
143
+ }]);
144
+ if (!isTTVCv1Disabled) {
145
+ vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
146
+ revision: 'fy25.01',
147
+ clean: false,
148
+ 'metric:vc90': null,
149
+ abortReason: abortReason.reason
150
+ });
151
+ }
152
+ return _context.abrupt("return", vcAbortedResultWithRevisions);
153
+ case 15:
125
154
  if (!(abortReasonInfo !== null && abortReason.blocking)) {
126
- _context.next = 10;
155
+ _context.next = 18;
127
156
  break;
128
157
  }
129
158
  // exposing data to devtools
@@ -133,8 +162,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
133
162
  }
134
163
  } catch (e) {}
135
164
  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));
136
- case 10:
137
- isTTVCv1Disabled = !((_getConfig = (0, _config.getConfig)()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'));
165
+ case 18:
138
166
  ttvcV1Result = isTTVCv1Disabled ? {
139
167
  VC: {},
140
168
  VCBox: {},
@@ -286,16 +314,16 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
286
314
  });
287
315
  speedIndex = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
288
316
  if (!isTTVCv1Disabled) {
289
- _context.next = 25;
317
+ _context.next = 32;
290
318
  break;
291
319
  }
292
320
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
293
- case 25:
321
+ case 32:
294
322
  isTTVCv3Enabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') || ((_getConfig2 = (0, _config.getConfig)()) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.vc) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.enabledVCRevisions) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.includes('fy25.03'));
295
323
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
296
324
  'metrics:vc': VC
297
325
  }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
298
- case 27:
326
+ case 34:
299
327
  case "end":
300
328
  return _context.stop();
301
329
  }
@@ -610,10 +638,12 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
610
638
  }, {
611
639
  key: "detachAbortListeners",
612
640
  value: function detachAbortListeners() {
613
- this.unbind.forEach(function (fn) {
614
- return fn();
615
- });
616
- this.unbind = [];
641
+ if (Array.isArray(this.unbind)) {
642
+ this.unbind.forEach(function (fn) {
643
+ return fn();
644
+ });
645
+ this.unbind = [];
646
+ }
617
647
  }
618
648
  }, {
619
649
  key: "measureStart",
@@ -8,7 +8,6 @@ exports.Observers = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _vcUtils = require("../media-wrapper/vc-utils");
13
12
  var _isNonVisualStyleMutation = _interopRequireDefault(require("./non-visual-styles/is-non-visual-style-mutation"));
14
13
  var _ssrPlaceholders = require("./ssr-placeholders");
@@ -60,22 +59,14 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
60
59
  var oldValue = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
61
60
  var newValue = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
62
61
  (_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.observe(node);
63
- if ((0, _platformFeatureFlags.fg)('platform_ufo_log_attr_mutation_values')) {
64
- _this.observedMutations.set(node, {
65
- mutation: mutation,
66
- ignoreReason: ignoreReason,
67
- type: type,
68
- attributeName: attributeName,
69
- oldValue: oldValue,
70
- newValue: newValue
71
- });
72
- } else {
73
- _this.observedMutations.set(node, {
74
- mutation: mutation,
75
- ignoreReason: ignoreReason,
76
- type: type
77
- });
78
- }
62
+ _this.observedMutations.set(node, {
63
+ mutation: mutation,
64
+ ignoreReason: ignoreReason,
65
+ type: type,
66
+ attributeName: attributeName,
67
+ oldValue: oldValue,
68
+ newValue: newValue
69
+ });
79
70
  });
80
71
  this.selectorConfig = _objectSpread(_objectSpread({}, this.selectorConfig), opts.selectorConfig);
81
72
  this.intersectionObserver = this.getIntersectionObserver();
@@ -9,6 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _percentileCalc = _interopRequireDefault(require("./percentile-calc"));
13
14
  var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
14
15
  var _getViewportWidth = _interopRequireDefault(require("./utils/get-viewport-width"));
@@ -24,7 +25,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
24
25
  var _this = this,
25
26
  _vcDetails$90$t,
26
27
  _vcDetails$;
27
- var startTime, stopTime, orderedEntries, filteredEntries, isVCClean, vcDetails;
28
+ var startTime, stopTime, orderedEntries, filteredEntries, _this$getVCCleanStatu, _isVCClean, dirtyReason, _isVCClean2, vcDetails;
28
29
  return _regenerator.default.wrap(function _callee$(_context) {
29
30
  while (1) switch (_context.prev = _context.next) {
30
31
  case 0:
@@ -32,9 +33,28 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
32
33
  filteredEntries = orderedEntries.filter(function (entry) {
33
34
  return _this.isEntryIncluded(entry);
34
35
  });
35
- isVCClean = this.isVCClean(filteredEntries);
36
- if (isVCClean) {
37
- _context.next = 5;
36
+ if (!(0, _platformFeatureFlags.fg)('platform_ufo_add_vc_abort_reason_by_revisions')) {
37
+ _context.next = 8;
38
+ break;
39
+ }
40
+ _this$getVCCleanStatu = this.getVCCleanStatus(filteredEntries), _isVCClean = _this$getVCCleanStatu.isVCClean, dirtyReason = _this$getVCCleanStatu.dirtyReason;
41
+ if (_isVCClean) {
42
+ _context.next = 6;
43
+ break;
44
+ }
45
+ return _context.abrupt("return", {
46
+ revision: this.revisionNo,
47
+ 'metric:vc90': null,
48
+ clean: false,
49
+ abortReason: dirtyReason
50
+ });
51
+ case 6:
52
+ _context.next = 11;
53
+ break;
54
+ case 8:
55
+ _isVCClean2 = this.isVCClean(filteredEntries);
56
+ if (_isVCClean2) {
57
+ _context.next = 11;
38
58
  break;
39
59
  }
40
60
  return _context.abrupt("return", {
@@ -42,8 +62,8 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
42
62
  'metric:vc90': null,
43
63
  clean: false
44
64
  });
45
- case 5:
46
- _context.next = 7;
65
+ case 11:
66
+ _context.next = 13;
47
67
  return (0, _percentileCalc.default)({
48
68
  viewport: {
49
69
  width: (0, _getViewportWidth.default)(),
@@ -54,15 +74,15 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
54
74
  orderedEntries: filteredEntries,
55
75
  percentiles: [25, 50, 75, 80, 85, 90, 95, 98, 99]
56
76
  });
57
- case 7:
77
+ case 13:
58
78
  vcDetails = _context.sent;
59
79
  return _context.abrupt("return", {
60
80
  revision: this.revisionNo,
61
81
  vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
62
- clean: isVCClean,
82
+ clean: true,
63
83
  '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
64
84
  });
65
- case 9:
85
+ case 15:
66
86
  case "end":
67
87
  return _context.stop();
68
88
  }
@@ -61,5 +61,29 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
61
61
  });
62
62
  return !hasAbortEvent;
63
63
  }
64
+ }, {
65
+ key: "getVCCleanStatus",
66
+ value: function getVCCleanStatus(filteredEntries) {
67
+ var dirtyReason = '';
68
+ var hasAbortEvent = filteredEntries.some(function (entry) {
69
+ if (entry.type === 'window:event') {
70
+ var data = entry.data;
71
+ if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
72
+ dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
73
+ return true;
74
+ }
75
+ }
76
+ return false;
77
+ });
78
+ if (hasAbortEvent && dirtyReason) {
79
+ return {
80
+ isVCClean: false,
81
+ dirtyReason: dirtyReason
82
+ };
83
+ }
84
+ return {
85
+ isVCClean: true
86
+ };
87
+ }
64
88
  }]);
65
89
  }(_abstractBaseVcCalculator.default);
@@ -118,7 +118,39 @@ export class VCObserver {
118
118
  ratios,
119
119
  multiHeatmap
120
120
  } = rawData;
121
- if (abortReasonInfo !== null && abortReason.blocking) {
121
+ const isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig$vc = _getConfig.vc) !== null && _getConfig$vc !== void 0 && (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) !== null && _getConfig$vc$enabled !== void 0 && _getConfig$vc$enabled.includes('fy25.01'));
122
+
123
+ // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
124
+ // we want to report abort by scroll events the same way as other abort reasons
125
+ // i.e. not have the concept of `abortReason.blocking` anymore
126
+ if (abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
127
+ // exposing data to devtools
128
+ try {
129
+ if (devToolsEnabled && !this.isPostInteraction) {
130
+ window.__vcNotAvailableReason = abortReasonInfo;
131
+ }
132
+ } catch (e) {}
133
+ const vcAbortedResultWithRevisions = {
134
+ [`${fullPrefix}vc:state`]: false,
135
+ [`${fullPrefix}vc:abort:reason`]: abortReason.reason,
136
+ [`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp,
137
+ [`${fullPrefix}vc:rev`]: [{
138
+ revision: 'fy25.02',
139
+ clean: false,
140
+ 'metric:vc90': null,
141
+ abortReason: abortReason.reason
142
+ }]
143
+ };
144
+ if (!isTTVCv1Disabled) {
145
+ vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
146
+ revision: 'fy25.01',
147
+ clean: false,
148
+ 'metric:vc90': null,
149
+ abortReason: abortReason.reason
150
+ });
151
+ }
152
+ return vcAbortedResultWithRevisions;
153
+ } else if (abortReasonInfo !== null && abortReason.blocking) {
122
154
  // exposing data to devtools
123
155
  try {
124
156
  if (devToolsEnabled && !this.isPostInteraction) {
@@ -131,7 +163,6 @@ export class VCObserver {
131
163
  [`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp
132
164
  };
133
165
  }
134
- const isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig$vc = _getConfig.vc) !== null && _getConfig$vc !== void 0 && (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) !== null && _getConfig$vc$enabled !== void 0 && _getConfig$vc$enabled.includes('fy25.01'));
135
166
  const ttvcV1Result = isTTVCv1Disabled ? {
136
167
  VC: {},
137
168
  VCBox: {},
@@ -701,8 +732,10 @@ export class VCObserver {
701
732
  return vc;
702
733
  }
703
734
  detachAbortListeners() {
704
- this.unbind.forEach(fn => fn());
705
- this.unbind = [];
735
+ if (Array.isArray(this.unbind)) {
736
+ this.unbind.forEach(fn => fn());
737
+ this.unbind = [];
738
+ }
706
739
  }
707
740
  measureStart() {
708
741
  this._startMeasureTimestamp = performance.now();
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
4
3
  import isNonVisualStyleMutation from './non-visual-styles/is-non-visual-style-mutation';
5
4
  import { SSRPlaceholderHandlers } from './ssr-placeholders';
@@ -45,22 +44,14 @@ export class Observers {
45
44
  _defineProperty(this, "observeElement", (node, mutation, type, ignoreReason, attributeName, oldValue = null, newValue = null) => {
46
45
  var _this$intersectionObs;
47
46
  (_this$intersectionObs = this.intersectionObserver) === null || _this$intersectionObs === void 0 ? void 0 : _this$intersectionObs.observe(node);
48
- if (fg('platform_ufo_log_attr_mutation_values')) {
49
- this.observedMutations.set(node, {
50
- mutation,
51
- ignoreReason,
52
- type,
53
- attributeName,
54
- oldValue,
55
- newValue
56
- });
57
- } else {
58
- this.observedMutations.set(node, {
59
- mutation,
60
- ignoreReason,
61
- type
62
- });
63
- }
47
+ this.observedMutations.set(node, {
48
+ mutation,
49
+ ignoreReason,
50
+ type,
51
+ attributeName,
52
+ oldValue,
53
+ newValue
54
+ });
64
55
  });
65
56
  this.selectorConfig = {
66
57
  ...this.selectorConfig,
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import calculateTTVCPercentiles from './percentile-calc';
2
3
  import getViewportHeight from './utils/get-viewport-height';
3
4
  import getViewportWidth from './utils/get-viewport-width';
@@ -14,13 +15,28 @@ export default class AbstractVCCalculatorBase {
14
15
  const filteredEntries = orderedEntries.filter(entry => {
15
16
  return this.isEntryIncluded(entry);
16
17
  });
17
- const isVCClean = this.isVCClean(filteredEntries);
18
- if (!isVCClean) {
19
- return {
20
- revision: this.revisionNo,
21
- 'metric:vc90': null,
22
- clean: false
23
- };
18
+ if (fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
19
+ const {
20
+ isVCClean,
21
+ dirtyReason
22
+ } = this.getVCCleanStatus(filteredEntries);
23
+ if (!isVCClean) {
24
+ return {
25
+ revision: this.revisionNo,
26
+ 'metric:vc90': null,
27
+ clean: false,
28
+ abortReason: dirtyReason
29
+ };
30
+ }
31
+ } else {
32
+ const isVCClean = this.isVCClean(filteredEntries);
33
+ if (!isVCClean) {
34
+ return {
35
+ revision: this.revisionNo,
36
+ 'metric:vc90': null,
37
+ clean: false
38
+ };
39
+ }
24
40
  }
25
41
  const vcDetails = await calculateTTVCPercentiles({
26
42
  viewport: {
@@ -35,7 +51,7 @@ export default class AbstractVCCalculatorBase {
35
51
  return {
36
52
  revision: this.revisionNo,
37
53
  vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
38
- clean: isVCClean,
54
+ clean: true,
39
55
  'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 ? void 0 : (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null
40
56
  };
41
57
  }
@@ -41,4 +41,26 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
41
41
  });
42
42
  return !hasAbortEvent;
43
43
  }
44
+ getVCCleanStatus(filteredEntries) {
45
+ let dirtyReason = '';
46
+ const hasAbortEvent = filteredEntries.some(entry => {
47
+ if (entry.type === 'window:event') {
48
+ const data = entry.data;
49
+ if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
50
+ dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
51
+ return true;
52
+ }
53
+ }
54
+ return false;
55
+ });
56
+ if (hasAbortEvent && dirtyReason) {
57
+ return {
58
+ isVCClean: false,
59
+ dirtyReason
60
+ };
61
+ }
62
+ return {
63
+ isVCClean: true
64
+ };
65
+ }
44
66
  }
@@ -1,5 +1,5 @@
1
1
  import calcUsingCanvas from './canvas-heatmap';
2
- import caclUsingOldHeatmap from './heatmap';
2
+ import calcUsingOldHeatmap from './heatmap';
3
3
  import calcUsingRectSweepingLine from './rect-sweeping-line';
4
4
  async function calculateTTVCPercentiles(arg) {
5
5
  const algo = 'canvas_heatmap';
@@ -12,7 +12,7 @@ async function calculateTTVCPercentiles(arg) {
12
12
  return vcDetails;
13
13
  }
14
14
  if (algo === 'old_heatmap') {
15
- const vcDetails = await caclUsingOldHeatmap(arg);
15
+ const vcDetails = await calcUsingOldHeatmap(arg);
16
16
  return vcDetails;
17
17
  }
18
18
  throw new Error('unexpected Error algo not chosen correctly');
@@ -100,7 +100,7 @@ export var VCObserver = /*#__PURE__*/function () {
100
100
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
101
101
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
102
102
  var _getConfig, _getConfig2;
103
- var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
103
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
104
104
  return _regeneratorRuntime.wrap(function _callee$(_context) {
105
105
  while (1) switch (_context.prev = _context.next) {
106
106
  case 0:
@@ -115,8 +115,37 @@ export var VCObserver = /*#__PURE__*/function () {
115
115
  return _context.abrupt("return", {});
116
116
  case 6:
117
117
  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, multiHeatmap = rawData.multiHeatmap;
118
+ isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01')); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
119
+ // we want to report abort by scroll events the same way as other abort reasons
120
+ // i.e. not have the concept of `abortReason.blocking` anymore
121
+ if (!(abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions'))) {
122
+ _context.next = 15;
123
+ break;
124
+ }
125
+ // exposing data to devtools
126
+ try {
127
+ if (devToolsEnabled && !_this.isPostInteraction) {
128
+ window.__vcNotAvailableReason = abortReasonInfo;
129
+ }
130
+ } catch (e) {}
131
+ 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"), [{
132
+ revision: 'fy25.02',
133
+ clean: false,
134
+ 'metric:vc90': null,
135
+ abortReason: abortReason.reason
136
+ }]);
137
+ if (!isTTVCv1Disabled) {
138
+ vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
139
+ revision: 'fy25.01',
140
+ clean: false,
141
+ 'metric:vc90': null,
142
+ abortReason: abortReason.reason
143
+ });
144
+ }
145
+ return _context.abrupt("return", vcAbortedResultWithRevisions);
146
+ case 15:
118
147
  if (!(abortReasonInfo !== null && abortReason.blocking)) {
119
- _context.next = 10;
148
+ _context.next = 18;
120
149
  break;
121
150
  }
122
151
  // exposing data to devtools
@@ -126,8 +155,7 @@ export var VCObserver = /*#__PURE__*/function () {
126
155
  }
127
156
  } catch (e) {}
128
157
  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));
129
- case 10:
130
- isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'));
158
+ case 18:
131
159
  ttvcV1Result = isTTVCv1Disabled ? {
132
160
  VC: {},
133
161
  VCBox: {},
@@ -279,16 +307,16 @@ export var VCObserver = /*#__PURE__*/function () {
279
307
  });
280
308
  speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
281
309
  if (!isTTVCv1Disabled) {
282
- _context.next = 25;
310
+ _context.next = 32;
283
311
  break;
284
312
  }
285
313
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
286
- case 25:
314
+ case 32:
287
315
  isTTVCv3Enabled = fg('platform_ufo_vc_observer_new') || ((_getConfig2 = getConfig()) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.vc) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.enabledVCRevisions) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.includes('fy25.03'));
288
316
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
289
317
  'metrics:vc': VC
290
318
  }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
291
- case 27:
319
+ case 34:
292
320
  case "end":
293
321
  return _context.stop();
294
322
  }
@@ -603,10 +631,12 @@ export var VCObserver = /*#__PURE__*/function () {
603
631
  }, {
604
632
  key: "detachAbortListeners",
605
633
  value: function detachAbortListeners() {
606
- this.unbind.forEach(function (fn) {
607
- return fn();
608
- });
609
- this.unbind = [];
634
+ if (Array.isArray(this.unbind)) {
635
+ this.unbind.forEach(function (fn) {
636
+ return fn();
637
+ });
638
+ this.unbind = [];
639
+ }
610
640
  }
611
641
  }, {
612
642
  key: "measureStart",
@@ -3,7 +3,6 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  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; }
5
5
  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
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
8
7
  import isNonVisualStyleMutation from './non-visual-styles/is-non-visual-style-mutation';
9
8
  import { SSRPlaceholderHandlers } from './ssr-placeholders';
@@ -53,22 +52,14 @@ export var Observers = /*#__PURE__*/function () {
53
52
  var oldValue = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
54
53
  var newValue = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
55
54
  (_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.observe(node);
56
- if (fg('platform_ufo_log_attr_mutation_values')) {
57
- _this.observedMutations.set(node, {
58
- mutation: mutation,
59
- ignoreReason: ignoreReason,
60
- type: type,
61
- attributeName: attributeName,
62
- oldValue: oldValue,
63
- newValue: newValue
64
- });
65
- } else {
66
- _this.observedMutations.set(node, {
67
- mutation: mutation,
68
- ignoreReason: ignoreReason,
69
- type: type
70
- });
71
- }
55
+ _this.observedMutations.set(node, {
56
+ mutation: mutation,
57
+ ignoreReason: ignoreReason,
58
+ type: type,
59
+ attributeName: attributeName,
60
+ oldValue: oldValue,
61
+ newValue: newValue
62
+ });
72
63
  });
73
64
  this.selectorConfig = _objectSpread(_objectSpread({}, this.selectorConfig), opts.selectorConfig);
74
65
  this.intersectionObserver = this.getIntersectionObserver();
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import calculateTTVCPercentiles from './percentile-calc';
6
7
  import getViewportHeight from './utils/get-viewport-height';
7
8
  import getViewportWidth from './utils/get-viewport-width';
@@ -17,7 +18,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
17
18
  var _this = this,
18
19
  _vcDetails$90$t,
19
20
  _vcDetails$;
20
- var startTime, stopTime, orderedEntries, filteredEntries, isVCClean, vcDetails;
21
+ var startTime, stopTime, orderedEntries, filteredEntries, _this$getVCCleanStatu, _isVCClean, dirtyReason, _isVCClean2, vcDetails;
21
22
  return _regeneratorRuntime.wrap(function _callee$(_context) {
22
23
  while (1) switch (_context.prev = _context.next) {
23
24
  case 0:
@@ -25,9 +26,28 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
25
26
  filteredEntries = orderedEntries.filter(function (entry) {
26
27
  return _this.isEntryIncluded(entry);
27
28
  });
28
- isVCClean = this.isVCClean(filteredEntries);
29
- if (isVCClean) {
30
- _context.next = 5;
29
+ if (!fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
30
+ _context.next = 8;
31
+ break;
32
+ }
33
+ _this$getVCCleanStatu = this.getVCCleanStatus(filteredEntries), _isVCClean = _this$getVCCleanStatu.isVCClean, dirtyReason = _this$getVCCleanStatu.dirtyReason;
34
+ if (_isVCClean) {
35
+ _context.next = 6;
36
+ break;
37
+ }
38
+ return _context.abrupt("return", {
39
+ revision: this.revisionNo,
40
+ 'metric:vc90': null,
41
+ clean: false,
42
+ abortReason: dirtyReason
43
+ });
44
+ case 6:
45
+ _context.next = 11;
46
+ break;
47
+ case 8:
48
+ _isVCClean2 = this.isVCClean(filteredEntries);
49
+ if (_isVCClean2) {
50
+ _context.next = 11;
31
51
  break;
32
52
  }
33
53
  return _context.abrupt("return", {
@@ -35,8 +55,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
35
55
  'metric:vc90': null,
36
56
  clean: false
37
57
  });
38
- case 5:
39
- _context.next = 7;
58
+ case 11:
59
+ _context.next = 13;
40
60
  return calculateTTVCPercentiles({
41
61
  viewport: {
42
62
  width: getViewportWidth(),
@@ -47,15 +67,15 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
47
67
  orderedEntries: filteredEntries,
48
68
  percentiles: [25, 50, 75, 80, 85, 90, 95, 98, 99]
49
69
  });
50
- case 7:
70
+ case 13:
51
71
  vcDetails = _context.sent;
52
72
  return _context.abrupt("return", {
53
73
  revision: this.revisionNo,
54
74
  vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
55
- clean: isVCClean,
75
+ clean: true,
56
76
  '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
57
77
  });
58
- case 9:
78
+ case 15:
59
79
  case "end":
60
80
  return _context.stop();
61
81
  }
@@ -54,6 +54,30 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
54
54
  });
55
55
  return !hasAbortEvent;
56
56
  }
57
+ }, {
58
+ key: "getVCCleanStatus",
59
+ value: function getVCCleanStatus(filteredEntries) {
60
+ var dirtyReason = '';
61
+ var hasAbortEvent = filteredEntries.some(function (entry) {
62
+ if (entry.type === 'window:event') {
63
+ var data = entry.data;
64
+ if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
65
+ dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
66
+ return true;
67
+ }
68
+ }
69
+ return false;
70
+ });
71
+ if (hasAbortEvent && dirtyReason) {
72
+ return {
73
+ isVCClean: false,
74
+ dirtyReason: dirtyReason
75
+ };
76
+ }
77
+ return {
78
+ isVCClean: true
79
+ };
80
+ }
57
81
  }]);
58
82
  }(AbstractVCCalculatorBase);
59
83
  export { VCCalculator_FY25_03 as default };
@@ -1,7 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import calcUsingCanvas from './canvas-heatmap';
4
- import caclUsingOldHeatmap from './heatmap';
4
+ import calcUsingOldHeatmap from './heatmap';
5
5
  import calcUsingRectSweepingLine from './rect-sweeping-line';
6
6
  function calculateTTVCPercentiles(_x) {
7
7
  return _calculateTTVCPercentiles.apply(this, arguments);
@@ -38,7 +38,7 @@ function _calculateTTVCPercentiles() {
38
38
  break;
39
39
  }
40
40
  _context.next = 14;
41
- return caclUsingOldHeatmap(arg);
41
+ return calcUsingOldHeatmap(arg);
42
42
  case 14:
43
43
  _vcDetails2 = _context.sent;
44
44
  return _context.abrupt("return", _vcDetails2);
@@ -5,7 +5,7 @@ export declare const AbortEvent: {
5
5
  readonly keydown: "keydown";
6
6
  readonly resize: "resize";
7
7
  };
8
- export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported';
8
+ export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported' | 'wheel';
9
9
  export type VCAbortReasonType = {
10
10
  reason: null | VCAbortReason;
11
11
  info: string;
@@ -115,6 +115,7 @@ export type RevisionPayloadEntry = {
115
115
  revision: string;
116
116
  clean: boolean;
117
117
  vcDetails?: RevisionPayloadVCDetails;
118
+ abortReason?: VCAbortReason | null;
118
119
  };
119
120
  export type RevisionPayload = RevisionPayloadEntry[];
120
121
  export {};
@@ -1,5 +1,5 @@
1
+ import { RevisionPayloadEntry } from '../../common/vc/types';
1
2
  import { type SelectorConfig } from './get-element-name';
2
- import type { RevisionPayloadEntry } from './metric-calculator/types';
3
3
  import type { VCObserverGetVCResultParam } from './types';
4
4
  export type VCObserverNewConfig = {
5
5
  selectorConfig?: SelectorConfig;
@@ -1,9 +1,14 @@
1
+ import { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
1
2
  import type { VCObserverEntry } from '../types';
2
- import type { RevisionPayloadEntry, VCCalculator, VCCalculatorParam } from './types';
3
+ import type { VCCalculator, VCCalculatorParam } from './types';
3
4
  export default abstract class AbstractVCCalculatorBase implements VCCalculator {
4
5
  private revisionNo;
5
6
  constructor(revisionNo: string);
6
7
  protected abstract isEntryIncluded(entry: VCObserverEntry): boolean;
7
8
  protected abstract isVCClean(filteredEntries: ReadonlyArray<VCObserverEntry>): boolean;
9
+ protected abstract getVCCleanStatus(filteredEntries: ReadonlyArray<VCObserverEntry>): {
10
+ isVCClean: boolean;
11
+ dirtyReason?: VCAbortReason;
12
+ };
8
13
  calculate({ startTime, stopTime, orderedEntries, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
9
14
  }
@@ -5,4 +5,11 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
5
5
  constructor();
6
6
  protected isEntryIncluded(entry: VCObserverEntry): boolean;
7
7
  protected isVCClean(filteredEntries: readonly VCObserverEntry[]): boolean;
8
+ protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
9
+ isVCClean: boolean;
10
+ dirtyReason: never;
11
+ } | {
12
+ isVCClean: boolean;
13
+ dirtyReason?: undefined;
14
+ };
8
15
  }
@@ -1,4 +1,4 @@
1
- import type { RevisionPayloadVCDetails } from '../../types';
1
+ import type { RevisionPayloadVCDetails } from '../../../../../common/vc/types';
2
2
  import type { CalcTTVCPercentilesArg } from '../types';
3
3
  declare function calculateTTVCPercentiles({ viewport, orderedEntries, percentiles, startTime, }: CalcTTVCPercentilesArg): Promise<RevisionPayloadVCDetails>;
4
4
  export default calculateTTVCPercentiles;
@@ -1,5 +1,5 @@
1
+ import type { RevisionPayloadVCDetails } from '../../../../../common/vc/types';
1
2
  import type { VCObserverEntry } from '../../../types';
2
- import type { RevisionPayloadVCDetails } from '../../types';
3
3
  import type { Viewport } from './types';
4
4
  declare function calculateTTVCPercentiles({ orderedEntries, viewport, percentiles, startTime, }: {
5
5
  orderedEntries: ReadonlyArray<VCObserverEntry>;
@@ -1,4 +1,4 @@
1
- import type { RevisionPayloadVCDetails } from '../types';
1
+ import type { RevisionPayloadVCDetails } from '../../../../common/vc/types';
2
2
  import type { CalcTTVCPercentilesArg } from './types';
3
3
  declare function calculateTTVCPercentiles(arg: CalcTTVCPercentilesArg): Promise<RevisionPayloadVCDetails | null>;
4
4
  export default calculateTTVCPercentiles;
@@ -1,17 +1,5 @@
1
+ import { RevisionPayloadEntry } from '../../../common/vc/types';
1
2
  import type { VCObserverEntry } from '../types';
2
- export type RevisionPayloadVCDetails = {
3
- [key: string]: {
4
- t: number;
5
- e: string[];
6
- };
7
- };
8
- export type RevisionPayloadEntry = {
9
- 'metric:vc90': number | null;
10
- revision: string;
11
- clean: boolean;
12
- vcDetails?: RevisionPayloadVCDetails;
13
- };
14
- export type RevisionPayload = RevisionPayloadEntry[];
15
3
  export type VCCalculatorParam = {
16
4
  startTime: DOMHighResTimeStamp;
17
5
  stopTime: DOMHighResTimeStamp;
@@ -5,7 +5,7 @@ export declare const AbortEvent: {
5
5
  readonly keydown: "keydown";
6
6
  readonly resize: "resize";
7
7
  };
8
- export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported';
8
+ export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported' | 'wheel';
9
9
  export type VCAbortReasonType = {
10
10
  reason: null | VCAbortReason;
11
11
  info: string;
@@ -115,6 +115,7 @@ export type RevisionPayloadEntry = {
115
115
  revision: string;
116
116
  clean: boolean;
117
117
  vcDetails?: RevisionPayloadVCDetails;
118
+ abortReason?: VCAbortReason | null;
118
119
  };
119
120
  export type RevisionPayload = RevisionPayloadEntry[];
120
121
  export {};
@@ -1,5 +1,5 @@
1
+ import { RevisionPayloadEntry } from '../../common/vc/types';
1
2
  import { type SelectorConfig } from './get-element-name';
2
- import type { RevisionPayloadEntry } from './metric-calculator/types';
3
3
  import type { VCObserverGetVCResultParam } from './types';
4
4
  export type VCObserverNewConfig = {
5
5
  selectorConfig?: SelectorConfig;
@@ -1,9 +1,14 @@
1
+ import { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
1
2
  import type { VCObserverEntry } from '../types';
2
- import type { RevisionPayloadEntry, VCCalculator, VCCalculatorParam } from './types';
3
+ import type { VCCalculator, VCCalculatorParam } from './types';
3
4
  export default abstract class AbstractVCCalculatorBase implements VCCalculator {
4
5
  private revisionNo;
5
6
  constructor(revisionNo: string);
6
7
  protected abstract isEntryIncluded(entry: VCObserverEntry): boolean;
7
8
  protected abstract isVCClean(filteredEntries: ReadonlyArray<VCObserverEntry>): boolean;
9
+ protected abstract getVCCleanStatus(filteredEntries: ReadonlyArray<VCObserverEntry>): {
10
+ isVCClean: boolean;
11
+ dirtyReason?: VCAbortReason;
12
+ };
8
13
  calculate({ startTime, stopTime, orderedEntries, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
9
14
  }
@@ -5,4 +5,11 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
5
5
  constructor();
6
6
  protected isEntryIncluded(entry: VCObserverEntry): boolean;
7
7
  protected isVCClean(filteredEntries: readonly VCObserverEntry[]): boolean;
8
+ protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
9
+ isVCClean: boolean;
10
+ dirtyReason: never;
11
+ } | {
12
+ isVCClean: boolean;
13
+ dirtyReason?: undefined;
14
+ };
8
15
  }
@@ -1,4 +1,4 @@
1
- import type { RevisionPayloadVCDetails } from '../../types';
1
+ import type { RevisionPayloadVCDetails } from '../../../../../common/vc/types';
2
2
  import type { CalcTTVCPercentilesArg } from '../types';
3
3
  declare function calculateTTVCPercentiles({ viewport, orderedEntries, percentiles, startTime, }: CalcTTVCPercentilesArg): Promise<RevisionPayloadVCDetails>;
4
4
  export default calculateTTVCPercentiles;
@@ -1,5 +1,5 @@
1
+ import type { RevisionPayloadVCDetails } from '../../../../../common/vc/types';
1
2
  import type { VCObserverEntry } from '../../../types';
2
- import type { RevisionPayloadVCDetails } from '../../types';
3
3
  import type { Viewport } from './types';
4
4
  declare function calculateTTVCPercentiles({ orderedEntries, viewport, percentiles, startTime, }: {
5
5
  orderedEntries: ReadonlyArray<VCObserverEntry>;
@@ -1,4 +1,4 @@
1
- import type { RevisionPayloadVCDetails } from '../types';
1
+ import type { RevisionPayloadVCDetails } from '../../../../common/vc/types';
2
2
  import type { CalcTTVCPercentilesArg } from './types';
3
3
  declare function calculateTTVCPercentiles(arg: CalcTTVCPercentilesArg): Promise<RevisionPayloadVCDetails | null>;
4
4
  export default calculateTTVCPercentiles;
@@ -1,17 +1,5 @@
1
+ import { RevisionPayloadEntry } from '../../../common/vc/types';
1
2
  import type { VCObserverEntry } from '../types';
2
- export type RevisionPayloadVCDetails = {
3
- [key: string]: {
4
- t: number;
5
- e: string[];
6
- };
7
- };
8
- export type RevisionPayloadEntry = {
9
- 'metric:vc90': number | null;
10
- revision: string;
11
- clean: boolean;
12
- vcDetails?: RevisionPayloadVCDetails;
13
- };
14
- export type RevisionPayload = RevisionPayloadEntry[];
15
3
  export type VCCalculatorParam = {
16
4
  startTime: DOMHighResTimeStamp;
17
5
  stopTime: DOMHighResTimeStamp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.9.4",
3
+ "version": "3.10.0",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -136,6 +136,9 @@
136
136
  "platform_ufo_vc_observer_new": {
137
137
  "type": "boolean"
138
138
  },
139
+ "platform_ufo_add_vc_abort_reason_by_revisions": {
140
+ "type": "boolean"
141
+ },
139
142
  "enable_ufo_devtools_api_for_extra_events": {
140
143
  "type": "boolean"
141
144
  },
@@ -154,9 +157,6 @@
154
157
  "platform_ufo_assets_check_for_nan": {
155
158
  "type": "boolean"
156
159
  },
157
- "platform_ufo_log_attr_mutation_values": {
158
- "type": "boolean"
159
- },
160
160
  "platform_ufo_enable_events_observer": {
161
161
  "type": "boolean"
162
162
  }