@atlaskit/react-ufo 3.8.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +2 -2
- package/dist/cjs/vc/index.js +1 -1
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +5 -2
- package/dist/cjs/vc/vc-observer/index.js +16 -9
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -2
- package/dist/es2019/vc/index.js +2 -2
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +5 -2
- package/dist/es2019/vc/vc-observer/index.js +14 -7
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/esm/create-payload/utils/get-vc-metrics.js +2 -2
- package/dist/esm/vc/index.js +1 -1
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +5 -2
- package/dist/esm/vc/vc-observer/index.js +16 -9
- package/dist/esm/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/types/config/index.d.ts +2 -1
- package/dist/types-ts4.5/config/index.d.ts +2 -1
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#147017](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147017)
|
|
8
|
+
[`cd0798d2a9a3d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd0798d2a9a3d) -
|
|
9
|
+
Enable VC revisions by UFO config
|
|
10
|
+
|
|
3
11
|
## 3.8.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -22,7 +22,7 @@ function getVCMetrics(_x) {
|
|
|
22
22
|
}
|
|
23
23
|
function _getVCMetrics() {
|
|
24
24
|
_getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
25
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
|
|
25
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI, _config$vc2;
|
|
26
26
|
var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, _result$ufoVcRev, ttvcV2Revision, VC;
|
|
27
27
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -70,7 +70,7 @@ function _getVCMetrics() {
|
|
|
70
70
|
(0, _vc.getVCObserver)().stop();
|
|
71
71
|
}
|
|
72
72
|
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
73
|
-
if (
|
|
73
|
+
if (config !== null && config !== void 0 && (_config$vc2 = config.vc) !== null && _config$vc2 !== void 0 && (_config$vc2 = _config$vc2.enabledVCRevisions) !== null && _config$vc2 !== void 0 && _config$vc2.includes('fy25.01')) {
|
|
74
74
|
_context.next = 26;
|
|
75
75
|
break;
|
|
76
76
|
}
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
26
26
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27
27
|
(0, _classCallCheck2.default)(this, VCObserverWrapper);
|
|
28
28
|
this.newVCObserver = null;
|
|
29
|
-
var isNewVCObserverEnabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') || ((_getConfig = (0, _config.getConfig)()) === null || _getConfig === void 0 || (_getConfig = _getConfig.vc) === null || _getConfig === void 0 ? void 0 : _getConfig.
|
|
29
|
+
var isNewVCObserverEnabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') || ((_getConfig = (0, _config.getConfig)()) === null || _getConfig === void 0 || (_getConfig = _getConfig.vc) === null || _getConfig === void 0 || (_getConfig = _getConfig.enabledVCRevisions) === null || _getConfig === void 0 ? void 0 : _getConfig.includes('fy25.03'));
|
|
30
30
|
if (isNewVCObserverEnabled) {
|
|
31
31
|
this.newVCObserver = new _vcObserverNew.default({
|
|
32
32
|
selectorConfig: opts.selectorConfig
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getVCRevisionsData = getVCRevisionsData;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
var _config = require("../../config");
|
|
10
11
|
var _hiddenTiming = require("../../hidden-timing");
|
|
11
12
|
var _revisions = require("./revisions/revisions");
|
|
12
13
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
@@ -45,6 +46,7 @@ function createVCDetails(calculatedVC, shouldHaveVCmetric) {
|
|
|
45
46
|
|
|
46
47
|
// Optimized implementation (current one)
|
|
47
48
|
function getVCRevisionsData(_ref) {
|
|
49
|
+
var _ufoConfig$vc, _ufoConfig$vc2;
|
|
48
50
|
var fullPrefix = _ref.fullPrefix,
|
|
49
51
|
interaction = _ref.interaction,
|
|
50
52
|
isVCClean = _ref.isVCClean,
|
|
@@ -53,7 +55,8 @@ function getVCRevisionsData(_ref) {
|
|
|
53
55
|
ssr = _ref.ssr,
|
|
54
56
|
calculatedVC = _ref.calculatedVC,
|
|
55
57
|
calculatedVCNext = _ref.calculatedVCNext;
|
|
56
|
-
|
|
58
|
+
var ufoConfig = (0, _config.getConfig)();
|
|
59
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') && !(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc = ufoConfig.vc) !== null && _ufoConfig$vc !== void 0 && (_ufoConfig$vc = _ufoConfig$vc.enabledVCRevisions) !== null && _ufoConfig$vc !== void 0 && _ufoConfig$vc.includes('fy25.03'))) {
|
|
57
60
|
if (!multiHeatmap) {
|
|
58
61
|
return null;
|
|
59
62
|
}
|
|
@@ -89,7 +92,7 @@ function getVCRevisionsData(_ref) {
|
|
|
89
92
|
'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
|
|
90
93
|
vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
|
|
91
94
|
};
|
|
92
|
-
if ((0
|
|
95
|
+
if (!(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc2 = ufoConfig.vc) !== null && _ufoConfig$vc2 !== void 0 && (_ufoConfig$vc2 = _ufoConfig$vc2.enabledVCRevisions) !== null && _ufoConfig$vc2 !== void 0 && _ufoConfig$vc2.includes('fy25.01'))) {
|
|
93
96
|
return (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:rev"), [ttvcV2Revision]);
|
|
94
97
|
}
|
|
95
98
|
|
|
@@ -14,6 +14,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
+
var _config = require("../../config");
|
|
17
18
|
var _attachAbortListeners = require("./attachAbortListeners");
|
|
18
19
|
var _getVCRevisionsData = require("./getVCRevisionsData");
|
|
19
20
|
var _getViewport = require("./getViewport");
|
|
@@ -44,7 +45,8 @@ function filterComponentsLog(log) {
|
|
|
44
45
|
}
|
|
45
46
|
var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
46
47
|
function VCObserver(options) {
|
|
47
|
-
var _this = this
|
|
48
|
+
var _this = this,
|
|
49
|
+
_getConfig5;
|
|
48
50
|
(0, _classCallCheck2.default)(this, VCObserver);
|
|
49
51
|
/* abort logic */
|
|
50
52
|
(0, _defineProperty2.default)(this, "abortReason", {
|
|
@@ -104,7 +106,8 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
104
106
|
});
|
|
105
107
|
(0, _defineProperty2.default)(this, "getVCResult", /*#__PURE__*/function () {
|
|
106
108
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
|
|
107
|
-
var
|
|
109
|
+
var _getConfig, _getConfig2;
|
|
110
|
+
var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, isCalcSpeedIndexEnabled, speedIndex, isTTVCv3Enabled;
|
|
108
111
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
109
112
|
while (1) switch (_context.prev = _context.next) {
|
|
110
113
|
case 0:
|
|
@@ -131,7 +134,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
131
134
|
} catch (e) {}
|
|
132
135
|
return _context.abrupt("return", (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp));
|
|
133
136
|
case 10:
|
|
134
|
-
isTTVCv1Disabled = (0,
|
|
137
|
+
isTTVCv1Disabled = !((_getConfig = (0, _config.getConfig)()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'));
|
|
135
138
|
ttvcV1Result = isTTVCv1Disabled ? {
|
|
136
139
|
VC: {},
|
|
137
140
|
VCBox: {},
|
|
@@ -289,10 +292,11 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
289
292
|
}
|
|
290
293
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
|
|
291
294
|
case 26:
|
|
295
|
+
isTTVCv3Enabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') || ((_getConfig2 = (0, _config.getConfig)()) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.vc) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.enabledVCRevisions) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.includes('fy25.03'));
|
|
292
296
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
293
297
|
'metrics:vc': VC
|
|
294
|
-
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"),
|
|
295
|
-
case
|
|
298
|
+
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : 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), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
|
|
299
|
+
case 28:
|
|
296
300
|
case "end":
|
|
297
301
|
return _context.stop();
|
|
298
302
|
}
|
|
@@ -303,9 +307,10 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
303
307
|
};
|
|
304
308
|
}());
|
|
305
309
|
(0, _defineProperty2.default)(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
|
|
310
|
+
var _getConfig3;
|
|
306
311
|
_this.measureStart();
|
|
307
312
|
_this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue);
|
|
308
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new')) {
|
|
313
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new') && !((_getConfig3 = (0, _config.getConfig)()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.vc) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.enabledVCRevisions) !== null && _getConfig3 !== void 0 && _getConfig3.includes('fy25.03'))) {
|
|
309
314
|
_this.onViewportChangeDetected({
|
|
310
315
|
timestamp: rawTime,
|
|
311
316
|
intersectionRect: intersectionRect,
|
|
@@ -322,13 +327,14 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
322
327
|
});
|
|
323
328
|
(0, _defineProperty2.default)(this, "legacyHandleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
|
|
324
329
|
if (_this.abortReason.reason === null || _this.abortReason.blocking === false) {
|
|
330
|
+
var _getConfig4;
|
|
325
331
|
var time = Math.round(rawTime - _this.startTime);
|
|
326
332
|
var mappedValues = _this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
327
333
|
_this.vcRatios[targetName] = _this.getElementRatio(mappedValues);
|
|
328
334
|
if (!ignoreReason) {
|
|
329
335
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
|
|
330
336
|
}
|
|
331
|
-
var isTTVCv1Disabled = (0,
|
|
337
|
+
var isTTVCv1Disabled = !((_getConfig4 = (0, _config.getConfig)()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.vc) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.enabledVCRevisions) !== null && _getConfig4 !== void 0 && _getConfig4.includes('fy25.01'));
|
|
332
338
|
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
333
339
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
|
|
334
340
|
}
|
|
@@ -466,7 +472,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
466
472
|
dataVC: true
|
|
467
473
|
}
|
|
468
474
|
});
|
|
469
|
-
this.heatmap = (0,
|
|
475
|
+
this.heatmap = !((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.vc) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.enabledVCRevisions) !== null && _getConfig5 !== void 0 && _getConfig5.includes('fy25.01')) ? [] : this.getCleanHeatmap();
|
|
470
476
|
this.heatmapNext = this.getCleanHeatmap();
|
|
471
477
|
this.multiHeatmap = new _heatmap.MultiRevisionHeatmap({
|
|
472
478
|
viewport: this.viewport,
|
|
@@ -546,6 +552,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
546
552
|
}, {
|
|
547
553
|
key: "resetState",
|
|
548
554
|
value: function resetState() {
|
|
555
|
+
var _getConfig6;
|
|
549
556
|
this.abortReason = {
|
|
550
557
|
reason: null,
|
|
551
558
|
info: '',
|
|
@@ -553,7 +560,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
553
560
|
blocking: false
|
|
554
561
|
};
|
|
555
562
|
this.detachAbortListeners();
|
|
556
|
-
this.heatmap = (0,
|
|
563
|
+
this.heatmap = !((_getConfig6 = (0, _config.getConfig)()) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.vc) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.enabledVCRevisions) !== null && _getConfig6 !== void 0 && _getConfig6.includes('fy25.01')) ? [] : this.getCleanHeatmap();
|
|
557
564
|
this.heatmapNext = this.getCleanHeatmap();
|
|
558
565
|
this.multiHeatmap = new _heatmap.MultiRevisionHeatmap({
|
|
559
566
|
viewport: this.viewport,
|
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getRevisions = getRevisions;
|
|
7
|
-
var
|
|
7
|
+
var _config = require("../../../config");
|
|
8
8
|
var _fy25_ = require("./fy25_01");
|
|
9
9
|
var _fy25_2 = require("./fy25_02");
|
|
10
10
|
function getRevisions() {
|
|
11
|
-
|
|
11
|
+
var _getConfig;
|
|
12
|
+
if (!((_getConfig = (0, _config.getConfig)()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'))) {
|
|
12
13
|
return [{
|
|
13
14
|
name: 'fy25.02',
|
|
14
15
|
classifier: _fy25_2.revFY25_02Classifier
|
|
@@ -6,7 +6,7 @@ import getInteractionStatus from './get-interaction-status';
|
|
|
6
6
|
import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
|
|
7
7
|
import getSSRDoneTimeValue from './get-ssr-done-time-value';
|
|
8
8
|
async function getVCMetrics(interaction) {
|
|
9
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$experimentalI;
|
|
9
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$experimentalI, _config$vc2, _config$vc2$enabledVC;
|
|
10
10
|
const config = getConfig();
|
|
11
11
|
if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
|
|
12
12
|
return {};
|
|
@@ -39,7 +39,7 @@ async function getVCMetrics(interaction) {
|
|
|
39
39
|
getVCObserver().stop();
|
|
40
40
|
}
|
|
41
41
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
42
|
-
if (
|
|
42
|
+
if (!(config !== null && config !== void 0 && (_config$vc2 = config.vc) !== null && _config$vc2 !== void 0 && (_config$vc2$enabledVC = _config$vc2.enabledVCRevisions) !== null && _config$vc2$enabledVC !== void 0 && _config$vc2$enabledVC.includes('fy25.01'))) {
|
|
43
43
|
var _result$ufoVcRev;
|
|
44
44
|
const ttvcV2Revision = result === null || result === void 0 ? void 0 : (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(({
|
|
45
45
|
revision
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { VCObserver } from './vc-observer';
|
|
|
6
6
|
import VCObserverNew from './vc-observer-new';
|
|
7
7
|
class VCObserverWrapper {
|
|
8
8
|
constructor(opts = {}) {
|
|
9
|
-
var _getConfig, _getConfig$vc;
|
|
9
|
+
var _getConfig, _getConfig$vc, _getConfig$vc$enabled;
|
|
10
10
|
this.newVCObserver = null;
|
|
11
|
-
const isNewVCObserverEnabled = fg('platform_ufo_vc_observer_new') || ((_getConfig = getConfig()) === null || _getConfig === void 0 ? void 0 : (_getConfig$vc = _getConfig.vc) === null || _getConfig$vc === void 0 ? void 0 : _getConfig$vc.
|
|
11
|
+
const isNewVCObserverEnabled = fg('platform_ufo_vc_observer_new') || ((_getConfig = getConfig()) === null || _getConfig === void 0 ? void 0 : (_getConfig$vc = _getConfig.vc) === null || _getConfig$vc === void 0 ? void 0 : (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) === null || _getConfig$vc$enabled === void 0 ? void 0 : _getConfig$vc$enabled.includes('fy25.03'));
|
|
12
12
|
if (isNewVCObserverEnabled) {
|
|
13
13
|
this.newVCObserver = new VCObserverNew({
|
|
14
14
|
selectorConfig: opts.selectorConfig
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { getConfig } from '../../config';
|
|
2
3
|
import { getPageVisibilityState } from '../../hidden-timing';
|
|
3
4
|
import { getRevisions } from './revisions/revisions';
|
|
4
5
|
const VCParts = ['25', '50', '75', '80', '85', '90', '95', '98', '99'];
|
|
@@ -37,7 +38,9 @@ export function getVCRevisionsData({
|
|
|
37
38
|
calculatedVC,
|
|
38
39
|
calculatedVCNext
|
|
39
40
|
}) {
|
|
40
|
-
|
|
41
|
+
var _ufoConfig$vc, _ufoConfig$vc$enabled, _ufoConfig$vc2, _ufoConfig$vc2$enable;
|
|
42
|
+
const ufoConfig = getConfig();
|
|
43
|
+
if (!fg('platform_ufo_vc_observer_new') && !(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc = ufoConfig.vc) !== null && _ufoConfig$vc !== void 0 && (_ufoConfig$vc$enabled = _ufoConfig$vc.enabledVCRevisions) !== null && _ufoConfig$vc$enabled !== void 0 && _ufoConfig$vc$enabled.includes('fy25.03'))) {
|
|
41
44
|
if (!multiHeatmap) {
|
|
42
45
|
return null;
|
|
43
46
|
}
|
|
@@ -71,7 +74,7 @@ export function getVCRevisionsData({
|
|
|
71
74
|
'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
|
|
72
75
|
vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
|
|
73
76
|
};
|
|
74
|
-
if (
|
|
77
|
+
if (!(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc2 = ufoConfig.vc) !== null && _ufoConfig$vc2 !== void 0 && (_ufoConfig$vc2$enable = _ufoConfig$vc2.enabledVCRevisions) !== null && _ufoConfig$vc2$enable !== void 0 && _ufoConfig$vc2$enable.includes('fy25.01'))) {
|
|
75
78
|
return {
|
|
76
79
|
[`${fullPrefix}vc:rev`]: [ttvcV2Revision]
|
|
77
80
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { getConfig } from '../../config';
|
|
3
4
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
4
5
|
import { getVCRevisionsData } from './getVCRevisionsData';
|
|
5
6
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
@@ -24,6 +25,7 @@ function filterComponentsLog(log) {
|
|
|
24
25
|
}
|
|
25
26
|
export class VCObserver {
|
|
26
27
|
constructor(options) {
|
|
28
|
+
var _getConfig5, _getConfig5$vc, _getConfig5$vc$enable;
|
|
27
29
|
/* abort logic */
|
|
28
30
|
_defineProperty(this, "abortReason", {
|
|
29
31
|
reason: null,
|
|
@@ -95,6 +97,7 @@ export class VCObserver {
|
|
|
95
97
|
vc,
|
|
96
98
|
isEventAborted
|
|
97
99
|
}) => {
|
|
100
|
+
var _getConfig, _getConfig$vc, _getConfig$vc$enabled, _getConfig2, _getConfig2$vc, _getConfig2$vc$enable;
|
|
98
101
|
const startTime = performance.now();
|
|
99
102
|
// add local measurement
|
|
100
103
|
const fullPrefix = prefix !== undefined && prefix !== '' ? `${prefix}:` : '';
|
|
@@ -128,7 +131,7 @@ export class VCObserver {
|
|
|
128
131
|
[`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp
|
|
129
132
|
};
|
|
130
133
|
}
|
|
131
|
-
const isTTVCv1Disabled =
|
|
134
|
+
const isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig$vc = _getConfig.vc) !== null && _getConfig$vc !== void 0 && (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) !== null && _getConfig$vc$enabled !== void 0 && _getConfig$vc$enabled.includes('fy25.01'));
|
|
132
135
|
const ttvcV1Result = isTTVCv1Disabled ? {
|
|
133
136
|
VC: {},
|
|
134
137
|
VCBox: {},
|
|
@@ -305,12 +308,13 @@ export class VCObserver {
|
|
|
305
308
|
...(isCalcSpeedIndexEnabled ? speedIndex : {})
|
|
306
309
|
};
|
|
307
310
|
}
|
|
311
|
+
const isTTVCv3Enabled = fg('platform_ufo_vc_observer_new') || ((_getConfig2 = getConfig()) === null || _getConfig2 === void 0 ? void 0 : (_getConfig2$vc = _getConfig2.vc) === null || _getConfig2$vc === void 0 ? void 0 : (_getConfig2$vc$enable = _getConfig2$vc.enabledVCRevisions) === null || _getConfig2$vc$enable === void 0 ? void 0 : _getConfig2$vc$enable.includes('fy25.03'));
|
|
308
312
|
return {
|
|
309
313
|
'metrics:vc': VC,
|
|
310
314
|
[`${fullPrefix}vc:state`]: true,
|
|
311
315
|
[`${fullPrefix}vc:clean`]: isVCClean,
|
|
312
316
|
[`${fullPrefix}vc:dom`]: VCBox,
|
|
313
|
-
[`${fullPrefix}vc:updates`]:
|
|
317
|
+
[`${fullPrefix}vc:updates`]: isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50),
|
|
314
318
|
// max 50
|
|
315
319
|
[`${fullPrefix}vc:size`]: viewport,
|
|
316
320
|
[`${fullPrefix}vc:time`]: Math.round(totalTime + (stopTime - startTime)),
|
|
@@ -318,7 +322,7 @@ export class VCObserver {
|
|
|
318
322
|
[`${fullPrefix}vc:ratios`]: ratios,
|
|
319
323
|
...outOfBoundary,
|
|
320
324
|
[`${fullPrefix}vc:next`]: vcNext.VC,
|
|
321
|
-
[`${fullPrefix}vc:next:updates`]:
|
|
325
|
+
[`${fullPrefix}vc:next:updates`]: isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50),
|
|
322
326
|
// max 50
|
|
323
327
|
[`${fullPrefix}vc:next:dom`]: vcNext.VCBox,
|
|
324
328
|
[`${fullPrefix}vc:ignored`]: this.getIgnoredElements(componentsLog),
|
|
@@ -327,9 +331,10 @@ export class VCObserver {
|
|
|
327
331
|
};
|
|
328
332
|
});
|
|
329
333
|
_defineProperty(this, "handleUpdate", (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) => {
|
|
334
|
+
var _getConfig3, _getConfig3$vc, _getConfig3$vc$enable;
|
|
330
335
|
this.measureStart();
|
|
331
336
|
this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue);
|
|
332
|
-
if (!fg('platform_ufo_vc_observer_new')) {
|
|
337
|
+
if (!fg('platform_ufo_vc_observer_new') && !((_getConfig3 = getConfig()) !== null && _getConfig3 !== void 0 && (_getConfig3$vc = _getConfig3.vc) !== null && _getConfig3$vc !== void 0 && (_getConfig3$vc$enable = _getConfig3$vc.enabledVCRevisions) !== null && _getConfig3$vc$enable !== void 0 && _getConfig3$vc$enable.includes('fy25.03'))) {
|
|
333
338
|
this.onViewportChangeDetected({
|
|
334
339
|
timestamp: rawTime,
|
|
335
340
|
intersectionRect,
|
|
@@ -346,13 +351,14 @@ export class VCObserver {
|
|
|
346
351
|
});
|
|
347
352
|
_defineProperty(this, "legacyHandleUpdate", (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) => {
|
|
348
353
|
if (this.abortReason.reason === null || this.abortReason.blocking === false) {
|
|
354
|
+
var _getConfig4, _getConfig4$vc, _getConfig4$vc$enable;
|
|
349
355
|
const time = Math.round(rawTime - this.startTime);
|
|
350
356
|
const mappedValues = this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
351
357
|
this.vcRatios[targetName] = this.getElementRatio(mappedValues);
|
|
352
358
|
if (!ignoreReason) {
|
|
353
359
|
this.applyChangesToHeatMap(mappedValues, time, this.heatmapNext);
|
|
354
360
|
}
|
|
355
|
-
const isTTVCv1Disabled =
|
|
361
|
+
const isTTVCv1Disabled = !((_getConfig4 = getConfig()) !== null && _getConfig4 !== void 0 && (_getConfig4$vc = _getConfig4.vc) !== null && _getConfig4$vc !== void 0 && (_getConfig4$vc$enable = _getConfig4$vc.enabledVCRevisions) !== null && _getConfig4$vc$enable !== void 0 && _getConfig4$vc$enable.includes('fy25.01'));
|
|
356
362
|
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
357
363
|
this.applyChangesToHeatMap(mappedValues, time, this.heatmap);
|
|
358
364
|
}
|
|
@@ -491,7 +497,7 @@ export class VCObserver {
|
|
|
491
497
|
dataVC: true
|
|
492
498
|
}
|
|
493
499
|
});
|
|
494
|
-
this.heatmap =
|
|
500
|
+
this.heatmap = !((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5$vc = _getConfig5.vc) !== null && _getConfig5$vc !== void 0 && (_getConfig5$vc$enable = _getConfig5$vc.enabledVCRevisions) !== null && _getConfig5$vc$enable !== void 0 && _getConfig5$vc$enable.includes('fy25.01')) ? [] : this.getCleanHeatmap();
|
|
495
501
|
this.heatmapNext = this.getCleanHeatmap();
|
|
496
502
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
497
503
|
viewport: this.viewport,
|
|
@@ -645,6 +651,7 @@ export class VCObserver {
|
|
|
645
651
|
}
|
|
646
652
|
}
|
|
647
653
|
resetState() {
|
|
654
|
+
var _getConfig6, _getConfig6$vc, _getConfig6$vc$enable;
|
|
648
655
|
this.abortReason = {
|
|
649
656
|
reason: null,
|
|
650
657
|
info: '',
|
|
@@ -652,7 +659,7 @@ export class VCObserver {
|
|
|
652
659
|
blocking: false
|
|
653
660
|
};
|
|
654
661
|
this.detachAbortListeners();
|
|
655
|
-
this.heatmap =
|
|
662
|
+
this.heatmap = !((_getConfig6 = getConfig()) !== null && _getConfig6 !== void 0 && (_getConfig6$vc = _getConfig6.vc) !== null && _getConfig6$vc !== void 0 && (_getConfig6$vc$enable = _getConfig6$vc.enabledVCRevisions) !== null && _getConfig6$vc$enable !== void 0 && _getConfig6$vc$enable.includes('fy25.01')) ? [] : this.getCleanHeatmap();
|
|
656
663
|
this.heatmapNext = this.getCleanHeatmap();
|
|
657
664
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
658
665
|
viewport: this.viewport,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConfig } from '../../../config';
|
|
2
2
|
import { revFY25_01Classifier } from './fy25_01';
|
|
3
3
|
import { revFY25_02Classifier } from './fy25_02';
|
|
4
4
|
export function getRevisions() {
|
|
5
|
-
|
|
5
|
+
var _getConfig, _getConfig$vc, _getConfig$vc$enabled;
|
|
6
|
+
if (!((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig$vc = _getConfig.vc) !== null && _getConfig$vc !== void 0 && (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) !== null && _getConfig$vc$enabled !== void 0 && _getConfig$vc$enabled.includes('fy25.01'))) {
|
|
6
7
|
return [{
|
|
7
8
|
name: 'fy25.02',
|
|
8
9
|
classifier: revFY25_02Classifier
|
|
@@ -15,7 +15,7 @@ function getVCMetrics(_x) {
|
|
|
15
15
|
}
|
|
16
16
|
function _getVCMetrics() {
|
|
17
17
|
_getVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
|
|
18
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
|
|
18
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI, _config$vc2;
|
|
19
19
|
var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, _result$ufoVcRev, ttvcV2Revision, VC;
|
|
20
20
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -63,7 +63,7 @@ function _getVCMetrics() {
|
|
|
63
63
|
getVCObserver().stop();
|
|
64
64
|
}
|
|
65
65
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
66
|
-
if (
|
|
66
|
+
if (config !== null && config !== void 0 && (_config$vc2 = config.vc) !== null && _config$vc2 !== void 0 && (_config$vc2 = _config$vc2.enabledVCRevisions) !== null && _config$vc2 !== void 0 && _config$vc2.includes('fy25.01')) {
|
|
67
67
|
_context.next = 26;
|
|
68
68
|
break;
|
|
69
69
|
}
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
18
18
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19
19
|
_classCallCheck(this, VCObserverWrapper);
|
|
20
20
|
this.newVCObserver = null;
|
|
21
|
-
var isNewVCObserverEnabled = fg('platform_ufo_vc_observer_new') || ((_getConfig = getConfig()) === null || _getConfig === void 0 || (_getConfig = _getConfig.vc) === null || _getConfig === void 0 ? void 0 : _getConfig.
|
|
21
|
+
var isNewVCObserverEnabled = fg('platform_ufo_vc_observer_new') || ((_getConfig = getConfig()) === null || _getConfig === void 0 || (_getConfig = _getConfig.vc) === null || _getConfig === void 0 || (_getConfig = _getConfig.enabledVCRevisions) === null || _getConfig === void 0 ? void 0 : _getConfig.includes('fy25.03'));
|
|
22
22
|
if (isNewVCObserverEnabled) {
|
|
23
23
|
this.newVCObserver = new VCObserverNew({
|
|
24
24
|
selectorConfig: opts.selectorConfig
|
|
@@ -3,6 +3,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
3
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { getConfig } from '../../config';
|
|
6
7
|
import { getPageVisibilityState } from '../../hidden-timing';
|
|
7
8
|
import { getRevisions } from './revisions/revisions';
|
|
8
9
|
var VCParts = ['25', '50', '75', '80', '85', '90', '95', '98', '99'];
|
|
@@ -38,6 +39,7 @@ function createVCDetails(calculatedVC, shouldHaveVCmetric) {
|
|
|
38
39
|
|
|
39
40
|
// Optimized implementation (current one)
|
|
40
41
|
export function getVCRevisionsData(_ref) {
|
|
42
|
+
var _ufoConfig$vc, _ufoConfig$vc2;
|
|
41
43
|
var fullPrefix = _ref.fullPrefix,
|
|
42
44
|
interaction = _ref.interaction,
|
|
43
45
|
isVCClean = _ref.isVCClean,
|
|
@@ -46,7 +48,8 @@ export function getVCRevisionsData(_ref) {
|
|
|
46
48
|
ssr = _ref.ssr,
|
|
47
49
|
calculatedVC = _ref.calculatedVC,
|
|
48
50
|
calculatedVCNext = _ref.calculatedVCNext;
|
|
49
|
-
|
|
51
|
+
var ufoConfig = getConfig();
|
|
52
|
+
if (!fg('platform_ufo_vc_observer_new') && !(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc = ufoConfig.vc) !== null && _ufoConfig$vc !== void 0 && (_ufoConfig$vc = _ufoConfig$vc.enabledVCRevisions) !== null && _ufoConfig$vc !== void 0 && _ufoConfig$vc.includes('fy25.03'))) {
|
|
50
53
|
if (!multiHeatmap) {
|
|
51
54
|
return null;
|
|
52
55
|
}
|
|
@@ -82,7 +85,7 @@ export function getVCRevisionsData(_ref) {
|
|
|
82
85
|
'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
|
|
83
86
|
vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
|
|
84
87
|
};
|
|
85
|
-
if (
|
|
88
|
+
if (!(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc2 = ufoConfig.vc) !== null && _ufoConfig$vc2 !== void 0 && (_ufoConfig$vc2 = _ufoConfig$vc2.enabledVCRevisions) !== null && _ufoConfig$vc2 !== void 0 && _ufoConfig$vc2.includes('fy25.01'))) {
|
|
86
89
|
return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [ttvcV2Revision]);
|
|
87
90
|
}
|
|
88
91
|
|
|
@@ -10,6 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { getConfig } from '../../config';
|
|
13
14
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
14
15
|
import { getVCRevisionsData } from './getVCRevisionsData';
|
|
15
16
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
@@ -37,7 +38,8 @@ function filterComponentsLog(log) {
|
|
|
37
38
|
}
|
|
38
39
|
export var VCObserver = /*#__PURE__*/function () {
|
|
39
40
|
function VCObserver(options) {
|
|
40
|
-
var _this = this
|
|
41
|
+
var _this = this,
|
|
42
|
+
_getConfig5;
|
|
41
43
|
_classCallCheck(this, VCObserver);
|
|
42
44
|
/* abort logic */
|
|
43
45
|
_defineProperty(this, "abortReason", {
|
|
@@ -97,7 +99,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
97
99
|
});
|
|
98
100
|
_defineProperty(this, "getVCResult", /*#__PURE__*/function () {
|
|
99
101
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
100
|
-
var
|
|
102
|
+
var _getConfig, _getConfig2;
|
|
103
|
+
var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, isCalcSpeedIndexEnabled, speedIndex, isTTVCv3Enabled;
|
|
101
104
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
102
105
|
while (1) switch (_context.prev = _context.next) {
|
|
103
106
|
case 0:
|
|
@@ -124,7 +127,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
124
127
|
} catch (e) {}
|
|
125
128
|
return _context.abrupt("return", _defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp));
|
|
126
129
|
case 10:
|
|
127
|
-
isTTVCv1Disabled =
|
|
130
|
+
isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'));
|
|
128
131
|
ttvcV1Result = isTTVCv1Disabled ? {
|
|
129
132
|
VC: {},
|
|
130
133
|
VCBox: {},
|
|
@@ -282,10 +285,11 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
282
285
|
}
|
|
283
286
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
|
|
284
287
|
case 26:
|
|
288
|
+
isTTVCv3Enabled = fg('platform_ufo_vc_observer_new') || ((_getConfig2 = getConfig()) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.vc) === null || _getConfig2 === void 0 || (_getConfig2 = _getConfig2.enabledVCRevisions) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.includes('fy25.03'));
|
|
285
289
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
286
290
|
'metrics:vc': VC
|
|
287
|
-
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"),
|
|
288
|
-
case
|
|
291
|
+
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : 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(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
|
|
292
|
+
case 28:
|
|
289
293
|
case "end":
|
|
290
294
|
return _context.stop();
|
|
291
295
|
}
|
|
@@ -296,9 +300,10 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
296
300
|
};
|
|
297
301
|
}());
|
|
298
302
|
_defineProperty(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
|
|
303
|
+
var _getConfig3;
|
|
299
304
|
_this.measureStart();
|
|
300
305
|
_this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue);
|
|
301
|
-
if (!fg('platform_ufo_vc_observer_new')) {
|
|
306
|
+
if (!fg('platform_ufo_vc_observer_new') && !((_getConfig3 = getConfig()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.vc) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.enabledVCRevisions) !== null && _getConfig3 !== void 0 && _getConfig3.includes('fy25.03'))) {
|
|
302
307
|
_this.onViewportChangeDetected({
|
|
303
308
|
timestamp: rawTime,
|
|
304
309
|
intersectionRect: intersectionRect,
|
|
@@ -315,13 +320,14 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
315
320
|
});
|
|
316
321
|
_defineProperty(this, "legacyHandleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
|
|
317
322
|
if (_this.abortReason.reason === null || _this.abortReason.blocking === false) {
|
|
323
|
+
var _getConfig4;
|
|
318
324
|
var time = Math.round(rawTime - _this.startTime);
|
|
319
325
|
var mappedValues = _this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
320
326
|
_this.vcRatios[targetName] = _this.getElementRatio(mappedValues);
|
|
321
327
|
if (!ignoreReason) {
|
|
322
328
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
|
|
323
329
|
}
|
|
324
|
-
var isTTVCv1Disabled =
|
|
330
|
+
var isTTVCv1Disabled = !((_getConfig4 = getConfig()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.vc) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.enabledVCRevisions) !== null && _getConfig4 !== void 0 && _getConfig4.includes('fy25.01'));
|
|
325
331
|
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
326
332
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
|
|
327
333
|
}
|
|
@@ -459,7 +465,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
459
465
|
dataVC: true
|
|
460
466
|
}
|
|
461
467
|
});
|
|
462
|
-
this.heatmap =
|
|
468
|
+
this.heatmap = !((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.vc) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.enabledVCRevisions) !== null && _getConfig5 !== void 0 && _getConfig5.includes('fy25.01')) ? [] : this.getCleanHeatmap();
|
|
463
469
|
this.heatmapNext = this.getCleanHeatmap();
|
|
464
470
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
465
471
|
viewport: this.viewport,
|
|
@@ -539,6 +545,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
539
545
|
}, {
|
|
540
546
|
key: "resetState",
|
|
541
547
|
value: function resetState() {
|
|
548
|
+
var _getConfig6;
|
|
542
549
|
this.abortReason = {
|
|
543
550
|
reason: null,
|
|
544
551
|
info: '',
|
|
@@ -546,7 +553,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
546
553
|
blocking: false
|
|
547
554
|
};
|
|
548
555
|
this.detachAbortListeners();
|
|
549
|
-
this.heatmap =
|
|
556
|
+
this.heatmap = !((_getConfig6 = getConfig()) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.vc) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.enabledVCRevisions) !== null && _getConfig6 !== void 0 && _getConfig6.includes('fy25.01')) ? [] : this.getCleanHeatmap();
|
|
550
557
|
this.heatmapNext = this.getCleanHeatmap();
|
|
551
558
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
552
559
|
viewport: this.viewport,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConfig } from '../../../config';
|
|
2
2
|
import { revFY25_01Classifier } from './fy25_01';
|
|
3
3
|
import { revFY25_02Classifier } from './fy25_02';
|
|
4
4
|
export function getRevisions() {
|
|
5
|
-
|
|
5
|
+
var _getConfig;
|
|
6
|
+
if (!((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'))) {
|
|
6
7
|
return [{
|
|
7
8
|
name: 'fy25.02',
|
|
8
9
|
classifier: revFY25_02Classifier
|
|
@@ -27,6 +27,7 @@ type SelectorConfig = {
|
|
|
27
27
|
type Rates = {
|
|
28
28
|
readonly [key: string]: number;
|
|
29
29
|
};
|
|
30
|
+
type TTVCRevisions = 'fy25.01' | 'fy25.02' | 'fy25.03';
|
|
30
31
|
export type Config = {
|
|
31
32
|
readonly enabled?: boolean;
|
|
32
33
|
readonly doNotAbortActivePressInteraction?: string[];
|
|
@@ -73,7 +74,7 @@ export type Config = {
|
|
|
73
74
|
readonly ssr?: boolean;
|
|
74
75
|
readonly ssrWhitelist?: string[];
|
|
75
76
|
readonly stopVCAtInteractionFinish?: boolean;
|
|
76
|
-
readonly
|
|
77
|
+
readonly enabledVCRevisions?: readonly TTVCRevisions[];
|
|
77
78
|
};
|
|
78
79
|
readonly postInteractionLog?: {
|
|
79
80
|
readonly enabled?: boolean;
|
|
@@ -27,6 +27,7 @@ type SelectorConfig = {
|
|
|
27
27
|
type Rates = {
|
|
28
28
|
readonly [key: string]: number;
|
|
29
29
|
};
|
|
30
|
+
type TTVCRevisions = 'fy25.01' | 'fy25.02' | 'fy25.03';
|
|
30
31
|
export type Config = {
|
|
31
32
|
readonly enabled?: boolean;
|
|
32
33
|
readonly doNotAbortActivePressInteraction?: string[];
|
|
@@ -73,7 +74,7 @@ export type Config = {
|
|
|
73
74
|
readonly ssr?: boolean;
|
|
74
75
|
readonly ssrWhitelist?: string[];
|
|
75
76
|
readonly stopVCAtInteractionFinish?: boolean;
|
|
76
|
-
readonly
|
|
77
|
+
readonly enabledVCRevisions?: readonly TTVCRevisions[];
|
|
77
78
|
};
|
|
78
79
|
readonly postInteractionLog?: {
|
|
79
80
|
readonly enabled?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -157,9 +157,6 @@
|
|
|
157
157
|
"ufo_payload_use_idle_callback": {
|
|
158
158
|
"type": "boolean"
|
|
159
159
|
},
|
|
160
|
-
"platform_ufo_disable_ttvc_v1": {
|
|
161
|
-
"type": "boolean"
|
|
162
|
-
},
|
|
163
160
|
"platform_ufo_assets_check_for_nan": {
|
|
164
161
|
"type": "boolean"
|
|
165
162
|
},
|