@atlaskit/react-ufo 4.1.10 → 4.1.12

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,20 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#195371](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195371)
8
+ [`928a3cc316c8f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/928a3cc316c8f) -
9
+ Fix post interaction log naming issue
10
+
11
+ ## 4.1.11
12
+
13
+ ### Patch Changes
14
+
15
+ - [`690db8120453b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/690db8120453b) -
16
+ Grouped reactUFO spans for chrome devtools
17
+
3
18
  ## 4.1.10
4
19
 
5
20
  ### Patch Changes
@@ -54,6 +54,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
54
54
  var _coinflip = _interopRequireDefault(require("../coinflip"));
55
55
  var _config = require("../config");
56
56
  var _createExperimentalInteractionMetricsPayload = require("../create-experimental-interaction-metrics-payload");
57
+ var _utils = require("../create-payload/common/utils");
57
58
  var _experienceTraceIdContext = require("../experience-trace-id-context");
58
59
  var _featureFlagsAccessed = require("../feature-flags-accessed");
59
60
  var _interactionIdContext = require("../interaction-id-context");
@@ -235,10 +236,23 @@ function addCustomTiming(interactionId, labelStack, data) {
235
236
  endTime = timingData.endTime;
236
237
  try {
237
238
  // for Firefox 102 and older
238
- performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
239
- start: startTime,
240
- end: endTime
241
- });
239
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
240
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
241
+ start: startTime,
242
+ end: endTime,
243
+ detail: {
244
+ devtools: {
245
+ track: '🛸 reactUFO detailed timings',
246
+ color: 'tertiary-light'
247
+ }
248
+ }
249
+ });
250
+ } else {
251
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
252
+ start: startTime,
253
+ end: endTime
254
+ });
255
+ }
242
256
  } catch (e) {
243
257
  // do nothing
244
258
  }
@@ -295,10 +309,23 @@ function addSpan(interactionId, type, name, labelStack, start) {
295
309
  if (isPerformanceTracingEnabled()) {
296
310
  try {
297
311
  // for Firefox 102 and older
298
- performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
299
- start: start,
300
- end: end
301
- });
312
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
313
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
314
+ start: start,
315
+ end: end,
316
+ detail: {
317
+ devtools: {
318
+ track: '🛸 reactUFO detailed timings',
319
+ color: 'secondary'
320
+ }
321
+ }
322
+ });
323
+ } else {
324
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
325
+ start: start,
326
+ end: end
327
+ });
328
+ }
302
329
  } catch (e) {
303
330
  // do nothing
304
331
  }
@@ -321,10 +348,23 @@ function addSpanToAll(type, name, labelStack, start) {
321
348
  if (isPerformanceTracingEnabled()) {
322
349
  try {
323
350
  // for Firefox 102 and older
324
- performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
325
- start: start,
326
- end: end
327
- });
351
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
352
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
353
+ start: start,
354
+ end: end,
355
+ detail: {
356
+ devtools: {
357
+ track: '🛸 reactUFO detailed timings',
358
+ color: 'secondary'
359
+ }
360
+ }
361
+ });
362
+ } else {
363
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
364
+ start: start,
365
+ end: end
366
+ });
367
+ }
328
368
  } catch (e) {
329
369
  // do nothing
330
370
  }
@@ -385,10 +425,23 @@ function addHold(interactionId, labelStack, name, experimental) {
385
425
  if (isPerformanceTracingEnabled()) {
386
426
  try {
387
427
  // for Firefox 102 and older
388
- performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
389
- start: start,
390
- end: end
391
- });
428
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
429
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
430
+ start: start,
431
+ end: end,
432
+ detail: {
433
+ devtools: {
434
+ track: '🛸 reactUFO detailed timings',
435
+ color: 'secondary-light'
436
+ }
437
+ }
438
+ });
439
+ } else {
440
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
441
+ start: start,
442
+ end: end
443
+ });
444
+ }
392
445
  } catch (e) {
393
446
  // do nothing
394
447
  }
