@atlaskit/react-ufo 4.15.14 → 4.15.16
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 +14 -0
- package/dist/cjs/assets/index.js +1 -1
- package/dist/cjs/config/index.js +12 -12
- package/dist/cjs/create-payload/utils/add-performance-measures.js +1 -1
- package/dist/cjs/create-payload/utils/get-navigation-metrics.js +1 -1
- package/dist/cjs/create-payload/utils/get-visibility-state-from-performance.js +1 -1
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +2 -2
- package/dist/cjs/interaction-metrics/index.js +11 -11
- package/dist/cjs/machine-utilisation/index.js +2 -2
- package/dist/cjs/resource-timing/common/utils/config.js +1 -1
- package/dist/cjs/vc/index.js +3 -1
- package/dist/cjs/vc/vc-observer/getViewport.js +2 -2
- package/dist/cjs/vc/vc-observer/observers/index.js +2 -2
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +1 -1
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +1 -1
- package/dist/cjs/vc/vc-observer-new/index.js +97 -19
- package/dist/cjs/vc/vc-observer-new/metric-calculator/{vcnext → fy26_04}/index.js +7 -11
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +1 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +1 -1
- package/dist/cjs/vc/vc-observer-new/raw-data-handler/index.js +70 -3
- package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/is-element-visible.js +1 -1
- package/dist/es2019/assets/index.js +1 -1
- package/dist/es2019/config/index.js +11 -11
- package/dist/es2019/create-payload/utils/add-performance-measures.js +1 -1
- package/dist/es2019/create-payload/utils/get-battery-info.js +1 -1
- package/dist/es2019/create-payload/utils/get-navigation-metrics.js +1 -1
- package/dist/es2019/create-payload/utils/get-visibility-state-from-performance.js +1 -1
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +2 -2
- package/dist/es2019/interaction-metrics/index.js +11 -11
- package/dist/es2019/machine-utilisation/index.js +1 -1
- package/dist/es2019/resource-timing/common/utils/config.js +1 -1
- package/dist/es2019/vc/index.js +3 -1
- package/dist/es2019/vc/vc-observer/getViewport.js +2 -2
- package/dist/es2019/vc/vc-observer/observers/index.js +2 -2
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +1 -1
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +1 -1
- package/dist/es2019/vc/vc-observer-new/index.js +85 -38
- package/dist/es2019/vc/vc-observer-new/metric-calculator/{vcnext → fy26_04}/index.js +2 -7
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +1 -1
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +1 -1
- package/dist/es2019/vc/vc-observer-new/raw-data-handler/index.js +53 -1
- package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/is-element-visible.js +1 -1
- package/dist/esm/assets/index.js +1 -1
- package/dist/esm/config/index.js +12 -12
- package/dist/esm/create-payload/utils/add-performance-measures.js +1 -1
- package/dist/esm/create-payload/utils/get-navigation-metrics.js +1 -1
- package/dist/esm/create-payload/utils/get-visibility-state-from-performance.js +1 -1
- package/dist/esm/feature-flags-accessed/common/utils/index.js +2 -2
- package/dist/esm/interaction-metrics/index.js +11 -11
- package/dist/esm/machine-utilisation/index.js +2 -2
- package/dist/esm/resource-timing/common/utils/config.js +1 -1
- package/dist/esm/vc/index.js +3 -1
- package/dist/esm/vc/vc-observer/getViewport.js +2 -2
- package/dist/esm/vc/vc-observer/observers/index.js +2 -2
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
- package/dist/esm/vc/vc-observer-new/get-element-name.js +1 -1
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +1 -1
- package/dist/esm/vc/vc-observer-new/index.js +95 -17
- package/dist/esm/vc/vc-observer-new/metric-calculator/{vcnext → fy26_04}/index.js +8 -13
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +1 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +1 -1
- package/dist/esm/vc/vc-observer-new/raw-data-handler/index.js +70 -3
- package/dist/esm/vc/vc-observer-new/viewport-observer/utils/is-element-visible.js +1 -1
- package/dist/types/common/vc/types.d.ts +6 -0
- package/dist/types/config/index.d.ts +5 -1
- package/dist/{types-ts4.5/vc/vc-observer-new/metric-calculator/vcnext → types/vc/vc-observer-new/metric-calculator/fy26_04}/index.d.ts +1 -1
- package/dist/types-ts4.5/common/vc/types.d.ts +6 -0
- package/dist/types-ts4.5/config/index.d.ts +5 -1
- package/dist/{types/vc/vc-observer-new/metric-calculator/vcnext → types-ts4.5/vc/vc-observer-new/metric-calculator/fy26_04}/index.d.ts +1 -1
- package/package.json +4 -1
|
@@ -20,6 +20,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
20
20
|
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; }
|
|
21
21
|
var ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
22
22
|
var MAX_OBSERVATIONS = 100;
|
|
23
|
+
function isWindowEventEntryData(data) {
|
|
24
|
+
return data.type === 'window:event' && 'eventType' in data;
|
|
25
|
+
}
|
|
23
26
|
var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
24
27
|
function RawDataHandler() {
|
|
25
28
|
(0, _classCallCheck2.default)(this, RawDataHandler);
|
|
@@ -56,7 +59,7 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
56
59
|
key: "getRawData",
|
|
57
60
|
value: function () {
|
|
58
61
|
var _getRawData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
59
|
-
var entries, startTime, stopTime, isPageVisible, isVCClean, dirtyReason, getVCCleanStatusResult, viewportEntries, targetNameToIdMap, elementMapEntriesMap, nextElementId, typeMap, typeMapEntriesMap, nextTypeId, attributeMap, attributeEntriesMap, nextAttributeId, rawObservations, firstObservation, lastObservations, referencedEids, referencedChgs, referencedAtts, _iterator, _step, observation, _iterator2, _step2, eid, _iterator3, _step3, chg, _iterator4, _step4, att, result;
|
|
62
|
+
var entries, startTime, stopTime, isPageVisible, isVCClean, dirtyReason, getVCCleanStatusResult, viewportEntries, windowEventEntries, targetNameToIdMap, elementMapEntriesMap, nextElementId, typeMap, typeMapEntriesMap, nextTypeId, attributeMap, attributeEntriesMap, nextAttributeId, eventTypeMap, eventTypeMapEntriesMap, nextEventTypeId, rawObservations, rawEventObservations, firstObservation, lastObservations, referencedEids, referencedChgs, referencedAtts, _iterator, _step, observation, _iterator2, _step2, eid, _iterator3, _step3, chg, _iterator4, _step4, att, firstEventObservation, lastEventObservations, referencedEvts, _iterator5, _step5, _observation, _iterator6, _step6, evt, result;
|
|
60
63
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
61
64
|
while (1) switch (_context.prev = _context.next) {
|
|
62
65
|
case 0:
|
|
@@ -83,6 +86,9 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
83
86
|
viewportEntries = entries.filter(function (entry) {
|
|
84
87
|
return entry.time >= startTime && entry.time <= stopTime && entry.data && entry.data.visible;
|
|
85
88
|
});
|
|
89
|
+
windowEventEntries = entries.filter(function (entry) {
|
|
90
|
+
return entry.time >= startTime && entry.time <= stopTime && entry.data && isWindowEventEntryData(entry.data);
|
|
91
|
+
});
|
|
86
92
|
targetNameToIdMap = new Map();
|
|
87
93
|
elementMapEntriesMap = {};
|
|
88
94
|
nextElementId = 1;
|
|
@@ -92,6 +98,9 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
92
98
|
attributeMap = new Map();
|
|
93
99
|
attributeEntriesMap = {};
|
|
94
100
|
nextAttributeId = 1;
|
|
101
|
+
eventTypeMap = new Map();
|
|
102
|
+
eventTypeMapEntriesMap = {};
|
|
103
|
+
nextEventTypeId = 1;
|
|
95
104
|
rawObservations = viewportEntries.map(function (entry) {
|
|
96
105
|
var viewportEntry = entry.data;
|
|
97
106
|
var targetName = viewportEntry.elementName || '';
|
|
@@ -131,6 +140,22 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
131
140
|
att: att
|
|
132
141
|
} : {});
|
|
133
142
|
return observation;
|
|
143
|
+
});
|
|
144
|
+
rawEventObservations = windowEventEntries.map(function (entry) {
|
|
145
|
+
var windowEventEntry = entry.data;
|
|
146
|
+
var eventType = windowEventEntry.eventType;
|
|
147
|
+
var evtId = eventTypeMap.get(eventType) || 0;
|
|
148
|
+
if (evtId === 0) {
|
|
149
|
+
evtId = nextEventTypeId;
|
|
150
|
+
nextEventTypeId += 1;
|
|
151
|
+
eventTypeMap.set(eventType, evtId);
|
|
152
|
+
eventTypeMapEntriesMap[evtId] = eventType;
|
|
153
|
+
}
|
|
154
|
+
var eventObservation = {
|
|
155
|
+
t: Math.round(entry.time - startTime),
|
|
156
|
+
evt: evtId
|
|
157
|
+
};
|
|
158
|
+
return eventObservation;
|
|
134
159
|
}); // If the number of observations is greater than the maximum allowed, we need to trim the observations to the maximum allowed.
|
|
135
160
|
// We do this by keeping the first observation and the last MAX_OBSERVATIONS observations.
|
|
136
161
|
// We then collect the referenced IDs from the remaining observations and remove the unreferenced entries from the maps
|
|
@@ -204,6 +229,46 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
204
229
|
_iterator4.f();
|
|
205
230
|
}
|
|
206
231
|
}
|
|
232
|
+
|
|
233
|
+
// If the number of event observations is greater than the maximum allowed, we need to trim the event observations to the maximum allowed.
|
|
234
|
+
// We do this by keeping the first observation and the last MAX_OBSERVATIONS observations.
|
|
235
|
+
// We then collect the referenced IDs from the remaining observations and remove the unreferenced entries from the maps
|
|
236
|
+
if (rawEventObservations.length > MAX_OBSERVATIONS) {
|
|
237
|
+
firstEventObservation = rawEventObservations[0];
|
|
238
|
+
lastEventObservations = rawEventObservations.slice(-MAX_OBSERVATIONS);
|
|
239
|
+
rawEventObservations = [firstEventObservation].concat((0, _toConsumableArray2.default)(lastEventObservations));
|
|
240
|
+
|
|
241
|
+
// Collect referenced IDs from remaining observations
|
|
242
|
+
referencedEvts = new Set();
|
|
243
|
+
_iterator5 = _createForOfIteratorHelper(rawEventObservations);
|
|
244
|
+
try {
|
|
245
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
246
|
+
_observation = _step5.value;
|
|
247
|
+
if (_observation.evt > 0) {
|
|
248
|
+
referencedEvts.add(_observation.evt);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Remove unreferenced entries from maps
|
|
253
|
+
} catch (err) {
|
|
254
|
+
_iterator5.e(err);
|
|
255
|
+
} finally {
|
|
256
|
+
_iterator5.f();
|
|
257
|
+
}
|
|
258
|
+
_iterator6 = _createForOfIteratorHelper(Object.keys(eventTypeMapEntriesMap).map(Number));
|
|
259
|
+
try {
|
|
260
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
261
|
+
evt = _step6.value;
|
|
262
|
+
if (!referencedEvts.has(evt)) {
|
|
263
|
+
delete eventTypeMapEntriesMap[evt];
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} catch (err) {
|
|
267
|
+
_iterator6.e(err);
|
|
268
|
+
} finally {
|
|
269
|
+
_iterator6.f();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
207
272
|
result = {
|
|
208
273
|
revision: this.revisionNo,
|
|
209
274
|
clean: isVCClean,
|
|
@@ -212,7 +277,9 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
212
277
|
obs: rawObservations !== null && rawObservations !== void 0 ? rawObservations : undefined,
|
|
213
278
|
eid: elementMapEntriesMap !== null && elementMapEntriesMap !== void 0 ? elementMapEntriesMap : undefined,
|
|
214
279
|
chg: typeMapEntriesMap !== null && typeMapEntriesMap !== void 0 ? typeMapEntriesMap : undefined,
|
|
215
|
-
att: attributeEntriesMap !== null && attributeEntriesMap !== void 0 ? attributeEntriesMap : undefined
|
|
280
|
+
att: attributeEntriesMap !== null && attributeEntriesMap !== void 0 ? attributeEntriesMap : undefined,
|
|
281
|
+
evts: rawEventObservations.length > 0 ? rawEventObservations : undefined,
|
|
282
|
+
evt: Object.keys(eventTypeMapEntriesMap).length > 0 ? eventTypeMapEntriesMap : undefined
|
|
216
283
|
},
|
|
217
284
|
abortReason: dirtyReason,
|
|
218
285
|
abortTimestamp: getVCCleanStatusResult.abortTimestamp,
|
|
@@ -222,7 +289,7 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
222
289
|
}
|
|
223
290
|
};
|
|
224
291
|
return _context.abrupt("return", result);
|
|
225
|
-
case
|
|
292
|
+
case 26:
|
|
226
293
|
case "end":
|
|
227
294
|
return _context.stop();
|
|
228
295
|
}
|
|
@@ -143,7 +143,7 @@ export function getInteractionRate(name, interactionKind) {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
return 0;
|
|
146
|
-
} catch
|
|
146
|
+
} catch {
|
|
147
147
|
// Fallback
|
|
148
148
|
return 0;
|
|
149
149
|
}
|
|
@@ -166,7 +166,7 @@ export function getExperimentalInteractionRate(name, interactionType) {
|
|
|
166
166
|
return experimentalInteractionMetrics.kind[interactionType];
|
|
167
167
|
}
|
|
168
168
|
return 0;
|
|
169
|
-
} catch
|
|
169
|
+
} catch {
|
|
170
170
|
return 0;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -217,7 +217,7 @@ function getConfigRate(name, interactionType, configName) {
|
|
|
217
217
|
return gotConfig.kind[interactionType];
|
|
218
218
|
}
|
|
219
219
|
return 0;
|
|
220
|
-
} catch
|
|
220
|
+
} catch {
|
|
221
221
|
return 0;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -239,7 +239,7 @@ export function getTypingPerformanceTracingMethod() {
|
|
|
239
239
|
} else {
|
|
240
240
|
return defaultMethod;
|
|
241
241
|
}
|
|
242
|
-
} catch
|
|
242
|
+
} catch {
|
|
243
243
|
return defaultMethod;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
@@ -258,7 +258,7 @@ export function getAwaitBM3TTIList() {
|
|
|
258
258
|
} else {
|
|
259
259
|
return [];
|
|
260
260
|
}
|
|
261
|
-
} catch
|
|
261
|
+
} catch {
|
|
262
262
|
return [];
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -279,7 +279,7 @@ export function getUfoNameOverrides() {
|
|
|
279
279
|
return ufoNameOverrides;
|
|
280
280
|
}
|
|
281
281
|
return undefined;
|
|
282
|
-
} catch
|
|
282
|
+
} catch {
|
|
283
283
|
return undefined;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
@@ -292,7 +292,7 @@ export function getMinorInteractions() {
|
|
|
292
292
|
minorInteractions
|
|
293
293
|
} = config;
|
|
294
294
|
return minorInteractions;
|
|
295
|
-
} catch
|
|
295
|
+
} catch {
|
|
296
296
|
return undefined;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
@@ -307,7 +307,7 @@ export function getDoNotAbortActivePressInteraction() {
|
|
|
307
307
|
doNotAbortActivePressInteraction
|
|
308
308
|
} = config;
|
|
309
309
|
return doNotAbortActivePressInteraction;
|
|
310
|
-
} catch
|
|
310
|
+
} catch {
|
|
311
311
|
return undefined;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
@@ -322,7 +322,7 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
322
322
|
doNotAbortActivePressInteractionOnTransition
|
|
323
323
|
} = config;
|
|
324
324
|
return doNotAbortActivePressInteractionOnTransition;
|
|
325
|
-
} catch
|
|
325
|
+
} catch {
|
|
326
326
|
return undefined;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -337,7 +337,7 @@ export function getFinishInteractionOnTransition() {
|
|
|
337
337
|
finishInteractionOnTransition
|
|
338
338
|
} = config;
|
|
339
339
|
return finishInteractionOnTransition;
|
|
340
|
-
} catch
|
|
340
|
+
} catch {
|
|
341
341
|
return undefined;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
@@ -358,7 +358,7 @@ export function getInteractionTimeout(ufoName) {
|
|
|
358
358
|
} else {
|
|
359
359
|
return CLEANUP_TIMEOUT;
|
|
360
360
|
}
|
|
361
|
-
} catch
|
|
361
|
+
} catch {
|
|
362
362
|
return CLEANUP_TIMEOUT;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
@@ -4,7 +4,7 @@ function startsAsObject(value) {
|
|
|
4
4
|
if (value.charAt(0) === '{') {
|
|
5
5
|
return true;
|
|
6
6
|
}
|
|
7
|
-
} catch
|
|
7
|
+
} catch {
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
10
|
return false;
|
|
@@ -16,7 +16,7 @@ function isString(input) {
|
|
|
16
16
|
let result;
|
|
17
17
|
try {
|
|
18
18
|
result = typeof input === 'string' || input instanceof String;
|
|
19
|
-
} catch
|
|
19
|
+
} catch {
|
|
20
20
|
// swallow any errors
|
|
21
21
|
result = false;
|
|
22
22
|
}
|
|
@@ -172,7 +172,7 @@ export function addCustomTiming(interactionId, labelStack, data) {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
|
-
} catch
|
|
175
|
+
} catch {
|
|
176
176
|
// do nothing
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -249,7 +249,7 @@ export function addSpan(interactionId, type, name, labelStack, start, end = perf
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
-
} catch
|
|
252
|
+
} catch {
|
|
253
253
|
// do nothing
|
|
254
254
|
}
|
|
255
255
|
}
|
|
@@ -279,7 +279,7 @@ export function addSpanToAll(type, name, labelStack, start, end = performance.no
|
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
} catch
|
|
282
|
+
} catch {
|
|
283
283
|
// do nothing
|
|
284
284
|
}
|
|
285
285
|
}
|
|
@@ -375,7 +375,7 @@ export function addHold(interactionId, labelStack, name, experimental) {
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
|
-
} catch
|
|
378
|
+
} catch {
|
|
379
379
|
// do nothing
|
|
380
380
|
}
|
|
381
381
|
}
|
|
@@ -571,7 +571,7 @@ export function addProfilerTimings(interactionId, labelStack, type, actualDurati
|
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
});
|
|
574
|
-
} catch
|
|
574
|
+
} catch {
|
|
575
575
|
// do nothing
|
|
576
576
|
}
|
|
577
577
|
}
|
|
@@ -625,7 +625,7 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
});
|
|
628
|
-
} catch
|
|
628
|
+
} catch {
|
|
629
629
|
// do nothing
|
|
630
630
|
}
|
|
631
631
|
if (data.featureFlags) {
|
|
@@ -710,7 +710,7 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
-
} catch
|
|
713
|
+
} catch {
|
|
714
714
|
// do nothing
|
|
715
715
|
}
|
|
716
716
|
}
|
|
@@ -719,7 +719,7 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
719
719
|
window.dispatchEvent(new CustomEvent('UFO_FINISH_INTERACTION', {
|
|
720
720
|
detail: data
|
|
721
721
|
}));
|
|
722
|
-
} catch
|
|
722
|
+
} catch {
|
|
723
723
|
// do nothing
|
|
724
724
|
}
|
|
725
725
|
}
|
|
@@ -1091,7 +1091,7 @@ export function addApdexToAll(apdex) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
1093
|
});
|
|
1094
|
-
} catch
|
|
1094
|
+
} catch {
|
|
1095
1095
|
// do nothing
|
|
1096
1096
|
}
|
|
1097
1097
|
if (interaction.type === 'page_load' || interaction.type === 'transition') {
|
|
@@ -1125,7 +1125,7 @@ export function addApdex(interactionId, apdexInfo) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
});
|
|
1128
|
-
} catch
|
|
1128
|
+
} catch {
|
|
1129
1129
|
// do nothing
|
|
1130
1130
|
}
|
|
1131
1131
|
if (interaction.type === 'page_load' || interaction.type === 'transition') {
|
|
@@ -1204,7 +1204,7 @@ export function addRedirect(interactionId, fromUfoName, nextUfoName, nextRouteNa
|
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
});
|
|
1207
|
-
} catch
|
|
1207
|
+
} catch {
|
|
1208
1208
|
// do nothing
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var _process, _process$env;
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { isVCRevisionEnabled } from '../config';
|
|
3
4
|
import { VCObserverNOOP } from './no-op-vc-observer';
|
|
4
5
|
import { VCObserver } from './vc-observer';
|
|
@@ -15,7 +16,8 @@ export class VCObserverWrapper {
|
|
|
15
16
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
|
|
16
17
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
+
const ttvcV4RevisionName = fg('platform_ufo_vcnext_to_fy26_04_revision_update') ? 'fy26.04' : 'next';
|
|
20
|
+
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled(ttvcV4RevisionName)) {
|
|
19
21
|
var _opts$ssrEnablePageLa2;
|
|
20
22
|
this.newVCObserver = new VCObserverNew({
|
|
21
23
|
selectorConfig: opts.selectorConfig,
|
|
@@ -2,7 +2,7 @@ export function getViewportWidth(document = window.document) {
|
|
|
2
2
|
let documentWidth;
|
|
3
3
|
try {
|
|
4
4
|
documentWidth = document.documentElement.clientWidth || 0;
|
|
5
|
-
} catch
|
|
5
|
+
} catch {
|
|
6
6
|
documentWidth = 0;
|
|
7
7
|
}
|
|
8
8
|
return Math.max(documentWidth, window.innerWidth || 0);
|
|
@@ -11,7 +11,7 @@ export function getViewportHeight(document = window.document) {
|
|
|
11
11
|
let documentHeight;
|
|
12
12
|
try {
|
|
13
13
|
documentHeight = document.documentElement.clientHeight || 0;
|
|
14
|
-
} catch
|
|
14
|
+
} catch {
|
|
15
15
|
documentHeight = 0;
|
|
16
16
|
}
|
|
17
17
|
return Math.max(documentHeight, window.innerHeight || 0);
|
|
@@ -225,7 +225,7 @@ export class Observers {
|
|
|
225
225
|
idString = [tagName, attrs || classList].join('');
|
|
226
226
|
}
|
|
227
227
|
return idString;
|
|
228
|
-
} catch
|
|
228
|
+
} catch {
|
|
229
229
|
return 'error';
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -260,7 +260,7 @@ export class Observers {
|
|
|
260
260
|
let elementName;
|
|
261
261
|
try {
|
|
262
262
|
elementName = this.getElementName(target);
|
|
263
|
-
} catch
|
|
263
|
+
} catch {
|
|
264
264
|
elementName = 'error';
|
|
265
265
|
}
|
|
266
266
|
callback(data.mutation.timestamp || performance.now(), ir, elementName, target, data.type, data.ignoreReason, data.attributeName, data.oldValue, data.newValue);
|
|
@@ -94,7 +94,7 @@ export class SSRPlaceholderHandlers {
|
|
|
94
94
|
try {
|
|
95
95
|
// Collect initial placeholders using SSR dimensions
|
|
96
96
|
this.collectPlaceholdersInternal();
|
|
97
|
-
} catch
|
|
97
|
+
} catch {} finally {
|
|
98
98
|
delete window.__SSR_PLACEHOLDERS_DIMENSIONS__;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -154,7 +154,7 @@ export class SSRPlaceholderHandlers {
|
|
|
154
154
|
try {
|
|
155
155
|
// Collect placeholders using SSR dimensions or fallback to live dimensions
|
|
156
156
|
this.collectPlaceholdersInternal();
|
|
157
|
-
} catch
|
|
157
|
+
} catch {
|
|
158
158
|
// Silently fail if there are any issues
|
|
159
159
|
} finally {
|
|
160
160
|
delete window.__SSR_PLACEHOLDERS_DIMENSIONS__;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { isVCRevisionEnabled } from '../../config';
|
|
3
4
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
4
5
|
import { SSRPlaceholderHandlers } from '../vc-observer/observers/ssr-placeholders';
|
|
5
6
|
import EntriesTimeline from './entries-timeline';
|
|
6
7
|
import getElementName from './get-element-name';
|
|
7
8
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
9
|
+
import VCCalculator_FY26_04 from './metric-calculator/fy26_04';
|
|
8
10
|
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
9
11
|
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
10
|
-
import VCNextCalculator from './metric-calculator/vcnext';
|
|
11
12
|
import RawDataHandler from './raw-data-handler';
|
|
12
13
|
import ViewportObserver from './viewport-observer';
|
|
13
14
|
import WindowEventObserver from './window-event-observer';
|
|
@@ -225,45 +226,91 @@ export default class VCObserverNew {
|
|
|
225
226
|
start,
|
|
226
227
|
stop
|
|
227
228
|
});
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
229
|
+
if (fg('platform_ufo_vcnext_to_fy26_04_revision_update')) {
|
|
230
|
+
const fy25_03 = isVCRevisionEnabled('fy25.03') ? await calculator_fy25_03.calculate({
|
|
231
|
+
orderedEntries,
|
|
232
|
+
startTime: start,
|
|
233
|
+
stopTime: stop,
|
|
234
|
+
interactionId,
|
|
235
|
+
interactionType,
|
|
236
|
+
isPostInteraction: this.isPostInteraction,
|
|
237
|
+
include3p,
|
|
238
|
+
excludeSmartAnswersInSearch,
|
|
239
|
+
includeSSRRatio,
|
|
240
|
+
isPageVisible,
|
|
241
|
+
interactionAbortReason
|
|
242
|
+
}) : null;
|
|
243
|
+
if (fy25_03) {
|
|
244
|
+
results.push(fy25_03);
|
|
245
|
+
}
|
|
244
246
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
// From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
|
|
248
|
+
// From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
|
|
249
|
+
if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
|
|
250
|
+
this.addSSR(param.ssr);
|
|
251
|
+
}
|
|
252
|
+
const calculator_fy26_04 = new VCCalculator_FY26_04();
|
|
253
|
+
const fy26_04 = isVCRevisionEnabled('fy26.04') || isVCRevisionEnabled('next') ? await calculator_fy26_04.calculate({
|
|
254
|
+
orderedEntries,
|
|
255
|
+
startTime: start,
|
|
256
|
+
stopTime: stop,
|
|
257
|
+
interactionId,
|
|
258
|
+
interactionType,
|
|
259
|
+
isPostInteraction: this.isPostInteraction,
|
|
260
|
+
include3p,
|
|
261
|
+
includeSSRRatio,
|
|
262
|
+
isPageVisible,
|
|
263
|
+
interactionAbortReason
|
|
264
|
+
}) : null;
|
|
265
|
+
if (fy26_04) {
|
|
266
|
+
const vcNext = {
|
|
267
|
+
revision: 'next',
|
|
268
|
+
'metric:vc90': fy26_04['metric:vc90'],
|
|
269
|
+
clean: fy26_04['clean']
|
|
270
|
+
};
|
|
271
|
+
results.push(fy26_04);
|
|
272
|
+
results.push(vcNext);
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
const fy25_03 = await calculator_fy25_03.calculate({
|
|
276
|
+
orderedEntries,
|
|
277
|
+
startTime: start,
|
|
278
|
+
stopTime: stop,
|
|
279
|
+
interactionId,
|
|
280
|
+
interactionType,
|
|
281
|
+
isPostInteraction: this.isPostInteraction,
|
|
282
|
+
include3p,
|
|
283
|
+
excludeSmartAnswersInSearch,
|
|
284
|
+
includeSSRRatio,
|
|
285
|
+
isPageVisible,
|
|
286
|
+
interactionAbortReason
|
|
287
|
+
});
|
|
288
|
+
if (fy25_03) {
|
|
289
|
+
results.push(fy25_03);
|
|
290
|
+
}
|
|
250
291
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
292
|
+
// From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
|
|
293
|
+
// From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
|
|
294
|
+
if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
|
|
295
|
+
this.addSSR(param.ssr);
|
|
296
|
+
}
|
|
297
|
+
const calculator_next = new VCCalculator_FY26_04();
|
|
298
|
+
const vcNext = await calculator_next.calculate({
|
|
299
|
+
orderedEntries,
|
|
300
|
+
startTime: start,
|
|
301
|
+
stopTime: stop,
|
|
302
|
+
interactionId,
|
|
303
|
+
interactionType,
|
|
304
|
+
isPostInteraction: this.isPostInteraction,
|
|
305
|
+
include3p,
|
|
306
|
+
includeSSRRatio,
|
|
307
|
+
isPageVisible,
|
|
308
|
+
interactionAbortReason
|
|
309
|
+
});
|
|
310
|
+
if (vcNext) {
|
|
311
|
+
vcNext.revision = 'next';
|
|
312
|
+
results.push(vcNext);
|
|
313
|
+
}
|
|
267
314
|
}
|
|
268
315
|
const feVCCalculationEndTime = performance.now();
|
|
269
316
|
if (includeRawData && fg('platform_ufo_enable_vc_raw_data')) {
|