@atlaskit/react-ufo 4.17.1 → 5.0.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 +14 -0
- package/dist/cjs/vc/index.js +1 -3
- package/dist/cjs/vc/vc-observer-new/index.js +55 -67
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +13 -4
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy26_04/index.js +2 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/vc-next/index.js +42 -0
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +7 -7
- package/dist/es2019/vc/index.js +1 -3
- package/dist/es2019/vc/vc-observer-new/index.js +59 -81
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +6 -1
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy26_04/index.js +2 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/vc-next/index.js +21 -0
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +7 -7
- package/dist/esm/vc/index.js +1 -3
- package/dist/esm/vc/vc-observer-new/index.js +53 -65
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +13 -4
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy26_04/index.js +2 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/vc-next/index.js +36 -0
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +7 -7
- package/dist/types/vc/vc-observer-new/metric-calculator/fy26_04/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/vc-next/index.d.ts +6 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy26_04/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/vc-next/index.d.ts +6 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`60444262e8606`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/60444262e8606) -
|
|
8
|
+
Deduplicate reported VC offenders in UFO payload
|
|
9
|
+
|
|
10
|
+
## 5.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- [`f06d1289b0fbd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f06d1289b0fbd) -
|
|
15
|
+
Decouple fy26.04 and vcNext TTVC revisions, default revision to be fy26.04
|
|
16
|
+
|
|
3
17
|
## 4.17.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
16
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _config = require("../config");
|
|
19
18
|
var _noOpVcObserver = require("./no-op-vc-observer");
|
|
20
19
|
var _vcObserver = require("./vc-observer");
|
|
@@ -36,8 +35,7 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
36
35
|
this.ssrPlaceholderHandler = new _ssrPlaceholders.SSRPlaceholderHandlers({
|
|
37
36
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
38
37
|
});
|
|
39
|
-
|
|
40
|
-
if ((0, _config.isVCRevisionEnabled)('fy25.03') || (0, _config.isVCRevisionEnabled)(ttvcV4RevisionName)) {
|
|
38
|
+
if ((0, _config.isVCRevisionEnabled)('fy25.03') || (0, _config.isVCRevisionEnabled)('fy26.04')) {
|
|
41
39
|
var _opts$ssrEnablePageLa2;
|
|
42
40
|
this.newVCObserver = new _vcObserverNew.default({
|
|
43
41
|
selectorConfig: opts.selectorConfig,
|
|
@@ -18,13 +18,16 @@ var _interactionMetrics = require("../../interaction-metrics");
|
|
|
18
18
|
var _ssrPlaceholders = require("../vc-observer/observers/ssr-placeholders");
|
|
19
19
|
var _entriesTimeline = _interopRequireDefault(require("./entries-timeline"));
|
|
20
20
|
var _getElementName2 = _interopRequireDefault(require("./get-element-name"));
|
|
21
|
-
var
|
|
21
|
+
var _fy25_ = _interopRequireDefault(require("./metric-calculator/fy25_03"));
|
|
22
22
|
var _fy26_ = _interopRequireDefault(require("./metric-calculator/fy26_04"));
|
|
23
23
|
var _getViewportHeight = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-height"));
|
|
24
24
|
var _getViewportWidth = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-width"));
|
|
25
|
+
var _vcNext2 = _interopRequireDefault(require("./metric-calculator/vc-next"));
|
|
25
26
|
var _rawDataHandler = _interopRequireDefault(require("./raw-data-handler"));
|
|
26
27
|
var _viewportObserver = _interopRequireDefault(require("./viewport-observer"));
|
|
27
28
|
var _windowEventObserver = _interopRequireDefault(require("./window-event-observer"));
|
|
29
|
+
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; }
|
|
30
|
+
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; }
|
|
28
31
|
var SSRState = {
|
|
29
32
|
normal: 1,
|
|
30
33
|
waitingForFirstRender: 2,
|
|
@@ -250,7 +253,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
250
253
|
key: "getVCResult",
|
|
251
254
|
value: function () {
|
|
252
255
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
253
|
-
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04,
|
|
256
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, calculator_next, vcNext, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
|
|
254
257
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
255
258
|
while (1) switch (_context.prev = _context.next) {
|
|
256
259
|
case 0:
|
|
@@ -258,7 +261,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
258
261
|
results = [];
|
|
259
262
|
this.addStartEntry(start);
|
|
260
263
|
feVCCalculationStartTime = performance.now();
|
|
261
|
-
calculator_fy25_03 = new
|
|
264
|
+
calculator_fy25_03 = new _fy25_.default();
|
|
262
265
|
if (param.includeSSRInV3 && param.ssr) {
|
|
263
266
|
this.addSSR(param.ssr);
|
|
264
267
|
}
|
|
@@ -266,15 +269,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
266
269
|
start: start,
|
|
267
270
|
stop: stop
|
|
268
271
|
});
|
|
269
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vcnext_to_fy26_04_revision_update')) {
|
|
270
|
-
_context.next = 30;
|
|
271
|
-
break;
|
|
272
|
-
}
|
|
273
272
|
if (!(0, _config.isVCRevisionEnabled)('fy25.03')) {
|
|
274
|
-
_context.next =
|
|
273
|
+
_context.next = 13;
|
|
275
274
|
break;
|
|
276
275
|
}
|
|
277
|
-
_context.next =
|
|
276
|
+
_context.next = 10;
|
|
278
277
|
return calculator_fy25_03.calculate({
|
|
279
278
|
orderedEntries: orderedEntries,
|
|
280
279
|
startTime: start,
|
|
@@ -288,13 +287,13 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
288
287
|
isPageVisible: isPageVisible,
|
|
289
288
|
interactionAbortReason: interactionAbortReason
|
|
290
289
|
});
|
|
291
|
-
case
|
|
290
|
+
case 10:
|
|
292
291
|
_context.t0 = _context.sent;
|
|
293
|
-
_context.next =
|
|
292
|
+
_context.next = 14;
|
|
294
293
|
break;
|
|
295
|
-
case
|
|
294
|
+
case 13:
|
|
296
295
|
_context.t0 = null;
|
|
297
|
-
case
|
|
296
|
+
case 14:
|
|
298
297
|
fy25_03 = _context.t0;
|
|
299
298
|
if (fy25_03) {
|
|
300
299
|
results.push(fy25_03);
|
|
@@ -306,11 +305,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
306
305
|
this.addSSR(param.ssr);
|
|
307
306
|
}
|
|
308
307
|
calculator_fy26_04 = new _fy26_.default();
|
|
309
|
-
if (!(
|
|
310
|
-
_context.next =
|
|
308
|
+
if (!(0, _config.isVCRevisionEnabled)('fy26.04')) {
|
|
309
|
+
_context.next = 24;
|
|
311
310
|
break;
|
|
312
311
|
}
|
|
313
|
-
_context.next =
|
|
312
|
+
_context.next = 21;
|
|
314
313
|
return calculator_fy26_04.calculate({
|
|
315
314
|
orderedEntries: orderedEntries,
|
|
316
315
|
startTime: start,
|
|
@@ -324,53 +323,29 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
324
323
|
isPageVisible: isPageVisible,
|
|
325
324
|
interactionAbortReason: interactionAbortReason
|
|
326
325
|
});
|
|
327
|
-
case
|
|
326
|
+
case 21:
|
|
328
327
|
_context.t1 = _context.sent;
|
|
329
|
-
_context.next =
|
|
328
|
+
_context.next = 25;
|
|
330
329
|
break;
|
|
331
|
-
case
|
|
330
|
+
case 24:
|
|
332
331
|
_context.t1 = null;
|
|
333
|
-
case
|
|
332
|
+
case 25:
|
|
334
333
|
fy26_04 = _context.t1;
|
|
335
|
-
if (fy26_04) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
'metric:vc90': fy26_04['metric:vc90'],
|
|
339
|
-
clean: fy26_04['clean']
|
|
340
|
-
};
|
|
341
|
-
results.push(fy26_04);
|
|
342
|
-
results.push(vcNext);
|
|
334
|
+
if (!fy26_04) {
|
|
335
|
+
_context.next = 43;
|
|
336
|
+
break;
|
|
343
337
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
return calculator_fy25_03.calculate({
|
|
349
|
-
orderedEntries: orderedEntries,
|
|
350
|
-
startTime: start,
|
|
351
|
-
stopTime: stop,
|
|
352
|
-
interactionId: interactionId,
|
|
353
|
-
interactionType: interactionType,
|
|
354
|
-
isPostInteraction: this.isPostInteraction,
|
|
355
|
-
include3p: include3p,
|
|
356
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
357
|
-
includeSSRRatio: includeSSRRatio,
|
|
358
|
-
isPageVisible: isPageVisible,
|
|
359
|
-
interactionAbortReason: interactionAbortReason
|
|
360
|
-
});
|
|
361
|
-
case 32:
|
|
362
|
-
_fy25_ = _context.sent;
|
|
363
|
-
if (_fy25_) {
|
|
364
|
-
results.push(_fy25_);
|
|
338
|
+
results.push(fy26_04);
|
|
339
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vcnext_for_ttvc_v5')) {
|
|
340
|
+
_context.next = 41;
|
|
341
|
+
break;
|
|
365
342
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
this.addSSR(param.ssr);
|
|
343
|
+
calculator_next = new _vcNext2.default();
|
|
344
|
+
if (!(0, _config.isVCRevisionEnabled)('next')) {
|
|
345
|
+
_context.next = 36;
|
|
346
|
+
break;
|
|
371
347
|
}
|
|
372
|
-
|
|
373
|
-
_context.next = 38;
|
|
348
|
+
_context.next = 33;
|
|
374
349
|
return calculator_next.calculate({
|
|
375
350
|
orderedEntries: orderedEntries,
|
|
376
351
|
startTime: start,
|
|
@@ -379,20 +354,33 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
379
354
|
interactionType: interactionType,
|
|
380
355
|
isPostInteraction: this.isPostInteraction,
|
|
381
356
|
include3p: include3p,
|
|
357
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
382
358
|
includeSSRRatio: includeSSRRatio,
|
|
383
359
|
isPageVisible: isPageVisible,
|
|
384
360
|
interactionAbortReason: interactionAbortReason
|
|
385
361
|
});
|
|
386
|
-
case
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
362
|
+
case 33:
|
|
363
|
+
_context.t2 = _context.sent;
|
|
364
|
+
_context.next = 37;
|
|
365
|
+
break;
|
|
366
|
+
case 36:
|
|
367
|
+
_context.t2 = null;
|
|
368
|
+
case 37:
|
|
369
|
+
vcNext = _context.t2;
|
|
370
|
+
if (vcNext) {
|
|
371
|
+
results.push(vcNext);
|
|
391
372
|
}
|
|
392
|
-
|
|
373
|
+
_context.next = 43;
|
|
374
|
+
break;
|
|
375
|
+
case 41:
|
|
376
|
+
_vcNext = _objectSpread(_objectSpread({}, fy26_04), {}, {
|
|
377
|
+
revision: 'next'
|
|
378
|
+
});
|
|
379
|
+
results.push(_vcNext);
|
|
380
|
+
case 43:
|
|
393
381
|
feVCCalculationEndTime = performance.now();
|
|
394
382
|
if (!(includeRawData && (0, _platformFeatureFlags.fg)('platform_ufo_enable_vc_raw_data'))) {
|
|
395
|
-
_context.next =
|
|
383
|
+
_context.next = 54;
|
|
396
384
|
break;
|
|
397
385
|
}
|
|
398
386
|
rawVCCalculationStartTime = performance.now();
|
|
@@ -402,14 +390,14 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
402
390
|
start: start,
|
|
403
391
|
stop: rawStopTime
|
|
404
392
|
}) : orderedEntries;
|
|
405
|
-
_context.next =
|
|
393
|
+
_context.next = 51;
|
|
406
394
|
return rawHandler.getRawData({
|
|
407
395
|
entries: rawOrderedEntries,
|
|
408
396
|
startTime: start,
|
|
409
397
|
stopTime: rawStopTime,
|
|
410
398
|
isPageVisible: isPageVisible
|
|
411
399
|
});
|
|
412
|
-
case
|
|
400
|
+
case 51:
|
|
413
401
|
raw = _context.sent;
|
|
414
402
|
results.forEach(function (result) {
|
|
415
403
|
delete result.vcDetails;
|
|
@@ -420,9 +408,9 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
420
408
|
raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
|
|
421
409
|
results.push(raw);
|
|
422
410
|
}
|
|
423
|
-
case
|
|
411
|
+
case 54:
|
|
424
412
|
return _context.abrupt("return", results);
|
|
425
|
-
case
|
|
413
|
+
case 55:
|
|
426
414
|
case "end":
|
|
427
415
|
return _context.stop();
|
|
428
416
|
}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -164,9 +164,18 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
164
164
|
case 19:
|
|
165
165
|
// Check if this entry matches any checkpoint percentiles
|
|
166
166
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
167
|
-
elementNames =
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
elementNames = [];
|
|
168
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_dedupe_repeated_vc_offenders')) {
|
|
169
|
+
elementNames = (0, _toConsumableArray2.default)(new Set(entries.map(function (e) {
|
|
170
|
+
return e.elementName;
|
|
171
|
+
})));
|
|
172
|
+
} else {
|
|
173
|
+
elementNames = entries.map(function (e) {
|
|
174
|
+
return e.elementName;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Process all matching percentiles in one go
|
|
170
179
|
while (percentileIndex < percentiles.length && viewportPercentage >= percentiles[percentileIndex]) {
|
|
171
180
|
vcDetails["".concat(percentiles[percentileIndex])] = {
|
|
172
181
|
t: Math.round(time),
|
|
@@ -33,8 +33,9 @@ var fy26_04_excluded_attributes = ['data-is-hovered' // non-visual attribute
|
|
|
33
33
|
];
|
|
34
34
|
var VCCalculator_FY26_04 = exports.default = /*#__PURE__*/function (_VCCalculator_FY25_) {
|
|
35
35
|
function VCCalculator_FY26_04() {
|
|
36
|
+
var revisionNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fy26.04';
|
|
36
37
|
(0, _classCallCheck2.default)(this, VCCalculator_FY26_04);
|
|
37
|
-
return _callSuper(this, VCCalculator_FY26_04, [
|
|
38
|
+
return _callSuper(this, VCCalculator_FY26_04, [revisionNo]);
|
|
38
39
|
}
|
|
39
40
|
(0, _inherits2.default)(VCCalculator_FY26_04, _VCCalculator_FY25_);
|
|
40
41
|
return (0, _createClass2.default)(VCCalculator_FY26_04, [{
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _fy26_ = _interopRequireDefault(require("../fy26_04"));
|
|
15
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
|
+
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
18
|
+
var getConsideredEntryTypes = function getConsideredEntryTypes() {
|
|
19
|
+
var consideredEntryTypes = [];
|
|
20
|
+
return consideredEntryTypes;
|
|
21
|
+
};
|
|
22
|
+
var getExcludedEntryTypes = function getExcludedEntryTypes() {
|
|
23
|
+
var excludedEntryTypes = [];
|
|
24
|
+
return excludedEntryTypes;
|
|
25
|
+
};
|
|
26
|
+
var VCCalculator_Next = exports.default = /*#__PURE__*/function (_VCCalculator_FY26_) {
|
|
27
|
+
function VCCalculator_Next() {
|
|
28
|
+
(0, _classCallCheck2.default)(this, VCCalculator_Next);
|
|
29
|
+
return _callSuper(this, VCCalculator_Next, ['next']);
|
|
30
|
+
}
|
|
31
|
+
(0, _inherits2.default)(VCCalculator_Next, _VCCalculator_FY26_);
|
|
32
|
+
return (0, _createClass2.default)(VCCalculator_Next, [{
|
|
33
|
+
key: "isEntryIncluded",
|
|
34
|
+
value: function isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
|
|
35
|
+
var isEntryIncludedInV4 = _superPropGet(VCCalculator_Next, "isEntryIncluded", this, 3)([entry, include3p, excludeSmartAnswersInSearch]);
|
|
36
|
+
if (isEntryIncludedInV4 && !getExcludedEntryTypes().includes(entry.data.type)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return getConsideredEntryTypes().includes(entry.data.type);
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
}(_fy26_.default);
|
|
@@ -43,13 +43,13 @@ function createMutationObserver(_ref) {
|
|
|
43
43
|
if (mut.type === 'attributes') {
|
|
44
44
|
var _mut$oldValue;
|
|
45
45
|
/*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
47
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
48
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
49
|
+
and whether or not they are the same doesn't really matter.
|
|
50
|
+
And Custom elements should work the same way as MutationObserver."
|
|
51
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
52
|
+
*/
|
|
53
53
|
var oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
54
54
|
var newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
55
55
|
if (oldValue !== newValue) {
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var _process, _process$env;
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { isVCRevisionEnabled } from '../config';
|
|
4
3
|
import { VCObserverNOOP } from './no-op-vc-observer';
|
|
5
4
|
import { VCObserver } from './vc-observer';
|
|
@@ -16,8 +15,7 @@ export class VCObserverWrapper {
|
|
|
16
15
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
|
|
17
16
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
18
17
|
});
|
|
19
|
-
|
|
20
|
-
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled(ttvcV4RevisionName)) {
|
|
18
|
+
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled('fy26.04')) {
|
|
21
19
|
var _opts$ssrEnablePageLa2;
|
|
22
20
|
this.newVCObserver = new VCObserverNew({
|
|
23
21
|
selectorConfig: opts.selectorConfig,
|
|
@@ -9,6 +9,7 @@ import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
|
9
9
|
import VCCalculator_FY26_04 from './metric-calculator/fy26_04';
|
|
10
10
|
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
11
11
|
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
12
|
+
import VCCalculator_Next from './metric-calculator/vc-next';
|
|
12
13
|
import RawDataHandler from './raw-data-handler';
|
|
13
14
|
import ViewportObserver from './viewport-observer';
|
|
14
15
|
import WindowEventObserver from './window-event-observer';
|
|
@@ -228,90 +229,67 @@ export default class VCObserverNew {
|
|
|
228
229
|
start,
|
|
229
230
|
stop
|
|
230
231
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
232
|
+
const fy25_03 = isVCRevisionEnabled('fy25.03') ? await calculator_fy25_03.calculate({
|
|
233
|
+
orderedEntries,
|
|
234
|
+
startTime: start,
|
|
235
|
+
stopTime: stop,
|
|
236
|
+
interactionId,
|
|
237
|
+
interactionType,
|
|
238
|
+
isPostInteraction: this.isPostInteraction,
|
|
239
|
+
include3p,
|
|
240
|
+
excludeSmartAnswersInSearch,
|
|
241
|
+
includeSSRRatio,
|
|
242
|
+
isPageVisible,
|
|
243
|
+
interactionAbortReason
|
|
244
|
+
}) : null;
|
|
245
|
+
if (fy25_03) {
|
|
246
|
+
results.push(fy25_03);
|
|
247
|
+
}
|
|
248
248
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
249
|
+
// From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
|
|
250
|
+
// From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
|
|
251
|
+
if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
|
|
252
|
+
this.addSSR(param.ssr);
|
|
253
|
+
}
|
|
254
|
+
const calculator_fy26_04 = new VCCalculator_FY26_04();
|
|
255
|
+
const fy26_04 = isVCRevisionEnabled('fy26.04') ? await calculator_fy26_04.calculate({
|
|
256
|
+
orderedEntries,
|
|
257
|
+
startTime: start,
|
|
258
|
+
stopTime: stop,
|
|
259
|
+
interactionId,
|
|
260
|
+
interactionType,
|
|
261
|
+
isPostInteraction: this.isPostInteraction,
|
|
262
|
+
include3p,
|
|
263
|
+
excludeSmartAnswersInSearch,
|
|
264
|
+
includeSSRRatio,
|
|
265
|
+
isPageVisible,
|
|
266
|
+
interactionAbortReason
|
|
267
|
+
}) : null;
|
|
268
|
+
if (fy26_04) {
|
|
269
|
+
results.push(fy26_04);
|
|
270
|
+
if (fg('platform_ufo_vcnext_for_ttvc_v5')) {
|
|
271
|
+
const calculator_next = new VCCalculator_Next();
|
|
272
|
+
const vcNext = isVCRevisionEnabled('next') ? await calculator_next.calculate({
|
|
273
|
+
orderedEntries,
|
|
274
|
+
startTime: start,
|
|
275
|
+
stopTime: stop,
|
|
276
|
+
interactionId,
|
|
277
|
+
interactionType,
|
|
278
|
+
isPostInteraction: this.isPostInteraction,
|
|
279
|
+
include3p,
|
|
280
|
+
excludeSmartAnswersInSearch,
|
|
281
|
+
includeSSRRatio,
|
|
282
|
+
isPageVisible,
|
|
283
|
+
interactionAbortReason
|
|
284
|
+
}) : null;
|
|
285
|
+
if (vcNext) {
|
|
286
|
+
results.push(vcNext);
|
|
287
|
+
}
|
|
288
|
+
} else {
|
|
269
289
|
const vcNext = {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
clean: fy26_04['clean']
|
|
290
|
+
...fy26_04,
|
|
291
|
+
revision: 'next'
|
|
273
292
|
};
|
|
274
|
-
results.push(fy26_04);
|
|
275
|
-
results.push(vcNext);
|
|
276
|
-
}
|
|
277
|
-
} else {
|
|
278
|
-
const fy25_03 = await calculator_fy25_03.calculate({
|
|
279
|
-
orderedEntries,
|
|
280
|
-
startTime: start,
|
|
281
|
-
stopTime: stop,
|
|
282
|
-
interactionId,
|
|
283
|
-
interactionType,
|
|
284
|
-
isPostInteraction: this.isPostInteraction,
|
|
285
|
-
include3p,
|
|
286
|
-
excludeSmartAnswersInSearch,
|
|
287
|
-
includeSSRRatio,
|
|
288
|
-
isPageVisible,
|
|
289
|
-
interactionAbortReason
|
|
290
|
-
});
|
|
291
|
-
if (fy25_03) {
|
|
292
|
-
results.push(fy25_03);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
|
|
296
|
-
// From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
|
|
297
|
-
if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
|
|
298
|
-
this.addSSR(param.ssr);
|
|
299
|
-
}
|
|
300
|
-
const calculator_next = new VCCalculator_FY26_04();
|
|
301
|
-
const vcNext = await calculator_next.calculate({
|
|
302
|
-
orderedEntries,
|
|
303
|
-
startTime: start,
|
|
304
|
-
stopTime: stop,
|
|
305
|
-
interactionId,
|
|
306
|
-
interactionType,
|
|
307
|
-
isPostInteraction: this.isPostInteraction,
|
|
308
|
-
include3p,
|
|
309
|
-
includeSSRRatio,
|
|
310
|
-
isPageVisible,
|
|
311
|
-
interactionAbortReason
|
|
312
|
-
});
|
|
313
|
-
if (vcNext) {
|
|
314
|
-
vcNext.revision = 'next';
|
|
315
293
|
results.push(vcNext);
|
|
316
294
|
}
|
|
317
295
|
}
|
|
@@ -90,7 +90,12 @@ export default class AbstractVCCalculatorBase {
|
|
|
90
90
|
|
|
91
91
|
// Check if this entry matches any checkpoint percentiles
|
|
92
92
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
93
|
-
|
|
93
|
+
let elementNames = [];
|
|
94
|
+
if (fg('platform_ufo_dedupe_repeated_vc_offenders')) {
|
|
95
|
+
elementNames = [...new Set(entries.map(e => e.elementName))];
|
|
96
|
+
} else {
|
|
97
|
+
elementNames = entries.map(e => e.elementName);
|
|
98
|
+
}
|
|
94
99
|
|
|
95
100
|
// Process all matching percentiles in one go
|
|
96
101
|
while (percentileIndex < percentiles.length && viewportPercentage >= percentiles[percentileIndex]) {
|
|
@@ -16,8 +16,8 @@ const getExcludedEntryTypes = () => {
|
|
|
16
16
|
const fy26_04_excluded_attributes = ['data-is-hovered' // non-visual attribute
|
|
17
17
|
];
|
|
18
18
|
export default class VCCalculator_FY26_04 extends VCCalculator_FY25_03 {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(
|
|
19
|
+
constructor(revisionNo = 'fy26.04') {
|
|
20
|
+
super(revisionNo);
|
|
21
21
|
}
|
|
22
22
|
isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
|
|
23
23
|
const isEntryIncludedInV3 = super.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import VCCalculator_FY26_04 from "../fy26_04";
|
|
2
|
+
const getConsideredEntryTypes = () => {
|
|
3
|
+
const consideredEntryTypes = [];
|
|
4
|
+
return consideredEntryTypes;
|
|
5
|
+
};
|
|
6
|
+
const getExcludedEntryTypes = () => {
|
|
7
|
+
const excludedEntryTypes = [];
|
|
8
|
+
return excludedEntryTypes;
|
|
9
|
+
};
|
|
10
|
+
export default class VCCalculator_Next extends VCCalculator_FY26_04 {
|
|
11
|
+
constructor() {
|
|
12
|
+
super('next');
|
|
13
|
+
}
|
|
14
|
+
isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
|
|
15
|
+
const isEntryIncludedInV4 = super.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
16
|
+
if (isEntryIncludedInV4 && !getExcludedEntryTypes().includes(entry.data.type)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return getConsideredEntryTypes().includes(entry.data.type);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -30,13 +30,13 @@ function createMutationObserver({
|
|
|
30
30
|
if (mut.type === 'attributes') {
|
|
31
31
|
var _mut$oldValue;
|
|
32
32
|
/*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
34
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
35
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
36
|
+
and whether or not they are the same doesn't really matter.
|
|
37
|
+
And Custom elements should work the same way as MutationObserver."
|
|
38
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
39
|
+
*/
|
|
40
40
|
const oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
41
41
|
const newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
42
42
|
if (oldValue !== newValue) {
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -7,7 +7,6 @@ var _process;
|
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
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; }
|
|
9
9
|
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; }
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { isVCRevisionEnabled } from '../config';
|
|
12
11
|
import { VCObserverNOOP } from './no-op-vc-observer';
|
|
13
12
|
import { VCObserver } from './vc-observer';
|
|
@@ -26,8 +25,7 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
26
25
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
|
|
27
26
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
28
27
|
});
|
|
29
|
-
|
|
30
|
-
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled(ttvcV4RevisionName)) {
|
|
28
|
+
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled('fy26.04')) {
|
|
31
29
|
var _opts$ssrEnablePageLa2;
|
|
32
30
|
this.newVCObserver = new VCObserverNew({
|
|
33
31
|
selectorConfig: opts.selectorConfig,
|
|
@@ -5,6 +5,8 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
8
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
11
|
import { isVCRevisionEnabled } from '../../config';
|
|
10
12
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
@@ -15,6 +17,7 @@ import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
|
15
17
|
import VCCalculator_FY26_04 from './metric-calculator/fy26_04';
|
|
16
18
|
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
17
19
|
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
20
|
+
import VCCalculator_Next from './metric-calculator/vc-next';
|
|
18
21
|
import RawDataHandler from './raw-data-handler';
|
|
19
22
|
import ViewportObserver from './viewport-observer';
|
|
20
23
|
import WindowEventObserver from './window-event-observer';
|
|
@@ -243,7 +246,7 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
243
246
|
key: "getVCResult",
|
|
244
247
|
value: function () {
|
|
245
248
|
var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
246
|
-
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04,
|
|
249
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, calculator_next, vcNext, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
|
|
247
250
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
248
251
|
while (1) switch (_context.prev = _context.next) {
|
|
249
252
|
case 0:
|
|
@@ -259,15 +262,11 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
259
262
|
start: start,
|
|
260
263
|
stop: stop
|
|
261
264
|
});
|
|
262
|
-
if (!fg('platform_ufo_vcnext_to_fy26_04_revision_update')) {
|
|
263
|
-
_context.next = 30;
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
265
|
if (!isVCRevisionEnabled('fy25.03')) {
|
|
267
|
-
_context.next =
|
|
266
|
+
_context.next = 13;
|
|
268
267
|
break;
|
|
269
268
|
}
|
|
270
|
-
_context.next =
|
|
269
|
+
_context.next = 10;
|
|
271
270
|
return calculator_fy25_03.calculate({
|
|
272
271
|
orderedEntries: orderedEntries,
|
|
273
272
|
startTime: start,
|
|
@@ -281,13 +280,13 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
281
280
|
isPageVisible: isPageVisible,
|
|
282
281
|
interactionAbortReason: interactionAbortReason
|
|
283
282
|
});
|
|
284
|
-
case
|
|
283
|
+
case 10:
|
|
285
284
|
_context.t0 = _context.sent;
|
|
286
|
-
_context.next =
|
|
285
|
+
_context.next = 14;
|
|
287
286
|
break;
|
|
288
|
-
case
|
|
287
|
+
case 13:
|
|
289
288
|
_context.t0 = null;
|
|
290
|
-
case
|
|
289
|
+
case 14:
|
|
291
290
|
fy25_03 = _context.t0;
|
|
292
291
|
if (fy25_03) {
|
|
293
292
|
results.push(fy25_03);
|
|
@@ -299,11 +298,11 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
299
298
|
this.addSSR(param.ssr);
|
|
300
299
|
}
|
|
301
300
|
calculator_fy26_04 = new VCCalculator_FY26_04();
|
|
302
|
-
if (!
|
|
303
|
-
_context.next =
|
|
301
|
+
if (!isVCRevisionEnabled('fy26.04')) {
|
|
302
|
+
_context.next = 24;
|
|
304
303
|
break;
|
|
305
304
|
}
|
|
306
|
-
_context.next =
|
|
305
|
+
_context.next = 21;
|
|
307
306
|
return calculator_fy26_04.calculate({
|
|
308
307
|
orderedEntries: orderedEntries,
|
|
309
308
|
startTime: start,
|
|
@@ -317,53 +316,29 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
317
316
|
isPageVisible: isPageVisible,
|
|
318
317
|
interactionAbortReason: interactionAbortReason
|
|
319
318
|
});
|
|
320
|
-
case
|
|
319
|
+
case 21:
|
|
321
320
|
_context.t1 = _context.sent;
|
|
322
|
-
_context.next =
|
|
321
|
+
_context.next = 25;
|
|
323
322
|
break;
|
|
324
|
-
case
|
|
323
|
+
case 24:
|
|
325
324
|
_context.t1 = null;
|
|
326
|
-
case
|
|
325
|
+
case 25:
|
|
327
326
|
fy26_04 = _context.t1;
|
|
328
|
-
if (fy26_04) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
'metric:vc90': fy26_04['metric:vc90'],
|
|
332
|
-
clean: fy26_04['clean']
|
|
333
|
-
};
|
|
334
|
-
results.push(fy26_04);
|
|
335
|
-
results.push(vcNext);
|
|
327
|
+
if (!fy26_04) {
|
|
328
|
+
_context.next = 43;
|
|
329
|
+
break;
|
|
336
330
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return calculator_fy25_03.calculate({
|
|
342
|
-
orderedEntries: orderedEntries,
|
|
343
|
-
startTime: start,
|
|
344
|
-
stopTime: stop,
|
|
345
|
-
interactionId: interactionId,
|
|
346
|
-
interactionType: interactionType,
|
|
347
|
-
isPostInteraction: this.isPostInteraction,
|
|
348
|
-
include3p: include3p,
|
|
349
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
350
|
-
includeSSRRatio: includeSSRRatio,
|
|
351
|
-
isPageVisible: isPageVisible,
|
|
352
|
-
interactionAbortReason: interactionAbortReason
|
|
353
|
-
});
|
|
354
|
-
case 32:
|
|
355
|
-
_fy25_ = _context.sent;
|
|
356
|
-
if (_fy25_) {
|
|
357
|
-
results.push(_fy25_);
|
|
331
|
+
results.push(fy26_04);
|
|
332
|
+
if (!fg('platform_ufo_vcnext_for_ttvc_v5')) {
|
|
333
|
+
_context.next = 41;
|
|
334
|
+
break;
|
|
358
335
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
this.addSSR(param.ssr);
|
|
336
|
+
calculator_next = new VCCalculator_Next();
|
|
337
|
+
if (!isVCRevisionEnabled('next')) {
|
|
338
|
+
_context.next = 36;
|
|
339
|
+
break;
|
|
364
340
|
}
|
|
365
|
-
|
|
366
|
-
_context.next = 38;
|
|
341
|
+
_context.next = 33;
|
|
367
342
|
return calculator_next.calculate({
|
|
368
343
|
orderedEntries: orderedEntries,
|
|
369
344
|
startTime: start,
|
|
@@ -372,20 +347,33 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
372
347
|
interactionType: interactionType,
|
|
373
348
|
isPostInteraction: this.isPostInteraction,
|
|
374
349
|
include3p: include3p,
|
|
350
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
375
351
|
includeSSRRatio: includeSSRRatio,
|
|
376
352
|
isPageVisible: isPageVisible,
|
|
377
353
|
interactionAbortReason: interactionAbortReason
|
|
378
354
|
});
|
|
379
|
-
case
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
355
|
+
case 33:
|
|
356
|
+
_context.t2 = _context.sent;
|
|
357
|
+
_context.next = 37;
|
|
358
|
+
break;
|
|
359
|
+
case 36:
|
|
360
|
+
_context.t2 = null;
|
|
361
|
+
case 37:
|
|
362
|
+
vcNext = _context.t2;
|
|
363
|
+
if (vcNext) {
|
|
364
|
+
results.push(vcNext);
|
|
384
365
|
}
|
|
385
|
-
|
|
366
|
+
_context.next = 43;
|
|
367
|
+
break;
|
|
368
|
+
case 41:
|
|
369
|
+
_vcNext = _objectSpread(_objectSpread({}, fy26_04), {}, {
|
|
370
|
+
revision: 'next'
|
|
371
|
+
});
|
|
372
|
+
results.push(_vcNext);
|
|
373
|
+
case 43:
|
|
386
374
|
feVCCalculationEndTime = performance.now();
|
|
387
375
|
if (!(includeRawData && fg('platform_ufo_enable_vc_raw_data'))) {
|
|
388
|
-
_context.next =
|
|
376
|
+
_context.next = 54;
|
|
389
377
|
break;
|
|
390
378
|
}
|
|
391
379
|
rawVCCalculationStartTime = performance.now();
|
|
@@ -395,14 +383,14 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
395
383
|
start: start,
|
|
396
384
|
stop: rawStopTime
|
|
397
385
|
}) : orderedEntries;
|
|
398
|
-
_context.next =
|
|
386
|
+
_context.next = 51;
|
|
399
387
|
return rawHandler.getRawData({
|
|
400
388
|
entries: rawOrderedEntries,
|
|
401
389
|
startTime: start,
|
|
402
390
|
stopTime: rawStopTime,
|
|
403
391
|
isPageVisible: isPageVisible
|
|
404
392
|
});
|
|
405
|
-
case
|
|
393
|
+
case 51:
|
|
406
394
|
raw = _context.sent;
|
|
407
395
|
results.forEach(function (result) {
|
|
408
396
|
delete result.vcDetails;
|
|
@@ -413,9 +401,9 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
413
401
|
raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
|
|
414
402
|
results.push(raw);
|
|
415
403
|
}
|
|
416
|
-
case
|
|
404
|
+
case 54:
|
|
417
405
|
return _context.abrupt("return", results);
|
|
418
|
-
case
|
|
406
|
+
case 55:
|
|
419
407
|
case "end":
|
|
420
408
|
return _context.stop();
|
|
421
409
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -158,9 +158,18 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
158
158
|
case 19:
|
|
159
159
|
// Check if this entry matches any checkpoint percentiles
|
|
160
160
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
161
|
-
elementNames =
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
elementNames = [];
|
|
162
|
+
if (fg('platform_ufo_dedupe_repeated_vc_offenders')) {
|
|
163
|
+
elementNames = _toConsumableArray(new Set(entries.map(function (e) {
|
|
164
|
+
return e.elementName;
|
|
165
|
+
})));
|
|
166
|
+
} else {
|
|
167
|
+
elementNames = entries.map(function (e) {
|
|
168
|
+
return e.elementName;
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Process all matching percentiles in one go
|
|
164
173
|
while (percentileIndex < percentiles.length && viewportPercentage >= percentiles[percentileIndex]) {
|
|
165
174
|
vcDetails["".concat(percentiles[percentileIndex])] = {
|
|
166
175
|
t: Math.round(time),
|
|
@@ -26,8 +26,9 @@ var fy26_04_excluded_attributes = ['data-is-hovered' // non-visual attribute
|
|
|
26
26
|
];
|
|
27
27
|
var VCCalculator_FY26_04 = /*#__PURE__*/function (_VCCalculator_FY25_) {
|
|
28
28
|
function VCCalculator_FY26_04() {
|
|
29
|
+
var revisionNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fy26.04';
|
|
29
30
|
_classCallCheck(this, VCCalculator_FY26_04);
|
|
30
|
-
return _callSuper(this, VCCalculator_FY26_04, [
|
|
31
|
+
return _callSuper(this, VCCalculator_FY26_04, [revisionNo]);
|
|
31
32
|
}
|
|
32
33
|
_inherits(VCCalculator_FY26_04, _VCCalculator_FY25_);
|
|
33
34
|
return _createClass(VCCalculator_FY26_04, [{
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _get from "@babel/runtime/helpers/get";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
10
|
+
import VCCalculator_FY26_04 from "../fy26_04";
|
|
11
|
+
var getConsideredEntryTypes = function getConsideredEntryTypes() {
|
|
12
|
+
var consideredEntryTypes = [];
|
|
13
|
+
return consideredEntryTypes;
|
|
14
|
+
};
|
|
15
|
+
var getExcludedEntryTypes = function getExcludedEntryTypes() {
|
|
16
|
+
var excludedEntryTypes = [];
|
|
17
|
+
return excludedEntryTypes;
|
|
18
|
+
};
|
|
19
|
+
var VCCalculator_Next = /*#__PURE__*/function (_VCCalculator_FY26_) {
|
|
20
|
+
function VCCalculator_Next() {
|
|
21
|
+
_classCallCheck(this, VCCalculator_Next);
|
|
22
|
+
return _callSuper(this, VCCalculator_Next, ['next']);
|
|
23
|
+
}
|
|
24
|
+
_inherits(VCCalculator_Next, _VCCalculator_FY26_);
|
|
25
|
+
return _createClass(VCCalculator_Next, [{
|
|
26
|
+
key: "isEntryIncluded",
|
|
27
|
+
value: function isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
|
|
28
|
+
var isEntryIncludedInV4 = _superPropGet(VCCalculator_Next, "isEntryIncluded", this, 3)([entry, include3p, excludeSmartAnswersInSearch]);
|
|
29
|
+
if (isEntryIncludedInV4 && !getExcludedEntryTypes().includes(entry.data.type)) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return getConsideredEntryTypes().includes(entry.data.type);
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
}(VCCalculator_FY26_04);
|
|
36
|
+
export { VCCalculator_Next as default };
|
|
@@ -38,13 +38,13 @@ function createMutationObserver(_ref) {
|
|
|
38
38
|
if (mut.type === 'attributes') {
|
|
39
39
|
var _mut$oldValue;
|
|
40
40
|
/*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
42
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
43
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
44
|
+
and whether or not they are the same doesn't really matter.
|
|
45
|
+
And Custom elements should work the same way as MutationObserver."
|
|
46
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
47
|
+
*/
|
|
48
48
|
var oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
49
49
|
var newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
50
50
|
if (oldValue !== newValue) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VCObserverEntry } from '../../types';
|
|
2
2
|
import VCCalculator_FY25_03 from '../fy25_03';
|
|
3
3
|
export default class VCCalculator_FY26_04 extends VCCalculator_FY25_03 {
|
|
4
|
-
constructor();
|
|
4
|
+
constructor(revisionNo?: string);
|
|
5
5
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
|
|
6
6
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VCObserverEntry } from "../../types";
|
|
2
|
+
import VCCalculator_FY26_04 from "../fy26_04";
|
|
3
|
+
export default class VCCalculator_Next extends VCCalculator_FY26_04 {
|
|
4
|
+
constructor();
|
|
5
|
+
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VCObserverEntry } from '../../types';
|
|
2
2
|
import VCCalculator_FY25_03 from '../fy25_03';
|
|
3
3
|
export default class VCCalculator_FY26_04 extends VCCalculator_FY25_03 {
|
|
4
|
-
constructor();
|
|
4
|
+
constructor(revisionNo?: string);
|
|
5
5
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
|
|
6
6
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VCObserverEntry } from "../../types";
|
|
2
|
+
import VCCalculator_FY26_04 from "../fy26_04";
|
|
3
|
+
export default class VCCalculator_Next extends VCCalculator_FY26_04 {
|
|
4
|
+
constructor();
|
|
5
|
+
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"platform_ufo_segment_critical_metrics": {
|
|
130
130
|
"type": "boolean"
|
|
131
131
|
},
|
|
132
|
-
"
|
|
132
|
+
"platform_ufo_vcnext_for_ttvc_v5": {
|
|
133
133
|
"type": "boolean"
|
|
134
134
|
},
|
|
135
135
|
"platform_ufo_v4_fix_nested_ssr_placeholder": {
|
|
@@ -192,6 +192,9 @@
|
|
|
192
192
|
"platform_ufo_enable_vc_raw_data": {
|
|
193
193
|
"type": "boolean"
|
|
194
194
|
},
|
|
195
|
+
"platform_ufo_dedupe_repeated_vc_offenders": {
|
|
196
|
+
"type": "boolean"
|
|
197
|
+
},
|
|
195
198
|
"platform_mark_ufo_segment_first_load": {
|
|
196
199
|
"type": "boolean"
|
|
197
200
|
},
|