@atlaskit/react-ufo 3.3.0 → 3.3.2
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 +16 -0
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +1 -0
- package/dist/cjs/create-payload/index.js +63 -156
- package/dist/cjs/create-payload/utils/get-interaction-status.js +37 -0
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +12 -0
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +14 -0
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +96 -0
- package/dist/cjs/interaction-metrics/post-interaction-log.js +1 -0
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +4 -1
- package/dist/cjs/vc/vc-observer/index.js +27 -30
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +1 -0
- package/dist/es2019/create-payload/index.js +11 -80
- package/dist/es2019/create-payload/utils/get-interaction-status.js +31 -0
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +8 -0
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +5 -0
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +53 -0
- package/dist/es2019/interaction-metrics/post-interaction-log.js +1 -0
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +4 -1
- package/dist/es2019/vc/vc-observer/index.js +29 -29
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +1 -0
- package/dist/esm/create-payload/index.js +56 -149
- package/dist/esm/create-payload/utils/get-interaction-status.js +31 -0
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +6 -0
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +5 -0
- package/dist/esm/create-payload/utils/get-vc-metrics.js +89 -0
- package/dist/esm/interaction-metrics/post-interaction-log.js +1 -0
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +4 -1
- package/dist/esm/vc/vc-observer/index.js +27 -30
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +27 -0
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -0
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +2 -0
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +5 -0
- package/dist/types/vc/types.d.ts +1 -0
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +2 -0
- package/dist/types/vc/vc-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +27 -0
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -0
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +2 -0
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +5 -0
- package/dist/types-ts4.5/vc/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122448](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122448)
|
|
8
|
+
[`e3c0eec530ab2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3c0eec530ab2) -
|
|
9
|
+
do not produce VC info on failed, aborted, or non active tab events
|
|
10
|
+
|
|
11
|
+
## 3.3.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#122115](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122115)
|
|
16
|
+
[`b39ca387a9eb6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b39ca387a9eb6) -
|
|
17
|
+
Remove VC multiheatmap FG
|
|
18
|
+
|
|
3
19
|
## 3.3.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -105,6 +105,7 @@ var getExperimentalVCMetrics = exports.getExperimentalVCMetrics = /*#__PURE__*/f
|
|
|
105
105
|
start: interaction.start,
|
|
106
106
|
stop: interaction.end,
|
|
107
107
|
tti: (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime,
|
|
108
|
+
isEventAborted: !!interaction.abortReason,
|
|
108
109
|
prefix: prefix,
|
|
109
110
|
vc: interaction.vc
|
|
110
111
|
});
|
|
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.createExperimentalMetricsPayload = createExperimentalMetricsPayload;
|
|
9
9
|
exports.createPayloads = createPayloads;
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
13
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
16
|
var _bowserUltralight = _interopRequireDefault(require("bowser-ultralight"));
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _additionalPayload = require("../additional-payload");
|
|
@@ -30,8 +30,11 @@ var _interactionMetrics = require("../interaction-metrics");
|
|
|
30
30
|
var resourceTiming = _interopRequireWildcard(require("../resource-timing"));
|
|
31
31
|
var _roundNumber = require("../round-number");
|
|
32
32
|
var ssr = _interopRequireWildcard(require("../ssr"));
|
|
33
|
-
var _vc = require("../vc");
|
|
34
33
|
var _utils = require("./common/utils");
|
|
34
|
+
var _getInteractionStatus = _interopRequireDefault(require("./utils/get-interaction-status"));
|
|
35
|
+
var _getPageVisibilityUpToTtai = _interopRequireDefault(require("./utils/get-page-visibility-up-to-ttai"));
|
|
36
|
+
var _getSsrDoneTimeValue = _interopRequireDefault(require("./utils/get-ssr-done-time-value"));
|
|
37
|
+
var _getVcMetrics = _interopRequireDefault(require("./utils/get-vc-metrics"));
|
|
35
38
|
var _excluded = ["labelStack", "time"],
|
|
36
39
|
_excluded2 = ["stopTime", "labelStack"],
|
|
37
40
|
_excluded3 = ["labelStack"],
|
|
@@ -86,11 +89,6 @@ var getPageVisibilityUpToTTI = function getPageVisibilityUpToTTI(interaction) {
|
|
|
86
89
|
var bm3EndTimeOrInteractionEndTime = getBm3EndTimeOrFallbackValue(interaction);
|
|
87
90
|
return (0, _hiddenTiming.getPageVisibilityState)(start, bm3EndTimeOrInteractionEndTime);
|
|
88
91
|
};
|
|
89
|
-
var getPageVisibilityUpToTTAI = function getPageVisibilityUpToTTAI(interaction) {
|
|
90
|
-
var start = interaction.start,
|
|
91
|
-
end = interaction.end;
|
|
92
|
-
return (0, _hiddenTiming.getPageVisibilityState)(start, end);
|
|
93
|
-
};
|
|
94
92
|
var getVisibilityStateFromPerformance = function getVisibilityStateFromPerformance(stop) {
|
|
95
93
|
try {
|
|
96
94
|
var results = performance.getEntriesByType('visibility-state');
|
|
@@ -136,7 +134,7 @@ var getMoreAccuratePageVisibilityUpToTTI = function getMoreAccuratePageVisibilit
|
|
|
136
134
|
return old;
|
|
137
135
|
};
|
|
138
136
|
var getMoreAccuratePageVisibilityUpToTTAI = function getMoreAccuratePageVisibilityUpToTTAI(interaction) {
|
|
139
|
-
var old =
|
|
137
|
+
var old = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
140
138
|
var buffered = getVisibilityStateFromPerformance(interaction.end);
|
|
141
139
|
if (!buffered) {
|
|
142
140
|
return old;
|
|
@@ -146,15 +144,6 @@ var getMoreAccuratePageVisibilityUpToTTAI = function getMoreAccuratePageVisibili
|
|
|
146
144
|
}
|
|
147
145
|
return old;
|
|
148
146
|
};
|
|
149
|
-
var getInteractionStatus = function getInteractionStatus(interaction) {
|
|
150
|
-
var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
|
|
151
|
-
var hasBm3TTI = interaction.apdex.length > 0;
|
|
152
|
-
var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
|
|
153
|
-
return {
|
|
154
|
-
originalInteractionStatus: originalInteractionStatus,
|
|
155
|
-
overrideStatus: overrideStatus
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
147
|
var getResourceTimings = function getResourceTimings(start, end) {
|
|
159
148
|
var _resourceTiming$getRe;
|
|
160
149
|
return (_resourceTiming$getRe = resourceTiming.getResourceTimings(start, end)) !== null && _resourceTiming$getRe !== void 0 ? _resourceTiming$getRe : undefined;
|
|
@@ -186,87 +175,9 @@ var getPaintMetrics = function getPaintMetrics(type) {
|
|
|
186
175
|
var getTTAI = function getTTAI(interaction) {
|
|
187
176
|
var start = interaction.start,
|
|
188
177
|
end = interaction.end;
|
|
189
|
-
var pageVisibilityUpToTTAI =
|
|
178
|
+
var pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
190
179
|
return !interaction.abortReason && pageVisibilityUpToTTAI === 'visible' ? Math.round(end - start) : undefined;
|
|
191
180
|
};
|
|
192
|
-
var getVCMetrics = /*#__PURE__*/function () {
|
|
193
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
194
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
|
|
195
|
-
var config, isSSREnabled, ssr, tti, prefix, result, VC, interactionStatus, pageVisibilityUpToTTAI, _result;
|
|
196
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
197
|
-
while (1) switch (_context.prev = _context.next) {
|
|
198
|
-
case 0:
|
|
199
|
-
config = (0, _config.getConfig)();
|
|
200
|
-
if (config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
201
|
-
_context.next = 3;
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
return _context.abrupt("return", {});
|
|
205
|
-
case 3:
|
|
206
|
-
if (!(interaction.type !== 'page_load' && interaction.type !== 'transition')) {
|
|
207
|
-
_context.next = 5;
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
return _context.abrupt("return", {});
|
|
211
|
-
case 5:
|
|
212
|
-
isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
213
|
-
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
214
|
-
ssr: getSSRDoneTimeValue(config)
|
|
215
|
-
} : null;
|
|
216
|
-
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
217
|
-
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
218
|
-
prefix = 'ufo';
|
|
219
|
-
_context.next = 12;
|
|
220
|
-
return (0, _vc.getVCObserver)().getVCResult(_objectSpread({
|
|
221
|
-
start: interaction.start,
|
|
222
|
-
stop: interaction.end,
|
|
223
|
-
tti: tti,
|
|
224
|
-
prefix: prefix,
|
|
225
|
-
vc: interaction.vc
|
|
226
|
-
}, ssr));
|
|
227
|
-
case 12:
|
|
228
|
-
result = _context.sent;
|
|
229
|
-
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
230
|
-
(0, _vc.getVCObserver)().stop();
|
|
231
|
-
}
|
|
232
|
-
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
233
|
-
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
234
|
-
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
235
|
-
_context.next = 18;
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
return _context.abrupt("return", result);
|
|
239
|
-
case 18:
|
|
240
|
-
interactionStatus = getInteractionStatus(interaction);
|
|
241
|
-
pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
242
|
-
if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
|
|
243
|
-
_context.next = 22;
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
return _context.abrupt("return", result);
|
|
247
|
-
case 22:
|
|
248
|
-
if ((0, _platformFeatureFlags.fg)('ufo_vc_multiheatmap')) {
|
|
249
|
-
(_result = result["".concat(prefix, ":vc:rev")]) === null || _result === void 0 || _result.forEach(function (element) {
|
|
250
|
-
var _element$vcDetails;
|
|
251
|
-
if ((_element$vcDetails = element.vcDetails) !== null && _element$vcDetails !== void 0 && (_element$vcDetails = _element$vcDetails['90']) !== null && _element$vcDetails !== void 0 && _element$vcDetails.t) {
|
|
252
|
-
var _element$vcDetails$;
|
|
253
|
-
element['metric:vc90'] = (_element$vcDetails$ = element.vcDetails['90']) === null || _element$vcDetails$ === void 0 ? void 0 : _element$vcDetails$.t;
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
258
|
-
'metric:vc90': VC['90']
|
|
259
|
-
}));
|
|
260
|
-
case 24:
|
|
261
|
-
case "end":
|
|
262
|
-
return _context.stop();
|
|
263
|
-
}
|
|
264
|
-
}, _callee);
|
|
265
|
-
}));
|
|
266
|
-
return function getVCMetrics(_x) {
|
|
267
|
-
return _ref2.apply(this, arguments);
|
|
268
|
-
};
|
|
269
|
-
}();
|
|
270
181
|
var getNavigationMetrics = function getNavigationMetrics(type) {
|
|
271
182
|
if (type !== 'page_load') {
|
|
272
183
|
return {};
|
|
@@ -314,13 +225,13 @@ var getNavigationMetrics = function getNavigationMetrics(type) {
|
|
|
314
225
|
};
|
|
315
226
|
};
|
|
316
227
|
var getPPSMetrics = function getPPSMetrics(interaction) {
|
|
317
|
-
var _interaction$
|
|
228
|
+
var _interaction$apdex;
|
|
318
229
|
var start = interaction.start,
|
|
319
230
|
end = interaction.end;
|
|
320
231
|
var config = (0, _config.getConfig)();
|
|
321
|
-
var interactionStatus =
|
|
322
|
-
var pageVisibilityUpToTTAI =
|
|
323
|
-
var tti = (_interaction$
|
|
232
|
+
var interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
233
|
+
var pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
234
|
+
var tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
324
235
|
var ttai = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && pageVisibilityUpToTTAI === 'visible' ? Math.round(end - start) : undefined;
|
|
325
236
|
var PPSMetricsAtTTI = tti !== undefined ? (0, _additionalPayload.getLighthouseMetrics)({
|
|
326
237
|
start: start,
|
|
@@ -416,10 +327,10 @@ var getTracingContextData = function getTracingContextData(interaction) {
|
|
|
416
327
|
function optimizeCustomData(interaction) {
|
|
417
328
|
var customData = interaction.customData,
|
|
418
329
|
legacyMetrics = interaction.legacyMetrics;
|
|
419
|
-
var customDataMap = customData.reduce(function (result,
|
|
330
|
+
var customDataMap = customData.reduce(function (result, _ref2) {
|
|
420
331
|
var _result$get$data, _result$get;
|
|
421
|
-
var labelStack =
|
|
422
|
-
data =
|
|
332
|
+
var labelStack = _ref2.labelStack,
|
|
333
|
+
data = _ref2.data;
|
|
423
334
|
var label = (0, _utils.stringifyLabelStackFully)(labelStack);
|
|
424
335
|
var value = (_result$get$data = (_result$get = result.get(label)) === null || _result$get === void 0 ? void 0 : _result$get.data) !== null && _result$get$data !== void 0 ? _result$get$data : {};
|
|
425
336
|
result.set(label, {
|
|
@@ -435,13 +346,13 @@ function optimizeCustomData(interaction) {
|
|
|
435
346
|
for (var _i = 0, _Object$entries = Object.entries(currentValue.custom || {}); _i < _Object$entries.length; _i++) {
|
|
436
347
|
var _result$get$data2, _result$get2;
|
|
437
348
|
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
438
|
-
|
|
349
|
+
key = _Object$entries$_i[0],
|
|
439
350
|
value = _Object$entries$_i[1];
|
|
440
351
|
var label = (0, _utils.stringifyLabelStackFully)([]);
|
|
441
352
|
var labelValue = (_result$get$data2 = (_result$get2 = result.get(label)) === null || _result$get2 === void 0 ? void 0 : _result$get2.data) !== null && _result$get$data2 !== void 0 ? _result$get$data2 : {};
|
|
442
353
|
result.set(label, {
|
|
443
354
|
labelStack: (0, _utils.optimizeLabelStack)([], (0, _constants.getReactUFOVersion)(interaction.type)),
|
|
444
|
-
data: Object.assign(labelValue, (0, _defineProperty2.default)({},
|
|
355
|
+
data: Object.assign(labelValue, (0, _defineProperty2.default)({}, key, value))
|
|
445
356
|
});
|
|
446
357
|
}
|
|
447
358
|
return result;
|
|
@@ -451,12 +362,12 @@ function optimizeCustomData(interaction) {
|
|
|
451
362
|
return (0, _toConsumableArray2.default)(customDataMap.values());
|
|
452
363
|
}
|
|
453
364
|
function optimizeReactProfilerTimings(reactProfilerTimings, interactionStart, reactUFOVersion) {
|
|
454
|
-
var reactProfilerTimingsMap = reactProfilerTimings.reduce(function (result,
|
|
455
|
-
var labelStack =
|
|
456
|
-
startTime =
|
|
457
|
-
commitTime =
|
|
458
|
-
actualDuration =
|
|
459
|
-
type =
|
|
365
|
+
var reactProfilerTimingsMap = reactProfilerTimings.reduce(function (result, _ref3) {
|
|
366
|
+
var labelStack = _ref3.labelStack,
|
|
367
|
+
startTime = _ref3.startTime,
|
|
368
|
+
commitTime = _ref3.commitTime,
|
|
369
|
+
actualDuration = _ref3.actualDuration,
|
|
370
|
+
type = _ref3.type;
|
|
460
371
|
if (labelStack && startTime >= interactionStart) {
|
|
461
372
|
var label = (0, _utils.stringifyLabelStackFully)(labelStack);
|
|
462
373
|
var start = Math.round(startTime);
|
|
@@ -602,10 +513,10 @@ function optimizeCustomTimings(customTimings, interactionStart) {
|
|
|
602
513
|
}, []);
|
|
603
514
|
}
|
|
604
515
|
function optimizeMarks(marks, reactUFOVersion) {
|
|
605
|
-
return marks.map(function (
|
|
606
|
-
var labelStack =
|
|
607
|
-
time =
|
|
608
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
516
|
+
return marks.map(function (_ref4) {
|
|
517
|
+
var labelStack = _ref4.labelStack,
|
|
518
|
+
time = _ref4.time,
|
|
519
|
+
others = (0, _objectWithoutProperties2.default)(_ref4, _excluded);
|
|
609
520
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
610
521
|
labelStack: labelStack && (0, _utils.optimizeLabelStack)(labelStack, reactUFOVersion),
|
|
611
522
|
time: Math.round(time)
|
|
@@ -613,10 +524,10 @@ function optimizeMarks(marks, reactUFOVersion) {
|
|
|
613
524
|
});
|
|
614
525
|
}
|
|
615
526
|
function optimizeApdex(apdex, reactUFOVersion) {
|
|
616
|
-
return apdex.map(function (
|
|
617
|
-
var stopTime =
|
|
618
|
-
labelStack =
|
|
619
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
527
|
+
return apdex.map(function (_ref5) {
|
|
528
|
+
var stopTime = _ref5.stopTime,
|
|
529
|
+
labelStack = _ref5.labelStack,
|
|
530
|
+
others = (0, _objectWithoutProperties2.default)(_ref5, _excluded2);
|
|
620
531
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
621
532
|
stopTime: Math.round(stopTime)
|
|
622
533
|
}, labelStack ? {
|
|
@@ -679,10 +590,6 @@ function getBm3TrackerTimings(interaction) {
|
|
|
679
590
|
legacyMetrics: legacyMetrics
|
|
680
591
|
};
|
|
681
592
|
}
|
|
682
|
-
function getSSRDoneTimeValue(config) {
|
|
683
|
-
var _config$ssr, _config$ssr2;
|
|
684
|
-
return config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime ? config === null || config === void 0 || (_config$ssr2 = config.ssr) === null || _config$ssr2 === void 0 ? void 0 : _config$ssr2.getSSRDoneTime() : ssr.getSSRDoneTime();
|
|
685
|
-
}
|
|
686
593
|
function getPayloadSize(payload) {
|
|
687
594
|
return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
|
|
688
595
|
}
|
|
@@ -734,27 +641,27 @@ function getErrorCounts(interaction) {
|
|
|
734
641
|
'ufo:errors:count': interaction.errors.length
|
|
735
642
|
};
|
|
736
643
|
}
|
|
737
|
-
function createInteractionMetricsPayload(_x2, _x3
|
|
644
|
+
function createInteractionMetricsPayload(_x, _x2, _x3) {
|
|
738
645
|
return _createInteractionMetricsPayload.apply(this, arguments);
|
|
739
646
|
}
|
|
740
647
|
function _createInteractionMetricsPayload() {
|
|
741
|
-
_createInteractionMetricsPayload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
648
|
+
_createInteractionMetricsPayload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction, interactionId, experimental) {
|
|
742
649
|
var _window$location, _config$additionalPay;
|
|
743
650
|
var interactionPayloadStart, config, end, start, ufoName, knownSegments, rate, type, abortReason, routeName, featureFlags, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, pageVisibilityAtTTI, pageVisibilityAtTTAI, segments, segmentTree, isDetailedPayload, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTI, moreAccuratePageVisibilityAtTTAI, labelStack, getPageLoadInteractionMetrics, getDetailedInteractionMetrics, getPageLoadDetailedInteractionMetrics, newUFOName, resourceTimings, _yield$Promise$all, _yield$Promise$all2, vcMetrics, experimentalMetrics, payload;
|
|
744
|
-
return _regenerator.default.wrap(function
|
|
745
|
-
while (1) switch (
|
|
651
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
652
|
+
while (1) switch (_context.prev = _context.next) {
|
|
746
653
|
case 0:
|
|
747
654
|
interactionPayloadStart = performance.now();
|
|
748
655
|
config = (0, _config.getConfig)();
|
|
749
656
|
if (config) {
|
|
750
|
-
|
|
657
|
+
_context.next = 4;
|
|
751
658
|
break;
|
|
752
659
|
}
|
|
753
660
|
throw Error('UFO Configuration not provided');
|
|
754
661
|
case 4:
|
|
755
662
|
end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, knownSegments = interaction.knownSegments, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, featureFlags = interaction.featureFlags, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName;
|
|
756
663
|
pageVisibilityAtTTI = getPageVisibilityUpToTTI(interaction);
|
|
757
|
-
pageVisibilityAtTTAI =
|
|
664
|
+
pageVisibilityAtTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
758
665
|
segments = config.killswitchNestedSegments ? [] : knownSegments;
|
|
759
666
|
segmentTree = (0, _constants.getReactUFOVersion)(interaction.type) === '2.0.0' ? (0, _utils.buildSegmentTree)(segments.map(function (segment) {
|
|
760
667
|
return segment.labelStack;
|
|
@@ -768,18 +675,18 @@ function _createInteractionMetricsPayload() {
|
|
|
768
675
|
labelStack: (0, _utils.optimizeLabelStack)(interaction.labelStack, (0, _constants.getReactUFOVersion)(interaction.type))
|
|
769
676
|
} : {}; // Page Load
|
|
770
677
|
getPageLoadInteractionMetrics = function getPageLoadInteractionMetrics() {
|
|
771
|
-
var _config$
|
|
678
|
+
var _config$ssr;
|
|
772
679
|
if (!isPageLoad) {
|
|
773
680
|
return {};
|
|
774
681
|
}
|
|
775
682
|
var config = (0, _config.getConfig)();
|
|
776
|
-
var SSRDoneTimeValue =
|
|
683
|
+
var SSRDoneTimeValue = (0, _getSsrDoneTimeValue.default)(config);
|
|
777
684
|
var SSRDoneTime = SSRDoneTimeValue !== undefined ? {
|
|
778
685
|
SSRDoneTime: Math.round(SSRDoneTimeValue)
|
|
779
686
|
} : {};
|
|
780
687
|
return _objectSpread(_objectSpread({}, SSRDoneTime), {}, {
|
|
781
688
|
isBM3ConfigSSRDoneAsFmp: interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp,
|
|
782
|
-
isUFOConfigSSRDoneAsFmp: interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp || !!(config !== null && config !== void 0 && (_config$
|
|
689
|
+
isUFOConfigSSRDoneAsFmp: interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp || !!(config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime)
|
|
783
690
|
});
|
|
784
691
|
}; // Detailed payload. Page visibility = visible
|
|
785
692
|
getDetailedInteractionMetrics = function getDetailedInteractionMetrics(resourceTimings) {
|
|
@@ -789,9 +696,9 @@ function _createInteractionMetricsPayload() {
|
|
|
789
696
|
var spans = [].concat((0, _toConsumableArray2.default)(interaction.spans), (0, _toConsumableArray2.default)(_interactionMetrics.interactionSpans));
|
|
790
697
|
_interactionMetrics.interactionSpans.length = 0;
|
|
791
698
|
return {
|
|
792
|
-
errors: interaction.errors.map(function (
|
|
793
|
-
var labelStack =
|
|
794
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
699
|
+
errors: interaction.errors.map(function (_ref6) {
|
|
700
|
+
var labelStack = _ref6.labelStack,
|
|
701
|
+
others = (0, _objectWithoutProperties2.default)(_ref6, _excluded3);
|
|
795
702
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
796
703
|
labelStack: labelStack && (0, _utils.optimizeLabelStack)(labelStack, (0, _constants.getReactUFOVersion)(interaction.type))
|
|
797
704
|
});
|
|
@@ -807,14 +714,14 @@ function _createInteractionMetricsPayload() {
|
|
|
807
714
|
};
|
|
808
715
|
}; // Page load & detailed payload
|
|
809
716
|
getPageLoadDetailedInteractionMetrics = function getPageLoadDetailedInteractionMetrics() {
|
|
810
|
-
var _config$
|
|
717
|
+
var _config$ssr2;
|
|
811
718
|
if (!isPageLoad || !isDetailedPayload) {
|
|
812
719
|
return {};
|
|
813
720
|
}
|
|
814
721
|
var config = (0, _config.getConfig)();
|
|
815
722
|
return {
|
|
816
723
|
initialPageLoadExtraTimings: objectToArray(initialPageLoadExtraTiming.getTimings()),
|
|
817
|
-
SSRTimings: config !== null && config !== void 0 && (_config$
|
|
724
|
+
SSRTimings: config !== null && config !== void 0 && (_config$ssr2 = config.ssr) !== null && _config$ssr2 !== void 0 && _config$ssr2.getSSRTimings ? config.ssr.getSSRTimings() : objectToArray(ssr.getSSRTimings())
|
|
818
725
|
};
|
|
819
726
|
};
|
|
820
727
|
if (experimental) {
|
|
@@ -824,10 +731,10 @@ function _createInteractionMetricsPayload() {
|
|
|
824
731
|
}
|
|
825
732
|
newUFOName = (0, _utils.sanitizeUfoName)(ufoName);
|
|
826
733
|
resourceTimings = getResourceTimings(start, end);
|
|
827
|
-
|
|
828
|
-
return Promise.all([
|
|
734
|
+
_context.next = 23;
|
|
735
|
+
return Promise.all([(0, _getVcMetrics.default)(interaction), experimental ? (0, _createExperimentalInteractionMetricsPayload.getExperimentalVCMetrics)(interaction) : Promise.resolve(undefined)]);
|
|
829
736
|
case 23:
|
|
830
|
-
_yield$Promise$all =
|
|
737
|
+
_yield$Promise$all = _context.sent;
|
|
831
738
|
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2);
|
|
832
739
|
vcMetrics = _yield$Promise$all2[0];
|
|
833
740
|
experimentalMetrics = _yield$Promise$all2[1];
|
|
@@ -873,9 +780,9 @@ function _createInteractionMetricsPayload() {
|
|
|
873
780
|
apdex: optimizeApdex(interaction.apdex, (0, _constants.getReactUFOVersion)(interaction.type)),
|
|
874
781
|
end: Math.round(end),
|
|
875
782
|
start: Math.round(start),
|
|
876
|
-
segments: (0, _constants.getReactUFOVersion)(interaction.type) === '2.0.0' ? segmentTree : segments.map(function (
|
|
877
|
-
var labelStack =
|
|
878
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
783
|
+
segments: (0, _constants.getReactUFOVersion)(interaction.type) === '2.0.0' ? segmentTree : segments.map(function (_ref7) {
|
|
784
|
+
var labelStack = _ref7.labelStack,
|
|
785
|
+
others = (0, _objectWithoutProperties2.default)(_ref7, _excluded4);
|
|
879
786
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
880
787
|
labelStack: (0, _utils.optimizeLabelStack)(labelStack, (0, _constants.getReactUFOVersion)(interaction.type))
|
|
881
788
|
});
|
|
@@ -896,38 +803,38 @@ function _createInteractionMetricsPayload() {
|
|
|
896
803
|
expTTAI = undefined;
|
|
897
804
|
}
|
|
898
805
|
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
899
|
-
return
|
|
806
|
+
return _context.abrupt("return", payload);
|
|
900
807
|
case 31:
|
|
901
808
|
case "end":
|
|
902
|
-
return
|
|
809
|
+
return _context.stop();
|
|
903
810
|
}
|
|
904
|
-
},
|
|
811
|
+
}, _callee);
|
|
905
812
|
}));
|
|
906
813
|
return _createInteractionMetricsPayload.apply(this, arguments);
|
|
907
814
|
}
|
|
908
|
-
function createPayloads(
|
|
815
|
+
function createPayloads(_x4, _x5) {
|
|
909
816
|
return _createPayloads.apply(this, arguments);
|
|
910
817
|
}
|
|
911
818
|
function _createPayloads() {
|
|
912
|
-
_createPayloads = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
819
|
+
_createPayloads = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(interactionId, interaction) {
|
|
913
820
|
var ufoNameOverride, modifiedInteraction, interactionMetricsPayload;
|
|
914
|
-
return _regenerator.default.wrap(function
|
|
915
|
-
while (1) switch (
|
|
821
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
822
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
916
823
|
case 0:
|
|
917
824
|
ufoNameOverride = getUfoNameOverride(interaction);
|
|
918
825
|
modifiedInteraction = _objectSpread(_objectSpread({}, interaction), {}, {
|
|
919
826
|
ufoName: ufoNameOverride
|
|
920
827
|
});
|
|
921
|
-
|
|
828
|
+
_context2.next = 4;
|
|
922
829
|
return createInteractionMetricsPayload(modifiedInteraction, interactionId);
|
|
923
830
|
case 4:
|
|
924
|
-
interactionMetricsPayload =
|
|
925
|
-
return
|
|
831
|
+
interactionMetricsPayload = _context2.sent;
|
|
832
|
+
return _context2.abrupt("return", [interactionMetricsPayload]);
|
|
926
833
|
case 6:
|
|
927
834
|
case "end":
|
|
928
|
-
return
|
|
835
|
+
return _context2.stop();
|
|
929
836
|
}
|
|
930
|
-
},
|
|
837
|
+
}, _callee2);
|
|
931
838
|
}));
|
|
932
839
|
return _createPayloads.apply(this, arguments);
|
|
933
840
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getInteractionStatus;
|
|
7
|
+
/**
|
|
8
|
+
* Determines the interaction status based on abort reason and BM3 TTI presence.
|
|
9
|
+
*
|
|
10
|
+
* @param {InteractionMetrics} interaction - The interaction metrics object containing abort reason and apdex data
|
|
11
|
+
* @returns {{
|
|
12
|
+
* originalInteractionStatus: 'ABORTED' | 'SUCCEEDED',
|
|
13
|
+
* overrideStatus: 'ABORTED' | 'SUCCEEDED'
|
|
14
|
+
* }} An object containing both the original and override status
|
|
15
|
+
*
|
|
16
|
+
* @description
|
|
17
|
+
* This function evaluates the interaction status in two ways:
|
|
18
|
+
* 1. originalInteractionStatus: Based on whether there's an abort reason
|
|
19
|
+
* 2. overrideStatus: Based on the presence of BM3 TTI (apdex data)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const interaction = {
|
|
23
|
+
* abortReason: null,
|
|
24
|
+
* apdex: [1, 2, 3]
|
|
25
|
+
* };
|
|
26
|
+
* const result = getInteractionStatus(interaction);
|
|
27
|
+
* // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
|
|
28
|
+
*/
|
|
29
|
+
function getInteractionStatus(interaction) {
|
|
30
|
+
var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
|
|
31
|
+
var hasBm3TTI = interaction.apdex.length > 0;
|
|
32
|
+
var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
|
|
33
|
+
return {
|
|
34
|
+
originalInteractionStatus: originalInteractionStatus,
|
|
35
|
+
overrideStatus: overrideStatus
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getPageVisibilityUpToTTAI;
|
|
7
|
+
var _hiddenTiming = require("../../hidden-timing");
|
|
8
|
+
function getPageVisibilityUpToTTAI(interaction) {
|
|
9
|
+
var start = interaction.start,
|
|
10
|
+
end = interaction.end;
|
|
11
|
+
return (0, _hiddenTiming.getPageVisibilityState)(start, end);
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = getSSRDoneTimeValue;
|
|
8
|
+
var ssr = _interopRequireWildcard(require("../../ssr"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function getSSRDoneTimeValue(config) {
|
|
12
|
+
var _config$ssr, _config$ssr2;
|
|
13
|
+
return config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime ? config === null || config === void 0 || (_config$ssr2 = config.ssr) === null || _config$ssr2 === void 0 ? void 0 : _config$ssr2.getSSRDoneTime() : ssr.getSSRDoneTime();
|
|
14
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = getVCMetrics;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var _config = require("../../config");
|
|
13
|
+
var _interactionMetrics = require("../../interaction-metrics");
|
|
14
|
+
var _vc = require("../../vc");
|
|
15
|
+
var _getInteractionStatus = _interopRequireDefault(require("./get-interaction-status"));
|
|
16
|
+
var _getPageVisibilityUpToTtai = _interopRequireDefault(require("./get-page-visibility-up-to-ttai"));
|
|
17
|
+
var _getSsrDoneTimeValue = _interopRequireDefault(require("./get-ssr-done-time-value"));
|
|
18
|
+
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; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
+
function getVCMetrics(_x) {
|
|
21
|
+
return _getVCMetrics.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
function _getVCMetrics() {
|
|
24
|
+
_getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
25
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
|
|
26
|
+
var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, VC;
|
|
27
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
config = (0, _config.getConfig)();
|
|
31
|
+
if (config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
32
|
+
_context.next = 3;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return _context.abrupt("return", {});
|
|
36
|
+
case 3:
|
|
37
|
+
if (!(interaction.type !== 'page_load' && interaction.type !== 'transition')) {
|
|
38
|
+
_context.next = 5;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
return _context.abrupt("return", {});
|
|
42
|
+
case 5:
|
|
43
|
+
interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
44
|
+
pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
45
|
+
if (!((interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible') && (0, _platformFeatureFlags.fg)('platform_ufo_no_vc_on_aborted'))) {
|
|
46
|
+
_context.next = 9;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
return _context.abrupt("return", {});
|
|
50
|
+
case 9:
|
|
51
|
+
isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
52
|
+
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
53
|
+
ssr: (0, _getSsrDoneTimeValue.default)(config)
|
|
54
|
+
} : null;
|
|
55
|
+
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
56
|
+
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
57
|
+
prefix = 'ufo';
|
|
58
|
+
_context.next = 16;
|
|
59
|
+
return (0, _vc.getVCObserver)().getVCResult(_objectSpread({
|
|
60
|
+
start: interaction.start,
|
|
61
|
+
stop: interaction.end,
|
|
62
|
+
tti: tti,
|
|
63
|
+
prefix: prefix,
|
|
64
|
+
vc: interaction.vc,
|
|
65
|
+
isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED'
|
|
66
|
+
}, ssr));
|
|
67
|
+
case 16:
|
|
68
|
+
result = _context.sent;
|
|
69
|
+
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
70
|
+
(0, _vc.getVCObserver)().stop();
|
|
71
|
+
}
|
|
72
|
+
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
73
|
+
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
74
|
+
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
75
|
+
_context.next = 22;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
return _context.abrupt("return", result);
|
|
79
|
+
case 22:
|
|
80
|
+
if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
|
|
81
|
+
_context.next = 24;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
return _context.abrupt("return", result);
|
|
85
|
+
case 24:
|
|
86
|
+
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
87
|
+
'metric:vc90': VC['90']
|
|
88
|
+
}));
|
|
89
|
+
case 25:
|
|
90
|
+
case "end":
|
|
91
|
+
return _context.stop();
|
|
92
|
+
}
|
|
93
|
+
}, _callee);
|
|
94
|
+
}));
|
|
95
|
+
return _getVCMetrics.apply(this, arguments);
|
|
96
|
+
}
|
|
@@ -137,6 +137,7 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
137
137
|
stop: performance.now(),
|
|
138
138
|
tti: -1,
|
|
139
139
|
// no need for TTI value here
|
|
140
|
+
isEventAborted: !!this.lastInteractionFinish.abortReason,
|
|
140
141
|
prefix: 'ufo'
|
|
141
142
|
}, this.vcObserverSSRConfig));
|
|
142
143
|
case 6:
|