@@ -515,10 +568,23 @@ function addProfilerTimings(interactionId, labelStack, type, actualDuration, bas
515
568
  if (isPerformanceTracingEnabled()) {
516
569
  try {
517
570
  // for Firefox 102 and older
518
- performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
519
- start: startTime,
520
- duration: actualDuration
521
- });
571
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
572
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
573
+ start: startTime,
574
+ duration: actualDuration,
575
+ detail: {
576
+ devtools: {
577
+ track: '🛸 reactUFO detailed timings',
578
+ color: 'secondary-dark'
579
+ }
580
+ }
581
+ });
582
+ } else {
583
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
584
+ start: startTime,
585
+ duration: actualDuration
586
+ });
587
+ }
522
588
  } catch (e) {
523
589
  // do nothing
524
590
  }
@@ -555,10 +621,24 @@ function finishInteraction(id, data) {
555
621
  data.end = endTime;
556
622
  try {
557
623
  // for Firefox 102 and older
558
- performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
559
- start: data.start,
560
- end: data.end
561
- });
624
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
625
+ performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
626
+ start: data.start,
627
+ end: data.end,
628
+ detail: {
629
+ devtools: {
630
+ track: 'main metrics',
631
+ trackGroup: '🛸 reactUFO metrics',
632
+ color: 'tertiary'
633
+ }
634
+ }
635
+ });
636
+ } else {
637
+ performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
638
+ start: data.start,
639
+ end: data.end
640
+ });
641
+ }
562
642
  } catch (e) {
563
643
  // do nothing
564
644
  }
@@ -574,6 +654,18 @@ function finishInteraction(id, data) {
574
654
  data.vc = observer.getVCRawData();
575
655
  }
576
656
  }
657
+
658
+ // By this time, stop the post interaction log observer if coinflip rate is 0
659
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
660
+ var sanitisedUfoName = (0, _utils.sanitizeUfoName)(data.ufoName);
661
+ if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(sanitisedUfoName, data.type))) {
662
+ postInteractionLog.stopVCObserver();
663
+ }
664
+ } else {
665
+ if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(data.routeName || data.ufoName, data.type))) {
666
+ postInteractionLog.stopVCObserver();
667
+ }
668
+ }
577
669
  if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
578
670
  remove(id);
579
671
  }
@@ -607,10 +699,23 @@ function finishInteraction(id, data) {
607
699
  labelStack = _step3$value$.labelStack,
608
700
  start = _step3$value$.start,
609
701
  end = _step3$value$.end;
610
- performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
611
- start: start,
612
- end: end
613
- });
702
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
703
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
704
+ start: start,
705
+ end: end,
706
+ detail: {
707
+ devtools: {
708
+ track: '🛸 reactUFO detailed timings',
709
+ color: 'secondary-dark'
710
+ }
711
+ }
712
+ });
713
+ } else {
714
+ performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
715
+ start: start,
716
+ end: end
717
+ });
718
+ }
614
719
  }
615
720
  } catch (err) {
616
721
  _iterator3.e(err);
@@ -783,8 +888,12 @@ function addOnCancelCallback(id, cancelCallback) {
783
888
  }
784
889
  function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
785
890
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
786
- if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
891
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
787
892
  postInteractionLog.reset();
893
+ } else {
894
+ if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
895
+ postInteractionLog.reset();
896
+ }
788
897
  }
789
898
  var vcObserver;
790
899
  var previousTime = startTime;
@@ -903,10 +1012,21 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
903
1012
  experienceKey: ufoName
904
1013
  });
905
1014
  }
906
- if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
907
- postInteractionLog.startVCObserver({
908
- startTime: startTime
909
- });
1015
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
1016
+ var _getConfig0;
1017
+ // Start post interaction observer for all if config is enabled
1018
+ // in case ufoName is updated at later time
1019
+ if ((_getConfig0 = (0, _config.getConfig)()) !== null && _getConfig0 !== void 0 && (_getConfig0 = _getConfig0.postInteractionLog) !== null && _getConfig0 !== void 0 && _getConfig0.enabled) {
1020
+ postInteractionLog.startVCObserver({
1021
+ startTime: startTime
1022
+ });
1023
+ }
1024
+ } else {
1025
+ if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
1026
+ postInteractionLog.startVCObserver({
1027
+ startTime: startTime
1028
+ });
1029
+ }
910
1030
  }
