@atlaskit/react-ufo 4.5.12 → 4.6.1
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 +19 -0
- package/dist/cjs/config/index.js +19 -6
- package/dist/cjs/create-payload/index.js +3 -1
- package/dist/cjs/create-post-interaction-log-payload/get-late-mutations.js +15 -3
- package/dist/cjs/create-post-interaction-log-payload/index.js +2 -1
- package/dist/cjs/interaction-metrics/index.js +2 -1
- package/dist/cjs/segment/segment.js +19 -2
- package/dist/cjs/trace-hover/index.js +12 -0
- package/dist/cjs/trace-interaction/internal/trace-ufo-interaction.js +23 -6
- package/dist/cjs/vc/vc-observer-new/index.js +74 -11
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +91 -36
- package/dist/es2019/config/index.js +13 -0
- package/dist/es2019/create-payload/index.js +3 -0
- package/dist/es2019/create-post-interaction-log-payload/get-late-mutations.js +12 -3
- package/dist/es2019/create-post-interaction-log-payload/index.js +2 -1
- package/dist/es2019/interaction-metrics/index.js +2 -1
- package/dist/es2019/segment/segment.js +21 -4
- package/dist/es2019/trace-hover/index.js +5 -0
- package/dist/es2019/trace-interaction/internal/trace-ufo-interaction.js +24 -7
- package/dist/es2019/vc/vc-observer-new/index.js +67 -10
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +56 -8
- package/dist/esm/config/index.js +18 -6
- package/dist/esm/create-payload/index.js +3 -1
- package/dist/esm/create-post-interaction-log-payload/get-late-mutations.js +15 -3
- package/dist/esm/create-post-interaction-log-payload/index.js +2 -1
- package/dist/esm/interaction-metrics/index.js +2 -1
- package/dist/esm/segment/segment.js +21 -4
- package/dist/esm/trace-hover/index.js +5 -0
- package/dist/esm/trace-interaction/internal/trace-ufo-interaction.js +24 -7
- package/dist/esm/vc/vc-observer-new/index.js +74 -11
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +91 -36
- package/dist/types/common/common/types.d.ts +5 -0
- package/dist/types/common/react-ufo-payload-schema.d.ts +4 -1
- package/dist/types/common/vc/types.d.ts +7 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/create-payload/index.d.ts +512 -0
- package/dist/types/create-post-interaction-log-payload/get-late-mutations.d.ts +2 -2
- package/dist/types/trace-hover/index.d.ts +2 -0
- package/dist/types/vc/vc-observer/getVCRevisionDebugDetails.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +5 -0
- package/dist/types-ts4.5/common/common/types.d.ts +5 -0
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +4 -1
- package/dist/types-ts4.5/common/vc/types.d.ts +7 -0
- package/dist/types-ts4.5/config/index.d.ts +2 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +512 -0
- package/dist/types-ts4.5/create-post-interaction-log-payload/get-late-mutations.d.ts +2 -2
- package/dist/types-ts4.5/trace-hover/index.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionDebugDetails.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +5 -0
- package/package.json +13 -1
- package/trace-hover/package.json +15 -0
|
@@ -5,6 +5,7 @@ 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
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { SSRPlaceholderHandlers } from '../vc-observer/observers/ssr-placeholders';
|
|
9
10
|
import EntriesTimeline from './entries-timeline';
|
|
10
11
|
import _getElementName from './get-element-name';
|
|
@@ -68,18 +69,27 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
68
69
|
if (element) {
|
|
69
70
|
elementName = _this.getElementName(element);
|
|
70
71
|
}
|
|
72
|
+
var data = {
|
|
73
|
+
type: type,
|
|
74
|
+
elementName: elementName,
|
|
75
|
+
rect: rect,
|
|
76
|
+
previousRect: previousRect,
|
|
77
|
+
visible: visible,
|
|
78
|
+
attributeName: mutationData === null || mutationData === void 0 ? void 0 : mutationData.attributeName,
|
|
79
|
+
oldValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.oldValue,
|
|
80
|
+
newValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.newValue
|
|
81
|
+
};
|
|
82
|
+
if (element && _this.isPostInteraction && fg('platform_ufo_enable_late_mutation_label_stacks')) {
|
|
83
|
+
var labelStacks = getLabelStacks(element);
|
|
84
|
+
if (labelStacks) {
|
|
85
|
+
Object.assign(data, {
|
|
86
|
+
labelStacks: labelStacks
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
71
90
|
_this.entriesTimeline.push({
|
|
72
91
|
time: time,
|
|
73
|
-
data:
|
|
74
|
-
type: type,
|
|
75
|
-
elementName: elementName,
|
|
76
|
-
rect: rect,
|
|
77
|
-
previousRect: previousRect,
|
|
78
|
-
visible: visible,
|
|
79
|
-
attributeName: mutationData === null || mutationData === void 0 ? void 0 : mutationData.attributeName,
|
|
80
|
-
oldValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.oldValue,
|
|
81
|
-
newValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.newValue
|
|
82
|
-
}
|
|
92
|
+
data: data
|
|
83
93
|
});
|
|
84
94
|
},
|
|
85
95
|
// Pass SSR context to ViewportObserver
|
|
@@ -302,4 +312,57 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
302
312
|
}
|
|
303
313
|
}]);
|
|
304
314
|
}();
|
|
305
|
-
export { VCObserverNew as default };
|
|
315
|
+
export { VCObserverNew as default };
|
|
316
|
+
function labelStackFromFiber(fiber) {
|
|
317
|
+
var _fiber$child;
|
|
318
|
+
var value = fiber === null || fiber === void 0 || (_fiber$child = fiber.child) === null || _fiber$child === void 0 || (_fiber$child = _fiber$child.memoizedProps) === null || _fiber$child === void 0 ? void 0 : _fiber$child.value;
|
|
319
|
+
return Array.isArray(value === null || value === void 0 ? void 0 : value.labelStack) ? value.labelStack : [];
|
|
320
|
+
}
|
|
321
|
+
function labelStackToString(labelStack) {
|
|
322
|
+
return labelStack.map(function (label) {
|
|
323
|
+
return label.name;
|
|
324
|
+
}).join('/');
|
|
325
|
+
}
|
|
326
|
+
function labelStackToSegment(labelStack) {
|
|
327
|
+
var segmentIndex = -1;
|
|
328
|
+
for (var i = labelStack.length - 1; i >= 0; i--) {
|
|
329
|
+
if (labelStack[i].segmentId) {
|
|
330
|
+
segmentIndex = i;
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return labelStack.slice(0, segmentIndex + 1).map(function (label) {
|
|
335
|
+
return label.name;
|
|
336
|
+
}).join('/');
|
|
337
|
+
}
|
|
338
|
+
function traverseFiber(fiber) {
|
|
339
|
+
var segment = 'unknown';
|
|
340
|
+
var labelStackString = 'unknown';
|
|
341
|
+
var currentFiber = fiber;
|
|
342
|
+
while (currentFiber) {
|
|
343
|
+
if (currentFiber.type) {
|
|
344
|
+
var componentName = currentFiber.type.displayName || currentFiber.type.name;
|
|
345
|
+
if (componentName === 'UFOSegment' || componentName === 'UFOLabel') {
|
|
346
|
+
var labelStack = labelStackFromFiber(currentFiber);
|
|
347
|
+
labelStackString = labelStackToString(labelStack) || 'unknown';
|
|
348
|
+
segment = labelStackToSegment(labelStack) || 'unknown';
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
currentFiber = currentFiber.return;
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
segment: segment,
|
|
356
|
+
labelStack: labelStackString
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function getLabelStacks(element) {
|
|
360
|
+
var reactFiberKey = Object.keys(element).find(function (key) {
|
|
361
|
+
return key.startsWith('__reactFiber$');
|
|
362
|
+
});
|
|
363
|
+
if (!reactFiberKey) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
var fiber = element[reactFiberKey];
|
|
367
|
+
return fiber ? traverseFiber(fiber) : null;
|
|
368
|
+
}
|
|
@@ -11,6 +11,9 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
11
11
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
12
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import getPageVisibilityUpToTTAI from '../../../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
15
|
+
import { getInteractionId } from '../../../interaction-id-context';
|
|
16
|
+
import { interactions } from '../../../interaction-metrics/common/constants';
|
|
14
17
|
import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
|
|
15
18
|
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
16
19
|
import getViewportHeight from './utils/get-viewport-height';
|
|
@@ -76,12 +79,35 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
76
79
|
}
|
|
77
80
|
return ratios;
|
|
78
81
|
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "getLabelStacks",
|
|
84
|
+
value: function getLabelStacks(filteredEntries) {
|
|
85
|
+
var labelStacks = {};
|
|
86
|
+
var _iterator3 = _createForOfIteratorHelper(filteredEntries),
|
|
87
|
+
_step3;
|
|
88
|
+
try {
|
|
89
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
90
|
+
var _entry2 = _step3.value;
|
|
91
|
+
if ('elementName' in _entry2.data && _entry2.data.labelStacks) {
|
|
92
|
+
labelStacks[_entry2.data.elementName] = {
|
|
93
|
+
segment: _entry2.data.labelStacks.segment,
|
|
94
|
+
labelStack: _entry2.data.labelStacks.labelStack
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} catch (err) {
|
|
99
|
+
_iterator3.e(err);
|
|
100
|
+
} finally {
|
|
101
|
+
_iterator3.f();
|
|
102
|
+
}
|
|
103
|
+
return labelStacks;
|
|
104
|
+
}
|
|
79
105
|
}, {
|
|
80
106
|
key: "calculateWithDebugInfo",
|
|
81
107
|
value: function () {
|
|
82
108
|
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p) {
|
|
83
109
|
var _window, _window2, _window3, _window5;
|
|
84
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer,
|
|
110
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _activeInteractionId$, activeInteractionId, activeInteraction, pageVisibilityUpToTTAI, isBackgrounded, _window4, _window4$__ufo_devtoo, _window6, _window6$__on_ufo_vc_;
|
|
85
111
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
86
112
|
while (1) switch (_context.prev = _context.next) {
|
|
87
113
|
case 0:
|
|
@@ -109,16 +135,16 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
109
135
|
_context.next = 29;
|
|
110
136
|
break;
|
|
111
137
|
}
|
|
112
|
-
|
|
138
|
+
_iterator4 = _createForOfIteratorHelper(vcLogs);
|
|
113
139
|
_context.prev = 11;
|
|
114
|
-
|
|
140
|
+
_iterator4.s();
|
|
115
141
|
case 13:
|
|
116
|
-
if ((
|
|
142
|
+
if ((_step4 = _iterator4.n()).done) {
|
|
117
143
|
_context.next = 21;
|
|
118
144
|
break;
|
|
119
145
|
}
|
|
120
|
-
|
|
121
|
-
time =
|
|
146
|
+
_entry3 = _step4.value;
|
|
147
|
+
time = _entry3.time, viewportPercentage = _entry3.viewportPercentage, entries = _entry3.entries; // Only process entries if we haven't reached all percentiles
|
|
122
148
|
if (!(percentileIndex >= percentiles.length)) {
|
|
123
149
|
_context.next = 18;
|
|
124
150
|
break;
|
|
@@ -155,10 +181,10 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
155
181
|
case 23:
|
|
156
182
|
_context.prev = 23;
|
|
157
183
|
_context.t0 = _context["catch"](11);
|
|
158
|
-
|
|
184
|
+
_iterator4.e(_context.t0);
|
|
159
185
|
case 26:
|
|
160
186
|
_context.prev = 26;
|
|
161
|
-
|
|
187
|
+
_iterator4.f();
|
|
162
188
|
return _context.finish(26);
|
|
163
189
|
case 29:
|
|
164
190
|
// Fill in any missing percentiles with the last known values
|
|
@@ -175,7 +201,15 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
175
201
|
}
|
|
176
202
|
}
|
|
177
203
|
enhancedVcLogs = vcLogs ? vcLogs.map(function (log) {
|
|
178
|
-
return _objectSpread(_objectSpread({}, log),
|
|
204
|
+
return _objectSpread(_objectSpread(_objectSpread({}, log), fg('platform_ufo_serialise_ttvc_v3_debug_data') && {
|
|
205
|
+
entries: log.entries.map(function (entry) {
|
|
206
|
+
var _entry$rect, _entry$previousRect;
|
|
207
|
+
return _objectSpread(_objectSpread({}, entry), {}, {
|
|
208
|
+
rect: (_entry$rect = entry.rect) === null || _entry$rect === void 0 ? void 0 : _entry$rect.toJSON(),
|
|
209
|
+
previousRect: (_entry$previousRect = entry.previousRect) === null || _entry$previousRect === void 0 ? void 0 : _entry$previousRect.toJSON()
|
|
210
|
+
});
|
|
211
|
+
})
|
|
212
|
+
}), {}, {
|
|
179
213
|
viewportPercentage: log.viewportPercentage
|
|
180
214
|
});
|
|
181
215
|
}) : []; // If 3p metric enabled - calculate the debug details
|
|
@@ -188,10 +222,10 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
188
222
|
}); // Pre-calculate max viewport percentage up to each time for efficient lookups
|
|
189
223
|
maxViewportPercentageAtTime = new Map();
|
|
190
224
|
maxSoFar = 0;
|
|
191
|
-
|
|
225
|
+
_iterator5 = _createForOfIteratorHelper(sortedVcLogs);
|
|
192
226
|
try {
|
|
193
|
-
for (
|
|
194
|
-
log =
|
|
227
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
228
|
+
log = _step5.value;
|
|
195
229
|
if (log.viewportPercentage !== null) {
|
|
196
230
|
maxSoFar = Math.max(maxSoFar, log.viewportPercentage);
|
|
197
231
|
maxViewportPercentageAtTime.set(log.time, maxSoFar);
|
|
@@ -200,9 +234,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
200
234
|
|
|
201
235
|
// Helper function to find the biggest previous viewport percentage
|
|
202
236
|
} catch (err) {
|
|
203
|
-
|
|
237
|
+
_iterator5.e(err);
|
|
204
238
|
} finally {
|
|
205
|
-
|
|
239
|
+
_iterator5.f();
|
|
206
240
|
}
|
|
207
241
|
getBiggestPreviousViewportPercentage = function getBiggestPreviousViewportPercentage(targetTime) {
|
|
208
242
|
// Binary search for the largest time <= targetTime
|
|
@@ -221,17 +255,20 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
221
255
|
return result >= 0 ? maxViewportPercentageAtTime.get(sortedVcLogs[result].time) || null : null;
|
|
222
256
|
}; // Group ignored entries by timestamp
|
|
223
257
|
ignoredEntriesByTime = new Map();
|
|
224
|
-
|
|
258
|
+
_iterator6 = _createForOfIteratorHelper(allEntries);
|
|
225
259
|
try {
|
|
226
|
-
for (
|
|
227
|
-
|
|
228
|
-
if ('rect' in
|
|
229
|
-
viewportData =
|
|
230
|
-
timestamp = Math.round(
|
|
260
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
261
|
+
_entry4 = _step6.value;
|
|
262
|
+
if ('rect' in _entry4.data && !this.isEntryIncluded(_entry4, include3p)) {
|
|
263
|
+
viewportData = _entry4.data;
|
|
264
|
+
timestamp = Math.round(_entry4.time);
|
|
231
265
|
if (!ignoredEntriesByTime.has(timestamp)) {
|
|
232
266
|
ignoredEntriesByTime.set(timestamp, []);
|
|
233
267
|
}
|
|
234
|
-
(_ignoredEntriesByTime = ignoredEntriesByTime.get(timestamp)) === null || _ignoredEntriesByTime === void 0 || _ignoredEntriesByTime.push(_objectSpread(_objectSpread({}, viewportData),
|
|
268
|
+
(_ignoredEntriesByTime = ignoredEntriesByTime.get(timestamp)) === null || _ignoredEntriesByTime === void 0 || _ignoredEntriesByTime.push(_objectSpread(_objectSpread(_objectSpread({}, viewportData), fg('platform_ufo_serialise_ttvc_v3_debug_data') && {
|
|
269
|
+
rect: (_viewportData$rect = viewportData.rect) === null || _viewportData$rect === void 0 ? void 0 : _viewportData$rect.toJSON(),
|
|
270
|
+
previousRect: (_viewportData$previou = viewportData.previousRect) === null || _viewportData$previou === void 0 ? void 0 : _viewportData$previou.toJSON()
|
|
271
|
+
}), {}, {
|
|
235
272
|
ignoreReason: viewportData.visible ? viewportData.type : 'not-visible'
|
|
236
273
|
}));
|
|
237
274
|
}
|
|
@@ -239,15 +276,15 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
239
276
|
|
|
240
277
|
// Add ignored entries to vcLogs
|
|
241
278
|
} catch (err) {
|
|
242
|
-
|
|
279
|
+
_iterator6.e(err);
|
|
243
280
|
} finally {
|
|
244
|
-
|
|
281
|
+
_iterator6.f();
|
|
245
282
|
}
|
|
246
283
|
additionalVcLogs = [];
|
|
247
|
-
|
|
284
|
+
_iterator7 = _createForOfIteratorHelper(ignoredEntriesByTime);
|
|
248
285
|
try {
|
|
249
|
-
for (
|
|
250
|
-
|
|
286
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
287
|
+
_step7$value = _slicedToArray(_step7.value, 2), _timestamp = _step7$value[0], ignoredEntries = _step7$value[1];
|
|
251
288
|
if (ignoredEntries.length > 0) {
|
|
252
289
|
_viewportPercentage = getBiggestPreviousViewportPercentage(_timestamp);
|
|
253
290
|
additionalVcLogs.push({
|
|
@@ -260,9 +297,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
260
297
|
|
|
261
298
|
// Combine and sort all vcLogs
|
|
262
299
|
} catch (err) {
|
|
263
|
-
|
|
300
|
+
_iterator7.e(err);
|
|
264
301
|
} finally {
|
|
265
|
-
|
|
302
|
+
_iterator7.f();
|
|
266
303
|
}
|
|
267
304
|
enhancedVcLogs = [].concat(_toConsumableArray(enhancedVcLogs), additionalVcLogs).sort(function (a, b) {
|
|
268
305
|
return a.time - b.time;
|
|
@@ -272,13 +309,28 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
272
309
|
// Only create debug details if callbacks exist
|
|
273
310
|
v3RevisionDebugDetails = null;
|
|
274
311
|
if (shouldCalculateDebugDetails) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
312
|
+
if (fg('platform_ufo_unify_abort_status_in_ttvc_debug_data')) {
|
|
313
|
+
// NOTE: using this instead of directly calling `getActiveInteraction()` to get around circular dependencies
|
|
314
|
+
activeInteractionId = getInteractionId();
|
|
315
|
+
activeInteraction = interactions.get((_activeInteractionId$ = activeInteractionId.current) !== null && _activeInteractionId$ !== void 0 ? _activeInteractionId$ : '');
|
|
316
|
+
pageVisibilityUpToTTAI = activeInteraction ? getPageVisibilityUpToTTAI(activeInteraction) : null;
|
|
317
|
+
isBackgrounded = pageVisibilityUpToTTAI !== 'visible';
|
|
318
|
+
v3RevisionDebugDetails = {
|
|
319
|
+
revision: this.revisionNo,
|
|
320
|
+
isClean: isVCClean && !(activeInteraction !== null && activeInteraction !== void 0 && activeInteraction.abortReason) && !isBackgrounded,
|
|
321
|
+
abortReason: isBackgrounded ? 'browser_backgrounded' : dirtyReason !== null && dirtyReason !== void 0 ? dirtyReason : activeInteraction === null || activeInteraction === void 0 ? void 0 : activeInteraction.abortReason,
|
|
322
|
+
vcLogs: enhancedVcLogs,
|
|
323
|
+
interactionId: interactionId
|
|
324
|
+
};
|
|
325
|
+
} else {
|
|
326
|
+
v3RevisionDebugDetails = {
|
|
327
|
+
revision: this.revisionNo,
|
|
328
|
+
isClean: isVCClean,
|
|
329
|
+
abortReason: dirtyReason,
|
|
330
|
+
vcLogs: enhancedVcLogs,
|
|
331
|
+
interactionId: interactionId
|
|
332
|
+
};
|
|
333
|
+
}
|
|
282
334
|
}
|
|
283
335
|
|
|
284
336
|
// Handle devtool callback
|
|
@@ -362,11 +414,14 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
362
414
|
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
363
415
|
};
|
|
364
416
|
result.ratios = this.calculateRatios(filteredEntries);
|
|
417
|
+
if (isPostInteraction) {
|
|
418
|
+
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
419
|
+
}
|
|
365
420
|
if (fg('platform_ufo_display_content_track_occurrence')) {
|
|
366
421
|
result.displayContentsOccurrence = cssIssueOccurrence;
|
|
367
422
|
}
|
|
368
423
|
return _context2.abrupt("return", result);
|
|
369
|
-
case
|
|
424
|
+
case 15:
|
|
370
425
|
case "end":
|
|
371
426
|
return _context2.stop();
|
|
372
427
|
}
|
|
@@ -90,6 +90,10 @@ export type ResponsivenessMetric = {
|
|
|
90
90
|
visuallyComplete?: number;
|
|
91
91
|
totalBlockingTime?: number;
|
|
92
92
|
};
|
|
93
|
+
export type MinorInteraction = {
|
|
94
|
+
name: string;
|
|
95
|
+
startTime: DOMHighResTimeStamp;
|
|
96
|
+
};
|
|
93
97
|
export interface InteractionMetrics {
|
|
94
98
|
id: string;
|
|
95
99
|
start: number;
|
|
@@ -170,6 +174,7 @@ export interface InteractionMetrics {
|
|
|
170
174
|
unknownElementHierarchy?: string;
|
|
171
175
|
hold3pActive?: Map<string, HoldActive>;
|
|
172
176
|
hold3pInfo?: HoldInfo[];
|
|
177
|
+
minorInteractions?: MinorInteraction[];
|
|
173
178
|
}
|
|
174
179
|
export type LoadProfilerEventInfo = {
|
|
175
180
|
identifier: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type createPayloads } from '../create-payload';
|
|
2
2
|
import { type LabelStack } from '../interaction-context';
|
|
3
3
|
import { type VCObserver } from '../vc/vc-observer';
|
|
4
|
-
import type { AbortReasonType, ApdexType, HoldActive, InteractionError, InteractionType, SegmentInfo } from './common/types';
|
|
4
|
+
import type { AbortReasonType, ApdexType, HoldActive, InteractionError, InteractionType, MinorInteraction, SegmentInfo } from './common/types';
|
|
5
5
|
import type { RevisionPayload } from './vc/types';
|
|
6
6
|
type ExtractPromise<T> = T extends Promise<infer U> ? U : never;
|
|
7
7
|
export type PageVisibility = 'hidden' | 'mixed' | 'visible';
|
|
@@ -158,6 +158,7 @@ export type ReactUFOPayload = {
|
|
|
158
158
|
holdActive: HoldActive[];
|
|
159
159
|
unknownElementName?: string;
|
|
160
160
|
unknownElementHierarchy?: string;
|
|
161
|
+
minorInteractions?: MinorInteraction[];
|
|
161
162
|
};
|
|
162
163
|
'ufo:vc:rev': RevisionPayload;
|
|
163
164
|
'ufo:vc:ratios': Record<string, number>;
|
|
@@ -200,6 +201,8 @@ export type LateMutation = {
|
|
|
200
201
|
time: number;
|
|
201
202
|
element: string;
|
|
202
203
|
viewportHeatmapPercentage: number;
|
|
204
|
+
segment?: string;
|
|
205
|
+
labelStack?: string;
|
|
203
206
|
};
|
|
204
207
|
export type PostInteractionLogPayload = {
|
|
205
208
|
actionSubject: 'experience';
|
|
@@ -14,6 +14,12 @@ export type VCAbortReasonType = {
|
|
|
14
14
|
export type VCRatioType = {
|
|
15
15
|
[elementName: string]: number;
|
|
16
16
|
};
|
|
17
|
+
export type VCLabelStacks = {
|
|
18
|
+
[elementName: string]: {
|
|
19
|
+
segment: string;
|
|
20
|
+
labelStack: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
17
23
|
export type VCRawDataType = {
|
|
18
24
|
abortReasonInfo: string | null;
|
|
19
25
|
abortReason: VCAbortReasonType;
|
|
@@ -114,6 +120,7 @@ export type RevisionPayloadEntry = {
|
|
|
114
120
|
clean: boolean;
|
|
115
121
|
vcDetails?: RevisionPayloadVCDetails;
|
|
116
122
|
ratios?: VCRatioType;
|
|
123
|
+
labelStacks?: VCLabelStacks;
|
|
117
124
|
abortReason?: VCAbortReason | null;
|
|
118
125
|
abortTimestamp?: number;
|
|
119
126
|
displayContentsOccurrence?: number;
|
|
@@ -59,6 +59,7 @@ export type ReactHydrationStats = {
|
|
|
59
59
|
export type Config = {
|
|
60
60
|
readonly enabled?: boolean;
|
|
61
61
|
readonly interactionTimeout?: Record<string, number>;
|
|
62
|
+
readonly minorInteractions?: string[];
|
|
62
63
|
readonly doNotAbortActivePressInteraction?: string[];
|
|
63
64
|
readonly doNotAbortActivePressInteractionOnTransition?: string[];
|
|
64
65
|
readonly awaitBM3TTI?: string[];
|
|
@@ -165,6 +166,7 @@ type ValidTypingMethod = (typeof validTypingMethods)[number];
|
|
|
165
166
|
export declare function getTypingPerformanceTracingMethod(): ValidTypingMethod;
|
|
166
167
|
export declare function getAwaitBM3TTIList(): string[];
|
|
167
168
|
export declare function getUfoNameOverrides(): UFONameOverride | undefined;
|
|
169
|
+
export declare function getMinorInteractions(): string[] | undefined;
|
|
168
170
|
export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
|
|
169
171
|
export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
|
|
170
172
|
export declare const CLEANUP_TIMEOUT: number;
|