@atlaskit/react-ufo 3.4.9 → 3.4.11

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 (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/create-payload/utils/get-vc-metrics.js +24 -6
  3. package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +81 -0
  4. package/dist/cjs/vc/vc-observer/index.js +119 -117
  5. package/dist/cjs/vc/vc-observer/observers/index.js +19 -7
  6. package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +9 -18
  7. package/dist/cjs/vc/vc-observer/revisions/revisions.js +13 -12
  8. package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
  9. package/dist/es2019/create-payload/utils/get-vc-metrics.js +23 -10
  10. package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +76 -0
  11. package/dist/es2019/vc/vc-observer/index.js +96 -93
  12. package/dist/es2019/vc/vc-observer/observers/index.js +19 -7
  13. package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +7 -16
  14. package/dist/es2019/vc/vc-observer/revisions/revisions.js +13 -14
  15. package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
  16. package/dist/esm/create-payload/utils/get-vc-metrics.js +24 -6
  17. package/dist/esm/vc/vc-observer/getVCRevisionsData.js +74 -0
  18. package/dist/esm/vc/vc-observer/index.js +119 -117
  19. package/dist/esm/vc/vc-observer/observers/index.js +19 -7
  20. package/dist/esm/vc/vc-observer/revisions/fy25_02.js +9 -18
  21. package/dist/esm/vc/vc-observer/revisions/revisions.js +13 -12
  22. package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
  23. package/dist/types/config/index.d.ts +1 -0
  24. package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +35 -0
  25. package/dist/types-ts4.5/config/index.d.ts +1 -0
  26. package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +35 -0
  27. package/package.json +10 -10
@@ -16,7 +16,7 @@ export default function getVCMetrics(_x) {
16
16
  function _getVCMetrics() {
17
17
  _getVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
18
18
  var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
19
- var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, VC;
19
+ var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, ttvcV2Revision, VC;
20
20
  return _regeneratorRuntime.wrap(function _callee$(_context) {
21
21
  while (1) switch (_context.prev = _context.next) {
22
22
  case 0:
@@ -63,23 +63,41 @@ function _getVCMetrics() {
63
63
  getVCObserver().stop();
64
64
  }
65
65
  postInteractionLog.setLastInteractionFinishVCResult(result);
66
+ if (!fg('platform_ufo_disable_ttvc_v1')) {
67
+ _context.next = 26;
68
+ break;
69
+ }
70
+ ttvcV2Revision = (result === null || result === void 0 ? void 0 : result['ufo:vc:rev']).find(function (_ref) {
71
+ var revision = _ref.revision;
72
+ return revision === 'fy25.02';
73
+ });
74
+ if (ttvcV2Revision !== null && ttvcV2Revision !== void 0 && ttvcV2Revision.clean) {
75
+ _context.next = 23;
76
+ break;
77
+ }
78
+ return _context.abrupt("return", result);
79
+ case 23:
80
+ return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
81
+ 'metric:vc90': ttvcV2Revision['metric:vc90']
82
+ }));
83
+ case 26:
66
84
  VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
67
85
  if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
68
- _context.next = 22;
86
+ _context.next = 29;
69
87
  break;
70
88
  }
71
89
  return _context.abrupt("return", result);
72
- case 22:
90
+ case 29:
73
91
  if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
74
- _context.next = 24;
92
+ _context.next = 31;
75
93
  break;
76
94
  }
77
95
  return _context.abrupt("return", result);
78
- case 24:
96
+ case 31:
79
97
  return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
80
98
  'metric:vc90': VC['90']
81
99
  }));
82
- case 25:
100
+ case 32:
83
101
  case "end":
84
102
  return _context.stop();
85
103
  }