911
1031
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(ufoName, type))) {
912
1032
  _createExperimentalInteractionMetricsPayload.experimentalVC.start({
@@ -940,12 +1060,27 @@ function addApdexToAll(apdex) {
940
1060
  _constants.interactions.forEach(function (interaction, key) {
941
1061
  interaction.apdex.push(apdex);
942
1062
  try {
943
- var _apdex$startTime;
944
1063
  // for Firefox 102 and older
945
- performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
946
- start: (_apdex$startTime = apdex.startTime) !== null && _apdex$startTime !== void 0 ? _apdex$startTime : interaction.start,
947
- end: apdex.stopTime
948
- });
1064
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
1065
+ var _apdex$startTime;
1066
+ performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
1067
+ start: (_apdex$startTime = apdex.startTime) !== null && _apdex$startTime !== void 0 ? _apdex$startTime : interaction.start,
1068
+ end: apdex.stopTime,
1069
+ detail: {
1070
+ devtools: {
1071
+ track: 'main metrics',
1072
+ trackGroup: '🛸 reactUFO metrics',
1073
+ color: 'primary-dark'
1074
+ }
1075
+ }
1076
+ });
1077
+ } else {
1078
+ var _apdex$startTime2;
1079
+ performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
1080
+ start: (_apdex$startTime2 = apdex.startTime) !== null && _apdex$startTime2 !== void 0 ? _apdex$startTime2 : interaction.start,
1081
+ end: apdex.stopTime
1082
+ });
1083
+ }
949
1084
  } catch (e) {
950
1085
  // do nothing
951
1086
  }
@@ -959,12 +1094,27 @@ function addApdex(interactionId, apdexInfo) {
959
1094
  if (interaction != null) {
960
1095
  interaction.apdex.push(apdexInfo);
961
1096
  try {
962
- var _apdexInfo$startTime;
963
1097
  // for Firefox 102 and older
964
- performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
965
- start: (_apdexInfo$startTime = apdexInfo.startTime) !== null && _apdexInfo$startTime !== void 0 ? _apdexInfo$startTime : interaction.start,
966
- end: apdexInfo.stopTime
967
- });
1098
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
1099
+ var _apdexInfo$startTime;
1100
+ performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
1101
+ start: (_apdexInfo$startTime = apdexInfo.startTime) !== null && _apdexInfo$startTime !== void 0 ? _apdexInfo$startTime : interaction.start,
1102
+ end: apdexInfo.stopTime,
1103
+ detail: {
1104
+ devtools: {
1105
+ track: 'main metrics',
1106
+ trackGroup: '🛸 reactUFO metrics',
1107
+ color: 'primary-dark'
1108
+ }
1109
+ }
1110
+ });
1111
+ } else {
1112
+ var _apdexInfo$startTime2;
1113
+ performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
1114
+ start: (_apdexInfo$startTime2 = apdexInfo.startTime) !== null && _apdexInfo$startTime2 !== void 0 ? _apdexInfo$startTime2 : interaction.start,
1115
+ end: apdexInfo.stopTime
1116
+ });
1117
+ }
968
1118
  } catch (e) {
969
1119
  // do nothing
970
1120
  }
@@ -1027,12 +1177,26 @@ function addRedirect(interactionId, fromUfoName, nextUfoName, nextRouteName, tim
1027
1177
  if (isPerformanceTracingEnabled()) {
1028
1178
  var prevRedirect = interaction.redirects.at(-2);
1029
1179
  try {
1030
- var _prevRedirect$time;
1031
1180
  // for Firefox 102 and older
1032
- performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
1033
- start: (_prevRedirect$time = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time !== void 0 ? _prevRedirect$time : interaction.start,
1034
- end: time
1035
- });
1181
+ if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
1182
+ var _prevRedirect$time;
1183
+ performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
1184
+ start: (_prevRedirect$time = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time !== void 0 ? _prevRedirect$time : interaction.start,
1185
+ end: time,
1186
+ detail: {
1187
+ devtools: {
1188
+ track: '🛸 reactUFO detailed timings',
1189
+ color: 'tertiary'
1190
+ }
1191
+ }
1192
+ });
1193
+ } else {
1194
+ var _prevRedirect$time2;
1195
+ performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
1196
+ start: (_prevRedirect$time2 = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time2 !== void 0 ? _prevRedirect$time2 : interaction.start,
1197
+ end: time
1198
+ });
1199
+ }
1036
1200
  } catch (e) {
1037
1201
  // do nothing
1038
1202
  }
