@atlaskit/react-ufo 2.4.7 → 2.5.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 +23 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +2 -4
- package/dist/cjs/common/constants.js +2 -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/post-interaction-log.js +1 -2
- 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 +50 -38
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +1 -2
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/test-utils.js +1 -2
- package/dist/cjs/vc/vc-observer/observers/index.js +1 -2
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +1 -2
- package/dist/es2019/common/constants.js +3 -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/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +2 -4
- package/dist/esm/common/constants.js +3 -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/post-interaction-log.js +1 -2
- 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 +50 -38
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +1 -2
- package/dist/esm/vc/vc-observer/observers/editor-lnv/test-utils.js +1 -2
- package/dist/esm/vc/vc-observer/observers/index.js +1 -2
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +1 -2
- 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 -5
- 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
|
@@ -31,7 +31,7 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
31
31
|
*/
|
|
32
32
|
_defineProperty(this, "sinkHandlerFn", function () {});
|
|
33
33
|
}
|
|
34
|
-
_createClass(PostInteractionLog, [{
|
|
34
|
+
return _createClass(PostInteractionLog, [{
|
|
35
35
|
key: "initializeVCObserver",
|
|
36
36
|
value: function initializeVCObserver(options) {
|
|
37
37
|
if (this.vcObserver === null) {
|
|
@@ -183,6 +183,5 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}]);
|
|
186
|
-
return PostInteractionLog;
|
|
187
186
|
}();
|
|
188
187
|
export { PostInteractionLog as default };
|
|
@@ -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,24 @@ 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 (
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
vc = _ref3.vc;
|
|
104
|
+
_defineProperty(this, "getVCResult", function (_ref5) {
|
|
105
|
+
var start = _ref5.start,
|
|
106
|
+
stop = _ref5.stop,
|
|
107
|
+
tti = _ref5.tti,
|
|
108
|
+
prefix = _ref5.prefix,
|
|
109
|
+
ssr = _ref5.ssr,
|
|
110
|
+
vc = _ref5.vc;
|
|
97
111
|
var startTime = performance.now();
|
|
98
112
|
// add local measurement
|
|
99
113
|
var fullPrefix = prefix !== undefined && prefix !== '' ? "".concat(prefix, ":") : '';
|
|
100
|
-
var rawData = vc !== undefined ? vc : _this.getVCRawData();
|
|
114
|
+
var rawData = vc !== undefined ? vc : _this.getVCRawData(stop);
|
|
101
115
|
if (rawData === null) {
|
|
102
116
|
return {};
|
|
103
117
|
}
|
|
@@ -112,14 +126,13 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
112
126
|
devToolsEnabled = rawData.devToolsEnabled,
|
|
113
127
|
ratios = rawData.ratios;
|
|
114
128
|
if (abortReasonInfo !== null && abortReason.blocking) {
|
|
115
|
-
var _ref4;
|
|
116
129
|
// exposing data to devtools
|
|
117
130
|
try {
|
|
118
131
|
if (devToolsEnabled && !_this.isPostInteraction) {
|
|
119
132
|
window.__vcNotAvailableReason = abortReasonInfo;
|
|
120
133
|
}
|
|
121
134
|
} catch (e) {}
|
|
122
|
-
return
|
|
135
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp);
|
|
123
136
|
}
|
|
124
137
|
var _VCObserver$calculate = VCObserver.calculateVC({
|
|
125
138
|
heatmap: heatmap,
|
|
@@ -189,9 +202,9 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
189
202
|
} catch (e) {
|
|
190
203
|
/* do nothing */
|
|
191
204
|
}
|
|
192
|
-
return _objectSpread(_objectSpread((
|
|
205
|
+
return _objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
193
206
|
'metrics:vc': VC
|
|
194
|
-
},
|
|
207
|
+
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), !abortReasonInfo), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)));
|
|
195
208
|
});
|
|
196
209
|
_defineProperty(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason) {
|
|
197
210
|
_this.measureStart();
|
|
@@ -274,10 +287,10 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
274
287
|
var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
|
|
275
288
|
if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
|
|
276
289
|
var _window2;
|
|
277
|
-
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (
|
|
278
|
-
var
|
|
279
|
-
key =
|
|
280
|
-
time =
|
|
290
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref8) {
|
|
291
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
292
|
+
key = _ref9[0],
|
|
293
|
+
time = _ref9[1];
|
|
281
294
|
if (time) {
|
|
282
295
|
_this.abortReasonCallback(key, time);
|
|
283
296
|
}
|
|
@@ -303,10 +316,10 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
303
316
|
this.heatmapNext = this.getCleanHeatmap();
|
|
304
317
|
this.isPostInteraction = options.isPostInteraction || false;
|
|
305
318
|
}
|
|
306
|
-
_createClass(VCObserver, [{
|
|
319
|
+
return _createClass(VCObserver, [{
|
|
307
320
|
key: "start",
|
|
308
|
-
value: function start(
|
|
309
|
-
var startTime =
|
|
321
|
+
value: function start(_ref10) {
|
|
322
|
+
var startTime = _ref10.startTime;
|
|
310
323
|
this.active = true;
|
|
311
324
|
if (this.observers.isBrowserSupported()) {
|
|
312
325
|
this.setViewportSize();
|
|
@@ -328,12 +341,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
328
341
|
}, {
|
|
329
342
|
key: "getIgnoredElements",
|
|
330
343
|
value: function getIgnoredElements(componentsLog) {
|
|
331
|
-
return Object.values(componentsLog).flat().filter(function (
|
|
332
|
-
var ignoreReason =
|
|
344
|
+
return Object.values(componentsLog).flat().filter(function (_ref11) {
|
|
345
|
+
var ignoreReason = _ref11.ignoreReason;
|
|
333
346
|
return Boolean(ignoreReason);
|
|
334
|
-
}).map(function (
|
|
335
|
-
var targetName =
|
|
336
|
-
ignoreReason =
|
|
347
|
+
}).map(function (_ref12) {
|
|
348
|
+
var targetName = _ref12.targetName,
|
|
349
|
+
ignoreReason = _ref12.ignoreReason;
|
|
337
350
|
return {
|
|
338
351
|
targetName: targetName,
|
|
339
352
|
ignoreReason: ignoreReason
|
|
@@ -454,12 +467,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
454
467
|
}
|
|
455
468
|
}], [{
|
|
456
469
|
key: "calculateVC",
|
|
457
|
-
value: function calculateVC(
|
|
458
|
-
var heatmap =
|
|
459
|
-
|
|
460
|
-
ssr =
|
|
461
|
-
componentsLog =
|
|
462
|
-
viewport =
|
|
470
|
+
value: function calculateVC(_ref13) {
|
|
471
|
+
var heatmap = _ref13.heatmap,
|
|
472
|
+
_ref13$ssr = _ref13.ssr,
|
|
473
|
+
ssr = _ref13$ssr === void 0 ? UNUSED_SECTOR : _ref13$ssr,
|
|
474
|
+
componentsLog = _ref13.componentsLog,
|
|
475
|
+
viewport = _ref13.viewport;
|
|
463
476
|
var lastUpdate = {};
|
|
464
477
|
var totalPainted = 0;
|
|
465
478
|
if (ssr !== UNUSED_SECTOR) {
|
|
@@ -519,11 +532,11 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
519
532
|
});
|
|
520
533
|
return VCRatio;
|
|
521
534
|
}, 0);
|
|
522
|
-
var VCEntries = entries.reduce(function (acc,
|
|
535
|
+
var VCEntries = entries.reduce(function (acc, _ref14, i) {
|
|
523
536
|
var _acc$abs, _componentsLog$timest;
|
|
524
|
-
var
|
|
525
|
-
timestamp =
|
|
526
|
-
entryPainted =
|
|
537
|
+
var _ref15 = _slicedToArray(_ref14, 2),
|
|
538
|
+
timestamp = _ref15[0],
|
|
539
|
+
entryPainted = _ref15[1];
|
|
527
540
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
528
541
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
529
542
|
var logEntry = (_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
|
|
@@ -557,7 +570,6 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
557
570
|
return vc;
|
|
558
571
|
}
|
|
559
572
|
}]);
|
|
560
|
-
return VCObserver;
|
|
561
573
|
}();
|
|
562
574
|
/** config * */
|
|
563
575
|
_defineProperty(VCObserver, "VCParts", ['25', '50', '75', '80', '85', '90', '95', '98', '99']);
|
|
@@ -72,7 +72,7 @@ export var EditorLnvHandler = /*#__PURE__*/function () {
|
|
|
72
72
|
}).forEach(_this.intersectionObserverCallback);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
_createClass(EditorLnvHandler, [{
|
|
75
|
+
return _createClass(EditorLnvHandler, [{
|
|
76
76
|
key: "shouldHandleAddedNode",
|
|
77
77
|
value: function shouldHandleAddedNode(el) {
|
|
78
78
|
var _el$dataset, _el$dataset2;
|
|
@@ -177,5 +177,4 @@ export var EditorLnvHandler = /*#__PURE__*/function () {
|
|
|
177
177
|
return Math.abs(a.width - b.width) < 1 && Math.abs(a.height - b.height) < 1;
|
|
178
178
|
}
|
|
179
179
|
}]);
|
|
180
|
-
return EditorLnvHandler;
|
|
181
180
|
}();
|
|
@@ -44,7 +44,7 @@ export function createMockIntersectionObserver(cbRef) {
|
|
|
44
44
|
}));
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
_createClass(_class, [{
|
|
47
|
+
return _createClass(_class, [{
|
|
48
48
|
key: "observe",
|
|
49
49
|
value: function observe() {}
|
|
50
50
|
}, {
|
|
@@ -54,6 +54,5 @@ export function createMockIntersectionObserver(cbRef) {
|
|
|
54
54
|
key: "disconnect",
|
|
55
55
|
value: function disconnect() {}
|
|
56
56
|
}]);
|
|
57
|
-
return _class;
|
|
58
57
|
}();
|
|
59
58
|
}
|
|
@@ -58,7 +58,7 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
58
58
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers();
|
|
59
59
|
this.editorLnvHandler = new EditorLnvHandler();
|
|
60
60
|
}
|
|
61
|
-
_createClass(Observers, [{
|
|
61
|
+
return _createClass(Observers, [{
|
|
62
62
|
key: "isBrowserSupported",
|
|
63
63
|
value: function isBrowserSupported() {
|
|
64
64
|
return typeof window.IntersectionObserver === 'function' && typeof window.MutationObserver === 'function';
|
|
@@ -294,5 +294,4 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
294
294
|
this._startMeasureTimestamp = -1;
|
|
295
295
|
}
|
|
296
296
|
}]);
|
|
297
|
-
return Observers;
|
|
298
297
|
}();
|
|
@@ -82,7 +82,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
_createClass(SSRPlaceholderHandlers, [{
|
|
85
|
+
return _createClass(SSRPlaceholderHandlers, [{
|
|
86
86
|
key: "clear",
|
|
87
87
|
value: function clear() {
|
|
88
88
|
this.staticPlaceholders = new Map();
|
|
@@ -170,5 +170,4 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
170
170
|
return rect && Math.abs(rect.x - boundingClientRect.x) < EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < EQUALITY_THRESHOLD || false;
|
|
171
171
|
}
|
|
172
172
|
}]);
|
|
173
|
-
return SSRPlaceholderHandlers;
|
|
174
173
|
}();
|
|
@@ -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;
|