@@ -0,0 +1,74 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { getPageVisibilityState } from '../../hidden-timing';
4
+ import { getRevisions } from './revisions/revisions';
5
+ var VCParts = ['25', '50', '75', '80', '85', '90', '95', '98', '99'];
6
+ export function getVCRevisionsData(_ref) {
7
+ var fullPrefix = _ref.fullPrefix,
8
+ interaction = _ref.interaction,
9
+ isVCClean = _ref.isVCClean,
10
+ isEventAborted = _ref.isEventAborted,
11
+ multiHeatmap = _ref.multiHeatmap,
12
+ ssr = _ref.ssr,
13
+ calculatedVC = _ref.calculatedVC,
14
+ calculatedVCNext = _ref.calculatedVCNext;
15
+ var isMultiHeatmapEnabled = !fg('platform_ufo_multiheatmap_killswitch');
16
+ if (!isMultiHeatmapEnabled) {
17
+ return null;
18
+ }
19
+ if (!fg('platform_ufo_vc_observer_new')) {
20
+ if (!multiHeatmap) {
21
+ return null;
22
+ }
23
+ return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap === null || multiHeatmap === void 0 ? void 0 : multiHeatmap.getPayloadShapedData({
24
+ VCParts: VCParts.map(function (v) {
25
+ return parseInt(v);
26
+ }),
27
+ VCCalculationMethods: getRevisions().map(function (_ref2) {
28
+ var classifier = _ref2.classifier;
29
+ return classifier.VCCalculationMethod;
30
+ }),
31
+ filterComponentsLog: getRevisions().map(function (_ref3) {
32
+ var classifier = _ref3.classifier;
33
+ return classifier.filterComponentsLog;
34
+ }),
35
+ isEventAborted: isEventAborted,
36
+ interactionStart: interaction.start,
37
+ ttai: interaction.end,
38
+ ssr: ssr,
39
+ clean: isVCClean
40
+ }));
41
+ }
42
+ var pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
43
+ var isVisiblePageVisibleUpToTTAI = pageVisibilityUpToTTAI === 'visible';
44
+ var shouldHaveVCmetric = isVCClean && !isEventAborted && isVisiblePageVisibleUpToTTAI;
45
+ var ttvcV1Revision = {
46
+ revision: 'fy25.01',
47
+ clean: isVCClean,
48
+ 'metric:vc90': shouldHaveVCmetric ? calculatedVC.VC['90'] : null,
49
+ vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(function (key) {
50
+ var _calculatedVC$VCBox$k;
51
+ return [key, {
52
+ t: calculatedVC.VC[key],
53
+ e: (_calculatedVC$VCBox$k = calculatedVC.VCBox[key]) !== null && _calculatedVC$VCBox$k !== void 0 ? _calculatedVC$VCBox$k : []
54
+ }];
55
+ })) : {}
56
+ };
57
+ var ttvcV2ReportedMetric = fg('platform_ufo_fix_v2_reported_vc90') ? calculatedVCNext.VC['90'] : calculatedVC.VC['90'];
58
+ var ttvcV2Revision = {
59
+ revision: 'fy25.02',
60
+ clean: isVCClean,
61
+ 'metric:vc90': shouldHaveVCmetric ? ttvcV2ReportedMetric : null,
62
+ vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(function (key) {
63
+ var _calculatedVCNext$VCB;
64
+ return [key, {
65
+ t: calculatedVCNext.VC[key],
66
+ e: (_calculatedVCNext$VCB = calculatedVCNext.VCBox[key]) !== null && _calculatedVCNext$VCB !== void 0 ? _calculatedVCNext$VCB : []
67
+ }];
68
+ })) : {}
69
+ };
70
+ if (fg('platform_ufo_disable_ttvc_v1')) {
71
+ return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [ttvcV2Revision]);
72
+ }
73
+ return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [ttvcV1Revision, ttvcV2Revision]);
74
+ }
@@ -10,8 +10,8 @@ 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
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
- import { getPageVisibilityState } from '../../hidden-timing';
14
13
  import { attachAbortListeners } from './attachAbortListeners';
14
+ import { getVCRevisionsData } from './getVCRevisionsData';
15
15
  import { getViewportHeight, getViewportWidth } from './getViewport';
16
16
  import { MultiRevisionHeatmap } from './heatmap/heatmap';
17
17
  import { Observers } from './observers';
@@ -97,7 +97,7 @@ export var VCObserver = /*#__PURE__*/function () {
97
97
  });
