@atlaskit/react-ufo 4.1.9 → 4.1.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.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/interaction-metrics/index.js +179 -43
- package/dist/cjs/vc/index.js +47 -3
- package/dist/cjs/vc/vc-observer/index.js +23 -16
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +14 -20
- package/dist/es2019/interaction-metrics/index.js +179 -43
- package/dist/es2019/vc/index.js +42 -0
- package/dist/es2019/vc/vc-observer/index.js +23 -16
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +6 -14
- package/dist/esm/interaction-metrics/index.js +179 -43
- package/dist/esm/vc/index.js +47 -3
- package/dist/esm/vc/vc-observer/index.js +23 -16
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +14 -20
- package/dist/types/vc/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/index.d.ts +1 -0
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.1.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`690db8120453b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/690db8120453b) -
|
|
8
|
+
Grouped reactUFO spans for chrome devtools
|
|
9
|
+
|
|
10
|
+
## 4.1.10
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#193091](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193091)
|
|
15
|
+
[`7e879ace28cec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e879ace28cec) -
|
|
16
|
+
AFO-4081 cleanup ttvc v3 ff
|
|
17
|
+
|
|
3
18
|
## 4.1.9
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -235,10 +235,23 @@ function addCustomTiming(interactionId, labelStack, data) {
|
|
|
235
235
|
endTime = timingData.endTime;
|
|
236
236
|
try {
|
|
237
237
|
// for Firefox 102 and older
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
239
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
|
|
240
|
+
start: startTime,
|
|
241
|
+
end: endTime,
|
|
242
|
+
detail: {
|
|
243
|
+
devtools: {
|
|
244
|
+
track: '🛸 reactUFO detailed timings',
|
|
245
|
+
color: 'tertiary-light'
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
} else {
|
|
250
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, key), " [custom_timing]"), {
|
|
251
|
+
start: startTime,
|
|
252
|
+
end: endTime
|
|
253
|
+
});
|
|
254
|
+
}
|
|
242
255
|
} catch (e) {
|
|
243
256
|
// do nothing
|
|
244
257
|
}
|
|
@@ -295,10 +308,23 @@ function addSpan(interactionId, type, name, labelStack, start) {
|
|
|
295
308
|
if (isPerformanceTracingEnabled()) {
|
|
296
309
|
try {
|
|
297
310
|
// for Firefox 102 and older
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
311
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
312
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
313
|
+
start: start,
|
|
314
|
+
end: end,
|
|
315
|
+
detail: {
|
|
316
|
+
devtools: {
|
|
317
|
+
track: '🛸 reactUFO detailed timings',
|
|
318
|
+
color: 'secondary'
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
} else {
|
|
323
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
324
|
+
start: start,
|
|
325
|
+
end: end
|
|
326
|
+
});
|
|
327
|
+
}
|
|
302
328
|
} catch (e) {
|
|
303
329
|
// do nothing
|
|
304
330
|
}
|
|
@@ -321,10 +347,23 @@ function addSpanToAll(type, name, labelStack, start) {
|
|
|
321
347
|
if (isPerformanceTracingEnabled()) {
|
|
322
348
|
try {
|
|
323
349
|
// for Firefox 102 and older
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
350
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
351
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
352
|
+
start: start,
|
|
353
|
+
end: end,
|
|
354
|
+
detail: {
|
|
355
|
+
devtools: {
|
|
356
|
+
track: '🛸 reactUFO detailed timings',
|
|
357
|
+
color: 'secondary'
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
} else {
|
|
362
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [").concat(type, "]"), {
|
|
363
|
+
start: start,
|
|
364
|
+
end: end
|
|
365
|
+
});
|
|
366
|
+
}
|
|
328
367
|
} catch (e) {
|
|
329
368
|
// do nothing
|
|
330
369
|
}
|
|
@@ -385,10 +424,23 @@ function addHold(interactionId, labelStack, name, experimental) {
|
|
|
385
424
|
if (isPerformanceTracingEnabled()) {
|
|
386
425
|
try {
|
|
387
426
|
// for Firefox 102 and older
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
427
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
428
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
|
|
429
|
+
start: start,
|
|
430
|
+
end: end,
|
|
431
|
+
detail: {
|
|
432
|
+
devtools: {
|
|
433
|
+
track: '🛸 reactUFO detailed timings',
|
|
434
|
+
color: 'secondary-light'
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
} else {
|
|
439
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack, name), " [hold]"), {
|
|
440
|
+
start: start,
|
|
441
|
+
end: end
|
|
442
|
+
});
|
|
443
|
+
}
|
|
392
444
|
} catch (e) {
|
|
393
445
|
// do nothing
|
|
394
446
|
}
|
|
@@ -515,10 +567,23 @@ function addProfilerTimings(interactionId, labelStack, type, actualDuration, bas
|
|
|
515
567
|
if (isPerformanceTracingEnabled()) {
|
|
516
568
|
try {
|
|
517
569
|
// for Firefox 102 and older
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
570
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
571
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
|
|
572
|
+
start: startTime,
|
|
573
|
+
duration: actualDuration,
|
|
574
|
+
detail: {
|
|
575
|
+
devtools: {
|
|
576
|
+
track: '🛸 reactUFO detailed timings',
|
|
577
|
+
color: 'secondary-dark'
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
} else {
|
|
582
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [react-profiler] ").concat(type), {
|
|
583
|
+
start: startTime,
|
|
584
|
+
duration: actualDuration
|
|
585
|
+
});
|
|
586
|
+
}
|
|
522
587
|
} catch (e) {
|
|
523
588
|
// do nothing
|
|
524
589
|
}
|
|
@@ -555,10 +620,24 @@ function finishInteraction(id, data) {
|
|
|
555
620
|
data.end = endTime;
|
|
556
621
|
try {
|
|
557
622
|
// for Firefox 102 and older
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
623
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
624
|
+
performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
|
|
625
|
+
start: data.start,
|
|
626
|
+
end: data.end,
|
|
627
|
+
detail: {
|
|
628
|
+
devtools: {
|
|
629
|
+
track: 'main metrics',
|
|
630
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
631
|
+
color: 'tertiary'
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
} else {
|
|
636
|
+
performance.measure("\uD83D\uDEF8 [".concat(data.type, "] ").concat(data.ufoName, " [ttai]"), {
|
|
637
|
+
start: data.start,
|
|
638
|
+
end: data.end
|
|
639
|
+
});
|
|
640
|
+
}
|
|
562
641
|
} catch (e) {
|
|
563
642
|
// do nothing
|
|
564
643
|
}
|
|
@@ -607,10 +686,23 @@ function finishInteraction(id, data) {
|
|
|
607
686
|
labelStack = _step3$value$.labelStack,
|
|
608
687
|
start = _step3$value$.start,
|
|
609
688
|
end = _step3$value$.end;
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
689
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
690
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
|
|
691
|
+
start: start,
|
|
692
|
+
end: end,
|
|
693
|
+
detail: {
|
|
694
|
+
devtools: {
|
|
695
|
+
track: '🛸 reactUFO detailed timings',
|
|
696
|
+
color: 'secondary-dark'
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
} else {
|
|
701
|
+
performance.measure("\uD83D\uDEF8 ".concat(labelStackToString(labelStack), " [segment_ttai]"), {
|
|
702
|
+
start: start,
|
|
703
|
+
end: end
|
|
704
|
+
});
|
|
705
|
+
}
|
|
614
706
|
}
|
|
615
707
|
} catch (err) {
|
|
616
708
|
_iterator3.e(err);
|
|
@@ -940,12 +1032,27 @@ function addApdexToAll(apdex) {
|
|
|
940
1032
|
_constants.interactions.forEach(function (interaction, key) {
|
|
941
1033
|
interaction.apdex.push(apdex);
|
|
942
1034
|
try {
|
|
943
|
-
var _apdex$startTime;
|
|
944
1035
|
// for Firefox 102 and older
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1036
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
1037
|
+
var _apdex$startTime;
|
|
1038
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
|
|
1039
|
+
start: (_apdex$startTime = apdex.startTime) !== null && _apdex$startTime !== void 0 ? _apdex$startTime : interaction.start,
|
|
1040
|
+
end: apdex.stopTime,
|
|
1041
|
+
detail: {
|
|
1042
|
+
devtools: {
|
|
1043
|
+
track: 'main metrics',
|
|
1044
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
1045
|
+
color: 'primary-dark'
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
} else {
|
|
1050
|
+
var _apdex$startTime2;
|
|
1051
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdex.key, " [bm3_tti]"), {
|
|
1052
|
+
start: (_apdex$startTime2 = apdex.startTime) !== null && _apdex$startTime2 !== void 0 ? _apdex$startTime2 : interaction.start,
|
|
1053
|
+
end: apdex.stopTime
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
949
1056
|
} catch (e) {
|
|
950
1057
|
// do nothing
|
|
951
1058
|
}
|
|
@@ -959,12 +1066,27 @@ function addApdex(interactionId, apdexInfo) {
|
|
|
959
1066
|
if (interaction != null) {
|
|
960
1067
|
interaction.apdex.push(apdexInfo);
|
|
961
1068
|
try {
|
|
962
|
-
var _apdexInfo$startTime;
|
|
963
1069
|
// for Firefox 102 and older
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1070
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
1071
|
+
var _apdexInfo$startTime;
|
|
1072
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
|
|
1073
|
+
start: (_apdexInfo$startTime = apdexInfo.startTime) !== null && _apdexInfo$startTime !== void 0 ? _apdexInfo$startTime : interaction.start,
|
|
1074
|
+
end: apdexInfo.stopTime,
|
|
1075
|
+
detail: {
|
|
1076
|
+
devtools: {
|
|
1077
|
+
track: 'main metrics',
|
|
1078
|
+
trackGroup: '🛸 reactUFO metrics',
|
|
1079
|
+
color: 'primary-dark'
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
} else {
|
|
1084
|
+
var _apdexInfo$startTime2;
|
|
1085
|
+
performance.measure("\uD83D\uDEF8 ".concat(apdexInfo.key, " [bm3_tti]"), {
|
|
1086
|
+
start: (_apdexInfo$startTime2 = apdexInfo.startTime) !== null && _apdexInfo$startTime2 !== void 0 ? _apdexInfo$startTime2 : interaction.start,
|
|
1087
|
+
end: apdexInfo.stopTime
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
968
1090
|
} catch (e) {
|
|
969
1091
|
// do nothing
|
|
970
1092
|
}
|
|
@@ -1027,12 +1149,26 @@ function addRedirect(interactionId, fromUfoName, nextUfoName, nextRouteName, tim
|
|
|
1027
1149
|
if (isPerformanceTracingEnabled()) {
|
|
1028
1150
|
var prevRedirect = interaction.redirects.at(-2);
|
|
1029
1151
|
try {
|
|
1030
|
-
var _prevRedirect$time;
|
|
1031
1152
|
// for Firefox 102 and older
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1153
|
+
if ((0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
1154
|
+
var _prevRedirect$time;
|
|
1155
|
+
performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
|
|
1156
|
+
start: (_prevRedirect$time = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time !== void 0 ? _prevRedirect$time : interaction.start,
|
|
1157
|
+
end: time,
|
|
1158
|
+
detail: {
|
|
1159
|
+
devtools: {
|
|
1160
|
+
track: '🛸 reactUFO detailed timings',
|
|
1161
|
+
color: 'tertiary'
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
});
|
|
1165
|
+
} else {
|
|
1166
|
+
var _prevRedirect$time2;
|
|
1167
|
+
performance.measure("\uD83D\uDEF8 ".concat(nextUfoName, " [redirect]"), {
|
|
1168
|
+
start: (_prevRedirect$time2 = prevRedirect === null || prevRedirect === void 0 ? void 0 : prevRedirect.time) !== null && _prevRedirect$time2 !== void 0 ? _prevRedirect$time2 : interaction.start,
|
|
1169
|
+
end: time
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1036
1172
|
} catch (e) {
|
|
1037
1173
|
// do nothing
|
|
1038
1174
|
}
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -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 =
|
|
174
|
+
_context.next = 20;
|
|
173
175
|
break;
|
|
174
176
|
}
|
|
175
177
|
return _context.abrupt("return", v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {});
|
|
176
|
-
case
|
|
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
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
});
|
|
@@ -10,7 +10,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _vcUtils = require("../../vc-observer/media-wrapper/vc-utils");
|
|
15
14
|
var _isNonVisualStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation"));
|
|
16
15
|
var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
|
|
@@ -55,21 +54,18 @@ var createElementMutationsWatcher = function createElementMutationsWatcher(remov
|
|
|
55
54
|
return function (_ref) {
|
|
56
55
|
var target = _ref.target,
|
|
57
56
|
rect = _ref.rect;
|
|
58
|
-
var isNoLsMarkerEnabled = (0, _platformFeatureFlags.fg)('platform_vc_ignore_no_ls_mutation_marker');
|
|
59
57
|
var isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(target);
|
|
60
|
-
if (!isInIgnoreLsMarker
|
|
58
|
+
if (!isInIgnoreLsMarker) {
|
|
61
59
|
return 'mutation:element';
|
|
62
60
|
}
|
|
63
61
|
var isRLLPlaceholder = _rllPlaceholders.RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
|
|
64
|
-
if (isRLLPlaceholder &&
|
|
62
|
+
if (isRLLPlaceholder && isInIgnoreLsMarker) {
|
|
65
63
|
return 'mutation:rll-placeholder';
|
|
66
64
|
}
|
|
67
65
|
var wasDeleted = removedNodeRects.some(function (nr) {
|
|
68
66
|
return sameRectDimensions(nr, rect);
|
|
69
67
|
});
|
|
70
|
-
|
|
71
|
-
// no layout shift mutation is excluded as per existing fy25.03 logic
|
|
72
|
-
if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
|
|
68
|
+
if (wasDeleted && isInIgnoreLsMarker) {
|
|
73
69
|
return 'mutation:element-replacement';
|
|
74
70
|
}
|
|
75
71
|
return 'mutation:element';
|
|
@@ -125,7 +121,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
125
121
|
_context2.prev = 4;
|
|
126
122
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
127
123
|
var _this$intersectionObs8;
|
|
128
|
-
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker,
|
|
124
|
+
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
|
|
129
125
|
return _regenerator.default.wrap(function _loop$(_context) {
|
|
130
126
|
while (1) switch (_context.prev = _context.next) {
|
|
131
127
|
case 0:
|
|
@@ -137,7 +133,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
137
133
|
}
|
|
138
134
|
return _context.abrupt("return", 0);
|
|
139
135
|
case 4:
|
|
140
|
-
if (!
|
|
136
|
+
if (!_this.getSSRState) {
|
|
141
137
|
_context.next = 19;
|
|
142
138
|
break;
|
|
143
139
|
}
|
|
@@ -172,7 +168,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
172
168
|
case 18:
|
|
173
169
|
ssrState.state = SSRStateEnum.normal;
|
|
174
170
|
case 19:
|
|
175
|
-
if (!
|
|
171
|
+
if (!_this.getSSRPlaceholderHandler) {
|
|
176
172
|
_context.next = 36;
|
|
177
173
|
break;
|
|
178
174
|
}
|
|
@@ -219,32 +215,30 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
219
215
|
return n.isEqualNode(addedNode);
|
|
220
216
|
});
|
|
221
217
|
isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(addedNode);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (!(sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker))) {
|
|
225
|
-
_context.next = 42;
|
|
218
|
+
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
219
|
+
_context.next = 41;
|
|
226
220
|
break;
|
|
227
221
|
}
|
|
228
222
|
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
|
|
229
223
|
return _context.abrupt("return", 0);
|
|
230
|
-
case
|
|
224
|
+
case 41:
|
|
231
225
|
if (!(0, _vcUtils.isContainedWithinMediaWrapper)(addedNode)) {
|
|
232
|
-
_context.next =
|
|
226
|
+
_context.next = 44;
|
|
233
227
|
break;
|
|
234
228
|
}
|
|
235
229
|
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
|
|
236
230
|
return _context.abrupt("return", 0);
|
|
237
|
-
case
|
|
231
|
+
case 44:
|
|
238
232
|
_checkWithinComponent = (0, _checkWithinComponentAndExtractChildProps.default)(addedNode, 'UFOThirdPartySegment'), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
|
|
239
233
|
if (!isWithinThirdPartySegment) {
|
|
240
|
-
_context.next =
|
|
234
|
+
_context.next = 48;
|
|
241
235
|
break;
|
|
242
236
|
}
|
|
243
237
|
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
244
238
|
return _context.abrupt("return", 0);
|
|
245
|
-
case
|
|
239
|
+
case 48:
|
|
246
240
|
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
247
|
-
case
|
|
241
|
+
case 49:
|
|
248
242
|
case "end":
|
|
249
243
|
return _context.stop();
|
|
250
244
|
}
|