@atlaskit/react-ufo 2.4.7 → 2.5.0
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/common/constants.js +1 -1
- package/dist/cjs/config/index.js +18 -40
- package/dist/cjs/create-payload/common/utils/index.js +1 -85
- package/dist/cjs/create-payload/index.js +77 -37
- package/dist/cjs/interaction-metrics/common/constants.js +1 -7
- package/dist/cjs/interaction-metrics/index.js +205 -140
- package/dist/cjs/interaction-metrics-init/index.js +9 -27
- package/dist/cjs/load-hold/UFOLoadHold.js +4 -3
- package/dist/cjs/segment/segment.js +9 -7
- package/dist/cjs/trace-pageload/index.js +1 -2
- package/dist/cjs/vc/vc-observer/index.js +48 -33
- package/dist/es2019/common/constants.js +1 -1
- package/dist/es2019/config/index.js +0 -22
- package/dist/es2019/create-payload/common/utils/index.js +1 -86
- package/dist/es2019/create-payload/index.js +74 -28
- package/dist/es2019/interaction-metrics/common/constants.js +0 -6
- package/dist/es2019/interaction-metrics/index.js +130 -93
- package/dist/es2019/interaction-metrics-init/index.js +8 -21
- package/dist/es2019/load-hold/UFOLoadHold.js +4 -3
- package/dist/es2019/segment/segment.js +12 -6
- package/dist/es2019/trace-pageload/index.js +1 -1
- package/dist/es2019/vc/vc-observer/index.js +17 -5
- package/dist/esm/common/constants.js +1 -1
- package/dist/esm/config/index.js +18 -39
- package/dist/esm/create-payload/common/utils/index.js +1 -80
- package/dist/esm/create-payload/index.js +75 -33
- package/dist/esm/interaction-metrics/common/constants.js +0 -6
- package/dist/esm/interaction-metrics/index.js +157 -88
- package/dist/esm/interaction-metrics-init/index.js +10 -24
- package/dist/esm/load-hold/UFOLoadHold.js +4 -3
- package/dist/esm/segment/segment.js +9 -7
- package/dist/esm/trace-pageload/index.js +1 -1
- package/dist/esm/vc/vc-observer/index.js +48 -33
- package/dist/types/common/common/types.d.ts +4 -6
- package/dist/types/config/index.d.ts +0 -6
- package/dist/types/create-payload/common/utils/index.d.ts +0 -12
- package/dist/types/create-payload/index.d.ts +5660 -13
- package/dist/types/interaction-metrics/common/constants.d.ts +1 -31
- package/dist/types/interaction-metrics/index.d.ts +15 -4
- package/dist/types/load-hold/UFOLoadHold.d.ts +2 -1
- package/dist/types/trace-pageload/index.d.ts +0 -1
- package/dist/types/vc/vc-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/common/common/types.d.ts +4 -6
- package/dist/types-ts4.5/config/index.d.ts +0 -6
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +0 -12
- package/dist/types-ts4.5/create-payload/index.d.ts +5660 -13
- package/dist/types-ts4.5/interaction-metrics/common/constants.d.ts +1 -31
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +15 -4
- package/dist/types-ts4.5/load-hold/UFOLoadHold.d.ts +2 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +0 -1
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +1 -1
- package/package.json +6 -4
- package/create-experimental-interaction-metrics-payload/package.json +0 -15
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +0 -89
- package/dist/cjs/interaction-metrics/common/index.js +0 -151
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +0 -67
- package/dist/es2019/interaction-metrics/common/index.js +0 -103
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +0 -81
- package/dist/esm/interaction-metrics/common/index.js +0 -132
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +0 -31
- package/dist/types/interaction-metrics/common/index.d.ts +0 -16
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +0 -31
- package/dist/types-ts4.5/interaction-metrics/common/index.d.ts +0 -16
|
@@ -3,7 +3,7 @@ import { unstable_IdlePriority as idlePriority, unstable_scheduleCallback as sch
|
|
|
3
3
|
import { startLighthouseObserver } from '../additional-payload';
|
|
4
4
|
import { setUFOConfig } from '../config';
|
|
5
5
|
import { setupHiddenTimingCapture } from '../hidden-timing';
|
|
6
|
-
import {
|
|
6
|
+
import { postInteractionLog, sinkInteractionHandler, sinkPostInteractionLogHandler } from '../interaction-metrics';
|
|
7
7
|
import { getVCObserver } from '../vc';
|
|
8
8
|
var initialized = false;
|
|
9
9
|
function sinkInteraction(instance, payloadPackage) {
|
|
@@ -16,14 +16,6 @@ function sinkInteraction(instance, payloadPackage) {
|
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function sinkExperimentalInteractionMetrics(instance, payloadPackage) {
|
|
20
|
-
sinkExperimentalHandler(function (interactionId, interaction) {
|
|
21
|
-
scheduleCallback(idlePriority, function () {
|
|
22
|
-
var payload = payloadPackage.createExperimentalInteractionMetricsPayload(interactionId, interaction);
|
|
23
|
-
instance.sendOperationalEvent(payload);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
19
|
function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
|
|
28
20
|
sinkPostInteractionLogHandler(function (logOutput) {
|
|
29
21
|
scheduleCallback(idlePriority, function () {
|
|
@@ -54,37 +46,31 @@ export var init = function init(analyticsWebClientAsync, config) {
|
|
|
54
46
|
postInteractionLog.startVCObserver({
|
|
55
47
|
startTime: 0
|
|
56
48
|
});
|
|
57
|
-
experimentalInteractionLog.initializeVCObserver(vcOptions).startVCObserver({
|
|
58
|
-
startTime: 0
|
|
59
|
-
});
|
|
60
49
|
}
|
|
61
50
|
setupHiddenTimingCapture();
|
|
62
51
|
startLighthouseObserver();
|
|
63
52
|
initialized = true;
|
|
64
|
-
Promise.all([analyticsWebClientAsync,
|
|
65
|
-
|
|
53
|
+
Promise.all([analyticsWebClientAsync,
|
|
54
|
+
// eslint-disable-next-line import/dynamic-import-chunkname
|
|
55
|
+
import( /* webpackChunkName: "create-payloads" */'../create-payload'),
|
|
56
|
+
// eslint-disable-next-line import/dynamic-import-chunkname
|
|
57
|
+
import( /* webpackChunkName: "create-post-intreaction-log-payload" */'../create-post-interaction-log-payload')]).then(function (_ref) {
|
|
58
|
+
var _ref2 = _slicedToArray(_ref, 3),
|
|
66
59
|
awc = _ref2[0],
|
|
67
60
|
payloadPackage = _ref2[1],
|
|
68
|
-
|
|
69
|
-
createPostInteractionLogPayloadPackage = _ref2[3];
|
|
61
|
+
createPostInteractionLogPayloadPackage = _ref2[2];
|
|
70
62
|
if (awc.getAnalyticsWebClientPromise) {
|
|
71
63
|
awc.getAnalyticsWebClientPromise().then(function (client) {
|
|
72
|
-
var _config$
|
|
64
|
+
var _config$postInteracti;
|
|
73
65
|
var instance = client.getInstance();
|
|
74
66
|
sinkInteraction(instance, payloadPackage);
|
|
75
|
-
if (config !== null && config !== void 0 && (_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
76
|
-
sinkExperimentalInteractionMetrics(instance, createExperimentalInteractionMetricsPayload);
|
|
77
|
-
}
|
|
78
67
|
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
79
68
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
80
69
|
}
|
|
81
70
|
});
|
|
82
71
|
} else if (awc.sendOperationalEvent) {
|
|
83
|
-
var _config$
|
|
72
|
+
var _config$postInteracti2;
|
|
84
73
|
sinkInteraction(awc, payloadPackage);
|
|
85
|
-
if (config !== null && config !== void 0 && (_config$experimentalI2 = config.experimentalInteractionMetrics) !== null && _config$experimentalI2 !== void 0 && _config$experimentalI2.enabled) {
|
|
86
|
-
sinkExperimentalInteractionMetrics(awc, createExperimentalInteractionMetricsPayload);
|
|
87
|
-
}
|
|
88
74
|
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
89
75
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
90
76
|
}
|
|
@@ -22,7 +22,8 @@ var useLayoutEffectSAFE = typeof window === 'undefined' ? useEffect : useLayoutE
|
|
|
22
22
|
* return (
|
|
23
23
|
* <>
|
|
24
24
|
* <Skeleton />
|
|
25
|
-
* <UFOLoadHold name="card"
|
|
25
|
+
* <UFOLoadHold name="card">
|
|
26
|
+
* </UFOLoadHold>
|
|
26
27
|
* )
|
|
27
28
|
* }
|
|
28
29
|
* ```
|
|
@@ -57,8 +58,8 @@ export default function UFOLoadHold(_ref) {
|
|
|
57
58
|
// react-18: useId instead
|
|
58
59
|
var context = useContext(UFOInteractionContext);
|
|
59
60
|
useLayoutEffectSAFE(function () {
|
|
60
|
-
if (hold && context != null) {
|
|
61
|
-
return context.hold(name
|
|
61
|
+
if (hold && !experimental && context != null) {
|
|
62
|
+
return context.hold(name);
|
|
62
63
|
}
|
|
63
64
|
}, [hold, context, name]);
|
|
64
65
|
|
|
@@ -79,14 +79,15 @@ export default function UFOSegment(_ref) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function _internalHold(labelStack, name
|
|
83
|
-
|
|
82
|
+
function _internalHold(labelStack, name
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
84
|
+
) {
|
|
84
85
|
if (interactionId.current != null) {
|
|
85
86
|
if (parentContext) {
|
|
86
|
-
return parentContext._internalHold(labelStack, name
|
|
87
|
+
return parentContext._internalHold(labelStack, name);
|
|
87
88
|
} else {
|
|
88
89
|
var capturedInteractionId = interactionId.current;
|
|
89
|
-
var disposeHold = addHold(interactionId.current, labelStack, name
|
|
90
|
+
var disposeHold = addHold(interactionId.current, labelStack, name);
|
|
90
91
|
return function () {
|
|
91
92
|
if (capturedInteractionId === interactionId.current) {
|
|
92
93
|
disposeHold();
|
|
@@ -95,7 +96,9 @@ export default function UFOSegment(_ref) {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
|
-
function _internalHoldByID(labelStack, id, name, remove
|
|
99
|
+
function _internalHoldByID(labelStack, id, name, remove
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
101
|
+
) {
|
|
99
102
|
if (interactionId.current != null) {
|
|
100
103
|
if (parentContext) {
|
|
101
104
|
parentContext._internalHoldByID(labelStack, name, id, remove);
|
|
@@ -118,8 +121,7 @@ export default function UFOSegment(_ref) {
|
|
|
118
121
|
labelStack: labelStack,
|
|
119
122
|
hold: function hold() {
|
|
120
123
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown';
|
|
121
|
-
|
|
122
|
-
return this._internalHold(this.labelStack, name, experimental);
|
|
124
|
+
return this._internalHold(this.labelStack, name);
|
|
123
125
|
},
|
|
124
126
|
addHoldByID: function addHoldByID(labelStack, id) {
|
|
125
127
|
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'unknown';
|
|
@@ -5,7 +5,7 @@ import { getActiveTrace } from '../experience-trace-id-context';
|
|
|
5
5
|
import { DefaultInteractionID } from '../interaction-id-context';
|
|
6
6
|
import { abort, addHoldByID, addNewInteraction, getActiveInteraction, removeHoldByID, updatePageLoadInteractionName } from '../interaction-metrics';
|
|
7
7
|
import UFORouteName from '../route-name-context';
|
|
8
|
-
|
|
8
|
+
var AWAITING_PAGELOAD_NAME = 'awaiting_pageload_name';
|
|
9
9
|
export default function traceUFOPageLoad(ufoName) {
|
|
10
10
|
var routeName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ufoName;
|
|
11
11
|
var activeInteraction = getActiveInteraction();
|
|
@@ -6,6 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
6
6
|
var _excluded = ["__debug__element"];
|
|
7
7
|
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; }
|
|
8
8
|
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; }
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
10
11
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
11
12
|
import { Observers } from './observers';
|
|
@@ -63,7 +64,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
63
64
|
var info = _this.abortReason.info !== '' ? " ".concat(_this.abortReason.info) : '';
|
|
64
65
|
return "".concat(_this.abortReason.reason).concat(info);
|
|
65
66
|
});
|
|
66
|
-
_defineProperty(this, "getVCRawData", function () {
|
|
67
|
+
_defineProperty(this, "getVCRawData", function (stopTime) {
|
|
67
68
|
_this.measureStart();
|
|
68
69
|
if (!_this.active) {
|
|
69
70
|
_this.measureStop();
|
|
@@ -72,6 +73,20 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
72
73
|
_this.stop();
|
|
73
74
|
var abortReasonInfo = _this.getAbortReasonInfo();
|
|
74
75
|
_this.measureStop();
|
|
76
|
+
var componentsLog = {};
|
|
77
|
+
if (stopTime && fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
78
|
+
Object.entries(_this.componentsLog).forEach(function (_ref3) {
|
|
79
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
80
|
+
_timestamp = _ref4[0],
|
|
81
|
+
value = _ref4[1];
|
|
82
|
+
var timestamp = Number(_timestamp);
|
|
83
|
+
if (stopTime > timestamp) {
|
|
84
|
+
componentsLog[timestamp] = value;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
} else {
|
|
88
|
+
componentsLog = _objectSpread({}, _this.componentsLog);
|
|
89
|
+
}
|
|
75
90
|
return {
|
|
76
91
|
abortReasonInfo: abortReasonInfo,
|
|
77
92
|
abortReason: _objectSpread({}, _this.abortReason),
|
|
@@ -79,25 +94,25 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
79
94
|
heatmapNext: _this.heatmapNext,
|
|
80
95
|
outOfBoundaryInfo: _this.outOfBoundaryInfo,
|
|
81
96
|
totalTime: Math.round(_this.totalTime + _this.observers.getTotalTime()),
|
|
82
|
-
componentsLog:
|
|
97
|
+
componentsLog: componentsLog,
|
|
83
98
|
viewport: _objectSpread({}, _this.viewport),
|
|
84
99
|
oldDomUpdatesEnabled: _this.oldDomUpdatesEnabled,
|
|
85
100
|
devToolsEnabled: _this.devToolsEnabled,
|
|
86
101
|
ratios: _this.vcRatios
|
|
87
102
|
};
|
|
88
103
|
});
|
|
89
|
-
_defineProperty(this, "getVCResult", function (
|
|
104
|
+
_defineProperty(this, "getVCResult", function (_ref5) {
|
|
90
105
|
var _objectSpread2, _objectSpread3;
|
|
91
|
-
var start =
|
|
92
|
-
stop =
|
|
93
|
-
tti =
|
|
94
|
-
prefix =
|
|
95
|
-
ssr =
|
|
96
|
-
vc =
|
|
106
|
+
var start = _ref5.start,
|
|
107
|
+
stop = _ref5.stop,
|
|
108
|
+
tti = _ref5.tti,
|
|
109
|
+
prefix = _ref5.prefix,
|
|
110
|
+
ssr = _ref5.ssr,
|
|
111
|
+
vc = _ref5.vc;
|
|
97
112
|
var startTime = performance.now();
|
|
98
113
|
// add local measurement
|
|
99
114
|
var fullPrefix = prefix !== undefined && prefix !== '' ? "".concat(prefix, ":") : '';
|
|
100
|
-
var rawData = vc !== undefined ? vc : _this.getVCRawData();
|
|
115
|
+
var rawData = vc !== undefined ? vc : _this.getVCRawData(stop);
|
|
101
116
|
if (rawData === null) {
|
|
102
117
|
return {};
|
|
103
118
|
}
|
|
@@ -112,14 +127,14 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
112
127
|
devToolsEnabled = rawData.devToolsEnabled,
|
|
113
128
|
ratios = rawData.ratios;
|
|
114
129
|
if (abortReasonInfo !== null && abortReason.blocking) {
|
|
115
|
-
var
|
|
130
|
+
var _ref6;
|
|
116
131
|
// exposing data to devtools
|
|
117
132
|
try {
|
|
118
133
|
if (devToolsEnabled && !_this.isPostInteraction) {
|
|
119
134
|
window.__vcNotAvailableReason = abortReasonInfo;
|
|
120
135
|
}
|
|
121
136
|
} catch (e) {}
|
|
122
|
-
return
|
|
137
|
+
return _ref6 = {}, _defineProperty(_ref6, "".concat(fullPrefix, "vc:state"), false), _defineProperty(_ref6, "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), _defineProperty(_ref6, "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), _ref6;
|
|
123
138
|
}
|
|
124
139
|
var _VCObserver$calculate = VCObserver.calculateVC({
|
|
125
140
|
heatmap: heatmap,
|
|
@@ -274,10 +289,10 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
274
289
|
var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
|
|
275
290
|
if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
|
|
276
291
|
var _window2;
|
|
277
|
-
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (
|
|
278
|
-
var
|
|
279
|
-
key =
|
|
280
|
-
time =
|
|
292
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref8) {
|
|
293
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
294
|
+
key = _ref9[0],
|
|
295
|
+
time = _ref9[1];
|
|
281
296
|
if (time) {
|
|
282
297
|
_this.abortReasonCallback(key, time);
|
|
283
298
|
}
|
|
@@ -305,8 +320,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
305
320
|
}
|
|
306
321
|
_createClass(VCObserver, [{
|
|
307
322
|
key: "start",
|
|
308
|
-
value: function start(
|
|
309
|
-
var startTime =
|
|
323
|
+
value: function start(_ref10) {
|
|
324
|
+
var startTime = _ref10.startTime;
|
|
310
325
|
this.active = true;
|
|
311
326
|
if (this.observers.isBrowserSupported()) {
|
|
312
327
|
this.setViewportSize();
|
|
@@ -328,12 +343,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
328
343
|
}, {
|
|
329
344
|
key: "getIgnoredElements",
|
|
330
345
|
value: function getIgnoredElements(componentsLog) {
|
|
331
|
-
return Object.values(componentsLog).flat().filter(function (
|
|
332
|
-
var ignoreReason =
|
|
346
|
+
return Object.values(componentsLog).flat().filter(function (_ref11) {
|
|
347
|
+
var ignoreReason = _ref11.ignoreReason;
|
|
333
348
|
return Boolean(ignoreReason);
|
|
334
|
-
}).map(function (
|
|
335
|
-
var targetName =
|
|
336
|
-
ignoreReason =
|
|
349
|
+
}).map(function (_ref12) {
|
|
350
|
+
var targetName = _ref12.targetName,
|
|
351
|
+
ignoreReason = _ref12.ignoreReason;
|
|
337
352
|
return {
|
|
338
353
|
targetName: targetName,
|
|
339
354
|
ignoreReason: ignoreReason
|
|
@@ -454,12 +469,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
454
469
|
}
|
|
455
470
|
}], [{
|
|
456
471
|
key: "calculateVC",
|
|
457
|
-
value: function calculateVC(
|
|
458
|
-
var heatmap =
|
|
459
|
-
|
|
460
|
-
ssr =
|
|
461
|
-
componentsLog =
|
|
462
|
-
viewport =
|
|
472
|
+
value: function calculateVC(_ref13) {
|
|
473
|
+
var heatmap = _ref13.heatmap,
|
|
474
|
+
_ref13$ssr = _ref13.ssr,
|
|
475
|
+
ssr = _ref13$ssr === void 0 ? UNUSED_SECTOR : _ref13$ssr,
|
|
476
|
+
componentsLog = _ref13.componentsLog,
|
|
477
|
+
viewport = _ref13.viewport;
|
|
463
478
|
var lastUpdate = {};
|
|
464
479
|
var totalPainted = 0;
|
|
465
480
|
if (ssr !== UNUSED_SECTOR) {
|
|
@@ -519,11 +534,11 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
519
534
|
});
|
|
520
535
|
return VCRatio;
|
|
521
536
|
}, 0);
|
|
522
|
-
var VCEntries = entries.reduce(function (acc,
|
|
537
|
+
var VCEntries = entries.reduce(function (acc, _ref14, i) {
|
|
523
538
|
var _acc$abs, _componentsLog$timest;
|
|
524
|
-
var
|
|
525
|
-
timestamp =
|
|
526
|
-
entryPainted =
|
|
539
|
+
var _ref15 = _slicedToArray(_ref14, 2),
|
|
540
|
+
timestamp = _ref15[0],
|
|
541
|
+
entryPainted = _ref15[1];
|
|
527
542
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
528
543
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
529
544
|
var logEntry = (_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
|
|
@@ -63,7 +63,7 @@ export interface SegmentInfo {
|
|
|
63
63
|
labelStack: LabelStack;
|
|
64
64
|
}
|
|
65
65
|
export interface CustomData {
|
|
66
|
-
[key: string]: null | string | number | boolean | undefined | CustomData | Record<string, CustomData>;
|
|
66
|
+
[key: string]: null | undefined | string | number | boolean | undefined | CustomData | Record<string, CustomData>;
|
|
67
67
|
}
|
|
68
68
|
export type CustomTiming = Record<string, {
|
|
69
69
|
startTime: number;
|
|
@@ -104,9 +104,7 @@ export interface InteractionMetrics {
|
|
|
104
104
|
labelStack: LabelStack;
|
|
105
105
|
})[];
|
|
106
106
|
holdInfo: HoldInfo[];
|
|
107
|
-
holdExpInfo: HoldInfo[];
|
|
108
107
|
holdActive: Map<string, HoldActive>;
|
|
109
|
-
holdExpActive: Map<string, HoldActive>;
|
|
110
108
|
reactProfilerTimings: ReactProfilerTiming[];
|
|
111
109
|
measureStart: number;
|
|
112
110
|
rate: number;
|
|
@@ -117,11 +115,11 @@ export interface InteractionMetrics {
|
|
|
117
115
|
abortReason?: AbortReasonType;
|
|
118
116
|
abortedByInteractionName?: string;
|
|
119
117
|
/**
|
|
120
|
-
* Apdex is
|
|
118
|
+
* Apdex is legacy performance measurement where it is
|
|
121
119
|
* capturing TTI at arbitrary point in the code (bm3/UFOv1)
|
|
122
120
|
*
|
|
123
121
|
* We are intercepting its values now just so we can use it for
|
|
124
|
-
* topline metric, but should encourage teams
|
|
122
|
+
* topline metric, but should encourage teams adopt TTAI
|
|
125
123
|
*
|
|
126
124
|
* This field might be ignored/dropped in the future.
|
|
127
125
|
*/
|
|
@@ -166,7 +164,7 @@ export interface LazyLoadProfilerContext {
|
|
|
166
164
|
addLoad(identifier: string, start: number, end: number): void;
|
|
167
165
|
}
|
|
168
166
|
export interface EnhancedUFOInteractionContextType extends UFOInteractionContextType, RelayMetricsRecorder, LazyLoadProfilerContext {
|
|
169
|
-
_internalHold(labelStack: LabelStack, name: string
|
|
167
|
+
_internalHold(labelStack: LabelStack, name: string): void | (() => void);
|
|
170
168
|
_internalHoldByID(labelStack: LabelStack, id: string, name: string, remove: boolean): void | (() => void);
|
|
171
169
|
addHoldByID(labelStack: LabelStack, id: string, name?: string): void;
|
|
172
170
|
removeHoldByID(labelStack: LabelStack, id: string, name?: string): void;
|
|
@@ -72,11 +72,6 @@ export type Config = {
|
|
|
72
72
|
readonly rates?: Rates;
|
|
73
73
|
readonly kind?: Record<InteractionType, number>;
|
|
74
74
|
};
|
|
75
|
-
readonly experimentalInteractionMetrics?: {
|
|
76
|
-
readonly enabled?: boolean;
|
|
77
|
-
readonly rates?: Rates;
|
|
78
|
-
readonly kind?: Record<InteractionType, number>;
|
|
79
|
-
};
|
|
80
75
|
readonly enableSegmentHighlighting?: boolean;
|
|
81
76
|
readonly enableAdditionalPerformanceMarks?: boolean;
|
|
82
77
|
readonly shouldCalculateLighthouseMetricsFromTTAI?: boolean;
|
|
@@ -90,7 +85,6 @@ export type Config = {
|
|
|
90
85
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
91
86
|
export declare function getConfig(): Config | undefined;
|
|
92
87
|
export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
|
|
93
|
-
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
94
88
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
95
89
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
96
90
|
declare const validTypingMethods: readonly ["timeout", "timeoutNoAlloc", "mutationObserver"];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { InteractionMetrics } from '../../../common';
|
|
2
|
-
import { type Config } from '../../../config';
|
|
3
1
|
import type { LabelStack, SegmentLabel } from '../../../interaction-context';
|
|
4
2
|
export type SegmentItem = {
|
|
5
3
|
n: string;
|
|
@@ -17,13 +15,3 @@ export declare function optimizeLabelStack(labelStack: LabelStack): string | {
|
|
|
17
15
|
s?: string | undefined;
|
|
18
16
|
n: string;
|
|
19
17
|
}[];
|
|
20
|
-
export declare const getInteractionStatus: (interaction: InteractionMetrics) => {
|
|
21
|
-
readonly originalInteractionStatus: "ABORTED" | "SUCCEEDED";
|
|
22
|
-
readonly overrideStatus: "ABORTED" | "SUCCEEDED";
|
|
23
|
-
};
|
|
24
|
-
export declare const getPageVisibilityUpToTTAI: (interaction: InteractionMetrics) => import("../../../hidden-timing").PageVisibility;
|
|
25
|
-
export declare const calculateVCMetrics: (interaction: InteractionMetrics, prefix: string, getVCResultFn: (props: any) => any) => any;
|
|
26
|
-
export declare function getSSRDoneTimeValue(config: Config | undefined): number | undefined;
|
|
27
|
-
export declare const getVCMetrics: (interaction: InteractionMetrics) => any;
|
|
28
|
-
export declare const getExperimentalVCMetrics: (interaction: InteractionMetrics) => any;
|
|
29
|
-
export declare const getTTAI: (interaction: InteractionMetrics) => number | undefined;
|