@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 +15 -0
- package/dist/cjs/interaction-metrics/index.js +212 -48
- package/dist/cjs/interaction-metrics/post-interaction-log.js +13 -10
- package/dist/cjs/vc/index.js +47 -3
- package/dist/cjs/vc/vc-observer/index.js +23 -16
- package/dist/es2019/interaction-metrics/index.js +212 -48
- package/dist/es2019/interaction-metrics/post-interaction-log.js +7 -3
- package/dist/es2019/vc/index.js +42 -0
- package/dist/es2019/vc/vc-observer/index.js +23 -16
- package/dist/esm/interaction-metrics/index.js +212 -48
- package/dist/esm/interaction-metrics/post-interaction-log.js +13 -10
- package/dist/esm/vc/index.js +47 -3
- package/dist/esm/vc/vc-observer/index.js +23 -16
- package/dist/types/vc/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/index.d.ts +1 -0
- package/package.json +7 -1
|
@@ -13,6 +13,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
13
13
|
import coinflip from '../coinflip';
|
|
14
14
|
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getInteractionTimeout, getPostInteractionRate } from '../config';
|
|
15
15
|
import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
|
|
16
|
+
import { sanitizeUfoName } from '../create-payload/common/utils';
|
|
16
17
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
17
18
|
import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
|
|
18
19
|
import { getInteractionId } from '../interaction-id-context';
|
|
@@ -189,10 +190,23 @@ export function addCustomTiming(interactionId, labelStack, data) {
|
|
|
189
190
|
endTime = timingData.endTime;
|
|
190
191
|
try {
|
|
191
192
|
// for Firefox 102 and older
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
194
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
|
|
195
|
+
start: startTime,
|
|
196
|
+
end: endTime,
|
|
197
|
+
detail: {
|
|
198
|
+
devtools: {
|
|
199
|
+
track: '🛸 reactUFO detailed timings',
|
|
200
|
+
color: 'tertiary-light'
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
} else {
|
|
205
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
|
|
206
|
+
start: startTime,
|
|
207
|
+
end: endTime
|
|
208
|
+
});
|
|
209
|
+
}
|
|
196
210
|
} catch (e) {
|
|
197
211
|
// do nothing
|
|
198
212
|
}
|
|
@@ -249,10 +263,23 @@ export function addSpan(interactionId, type, name, labelStack, start) {
|
|
|
249
263
|
if (isPerformanceTracingEnabled()) {
|
|
250
264
|
try {
|
|
251
265
|
// for Firefox 102 and older
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
267
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
268
|
+
start: start,
|
|
269
|
+
end: end,
|
|
270
|
+
detail: {
|
|
271
|
+
devtools: {
|
|
272
|
+
track: '🛸 reactUFO detailed timings',
|
|
273
|
+
color: 'secondary'
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
} else {
|
|
278
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
279
|
+
start: start,
|
|
280
|
+
end: end
|
|
281
|
+
});
|
|
282
|
+
}
|
|
256
283
|
} catch (e) {
|
|
257
284
|
// do nothing
|
|
258
285
|
}
|
|
@@ -275,10 +302,23 @@ export function addSpanToAll(type, name, labelStack, start) {
|
|
|
275
302
|
if (isPerformanceTracingEnabled()) {
|
|
276
303
|
try {
|
|
277
304
|
// for Firefox 102 and older
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
305
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
306
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
307
|
+
start: start,
|
|
308
|
+
end: end,
|
|
309
|
+
detail: {
|
|
310
|
+
devtools: {
|
|
311
|
+
track: '🛸 reactUFO detailed timings',
|
|
312
|
+
color: 'secondary'
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
} else {
|
|
317
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
318
|
+
start: start,
|
|
319
|
+
end: end
|
|
320
|
+
});
|
|
321
|
+
}
|
|
282
322
|
} catch (e) {
|
|
283
323
|
// do nothing
|
|
284
324
|
}
|
|
@@ -339,10 +379,23 @@ export function addHold(interactionId, labelStack, name, experimental) {
|
|
|
339
379
|
if (isPerformanceTracingEnabled()) {
|
|
340
380
|
try {
|
|
341
381
|
// for Firefox 102 and older
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
382
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
383
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
|
|
384
|
+
start: start,
|
|
385
|
+
end: end,
|
|
386
|
+
detail: {
|
|
387
|
+
devtools: {
|
|
388
|
+
track: '🛸 reactUFO detailed timings',
|
|
389
|
+
color: 'secondary-light'
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
} else {
|
|
394
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
|
|
395
|
+
start: start,
|
|
396
|
+
end: end
|
|
397
|
+
});
|
|
398
|
+
}
|
|
346
399
|
} catch (e) {
|
|
347
400
|
// do nothing
|
|
348
401
|
}
|
|
@@ -469,10 +522,23 @@ export function addProfilerTimings(interactionId, labelStack, type, actualDurati
|
|
|
469
522
|
if (isPerformanceTracingEnabled()) {
|
|
470
523
|
try {
|
|
471
524
|
// for Firefox 102 and older
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
525
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
526
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
|
|
527
|
+
start: startTime,
|
|
528
|
+
duration: actualDuration,
|
|
529
|
+
detail: {
|
|
530
|
+
devtools: {
|
|
531
|
+
track: '🛸 reactUFO detailed timings',
|
|
532
|
+
color: 'secondary-dark'
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
} else {
|
|
537
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
|
|
538
|
+
start: startTime,
|
|
539
|
+
duration: actualDuration
|
|
540
|
+
});
|
|
541
|
+
}
|
|
476
542
|
} catch (e) {
|
|
477
543
|
// do nothing
|
|
478
544
|
}
|
|
@@ -509,10 +575,24 @@ function finishInteraction(id, data) {
|
|
|
509
575
|
data.end = endTime;
|
|
510
576
|
try {
|
|
511
577
|
// for Firefox 102 and older
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
578
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
579
|
+
performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
|
|
580
|
+
start: data.start,
|
|
581
|
+
end: data.end,
|
|
582
|
+
detail: {
|
|
583
|
+
devtools: {
|
|
584
|
+
track: 'main metrics',
|
|
585
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
586
|
+
color: 'tertiary'
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
} else {
|
|
591
|
+
performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
|
|
592
|
+
start: data.start,
|
|
593
|
+
end: data.end
|
|
594
|
+
});
|
|
595
|
+
}
|
|
516
596
|
} catch (e) {
|
|
517
597
|
// do nothing
|
|
518
598
|
}
|
|
@@ -528,6 +608,18 @@ function finishInteraction(id, data) {
|
|
|
528
608
|
data.vc = observer.getVCRawData();
|
|
529
609
|
}
|
|
530
610
|
}
|
|
611
|
+
|
|
612
|
+
// By this time, stop the post interaction log observer if coinflip rate is 0
|
|
613
|
+
if (fg('platform_ufo_post_interaction_check_name')) {
|
|
614
|
+
var sanitisedUfoName = sanitizeUfoName(data.ufoName);
|
|
615
|
+
if (!coinflip(getPostInteractionRate(sanitisedUfoName, data.type))) {
|
|
616
|
+
postInteractionLog.stopVCObserver();
|
|
617
|
+
}
|
|
618
|
+
} else {
|
|
619
|
+
if (!coinflip(getPostInteractionRate(data.routeName || data.ufoName, data.type))) {
|
|
620
|
+
postInteractionLog.stopVCObserver();
|
|
621
|
+
}
|
|
622
|
+
}
|
|
531
623
|
if (!((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
532
624
|
remove(id);
|
|
533
625
|
}
|
|
@@ -561,10 +653,23 @@ function finishInteraction(id, data) {
|
|
|
561
653
|
labelStack = _step3$value$.labelStack,
|
|
562
654
|
start = _step3$value$.start,
|
|
563
655
|
end = _step3$value$.end;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
656
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
657
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
|
|
658
|
+
start: start,
|
|
659
|
+
end: end,
|
|
660
|
+
detail: {
|
|
661
|
+
devtools: {
|
|
662
|
+
track: '🛸 reactUFO detailed timings',
|
|
663
|
+
color: 'secondary-dark'
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
} else {
|
|
668
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
|
|
669
|
+
start: start,
|
|
670
|
+
end: end
|
|
671
|
+
});
|
|
672
|
+
}
|
|
568
673
|
}
|
|
569
674
|
} catch (err) {
|
|
570
675
|
_iterator3.e(err);
|
|
@@ -737,8 +842,12 @@ export function addOnCancelCallback(id, cancelCallback) {
|
|
|
737
842
|
}
|
|
738
843
|
export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
|
|
739
844
|
var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
|
|
740
|
-
if (
|
|
845
|
+
if (fg('platform_ufo_post_interaction_check_name')) {
|
|
741
846
|
postInteractionLog.reset();
|
|
847
|
+
} else {
|
|
848
|
+
if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
|
|
849
|
+
postInteractionLog.reset();
|
|
850
|
+
}
|
|
742
851
|
}
|
|
743
852
|
var vcObserver;
|
|
744
853
|
var previousTime = startTime;
|
|
@@ -857,10 +966,21 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
857
966
|
experienceKey: ufoName
|
|
858
967
|
});
|
|
859
968
|
}
|
|
860
|
-
if (
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
969
|
+
if (fg('platform_ufo_post_interaction_check_name')) {
|
|
970
|
+
var _getConfig0;
|
|
971
|
+
// Start post interaction observer for all if config is enabled
|
|
972
|
+
// in case ufoName is updated at later time
|
|
973
|
+
if ((_getConfig0 = getConfig()) !== null && _getConfig0 !== void 0 && (_getConfig0 = _getConfig0.postInteractionLog) !== null && _getConfig0 !== void 0 && _getConfig0.enabled) {
|
|
974
|
+
postInteractionLog.startVCObserver({
|
|
975
|
+
startTime: startTime
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
} else {
|
|
979
|
+
if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
|
|
980
|
+
postInteractionLog.startVCObserver({
|
|
981
|
+
startTime: startTime
|
|
982
|
+
});
|
|
983
|
+
}
|
|
864
984
|
}
|
|
865
985
|
if (coinflip(getExperimentalInteractionRate(ufoName, type))) {
|
|
866
986
|
experimentalVC.start({
|
|
@@ -894,12 +1014,27 @@ export function addApdexToAll(apdex) {
|
|
|
894
1014
|
interactions.forEach(function (interaction, key) {
|
|
895
1015
|
interaction.apdex.push(apdex);
|
|
896
1016
|
try {
|
|
897
|
-
var _apdex$startTime;
|
|
898
1017
|
// for Firefox 102 and older
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1018
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
1019
|
+
var _apdex$startTime;
|
|
1020
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
|
|
1021
|
+
start: (_apdex$startTime = apdex.startTime) !== null && _apdex$startTime !== void 0 ? _apdex$startTime : interaction.start,
|
|
1022
|
+
end: apdex.stopTime,
|
|
1023
|
+
detail: {
|
|
1024
|
+
devtools: {
|
|
1025
|
+
track: 'main metrics',
|
|
1026
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
1027
|
+
color: 'primary-dark'
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
} else {
|
|
1032
|
+
var _apdex$startTime2;
|
|
1033
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
|
|
1034
|
+
start: (_apdex$startTime2 = apdex.startTime) !== null && _apdex$startTime2 !== void 0 ? _apdex$startTime2 : interaction.start,
|
|
1035
|
+
end: apdex.stopTime
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
903
1038
|
} catch (e) {
|
|
904
1039
|
// do nothing
|
|
905
1040
|
}
|
|
@@ -913,12 +1048,27 @@ export function addApdex(interactionId, apdexInfo) {
|
|
|
913
1048
|
if (interaction != null) {
|
|
914
1049
|
interaction.apdex.push(apdexInfo);
|
|
915
1050
|
try {
|
|
916
|
-
var _apdexInfo$startTime;
|
|
917
1051
|
// for Firefox 102 and older
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1052
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
1053
|
+
var _apdexInfo$startTime;
|
|
1054
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
|
|
1055
|
+
start: (_apdexInfo$startTime = apdexInfo.startTime) !== null && _apdexInfo$startTime !== void 0 ? _apdexInfo$startTime : interaction.start,
|
|
1056
|
+
end: apdexInfo.stopTime,
|
|
1057
|
+
detail: {
|
|
1058
|
+
devtools: {
|
|
1059
|
+
track: 'main metrics',
|
|
1060
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
1061
|
+
color: 'primary-dark'
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
} else {
|
|
1066
|
+
var _apdexInfo$startTime2;
|
|
1067
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
|
|
1068
|
+
start: (_apdexInfo$startTime2 = apdexInfo.startTime) !== null && _apdexInfo$startTime2 !== void 0 ? _apdexInfo$startTime2 : interaction.start,
|
|
1069
|
+
end: apdexInfo.stopTime
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
922
1072
|
} catch (e) {
|
|
923
1073
|
// do nothing
|
|
924
1074
|
}
|
|
@@ -981,12 +1131,26 @@ export function addRedirect(interactionId, fromUfoName, nextUfoName, nextRouteNa
|
|
|
981
1131
|
if (isPerformanceTracingEnabled()) {
|
|
982
1132
|
var prevRedirect = interaction.redirects.at(-2);
|
|
983
1133
|
try {
|
|
984
|
-
var _prevRedirect$time;
|
|
985
1134
|
// for Firefox 102 and older
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1135
|
+
if (fg('ufo_chrome_devtools_uplift')) {
|
|
1136
|
+
var _prevRedirect$time;
|
|
1137
|
+
performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
|
|
1138
|
+
start: (_prevRedirect$time = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time !== void 0 ? _prevRedirect$time : interaction.start,
|
|
1139
|
+
end: time,
|
|
1140
|
+
detail: {
|
|
1141
|
+
devtools: {
|
|
1142
|
+
track: '🛸 reactUFO detailed timings',
|
|
1143
|
+
color: 'tertiary'
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
} else {
|
|
1148
|
+
var _prevRedirect$time2;
|
|
1149
|
+
performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
|
|
1150
|
+
start: (_prevRedirect$time2 = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time2 !== void 0 ? _prevRedirect$time2 : interaction.start,
|
|
1151
|
+
end: time
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
990
1154
|
} catch (e) {
|
|
991
1155
|
// do nothing
|
|
992
1156
|
}
|
|
@@ -113,8 +113,8 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
113
113
|
key: "sendPostInteractionLog",
|
|
114
114
|
value: (function () {
|
|
115
115
|
var _sendPostInteractionLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
116
|
-
var _this$vcObserver4, _this$vcObserver5;
|
|
117
|
-
var _this$vcObserver3, postInteractionFinishVCResult;
|
|
116
|
+
var _this$vcObserver4, _config$vc, _config$vc2, _this$vcObserver5;
|
|
117
|
+
var _this$vcObserver3, config, postInteractionFinishVCResult;
|
|
118
118
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
119
119
|
while (1) switch (_context.prev = _context.next) {
|
|
120
120
|
case 0:
|
|
@@ -126,18 +126,21 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
126
126
|
(_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 || _this$vcObserver3.stop();
|
|
127
127
|
return _context.abrupt("return");
|
|
128
128
|
case 4:
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
config = getConfig();
|
|
130
|
+
_context.next = 7;
|
|
131
|
+
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread({
|
|
131
132
|
start: this.lastInteractionFinish.start,
|
|
132
133
|
stop: performance.now(),
|
|
133
134
|
tti: -1,
|
|
134
135
|
// no need for TTI value here
|
|
135
136
|
isEventAborted: !!this.lastInteractionFinish.abortReason,
|
|
136
|
-
prefix: 'ufo'
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
prefix: 'ufo',
|
|
138
|
+
experienceKey: this.lastInteractionFinish.ufoName,
|
|
139
|
+
interactionId: this.lastInteractionFinish.id,
|
|
140
|
+
includeSSRInV3: config === null || config === void 0 || (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
|
|
141
|
+
includeSSRRatio: config === null || config === void 0 || (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
|
|
142
|
+
}, this.vcObserverSSRConfig));
|
|
143
|
+
case 7:
|
|
141
144
|
postInteractionFinishVCResult = _context.sent;
|
|
142
145
|
(_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 || _this$vcObserver5.stop();
|
|
143
146
|
this.sinkHandlerFn({
|
|
@@ -147,7 +150,7 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
147
150
|
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
148
151
|
});
|
|
149
152
|
this.reset();
|
|
150
|
-
case
|
|
153
|
+
case 11:
|
|
151
154
|
case "end":
|
|
152
155
|
return _context.stop();
|
|
153
156
|
}
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var _process;
|
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
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
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
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { isVCRevisionEnabled } from '../config';
|
|
11
12
|
import { VCObserverNOOP } from './no-op-vc-observer';
|
|
12
13
|
import { VCObserver } from './vc-observer';
|
|
@@ -158,16 +159,17 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
158
159
|
_context.t1 = [];
|
|
159
160
|
case 16:
|
|
160
161
|
v3Result = _context.t1;
|
|
162
|
+
fg('ufo_chrome_devtools_uplift') && this.addPerformanceMeasures(param.start, [].concat(_toConsumableArray((v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) || []), _toConsumableArray(v3Result !== null && v3Result !== void 0 ? v3Result : [])));
|
|
161
163
|
if (v3Result) {
|
|
162
|
-
_context.next =
|
|
164
|
+
_context.next = 20;
|
|
163
165
|
break;
|
|
164
166
|
}
|
|
165
167
|
return _context.abrupt("return", v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {});
|
|
166
|
-
case
|
|
168
|
+
case 20:
|
|
167
169
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, v1v2Result), {}, {
|
|
168
170
|
'ufo:vc:rev': [].concat(_toConsumableArray((_ref2 = v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) !== null && _ref2 !== void 0 ? _ref2 : []), _toConsumableArray(v3Result !== null && v3Result !== void 0 ? v3Result : []))
|
|
169
171
|
}));
|
|
170
|
-
case
|
|
172
|
+
case 21:
|
|
171
173
|
case "end":
|
|
172
174
|
return _context.stop();
|
|
173
175
|
}
|
|
@@ -204,6 +206,48 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
204
206
|
value: function collectSSRPlaceholders() {
|
|
205
207
|
this.ssrPlaceholderHandler.collectExistingPlaceholders();
|
|
206
208
|
}
|
|
209
|
+
}, {
|
|
210
|
+
key: "addPerformanceMeasures",
|
|
211
|
+
value: function addPerformanceMeasures(start, measures) {
|
|
212
|
+
try {
|
|
213
|
+
measures.forEach(function (entry) {
|
|
214
|
+
var _entry$vcDetails;
|
|
215
|
+
if (!entry || !entry.vcDetails) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
var VCParts = Object.keys(entry.vcDetails);
|
|
219
|
+
performance.measure("VC90 (".concat(entry.revision, ")"), {
|
|
220
|
+
start: start,
|
|
221
|
+
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,
|
|
222
|
+
detail: {
|
|
223
|
+
devtools: {
|
|
224
|
+
track: "main metrics",
|
|
225
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
226
|
+
color: 'tertiary'
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
VCParts.forEach(function (key) {
|
|
231
|
+
var _entry$vcDetails2;
|
|
232
|
+
var duration = (_entry$vcDetails2 = entry.vcDetails) === null || _entry$vcDetails2 === void 0 ? void 0 : _entry$vcDetails2[key].t;
|
|
233
|
+
if (typeof duration !== 'number') {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
performance.measure("VC".concat(key), {
|
|
237
|
+
start: start,
|
|
238
|
+
duration: duration,
|
|
239
|
+
detail: {
|
|
240
|
+
devtools: {
|
|
241
|
+
track: "VC ".concat(entry.revision),
|
|
242
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
243
|
+
color: key === '90' ? 'tertiary' : 'primary-light'
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
} catch (error) {}
|
|
250
|
+
}
|
|
207
251
|
}]);
|
|
208
252
|
}();
|
|
209
253
|
|
|
@@ -9,6 +9,7 @@ var _excluded = ["__debug__element"];
|
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { isVCRevisionEnabled } from '../../config';
|
|
13
14
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
14
15
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
@@ -177,29 +178,35 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
177
178
|
if (isTTVCv1Disabled) {
|
|
178
179
|
var duration = vcNext.VC[key];
|
|
179
180
|
if (duration !== null && duration !== undefined) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
181
|
+
if (!fg('ufo_chrome_devtools_uplift')) {
|
|
182
|
+
performance.measure("VC".concat(key), {
|
|
183
|
+
start: start,
|
|
184
|
+
duration: duration
|
|
185
|
+
});
|
|
186
|
+
performance.measure("VC_Next".concat(key), {
|
|
187
|
+
start: start,
|
|
188
|
+
duration: duration
|
|
189
|
+
});
|
|
190
|
+
}
|
|
188
191
|
}
|
|
189
192
|
} else {
|
|
190
193
|
var ttvcV1duration = VC[key];
|
|
191
194
|
if (ttvcV1duration !== null && ttvcV1duration !== undefined) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
if (!fg('ufo_chrome_devtools_uplift')) {
|
|
196
|
+
performance.measure("VC".concat(key), {
|
|
197
|
+
start: start,
|
|
198
|
+
duration: ttvcV1duration
|
|
199
|
+
});
|
|
200
|
+
}
|
|
196
201
|
}
|
|
197
202
|
var ttvcV2duration = vcNext.VC[key];
|
|
198
203
|
if (ttvcV2duration !== null && ttvcV2duration !== undefined) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
if (!fg('ufo_chrome_devtools_uplift')) {
|
|
205
|
+
performance.measure("VC_Next".concat(key), {
|
|
206
|
+
start: start,
|
|
207
|
+
duration: ttvcV2duration
|
|
208
|
+
});
|
|
209
|
+
}
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
212
|
});
|
package/dist/types/vc/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class VCObserverWrapper implements VCObserverInterface {
|
|
|
21
21
|
setReactRootRenderStart(startTime: number): void;
|
|
22
22
|
setReactRootRenderStop(stopTime: number): void;
|
|
23
23
|
collectSSRPlaceholders(): void;
|
|
24
|
+
private addPerformanceMeasures;
|
|
24
25
|
}
|
|
25
26
|
export declare function isEnvironmentSupported(): boolean;
|
|
26
27
|
export declare function getVCObserver(opts?: VCObserverOptions): VCObserverInterface;
|
|
@@ -21,6 +21,7 @@ export declare class VCObserverWrapper implements VCObserverInterface {
|
|
|
21
21
|
setReactRootRenderStart(startTime: number): void;
|
|
22
22
|
setReactRootRenderStop(stopTime: number): void;
|
|
23
23
|
collectSSRPlaceholders(): void;
|
|
24
|
+
private addPerformanceMeasures;
|
|
24
25
|
}
|
|
25
26
|
export declare function isEnvironmentSupported(): boolean;
|
|
26
27
|
export declare function getVCObserver(opts?: VCObserverOptions): VCObserverInterface;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.12",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -191,6 +191,12 @@
|
|
|
191
191
|
},
|
|
192
192
|
"platform_ufo_segment_critical_metrics": {
|
|
193
193
|
"type": "boolean"
|
|
194
|
+
},
|
|
195
|
+
"ufo_chrome_devtools_uplift": {
|
|
196
|
+
"type": "boolean"
|
|
197
|
+
},
|
|
198
|
+
"platform_ufo_post_interaction_check_name": {
|
|
199
|
+
"type": "boolean"
|
|
194
200
|
}
|
|
195
201
|
}
|
|
196
202
|
}
|