@@ -120,8 +120,8 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
120
120
  key: "sendPostInteractionLog",
121
121
  value: (function () {
122
122
  var _sendPostInteractionLog = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
123
- var _this$vcObserver4, _this$vcObserver5;
124
- var _this$vcObserver3, postInteractionFinishVCResult;
123
+ var _this$vcObserver4, _config$vc, _config$vc2, _this$vcObserver5;
124
+ var _this$vcObserver3, config, postInteractionFinishVCResult;
125
125
  return _regenerator.default.wrap(function _callee$(_context) {
126
126
  while (1) switch (_context.prev = _context.next) {
127
127
  case 0:
@@ -133,18 +133,21 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
133
133
  (_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 || _this$vcObserver3.stop();
134
134
  return _context.abrupt("return");
135
135
  case 4:
136
- _context.next = 6;
137
- return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread(_objectSpread({
136
+ config = (0, _config.getConfig)();
137
+ _context.next = 7;
138
+ return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread({
138
139
  start: this.lastInteractionFinish.start,
139
140
  stop: performance.now(),
140
141
  tti: -1,
141
142
  // no need for TTI value here
142
143
  isEventAborted: !!this.lastInteractionFinish.abortReason,
143
- prefix: 'ufo'
144
- }, this.vcObserverSSRConfig), {}, {
145
- experienceKey: this.lastInteractionFinish.ufoName
146
- }));
147
- case 6:
144
+ prefix: 'ufo',
145
+ experienceKey: this.lastInteractionFinish.ufoName,
146
+ interactionId: this.lastInteractionFinish.id,
147
+ includeSSRInV3: config === null || config === void 0 || (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
148
+ includeSSRRatio: config === null || config === void 0 || (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
149
+ }, this.vcObserverSSRConfig));
150
+ case 7:
148
151
  postInteractionFinishVCResult = _context.sent;
149
152
  (_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 || _this$vcObserver5.stop();
150
153
  this.sinkHandlerFn({
@@ -154,7 +157,7 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
154
157
  lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
155
158
  });
156
159
  this.reset();
157
- case 10:
160
+ case 11:
158
161
  case "end":
159
162
  return _context.stop();
160
163
  }
@@ -14,6 +14,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
16
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
18
  var _config = require("../config");
18
19
  var _noOpVcObserver = require("./no-op-vc-observer");
19
20
  var _vcObserver = require("./vc-observer");
@@ -168,16 +169,17 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
168
169
  _context.t1 = [];
169
170
  case 16:
170
171
  v3Result = _context.t1;
172
+ (0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift') && this.addPerformanceMeasures(param.start, [].concat((0, _toConsumableArray2.default)((v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) || []), (0, _toConsumableArray2.default)(v3Result !== null && v3Result !== void 0 ? v3Result : [])));
171
173
  if (v3Result) {
172
- _context.next = 19;
174
+ _context.next = 20;
173
175
  break;
174
176
  }
175
177
  return _context.abrupt("return", v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {});
176
- case 19:
178
+ case 20:
177
179
  return _context.abrupt("return", _objectSpread(_objectSpread({}, v1v2Result), {}, {
178
180
  'ufo:vc:rev': [].concat((0, _toConsumableArray2.default)((_ref2 = v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) !== null && _ref2 !== void 0 ? _ref2 : []), (0, _toConsumableArray2.default)(v3Result !== null && v3Result !== void 0 ? v3Result : []))
179
181
  }));
180
- case 20:
182
+ case 21:
181
183
  case "end":
182
184
  return _context.stop();
183
185
  }
@@ -214,6 +216,48 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
214
216
  value: function collectSSRPlaceholders() {
215
217
  this.ssrPlaceholderHandler.collectExistingPlaceholders();
216
218
  }
219
+ }, {
220
+ key: "addPerformanceMeasures",
221
+ value: function addPerformanceMeasures(start, measures) {
222
+ try {
223
+ measures.forEach(function (entry) {
224
+ var _entry$vcDetails;
225
+ if (!entry || !entry.vcDetails) {
226
+ return;
227
+ }
228
+ var VCParts = Object.keys(entry.vcDetails);
229
+ performance.measure("VC90 (".concat(entry.revision, ")"), {
230
+ start: start,
231
+ duration: (_entry$vcDetails = entry.vcDetails) === null || _entry$vcDetails === void 0 || (_entry$vcDetails = _entry$vcDetails['90']) === null || _entry$vcDetails === void 0 ? void 0 : _entry$vcDetails.t,
232
+ detail: {
233
+ devtools: {
234
+ track: "main metrics",
235
+ trackGroup: '🛸 reactUFO metrics',
236
+ color: 'tertiary'
237
+ }
238
+ }
239
+ });
240
+ VCParts.forEach(function (key) {
241
+ var _entry$vcDetails2;
242
+ var duration = (_entry$vcDetails2 = entry.vcDetails) === null || _entry$vcDetails2 === void 0 ? void 0 : _entry$vcDetails2[key].t;
243
+ if (typeof duration !== 'number') {
244
+ return;
245
+ }
246
+ performance.measure("VC".concat(key), {
247
+ start: start,
248
+ duration: duration,
249
+ detail: {
250
+ devtools: {
251
+ track: "VC ".concat(entry.revision),
252
+ trackGroup: '🛸 reactUFO metrics',
253
+ color: key === '90' ? 'tertiary' : 'primary-light'
254
+ }
255
+ }
256
+ });
257
+ });
258
+ });
259
+ } catch (error) {}
260
+ }
217
261
  }]);
218
262
  }(); // Some products set this variable to indicate it is running in SSR
219
263
  var isServer = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__SERVER__);
@@ -13,6 +13,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _config = require("../../config");
17
18
  var _interactionMetrics = require("../../interaction-metrics");
18
19
  var _attachAbortListeners = require("./attachAbortListeners");
@@ -184,29 +185,35 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
184
185
  if (isTTVCv1Disabled) {
185
186
  var duration = vcNext.VC[key];
186
187
  if (duration !== null && duration !== undefined) {
187
- performance.measure("VC".concat(key), {
188
- start: start,
189
- duration: duration
190
- });
191
- performance.measure("VC_Next".concat(key), {
192
- start: start,
193
- duration: duration
194
- });
188
+ if (!(0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
189
+ performance.measure("VC".concat(key), {
190
+ start: start,
191
+ duration: duration
192
+ });
193
+ performance.measure("VC_Next".concat(key), {
194
+ start: start,
195
+ duration: duration
196
+ });
197
+ }
195
198
  }
196
199
  } else {
197
200
  var ttvcV1duration = VC[key];
198
201
  if (ttvcV1duration !== null && ttvcV1duration !== undefined) {
199
- performance.measure("VC".concat(key), {
200
- start: start,
201
- duration: ttvcV1duration
202
- });
202
+ if (!(0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
203
+ performance.measure("VC".concat(key), {
204
+ start: start,
205
+ duration: ttvcV1duration
206
+ });
207
+ }
203
208
  }
204
209
  var ttvcV2duration = vcNext.VC[key];
205
210
  if (ttvcV2duration !== null && ttvcV2duration !== undefined) {
206
- performance.measure("VC_Next".concat(key), {
207
- start: start,
208
- duration: ttvcV2duration
209
- });
211
+ if (!(0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
212
+ performance.measure("VC_Next".concat(key), {
213
+ start: start,
214
+ duration: ttvcV2duration
215
+ });
216
+ }
210
217
  }
211
218
  }
212
219
  });