98
98
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
99
99
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
100
- var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, _VCObserver$calculate, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, isVCClean, isMultiHeatmapEnabled, pageVisibilityUpToTTAI, isVisiblePageVisibleUpToTTAI, shouldHaveVCmetric, revisionsData, isCalcSpeedIndexEnabled, speedIndex;
100
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, isCalcSpeedIndexEnabled, speedIndex;
101
101
  return _regeneratorRuntime.wrap(function _callee$(_context) {
102
102
  while (1) switch (_context.prev = _context.next) {
103
103
  case 0:
@@ -124,41 +124,33 @@ export var VCObserver = /*#__PURE__*/function () {
124
124
  } catch (e) {}
125
125
  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));
126
126
  case 10:
127
- _VCObserver$calculate = VCObserver.calculateVC({
127
+ isTTVCv1Disabled = fg('platform_ufo_disable_ttvc_v1');
128
+ ttvcV1Result = isTTVCv1Disabled ? {
129
+ VC: {},
130
+ VCBox: {},
131
+ VCEntries: {
132
+ abs: [],
133
+ rel: [],
134
+ speedIndex: -1
135
+ },
136
+ totalPainted: -1
137
+ } : VCObserver.calculateVC({
128
138
  heatmap: heatmap,
129
139
  ssr: ssr,
130
140
  componentsLog: _objectSpread({}, componentsLog),
131
141
  viewport: viewport
132
- }), VC = _VCObserver$calculate.VC, VCBox = _VCObserver$calculate.VCBox, VCEntries = _VCObserver$calculate.VCEntries, totalPainted = _VCObserver$calculate.totalPainted;
133
- try {
134
- if (!_this.isPostInteraction) {
135
- VCObserver.VCParts.forEach(function (key) {
136
- var duration = VC[key];
137
- if (duration !== null && duration !== undefined) {
138
- performance.measure("VC".concat(key), {
139
- start: start,
140
- duration: duration
141
- });
142
- }
143
- });
142
+ });
143
+ VC = ttvcV1Result.VC, VCBox = ttvcV1Result.VCBox, VCEntries = ttvcV1Result.VCEntries, totalPainted = ttvcV1Result.totalPainted;
144
+ _componentsLog = {};
145
+ Object.entries(_this.componentsLog).forEach(function (_ref6) {
146
+ var _ref7 = _slicedToArray(_ref6, 2),
147
+ _timestamp = _ref7[0],
148
+ value = _ref7[1];
149
+ var timestamp = Number(_timestamp);
150
+ if (stop > timestamp) {
151
+ _componentsLog[timestamp] = value;
144
152
  }
145
- } catch (e) {
146
- /* empty */
147
- }
148
- _componentsLog = {}; // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
149
- if (fg('ufo-remove-vc-component-observations-after-ttai')) {
150
- Object.entries(_this.componentsLog).forEach(function (_ref6) {
151
- var _ref7 = _slicedToArray(_ref6, 2),
152
- _timestamp = _ref7[0],
153
- value = _ref7[1];
154
- var timestamp = Number(_timestamp);
155
- if (stop > timestamp) {
156
- _componentsLog[timestamp] = value;
157
- }
158
- });
159
- } else {
160
- _componentsLog = _objectSpread({}, componentsLog);
161
- }
153
+ });
162
154
  vcNext = VCObserver.calculateVC({
163
155
  heatmap: heatmapNext,
164
156
  ssr: ssr,
@@ -168,12 +160,33 @@ export var VCObserver = /*#__PURE__*/function () {
168
160
  try {
169
161
  if (!_this.isPostInteraction) {
170
162
  VCObserver.VCParts.forEach(function (key) {
171
- var duration = vcNext.VC[key];
172
- if (duration !== null && duration !== undefined) {
173
- performance.measure("VC_Next".concat(key), {
174
- start: start,
175
- duration: duration
176
- });
163
+ if (isTTVCv1Disabled) {
164
+ var duration = vcNext.VC[key];
165
+ if (duration !== null && duration !== undefined) {
166
+ performance.measure("VC".concat(key), {
167
+ start: start,
168
+ duration: duration
169
+ });
170
+ performance.measure("VC_Next".concat(key), {
171
+ start: start,
172
+ duration: duration
173
+ });
174
+ }
175
+ } else {
176
+ var ttvcV1duration = VC[key];
177
+ if (ttvcV1duration !== null && ttvcV1duration !== undefined) {
178
+ performance.measure("VC".concat(key), {
179
+ start: start,
180
+ duration: ttvcV1duration
181
+ });
182
+ }
183
+ var ttvcV2duration = vcNext.VC[key];
184
+ if (ttvcV2duration !== null && ttvcV2duration !== undefined) {
185
+ performance.measure("VC_Next".concat(key), {
186
+ start: start,
187
+ duration: ttvcV2duration
188
+ });
189
+ }
177
190
  }
178
191
  });
179
192
  }
@@ -184,7 +197,7 @@ export var VCObserver = /*#__PURE__*/function () {
184
197
  stopTime = performance.now(); // exposing data to devtools
185
198
  try {
186
199
  if (!_this.isPostInteraction && devToolsEnabled) {
187
- window.__vc = {
200
+ ttvcV1DevToolInfo = isTTVCv1Disabled ? undefined : {
188
201
  entries: VCEntries.rel,
189
202
  log: componentsLog,
190
203
  metrics: {
@@ -203,7 +216,7 @@ export var VCObserver = /*#__PURE__*/function () {
203
216
  heatmap: heatmap,
204
217
  ratios: ratios
205
218
  };
206
- window.__vcNext = {
219
+ ttvcV2DevToolInfo = {
207
220
  entries: vcNext.VCEntries.rel,
208
221
  log: componentsLog,
209
222
  metrics: {
@@ -222,12 +235,19 @@ export var VCObserver = /*#__PURE__*/function () {
222
235
  heatmap: heatmapNext,
223
236
  ratios: ratios
224
237
  };
238
+ if (isTTVCv1Disabled) {
239
+ window.__vc = ttvcV2DevToolInfo;
240
+ window.__vcNext = ttvcV2DevToolInfo;
241
+ } else {
242
+ window.__vc = ttvcV1DevToolInfo;
243
+ window.__vcNext = ttvcV2DevToolInfo;
244
+ }
225
245
 
226
246
  // Emitting a custom event to make it available in the Chrome extension
227
247
  window.dispatchEvent(new CustomEvent('vcReady', {
228
248
  detail: {
229
249
  log: filterComponentsLog(componentsLog),
230
- entries: VCEntries.rel
250
+ entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
231
251
  }
232
252
  }));
233
253
  }
@@ -235,56 +255,37 @@ export var VCObserver = /*#__PURE__*/function () {
235
255
  /* do nothing */
236
256
  }
237
257
  isVCClean = !abortReasonInfo;
238
- isMultiHeatmapEnabled = !fg('platform_ufo_multiheatmap_killswitch');
239
- pageVisibilityUpToTTAI = getPageVisibilityState(start, stop);
240
- isVisiblePageVisibleUpToTTAI = pageVisibilityUpToTTAI === 'visible';
241
- shouldHaveVCmetric = isVCClean && !isEventAborted && isVisiblePageVisibleUpToTTAI;
242
- revisionsData = isMultiHeatmapEnabled ? fg('platform_ufo_vc_observer_new') ? _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [{
243
- revision: 'fy25.01',
244
- clean: isVCClean,
245
- 'metric:vc90': shouldHaveVCmetric ? VC['90'] : null,
246
- vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCObserver.VCParts.map(function (key) {
247
- var _VCBox$key;
248
- return [key, {
249
- t: VC[key],
250
- e: (_VCBox$key = VCBox[key]) !== null && _VCBox$key !== void 0 ? _VCBox$key : []
251
- }];
252
- })) : []
253
- }, {
254
- revision: 'fy25.02',
255
- clean: isVCClean,
256
- 'metric:vc90': shouldHaveVCmetric ? VC['90'] : null,
257
- vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCObserver.VCParts.map(function (key) {
258
- var _vcNext$VCBox$key;
259
- return [key, {
260
- t: vcNext.VC[key],
261
- e: (_vcNext$VCBox$key = vcNext.VCBox[key]) !== null && _vcNext$VCBox$key !== void 0 ? _vcNext$VCBox$key : []
262
- }];
263
- })) : []
264
- }]) : multiHeatmap !== null ? _defineProperty({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap === null || multiHeatmap === void 0 ? void 0 : multiHeatmap.getPayloadShapedData({
265
- VCParts: VCObserver.VCParts.map(function (v) {
266
- return parseInt(v);
267
- }),
268
- VCCalculationMethods: getRevisions().map(function (_ref10) {
269
- var classifier = _ref10.classifier;
270
- return classifier.VCCalculationMethod;
271
- }),
272
- filterComponentsLog: getRevisions().map(function (_ref11) {
273
- var classifier = _ref11.classifier;
274
- return classifier.filterComponentsLog;
275
- }),
276
- isEventAborted: isEventAborted,
277
- interactionStart: start,
278
- ttai: stop,
258
+ revisionsData = getVCRevisionsData({
259
+ fullPrefix: fullPrefix,
260
+ interaction: {
261
+ start: start,
262
+ end: stop
263
+ },
264
+ isVCClean: isVCClean,
265
+ multiHeatmap: multiHeatmap,
279
266
  ssr: ssr,
280
- clean: isVCClean
281
- })) : null : null; // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
267
+ calculatedVC: {
268
+ VC: VC,
269
+ VCBox: VCBox
270
+ },
271
+ calculatedVCNext: {
272
+ VC: vcNext.VC,
273
+ VCBox: vcNext.VCBox
274
+ },
275
+ isEventAborted: isEventAborted
276
+ }); // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
282
277
  isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
283
- speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
278
+ speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
279
+ if (!isTTVCv1Disabled) {
280
+ _context.next = 26;
281
+ break;
282
+ }
283
+ return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
284
+ case 26:
284
285
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
285
286
  'metrics:vc': VC
286
287
  }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), 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"), vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
287
- case 28:
288
+ case 27:
288
289
  case "end":
289
290
  return _context.stop();
290
291
  }
@@ -317,7 +318,8 @@ export var VCObserver = /*#__PURE__*/function () {
317
318
  if (!ignoreReason) {
318
319
  _this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
319
320
  }
320
- if ((!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
321
+ var isTTVCv1Disabled = fg('platform_ufo_disable_ttvc_v1');
322
+ if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
321
323
  _this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
322
324
  }
323
325
  if (!_this.componentsLog[time]) {
@@ -331,13 +333,13 @@ export var VCObserver = /*#__PURE__*/function () {
331
333
  });
332
334
  }
333
335
  });
334
- _defineProperty(this, "onViewportChangeDetected", function (_ref13) {
335
- var element = _ref13.element,
336
- type = _ref13.type,
337
- ignoreReason = _ref13.ignoreReason,
338
- timestamp = _ref13.timestamp,
339
- targetName = _ref13.targetName,
340
- intersectionRect = _ref13.intersectionRect;
336
+ _defineProperty(this, "onViewportChangeDetected", function (_ref9) {
337
+ var element = _ref9.element,
338
+ type = _ref9.type,
339
+ ignoreReason = _ref9.ignoreReason,
340
+ timestamp = _ref9.timestamp,
341
+ targetName = _ref9.targetName,
342
+ intersectionRect = _ref9.intersectionRect;
341
343
  if (_this.multiHeatmap === null) {
342
344
  return;
343
345
  }
@@ -419,10 +421,10 @@ export var VCObserver = /*#__PURE__*/function () {
419
421
  var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
420
422
  if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
421
423
  var _window2;
422
- Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref14) {
423
- var _ref15 = _slicedToArray(_ref14, 2),
424
- key = _ref15[0],
425
- time = _ref15[1];
424
+ Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref10) {
425
+ var _ref11 = _slicedToArray(_ref10, 2),
426
+ key = _ref11[0],
427
+ time = _ref11[1];
426
428
  if (time) {
427
429
  _this.abortReasonCallback(key, time);
428
430
  }
@@ -444,7 +446,7 @@ export var VCObserver = /*#__PURE__*/function () {
444
446
  dataVC: true
445
447
  }
446
448
  });
447
- this.heatmap = this.getCleanHeatmap();
449
+ this.heatmap = fg('platform_ufo_disable_ttvc_v1') ? [] : this.getCleanHeatmap();
448
450
  this.heatmapNext = this.getCleanHeatmap();
449
451
  this.multiHeatmap = new MultiRevisionHeatmap({
450
452
  viewport: this.viewport,
@@ -455,8 +457,8 @@ export var VCObserver = /*#__PURE__*/function () {
455
457
  }
456
458
  return _createClass(VCObserver, [{
457
459
  key: "start",
458
- value: function start(_ref16) {
459
- var startTime = _ref16.startTime;
460
+ value: function start(_ref12) {
461
+ var startTime = _ref12.startTime;
460
462
  this.active = true;
461
463
  if (this.observers.isBrowserSupported()) {
462
464
  this.setViewportSize();
@@ -478,12 +480,12 @@ export var VCObserver = /*#__PURE__*/function () {
478
480
  }, {
479
481
  key: "getIgnoredElements",
480
482
  value: function getIgnoredElements(componentsLog) {
481
- return Object.values(componentsLog).flat().filter(function (_ref17) {
482
- var ignoreReason = _ref17.ignoreReason;
483
+ return Object.values(componentsLog).flat().filter(function (_ref13) {
484
+ var ignoreReason = _ref13.ignoreReason;
483
485
  return Boolean(ignoreReason);
484
- }).map(function (_ref18) {
485
- var targetName = _ref18.targetName,
486
- ignoreReason = _ref18.ignoreReason;
486
+ }).map(function (_ref14) {
487
+ var targetName = _ref14.targetName,
488
+ ignoreReason = _ref14.ignoreReason;
487
489
  return {
488
490
  targetName: targetName,
489
491
  ignoreReason: ignoreReason
@@ -531,7 +533,7 @@ export var VCObserver = /*#__PURE__*/function () {
531
533
  blocking: false
532
534
  };
533
535
  this.detachAbortListeners();
534
- this.heatmap = this.getCleanHeatmap();
536
+ this.heatmap = fg('platform_ufo_disable_ttvc_v1') ? [] : this.getCleanHeatmap();
535
537
  this.heatmapNext = this.getCleanHeatmap();
536
538
  this.multiHeatmap = new MultiRevisionHeatmap({
537
539
  viewport: this.viewport,
@@ -603,12 +605,12 @@ export var VCObserver = /*#__PURE__*/function () {
603
605
  }
604
606
  }], [{
605
607
  key: "calculateVC",
606
- value: function calculateVC(_ref19) {
607
- var heatmap = _ref19.heatmap,
608
- _ref19$ssr = _ref19.ssr,
609
- ssr = _ref19$ssr === void 0 ? UNUSED_SECTOR : _ref19$ssr,
610
- componentsLog = _ref19.componentsLog,
611
- viewport = _ref19.viewport;
608
+ value: function calculateVC(_ref15) {
609
+ var heatmap = _ref15.heatmap,
610
+ _ref15$ssr = _ref15.ssr,
611
+ ssr = _ref15$ssr === void 0 ? UNUSED_SECTOR : _ref15$ssr,
612
+ componentsLog = _ref15.componentsLog,
613
+ viewport = _ref15.viewport;
612
614
  var lastUpdate = {};
613
615
  var totalPainted = 0;
614
616
  if (ssr !== UNUSED_SECTOR) {
@@ -677,11 +679,11 @@ export var VCObserver = /*#__PURE__*/function () {
677
679
  });
678
680
  return VCRatio;
679
681
  }, 0);
680
- var VCEntries = entries.reduce(function (acc, _ref20, i) {
682
+ var VCEntries = entries.reduce(function (acc, _ref16, i) {
681
683
  var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
682
- var _ref21 = _slicedToArray(_ref20, 2),
683
- timestamp = _ref21[0],
684
- entryPainted = _ref21[1];
684
+ var _ref17 = _slicedToArray(_ref16, 2),
685
+ timestamp = _ref17[0],
686
+ entryPainted = _ref17[1];
685
687
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
686
688
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
687
689
  var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
@@ -87,7 +87,7 @@ export var Observers = /*#__PURE__*/function () {
87
87
  renderStop: -1
88
88
  };
89
89
  (_this$mutationObserve = this.mutationObserver) === null || _this$mutationObserve === void 0 || _this$mutationObserve.observe(document.body, {
90
- attributeFilter: fg('platform-ufo-vc-observe-attributes') ? ['hidden', 'style', 'src', 'class'] : ['hidden', 'style', 'src'],
90
+ attributeFilter: ['hidden', 'style', 'src', 'class'],
91
91
  attributeOldValue: true,
92
92
  attributes: true,
93
93
  childList: true,
@@ -204,13 +204,27 @@ export var Observers = /*#__PURE__*/function () {
204
204
  });
205
205
  } else if (mutation.type === 'attributes') {
206
206
  if (mutation.target instanceof HTMLElement) {
207
- if (fg('platform-ufo-vc-observe-attributes')) {
207
+ if (fg('platform_ufo_vc_ignore_same_value_mutation')) {
208
+ var _mutation$oldValue;
209
+ /*
210
+ "MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
211
+ I think it might have been something along the lines that for consistency every setAttribute call should create a record.
212
+ Conceptually there is after all a mutation: there is an old value replaced with a new one,
213
+ and whether or not they are the same doesn't really matter.
214
+ And Custom elements should work the same way as MutationObserver."
215
+ https://github.com/whatwg/dom/issues/520#issuecomment-336574796
216
+ */
217
+ var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
218
+ var newValue = mutation.attributeName ? mutation.target.getAttribute(mutation.attributeName) : undefined;
219
+ if (oldValue !== newValue) {
220
+ _this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
221
+ }
222
+ } else {
208
223
  _this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
209
224
  }
210
225
  }
211
226
  }
212
227
  });
213
- _this2.measureStop();
214
228
  }) : null;
215
229
  }
216
230
  }, {
@@ -260,10 +274,8 @@ export var Observers = /*#__PURE__*/function () {
260
274
  // ignore intersection report without recent mutation
261
275
  return;
262
276
  }
263
- if (fg('platform-ufo-invisible-element-vc-calculations')) {
264
- if (!isElementVisible(target)) {
265
- data.ignoreReason = 'not-visible';
266
- }
277
+ if (!isElementVisible(target)) {
278
+ data.ignoreReason = 'not-visible';
267
279
  }
268
280
  if (fg('platform_editor_ed-25937_ignore_mutations_for_ttvc')) {
269
281
  if (isInsideEditorContainer(target)) {
@@ -5,11 +5,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- 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; }
9
- 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; }
10
8
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
10
  import { FY25_01Classifier } from './fy25_01';
14
11
  export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
15
12
  function FY25_02Classifier() {
@@ -39,21 +36,15 @@ export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
39
36
  var componentsLog = _ref2.componentsLog,
40
37
  ttai = _ref2.ttai;
41
38
  var _componentsLog = {};
42
-
43
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
44
- if (fg('ufo-remove-vc-component-observations-after-ttai')) {
45
- Object.entries(componentsLog).forEach(function (_ref3) {
46
- var _ref4 = _slicedToArray(_ref3, 2),
47
- _timestamp = _ref4[0],
48
- value = _ref4[1];
49
- var timestamp = Number(_timestamp);
50
- if (ttai > timestamp) {
51
- _componentsLog[timestamp] = value;
52
- }
53
- });
54
- } else {
55
- _componentsLog = _objectSpread({}, componentsLog);
56
- }
39
+ Object.entries(componentsLog).forEach(function (_ref3) {
40
+ var _ref4 = _slicedToArray(_ref3, 2),
41
+ _timestamp = _ref4[0],
42
+ value = _ref4[1];
43
+ var timestamp = Number(_timestamp);
44
+ if (Math.ceil(ttai) >= timestamp) {
45
+ _componentsLog[timestamp] = value;
46
+ }
47
+ });
57
48
  return _componentsLog;
58
49
  }
59
50
  }]);
@@ -1,17 +1,18 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import { revFY25_01Classifier } from './fy25_01';
2
3
  import { revFY25_02Classifier } from './fy25_02';
3
- var Revisions = [{
4
- name: 'fy25.01',
5
- classifier: revFY25_01Classifier
6
- }, {
7
- name: 'fy25.02',
8
- classifier: revFY25_02Classifier
9
- }];
10
- var revisionResultCache = null;
11
4
  export var getRevisions = function getRevisions() {
12
- if (revisionResultCache !== null) {
13
- return revisionResultCache;
5
+ if (fg('platform_ufo_disable_ttvc_v1')) {
6
+ return [{
7
+ name: 'fy25.02',
8
+ classifier: revFY25_02Classifier
9
+ }];
14
10
  }
15
- revisionResultCache = [].concat(Revisions);
16
- return revisionResultCache;
11
+ return [{
12
+ name: 'fy25.01',
13
+ classifier: revFY25_01Classifier
14
+ }, {
15
+ name: 'fy25.02',
16
+ classifier: revFY25_02Classifier
17
+ }];
17
18
  };