@atlaskit/react-ufo 5.0.6 → 5.0.7

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,14 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 5.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d962c32704964`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d962c32704964) -
8
+ FG cleanup - platform_ufo_remove_ssr_placeholder_in_ttvc_v4
9
+ - [`6367a096e4f17`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6367a096e4f17) -
10
+ FG cleanup - platform_ufo_vcnext_for_ttvc_v5
11
+
3
12
  ## 5.0.6
4
13
 
5
14
  ### Patch Changes
@@ -22,12 +22,10 @@ var _fy25_ = _interopRequireDefault(require("./metric-calculator/fy25_03"));
22
22
  var _fy26_ = _interopRequireDefault(require("./metric-calculator/fy26_04"));
23
23
  var _getViewportHeight = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-height"));
24
24
  var _getViewportWidth = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-width"));
25
- var _vcNext2 = _interopRequireDefault(require("./metric-calculator/vc-next"));
25
+ var _vcNext = _interopRequireDefault(require("./metric-calculator/vc-next"));
26
26
  var _rawDataHandler = _interopRequireDefault(require("./raw-data-handler"));
27
27
  var _viewportObserver = _interopRequireDefault(require("./viewport-observer"));
28
28
  var _windowEventObserver = _interopRequireDefault(require("./window-event-observer"));
29
- 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; }
30
- 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; }
31
29
  var SSRState = {
32
30
  normal: 1,
33
31
  waitingForFirstRender: 2,
@@ -253,7 +251,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
253
251
  key: "getVCResult",
254
252
  value: function () {
255
253
  var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
256
- var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, calculator_next, vcNext, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
254
+ var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, calculator_next, calculatorParams, _yield$Promise$all, _yield$Promise$all2, fy26_04, vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
257
255
  return _regenerator.default.wrap(function _callee$(_context) {
258
256
  while (1) switch (_context.prev = _context.next) {
259
257
  case 0:
@@ -305,12 +303,8 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
305
303
  this.addSSR(param.ssr);
306
304
  }
307
305
  calculator_fy26_04 = new _fy26_.default();
308
- if (!(0, _config.isVCRevisionEnabled)('fy26.04')) {
309
- _context.next = 24;
310
- break;
311
- }
312
- _context.next = 21;
313
- return calculator_fy26_04.calculate({
306
+ calculator_next = new _vcNext.default();
307
+ calculatorParams = {
314
308
  orderedEntries: orderedEntries,
315
309
  startTime: start,
316
310
  stopTime: stop,
@@ -322,65 +316,24 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
322
316
  includeSSRRatio: includeSSRRatio,
323
317
  isPageVisible: isPageVisible,
324
318
  interactionAbortReason: interactionAbortReason
325
- });
326
- case 21:
327
- _context.t1 = _context.sent;
328
- _context.next = 25;
329
- break;
330
- case 24:
331
- _context.t1 = null;
332
- case 25:
333
- fy26_04 = _context.t1;
334
- if (!fy26_04) {
335
- _context.next = 43;
336
- break;
337
- }
338
- results.push(fy26_04);
339
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_vcnext_for_ttvc_v5')) {
340
- _context.next = 41;
341
- break;
342
- }
343
- calculator_next = new _vcNext2.default();
344
- if (!(0, _config.isVCRevisionEnabled)('next')) {
345
- _context.next = 36;
346
- break;
319
+ };
320
+ _context.next = 22;
321
+ return Promise.all([(0, _config.isVCRevisionEnabled)('fy26.04') ? calculator_fy26_04.calculate(calculatorParams) : null, (0, _config.isVCRevisionEnabled)('next') ? calculator_next.calculate(calculatorParams) : null]);
322
+ case 22:
323
+ _yield$Promise$all = _context.sent;
324
+ _yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2);
325
+ fy26_04 = _yield$Promise$all2[0];
326
+ vcNext = _yield$Promise$all2[1];
327
+ if (fy26_04) {
328
+ results.push(fy26_04);
347
329
  }
348
- _context.next = 33;
349
- return calculator_next.calculate({
350
- orderedEntries: orderedEntries,
351
- startTime: start,
352
- stopTime: stop,
353
- interactionId: interactionId,
354
- interactionType: interactionType,
355
- isPostInteraction: this.isPostInteraction,
356
- include3p: include3p,
357
- excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
358
- includeSSRRatio: includeSSRRatio,
359
- isPageVisible: isPageVisible,
360
- interactionAbortReason: interactionAbortReason
361
- });
362
- case 33:
363
- _context.t2 = _context.sent;
364
- _context.next = 37;
365
- break;
366
- case 36:
367
- _context.t2 = null;
368
- case 37:
369
- vcNext = _context.t2;
330
+ ;
370
331
  if (vcNext) {
371
332
  results.push(vcNext);
372
333
  }
373
- _context.next = 43;
374
- break;
375
- case 41:
376
- _vcNext = _objectSpread(_objectSpread({}, fy26_04), {}, {
377
- revision: 'next'
378
- });
379
- results.push(_vcNext);
380
- case 43:
381
334
  feVCCalculationEndTime = performance.now();
382
335
  if (!(includeRawData && (0, _platformFeatureFlags.fg)('platform_ufo_enable_vc_raw_data'))) {
383
- _context.next = 54;
336
+ _context.next = 40;
384
337
  break;
385
338
  }
386
339
  rawVCCalculationStartTime = performance.now();
@@ -390,14 +343,14 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
390
343
  start: start,
391
344
  stop: rawStopTime
392
345
  }) : orderedEntries;
393
- _context.next = 51;
346
+ _context.next = 37;
394
347
  return rawHandler.getRawData({
395
348
  entries: rawOrderedEntries,
396
349
  startTime: start,
397
350
  stopTime: rawStopTime,
398
351
  isPageVisible: isPageVisible
399
352
  });
400
- case 51:
353
+ case 37:
401
354
  raw = _context.sent;
402
355
  results.forEach(function (result) {
403
356
  delete result.vcDetails;
@@ -408,9 +361,9 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
408
361
  raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
409
362
  results.push(raw);
410
363
  }
411
- case 54:
364
+ case 40:
412
365
  return _context.abrupt("return", results);
413
- case 55:
366
+ case 41:
414
367
  case "end":
415
368
  return _context.stop();
416
369
  }
@@ -19,9 +19,6 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
19
19
  function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
20
20
  var getConsideredEntryTypes = function getConsideredEntryTypes() {
21
21
  var consideredEntryTypes = ['mutation:display-contents-children-element'];
22
- if ((0, _platformFeatureFlags.fg)('platform_ufo_remove_ssr_placeholder_in_ttvc_v4')) {
23
- consideredEntryTypes.push('mutation:ssr-placeholder');
24
- }
25
22
  consideredEntryTypes.push('mutation:display-contents-children-attribute');
26
23
  return consideredEntryTypes;
27
24
  };
@@ -252,7 +252,8 @@ export default class VCObserverNew {
252
252
  this.addSSR(param.ssr);
253
253
  }
254
254
  const calculator_fy26_04 = new VCCalculator_FY26_04();
255
- const fy26_04 = isVCRevisionEnabled('fy26.04') ? await calculator_fy26_04.calculate({
255
+ const calculator_next = new VCCalculator_Next();
256
+ const calculatorParams = {
256
257
  orderedEntries,
257
258
  startTime: start,
258
259
  stopTime: stop,
@@ -264,34 +265,14 @@ export default class VCObserverNew {
264
265
  includeSSRRatio,
265
266
  isPageVisible,
266
267
  interactionAbortReason
267
- }) : null;
268
+ };
269
+ const [fy26_04, vcNext] = await Promise.all([isVCRevisionEnabled('fy26.04') ? calculator_fy26_04.calculate(calculatorParams) : null, isVCRevisionEnabled('next') ? calculator_next.calculate(calculatorParams) : null]);
268
270
  if (fy26_04) {
269
271
  results.push(fy26_04);
270
- if (fg('platform_ufo_vcnext_for_ttvc_v5')) {
271
- const calculator_next = new VCCalculator_Next();
272
- const vcNext = isVCRevisionEnabled('next') ? await calculator_next.calculate({
273
- orderedEntries,
274
- startTime: start,
275
- stopTime: stop,
276
- interactionId,
277
- interactionType,
278
- isPostInteraction: this.isPostInteraction,
279
- include3p,
280
- excludeSmartAnswersInSearch,
281
- includeSSRRatio,
282
- isPageVisible,
283
- interactionAbortReason
284
- }) : null;
285
- if (vcNext) {
286
- results.push(vcNext);
287
- }
288
- } else {
289
- const vcNext = {
290
- ...fy26_04,
291
- revision: 'next'
292
- };
293
- results.push(vcNext);
294
- }
272
+ }
273
+ ;
274
+ if (vcNext) {
275
+ results.push(vcNext);
295
276
  }
296
277
  const feVCCalculationEndTime = performance.now();
297
278
  if (includeRawData && fg('platform_ufo_enable_vc_raw_data')) {
@@ -3,9 +3,6 @@ import VCCalculator_FY25_03 from '../fy25_03';
3
3
  import { KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS, NON_VISUAL_ARIA_ATTRIBUTES, THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES } from '../utils/constants';
4
4
  const getConsideredEntryTypes = () => {
5
5
  const consideredEntryTypes = ['mutation:display-contents-children-element'];
6
- if (fg('platform_ufo_remove_ssr_placeholder_in_ttvc_v4')) {
7
- consideredEntryTypes.push('mutation:ssr-placeholder');
8
- }
9
6
  consideredEntryTypes.push('mutation:display-contents-children-attribute');
10
7
  return consideredEntryTypes;
11
8
  };
@@ -5,8 +5,6 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
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
  import { fg } from '@atlaskit/platform-feature-flags';
11
9
  import { isVCRevisionEnabled } from '../../config';
12
10
  import { getActiveInteraction } from '../../interaction-metrics';
@@ -246,7 +244,7 @@ var VCObserverNew = /*#__PURE__*/function () {
246
244
  key: "getVCResult",
247
245
  value: function () {
248
246
  var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
249
- var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, calculator_next, vcNext, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
247
+ var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, calculator_next, calculatorParams, _yield$Promise$all, _yield$Promise$all2, fy26_04, vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
250
248
  return _regeneratorRuntime.wrap(function _callee$(_context) {
251
249
  while (1) switch (_context.prev = _context.next) {
252
250
  case 0:
@@ -298,48 +296,8 @@ var VCObserverNew = /*#__PURE__*/function () {
298
296
  this.addSSR(param.ssr);
299
297
  }
300
298
  calculator_fy26_04 = new VCCalculator_FY26_04();
301
- if (!isVCRevisionEnabled('fy26.04')) {
302
- _context.next = 24;
303
- break;
304
- }
305
- _context.next = 21;
306
- return calculator_fy26_04.calculate({
307
- orderedEntries: orderedEntries,
308
- startTime: start,
309
- stopTime: stop,
310
- interactionId: interactionId,
311
- interactionType: interactionType,
312
- isPostInteraction: this.isPostInteraction,
313
- include3p: include3p,
314
- excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
315
- includeSSRRatio: includeSSRRatio,
316
- isPageVisible: isPageVisible,
317
- interactionAbortReason: interactionAbortReason
318
- });
319
- case 21:
320
- _context.t1 = _context.sent;
321
- _context.next = 25;
322
- break;
323
- case 24:
324
- _context.t1 = null;
325
- case 25:
326
- fy26_04 = _context.t1;
327
- if (!fy26_04) {
328
- _context.next = 43;
329
- break;
330
- }
331
- results.push(fy26_04);
332
- if (!fg('platform_ufo_vcnext_for_ttvc_v5')) {
333
- _context.next = 41;
334
- break;
335
- }
336
299
  calculator_next = new VCCalculator_Next();
337
- if (!isVCRevisionEnabled('next')) {
338
- _context.next = 36;
339
- break;
340
- }
341
- _context.next = 33;
342
- return calculator_next.calculate({
300
+ calculatorParams = {
343
301
  orderedEntries: orderedEntries,
344
302
  startTime: start,
345
303
  stopTime: stop,
@@ -351,29 +309,24 @@ var VCObserverNew = /*#__PURE__*/function () {
351
309
  includeSSRRatio: includeSSRRatio,
352
310
  isPageVisible: isPageVisible,
353
311
  interactionAbortReason: interactionAbortReason
354
- });
355
- case 33:
356
- _context.t2 = _context.sent;
357
- _context.next = 37;
358
- break;
359
- case 36:
360
- _context.t2 = null;
361
- case 37:
362
- vcNext = _context.t2;
312
+ };
313
+ _context.next = 22;
314
+ return Promise.all([isVCRevisionEnabled('fy26.04') ? calculator_fy26_04.calculate(calculatorParams) : null, isVCRevisionEnabled('next') ? calculator_next.calculate(calculatorParams) : null]);
315
+ case 22:
316
+ _yield$Promise$all = _context.sent;
317
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
318
+ fy26_04 = _yield$Promise$all2[0];
319
+ vcNext = _yield$Promise$all2[1];
320
+ if (fy26_04) {
321
+ results.push(fy26_04);
322
+ }
323
+ ;
363
324
  if (vcNext) {
364
325
  results.push(vcNext);
365
326
  }
366
- _context.next = 43;
367
- break;
368
- case 41:
369
- _vcNext = _objectSpread(_objectSpread({}, fy26_04), {}, {
370
- revision: 'next'
371
- });
372
- results.push(_vcNext);
373
- case 43:
374
327
  feVCCalculationEndTime = performance.now();
375
328
  if (!(includeRawData && fg('platform_ufo_enable_vc_raw_data'))) {
376
- _context.next = 54;
329
+ _context.next = 40;
377
330
  break;
378
331
  }
379
332
  rawVCCalculationStartTime = performance.now();
@@ -383,14 +336,14 @@ var VCObserverNew = /*#__PURE__*/function () {
383
336
  start: start,
384
337
  stop: rawStopTime
385
338
  }) : orderedEntries;
386
- _context.next = 51;
339
+ _context.next = 37;
387
340
  return rawHandler.getRawData({
388
341
  entries: rawOrderedEntries,
389
342
  startTime: start,
390
343
  stopTime: rawStopTime,
391
344
  isPageVisible: isPageVisible
392
345
  });
393
- case 51:
346
+ case 37:
394
347
  raw = _context.sent;
395
348
  results.forEach(function (result) {
396
349
  delete result.vcDetails;
@@ -401,9 +354,9 @@ var VCObserverNew = /*#__PURE__*/function () {
401
354
  raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
402
355
  results.push(raw);
403
356
  }
404
- case 54:
357
+ case 40:
405
358
  return _context.abrupt("return", results);
406
- case 55:
359
+ case 41:
407
360
  case "end":
408
361
  return _context.stop();
409
362
  }
@@ -12,9 +12,6 @@ import VCCalculator_FY25_03 from '../fy25_03';
12
12
  import { KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS, NON_VISUAL_ARIA_ATTRIBUTES, THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES } from '../utils/constants';
13
13
  var getConsideredEntryTypes = function getConsideredEntryTypes() {
14
14
  var consideredEntryTypes = ['mutation:display-contents-children-element'];
15
- if (fg('platform_ufo_remove_ssr_placeholder_in_ttvc_v4')) {
16
- consideredEntryTypes.push('mutation:ssr-placeholder');
17
- }
18
15
  consideredEntryTypes.push('mutation:display-contents-children-attribute');
19
16
  return consideredEntryTypes;
20
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -118,9 +118,6 @@
118
118
  "platform_ufo_disable_vcnext_observations": {
119
119
  "type": "boolean"
120
120
  },
121
- "platform_ufo_remove_ssr_placeholder_in_ttvc_v4": {
122
- "type": "boolean"
123
- },
124
121
  "platform_ufo_exclude_3p_elements_from_ttai": {
125
122
  "type": "boolean"
126
123
  },
@@ -133,9 +130,6 @@
133
130
  "platform_ufo_segment_critical_metrics": {
134
131
  "type": "boolean"
135
132
  },
136
- "platform_ufo_vcnext_for_ttvc_v5": {
137
- "type": "boolean"
138
- },
139
133
  "platform_ufo_v4_fix_nested_ssr_placeholder": {
140
134
  "type": "boolean"
141
135
  },