@atlaskit/react-ufo 3.4.9 → 3.4.11
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 +16 -0
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +24 -6
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +81 -0
- package/dist/cjs/vc/vc-observer/index.js +119 -117
- package/dist/cjs/vc/vc-observer/observers/index.js +19 -7
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +9 -18
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +13 -12
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +23 -10
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +76 -0
- package/dist/es2019/vc/vc-observer/index.js +96 -93
- package/dist/es2019/vc/vc-observer/observers/index.js +19 -7
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +7 -16
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +13 -14
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
- package/dist/esm/create-payload/utils/get-vc-metrics.js +24 -6
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +74 -0
- package/dist/esm/vc/vc-observer/index.js +119 -117
- package/dist/esm/vc/vc-observer/observers/index.js +19 -7
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +9 -18
- package/dist/esm/vc/vc-observer/revisions/revisions.js +13 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +35 -0
- package/dist/types-ts4.5/config/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +35 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.4.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134206](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134206)
|
|
8
|
+
[`073d4d11dd3d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/073d4d11dd3d6) -
|
|
9
|
+
add FG to disable TTVC v1 calculations
|
|
10
|
+
|
|
11
|
+
## 3.4.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#134112](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134112)
|
|
16
|
+
[`b993bf17b9c1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b993bf17b9c1b) -
|
|
17
|
+
Ignore same value attribute mutation
|
|
18
|
+
|
|
3
19
|
## 3.4.9
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -23,7 +23,7 @@ function getVCMetrics(_x) {
|
|
|
23
23
|
function _getVCMetrics() {
|
|
24
24
|
_getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
25
25
|
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
|
|
26
|
-
var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, VC;
|
|
26
|
+
var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, ttvcV2Revision, VC;
|
|
27
27
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
@@ -70,23 +70,41 @@ function _getVCMetrics() {
|
|
|
70
70
|
(0, _vc.getVCObserver)().stop();
|
|
71
71
|
}
|
|
72
72
|
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
73
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_disable_ttvc_v1')) {
|
|
74
|
+
_context.next = 26;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
ttvcV2Revision = (result === null || result === void 0 ? void 0 : result['ufo:vc:rev']).find(function (_ref) {
|
|
78
|
+
var revision = _ref.revision;
|
|
79
|
+
return revision === 'fy25.02';
|
|
80
|
+
});
|
|
81
|
+
if (ttvcV2Revision !== null && ttvcV2Revision !== void 0 && ttvcV2Revision.clean) {
|
|
82
|
+
_context.next = 23;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
return _context.abrupt("return", result);
|
|
86
|
+
case 23:
|
|
87
|
+
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
88
|
+
'metric:vc90': ttvcV2Revision['metric:vc90']
|
|
89
|
+
}));
|
|
90
|
+
case 26:
|
|
73
91
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
74
92
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
75
|
-
_context.next =
|
|
93
|
+
_context.next = 29;
|
|
76
94
|
break;
|
|
77
95
|
}
|
|
78
96
|
return _context.abrupt("return", result);
|
|
79
|
-
case
|
|
97
|
+
case 29:
|
|
80
98
|
if (!(interactionStatus.originalInteractionStatus !== 'SUCCEEDED' || pageVisibilityUpToTTAI !== 'visible')) {
|
|
81
|
-
_context.next =
|
|
99
|
+
_context.next = 31;
|
|
82
100
|
break;
|
|
83
101
|
}
|
|
84
102
|
return _context.abrupt("return", result);
|
|
85
|
-
case
|
|
103
|
+
case 31:
|
|
86
104
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
87
105
|
'metric:vc90': VC['90']
|
|
88
106
|
}));
|
|
89
|
-
case
|
|
107
|
+
case 32:
|
|
90
108
|
case "end":
|
|
91
109
|
return _context.stop();
|
|
92
110
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getVCRevisionsData = getVCRevisionsData;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
var _hiddenTiming = require("../../hidden-timing");
|
|
11
|
+
var _revisions = require("./revisions/revisions");
|
|
12
|
+
var VCParts = ['25', '50', '75', '80', '85', '90', '95', '98', '99'];
|
|
13
|
+
function getVCRevisionsData(_ref) {
|
|
14
|
+
var fullPrefix = _ref.fullPrefix,
|
|
15
|
+
interaction = _ref.interaction,
|
|
16
|
+
isVCClean = _ref.isVCClean,
|
|
17
|
+
isEventAborted = _ref.isEventAborted,
|
|
18
|
+
multiHeatmap = _ref.multiHeatmap,
|
|
19
|
+
ssr = _ref.ssr,
|
|
20
|
+
calculatedVC = _ref.calculatedVC,
|
|
21
|
+
calculatedVCNext = _ref.calculatedVCNext;
|
|
22
|
+
var isMultiHeatmapEnabled = !(0, _platformFeatureFlags.fg)('platform_ufo_multiheatmap_killswitch');
|
|
23
|
+
if (!isMultiHeatmapEnabled) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vc_observer_new')) {
|
|
27
|
+
if (!multiHeatmap) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap === null || multiHeatmap === void 0 ? void 0 : multiHeatmap.getPayloadShapedData({
|
|
31
|
+
VCParts: VCParts.map(function (v) {
|
|
32
|
+
return parseInt(v);
|
|
33
|
+
}),
|
|
34
|
+
VCCalculationMethods: (0, _revisions.getRevisions)().map(function (_ref2) {
|
|
35
|
+
var classifier = _ref2.classifier;
|
|
36
|
+
return classifier.VCCalculationMethod;
|
|
37
|
+
}),
|
|
38
|
+
filterComponentsLog: (0, _revisions.getRevisions)().map(function (_ref3) {
|
|
39
|
+
var classifier = _ref3.classifier;
|
|
40
|
+
return classifier.filterComponentsLog;
|
|
41
|
+
}),
|
|
42
|
+
isEventAborted: isEventAborted,
|
|
43
|
+
interactionStart: interaction.start,
|
|
44
|
+
ttai: interaction.end,
|
|
45
|
+
ssr: ssr,
|
|
46
|
+
clean: isVCClean
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
var pageVisibilityUpToTTAI = (0, _hiddenTiming.getPageVisibilityState)(interaction.start, interaction.end);
|
|
50
|
+
var isVisiblePageVisibleUpToTTAI = pageVisibilityUpToTTAI === 'visible';
|
|
51
|
+
var shouldHaveVCmetric = isVCClean && !isEventAborted && isVisiblePageVisibleUpToTTAI;
|
|
52
|
+
var ttvcV1Revision = {
|
|
53
|
+
revision: 'fy25.01',
|
|
54
|
+
clean: isVCClean,
|
|
55
|
+
'metric:vc90': shouldHaveVCmetric ? calculatedVC.VC['90'] : null,
|
|
56
|
+
vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(function (key) {
|
|
57
|
+
var _calculatedVC$VCBox$k;
|
|
58
|
+
return [key, {
|
|
59
|
+
t: calculatedVC.VC[key],
|
|
60
|
+
e: (_calculatedVC$VCBox$k = calculatedVC.VCBox[key]) !== null && _calculatedVC$VCBox$k !== void 0 ? _calculatedVC$VCBox$k : []
|
|
61
|
+
}];
|
|
62
|
+
})) : {}
|
|
63
|
+
};
|
|
64
|
+
var ttvcV2ReportedMetric = (0, _platformFeatureFlags.fg)('platform_ufo_fix_v2_reported_vc90') ? calculatedVCNext.VC['90'] : calculatedVC.VC['90'];
|
|
65
|
+
var ttvcV2Revision = {
|
|
66
|
+
revision: 'fy25.02',
|
|
67
|
+
clean: isVCClean,
|
|
68
|
+
'metric:vc90': shouldHaveVCmetric ? ttvcV2ReportedMetric : null,
|
|
69
|
+
vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(function (key) {
|
|
70
|
+
var _calculatedVCNext$VCB;
|
|
71
|
+
return [key, {
|
|
72
|
+
t: calculatedVCNext.VC[key],
|
|
73
|
+
e: (_calculatedVCNext$VCB = calculatedVCNext.VCBox[key]) !== null && _calculatedVCNext$VCB !== void 0 ? _calculatedVCNext$VCB : []
|
|
74
|
+
}];
|
|
75
|
+
})) : {}
|
|
76
|
+
};
|
|
77
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_disable_ttvc_v1')) {
|
|
78
|
+
return (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:rev"), [ttvcV2Revision]);
|
|
79
|
+
}
|
|
80
|
+
return (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:rev"), [ttvcV1Revision, ttvcV2Revision]);
|
|
81
|
+
}
|
|
@@ -14,8 +14,8 @@ 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 _hiddenTiming = require("../../hidden-timing");
|
|
18
17
|
var _attachAbortListeners = require("./attachAbortListeners");
|
|
18
|
+
var _getVCRevisionsData = require("./getVCRevisionsData");
|
|
19
19
|
var _getViewport = require("./getViewport");
|
|
20
20
|
var _heatmap = require("./heatmap/heatmap");
|
|
21
21
|
var _observers = require("./observers");
|
|
@@ -104,7 +104,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
104
104
|
});
|
|
105
105
|
(0, _defineProperty2.default)(this, "getVCResult", /*#__PURE__*/function () {
|
|
106
106
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
|
|
107
|
-
var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap,
|
|
107
|
+
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;
|
|
108
108
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
109
109
|
while (1) switch (_context.prev = _context.next) {
|
|
110
110
|
case 0:
|
|
@@ -131,41 +131,33 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
131
131
|
} catch (e) {}
|
|
132
132
|
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
133
|
case 10:
|
|
134
|
-
|
|
134
|
+
isTTVCv1Disabled = (0, _platformFeatureFlags.fg)('platform_ufo_disable_ttvc_v1');
|
|
135
|
+
ttvcV1Result = isTTVCv1Disabled ? {
|
|
136
|
+
VC: {},
|
|
137
|
+
VCBox: {},
|
|
138
|
+
VCEntries: {
|
|
139
|
+
abs: [],
|
|
140
|
+
rel: [],
|
|
141
|
+
speedIndex: -1
|
|
142
|
+
},
|
|
143
|
+
totalPainted: -1
|
|
144
|
+
} : VCObserver.calculateVC({
|
|
135
145
|
heatmap: heatmap,
|
|
136
146
|
ssr: ssr,
|
|
137
147
|
componentsLog: _objectSpread({}, componentsLog),
|
|
138
148
|
viewport: viewport
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
});
|
|
149
|
+
});
|
|
150
|
+
VC = ttvcV1Result.VC, VCBox = ttvcV1Result.VCBox, VCEntries = ttvcV1Result.VCEntries, totalPainted = ttvcV1Result.totalPainted;
|
|
151
|
+
_componentsLog = {};
|
|
152
|
+
Object.entries(_this.componentsLog).forEach(function (_ref6) {
|
|
153
|
+
var _ref7 = (0, _slicedToArray2.default)(_ref6, 2),
|
|
154
|
+
_timestamp = _ref7[0],
|
|
155
|
+
value = _ref7[1];
|
|
156
|
+
var timestamp = Number(_timestamp);
|
|
157
|
+
if (stop > timestamp) {
|
|
158
|
+
_componentsLog[timestamp] = value;
|
|
151
159
|
}
|
|
152
|
-
}
|
|
153
|
-
/* empty */
|
|
154
|
-
}
|
|
155
|
-
_componentsLog = {}; // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
156
|
-
if ((0, _platformFeatureFlags.fg)('ufo-remove-vc-component-observations-after-ttai')) {
|
|
157
|
-
Object.entries(_this.componentsLog).forEach(function (_ref6) {
|
|
158
|
-
var _ref7 = (0, _slicedToArray2.default)(_ref6, 2),
|
|
159
|
-
_timestamp = _ref7[0],
|
|
160
|
-
value = _ref7[1];
|
|
161
|
-
var timestamp = Number(_timestamp);
|
|
162
|
-
if (stop > timestamp) {
|
|
163
|
-
_componentsLog[timestamp] = value;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
} else {
|
|
167
|
-
_componentsLog = _objectSpread({}, componentsLog);
|
|
168
|
-
}
|
|
160
|
+
});
|
|
169
161
|
vcNext = VCObserver.calculateVC({
|
|
170
162
|
heatmap: heatmapNext,
|
|
171
163
|
ssr: ssr,
|
|
@@ -175,12 +167,33 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
175
167
|
try {
|
|
176
168
|
if (!_this.isPostInteraction) {
|
|
177
169
|
VCObserver.VCParts.forEach(function (key) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
170
|
+
if (isTTVCv1Disabled) {
|
|
171
|
+
var duration = vcNext.VC[key];
|
|
172
|
+
if (duration !== null && duration !== undefined) {
|
|
173
|
+
performance.measure("VC".concat(key), {
|
|
174
|
+
start: start,
|
|
175
|
+
duration: duration
|
|
176
|
+
});
|
|
177
|
+
performance.measure("VC_Next".concat(key), {
|
|
178
|
+
start: start,
|
|
179
|
+
duration: duration
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
var ttvcV1duration = VC[key];
|
|
184
|
+
if (ttvcV1duration !== null && ttvcV1duration !== undefined) {
|
|
185
|
+
performance.measure("VC".concat(key), {
|
|
186
|
+
start: start,
|
|
187
|
+
duration: ttvcV1duration
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
var ttvcV2duration = vcNext.VC[key];
|
|
191
|
+
if (ttvcV2duration !== null && ttvcV2duration !== undefined) {
|
|
192
|
+
performance.measure("VC_Next".concat(key), {
|
|
193
|
+
start: start,
|
|
194
|
+
duration: ttvcV2duration
|
|
195
|
+
});
|
|
196
|
+
}
|
|
184
197
|
}
|
|
185
198
|
});
|
|
186
199
|
}
|
|
@@ -191,7 +204,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
191
204
|
stopTime = performance.now(); // exposing data to devtools
|
|
192
205
|
try {
|
|
193
206
|
if (!_this.isPostInteraction && devToolsEnabled) {
|
|
194
|
-
|
|
207
|
+
ttvcV1DevToolInfo = isTTVCv1Disabled ? undefined : {
|
|
195
208
|
entries: VCEntries.rel,
|
|
196
209
|
log: componentsLog,
|
|
197
210
|
metrics: {
|
|
@@ -210,7 +223,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
210
223
|
heatmap: heatmap,
|
|
211
224
|
ratios: ratios
|
|
212
225
|
};
|
|
213
|
-
|
|
226
|
+
ttvcV2DevToolInfo = {
|
|
214
227
|
entries: vcNext.VCEntries.rel,
|
|
215
228
|
log: componentsLog,
|
|
216
229
|
metrics: {
|
|
@@ -229,12 +242,19 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
229
242
|
heatmap: heatmapNext,
|
|
230
243
|
ratios: ratios
|
|
231
244
|
};
|
|
245
|
+
if (isTTVCv1Disabled) {
|
|
246
|
+
window.__vc = ttvcV2DevToolInfo;
|
|
247
|
+
window.__vcNext = ttvcV2DevToolInfo;
|
|
248
|
+
} else {
|
|
249
|
+
window.__vc = ttvcV1DevToolInfo;
|
|
250
|
+
window.__vcNext = ttvcV2DevToolInfo;
|
|
251
|
+
}
|
|
232
252
|
|
|
233
253
|
// Emitting a custom event to make it available in the Chrome extension
|
|
234
254
|
window.dispatchEvent(new CustomEvent('vcReady', {
|
|
235
255
|
detail: {
|
|
236
256
|
log: filterComponentsLog(componentsLog),
|
|
237
|
-
entries: VCEntries.rel
|
|
257
|
+
entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
|
|
238
258
|
}
|
|
239
259
|
}));
|
|
240
260
|
}
|
|
@@ -242,56 +262,37 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
242
262
|
/* do nothing */
|
|
243
263
|
}
|
|
244
264
|
isVCClean = !abortReasonInfo;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCObserver.VCParts.map(function (key) {
|
|
254
|
-
var _VCBox$key;
|
|
255
|
-
return [key, {
|
|
256
|
-
t: VC[key],
|
|
257
|
-
e: (_VCBox$key = VCBox[key]) !== null && _VCBox$key !== void 0 ? _VCBox$key : []
|
|
258
|
-
}];
|
|
259
|
-
})) : []
|
|
260
|
-
}, {
|
|
261
|
-
revision: 'fy25.02',
|
|
262
|
-
clean: isVCClean,
|
|
263
|
-
'metric:vc90': shouldHaveVCmetric ? VC['90'] : null,
|
|
264
|
-
vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCObserver.VCParts.map(function (key) {
|
|
265
|
-
var _vcNext$VCBox$key;
|
|
266
|
-
return [key, {
|
|
267
|
-
t: vcNext.VC[key],
|
|
268
|
-
e: (_vcNext$VCBox$key = vcNext.VCBox[key]) !== null && _vcNext$VCBox$key !== void 0 ? _vcNext$VCBox$key : []
|
|
269
|
-
}];
|
|
270
|
-
})) : []
|
|
271
|
-
}]) : multiHeatmap !== null ? (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap === null || multiHeatmap === void 0 ? void 0 : multiHeatmap.getPayloadShapedData({
|
|
272
|
-
VCParts: VCObserver.VCParts.map(function (v) {
|
|
273
|
-
return parseInt(v);
|
|
274
|
-
}),
|
|
275
|
-
VCCalculationMethods: (0, _revisions.getRevisions)().map(function (_ref10) {
|
|
276
|
-
var classifier = _ref10.classifier;
|
|
277
|
-
return classifier.VCCalculationMethod;
|
|
278
|
-
}),
|
|
279
|
-
filterComponentsLog: (0, _revisions.getRevisions)().map(function (_ref11) {
|
|
280
|
-
var classifier = _ref11.classifier;
|
|
281
|
-
return classifier.filterComponentsLog;
|
|
282
|
-
}),
|
|
283
|
-
isEventAborted: isEventAborted,
|
|
284
|
-
interactionStart: start,
|
|
285
|
-
ttai: stop,
|
|
265
|
+
revisionsData = (0, _getVCRevisionsData.getVCRevisionsData)({
|
|
266
|
+
fullPrefix: fullPrefix,
|
|
267
|
+
interaction: {
|
|
268
|
+
start: start,
|
|
269
|
+
end: stop
|
|
270
|
+
},
|
|
271
|
+
isVCClean: isVCClean,
|
|
272
|
+
multiHeatmap: multiHeatmap,
|
|
286
273
|
ssr: ssr,
|
|
287
|
-
|
|
288
|
-
|
|
274
|
+
calculatedVC: {
|
|
275
|
+
VC: VC,
|
|
276
|
+
VCBox: VCBox
|
|
277
|
+
},
|
|
278
|
+
calculatedVCNext: {
|
|
279
|
+
VC: vcNext.VC,
|
|
280
|
+
VCBox: vcNext.VCBox
|
|
281
|
+
},
|
|
282
|
+
isEventAborted: isEventAborted
|
|
283
|
+
}); // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
289
284
|
isCalcSpeedIndexEnabled = (0, _platformFeatureFlags.fg)('ufo-calc-speed-index');
|
|
290
|
-
speedIndex = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "ufo:speedIndex", VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
|
|
285
|
+
speedIndex = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
|
|
286
|
+
if (!isTTVCv1Disabled) {
|
|
287
|
+
_context.next = 26;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
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
|
+
case 26:
|
|
291
292
|
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)({
|
|
292
293
|
'metrics:vc': VC
|
|
293
294
|
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), isCalcSpeedIndexEnabled ? speedIndex : {}));
|
|
294
|
-
case
|
|
295
|
+
case 27:
|
|
295
296
|
case "end":
|
|
296
297
|
return _context.stop();
|
|
297
298
|
}
|
|
@@ -324,7 +325,8 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
324
325
|
if (!ignoreReason) {
|
|
325
326
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
|
|
326
327
|
}
|
|
327
|
-
|
|
328
|
+
var isTTVCv1Disabled = (0, _platformFeatureFlags.fg)('platform_ufo_disable_ttvc_v1');
|
|
329
|
+
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
328
330
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
|
|
329
331
|
}
|
|
330
332
|
if (!_this.componentsLog[time]) {
|
|
@@ -338,13 +340,13 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
338
340
|
});
|
|
339
341
|
}
|
|
340
342
|
});
|
|
341
|
-
(0, _defineProperty2.default)(this, "onViewportChangeDetected", function (
|
|
342
|
-
var element =
|
|
343
|
-
type =
|
|
344
|
-
ignoreReason =
|
|
345
|
-
timestamp =
|
|
346
|
-
targetName =
|
|
347
|
-
intersectionRect =
|
|
343
|
+
(0, _defineProperty2.default)(this, "onViewportChangeDetected", function (_ref9) {
|
|
344
|
+
var element = _ref9.element,
|
|
345
|
+
type = _ref9.type,
|
|
346
|
+
ignoreReason = _ref9.ignoreReason,
|
|
347
|
+
timestamp = _ref9.timestamp,
|
|
348
|
+
targetName = _ref9.targetName,
|
|
349
|
+
intersectionRect = _ref9.intersectionRect;
|
|
348
350
|
if (_this.multiHeatmap === null) {
|
|
349
351
|
return;
|
|
350
352
|
}
|
|
@@ -426,10 +428,10 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
426
428
|
var unbinds = (0, _attachAbortListeners.attachAbortListeners)(window, _this.viewport, _this.abortReasonCallback);
|
|
427
429
|
if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
|
|
428
430
|
var _window2;
|
|
429
|
-
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (
|
|
430
|
-
var
|
|
431
|
-
key =
|
|
432
|
-
time =
|
|
431
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref10) {
|
|
432
|
+
var _ref11 = (0, _slicedToArray2.default)(_ref10, 2),
|
|
433
|
+
key = _ref11[0],
|
|
434
|
+
time = _ref11[1];
|
|
433
435
|
if (time) {
|
|
434
436
|
_this.abortReasonCallback(key, time);
|
|
435
437
|
}
|
|
@@ -451,7 +453,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
451
453
|
dataVC: true
|
|
452
454
|
}
|
|
453
455
|
});
|
|
454
|
-
this.heatmap = this.getCleanHeatmap();
|
|
456
|
+
this.heatmap = (0, _platformFeatureFlags.fg)('platform_ufo_disable_ttvc_v1') ? [] : this.getCleanHeatmap();
|
|
455
457
|
this.heatmapNext = this.getCleanHeatmap();
|
|
456
458
|
this.multiHeatmap = new _heatmap.MultiRevisionHeatmap({
|
|
457
459
|
viewport: this.viewport,
|
|
@@ -462,8 +464,8 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
462
464
|
}
|
|
463
465
|
return (0, _createClass2.default)(VCObserver, [{
|
|
464
466
|
key: "start",
|
|
465
|
-
value: function start(
|
|
466
|
-
var startTime =
|
|
467
|
+
value: function start(_ref12) {
|
|
468
|
+
var startTime = _ref12.startTime;
|
|
467
469
|
this.active = true;
|
|
468
470
|
if (this.observers.isBrowserSupported()) {
|
|
469
471
|
this.setViewportSize();
|
|
@@ -485,12 +487,12 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
485
487
|
}, {
|
|
486
488
|
key: "getIgnoredElements",
|
|
487
489
|
value: function getIgnoredElements(componentsLog) {
|
|
488
|
-
return Object.values(componentsLog).flat().filter(function (
|
|
489
|
-
var ignoreReason =
|
|
490
|
+
return Object.values(componentsLog).flat().filter(function (_ref13) {
|
|
491
|
+
var ignoreReason = _ref13.ignoreReason;
|
|
490
492
|
return Boolean(ignoreReason);
|
|
491
|
-
}).map(function (
|
|
492
|
-
var targetName =
|
|
493
|
-
ignoreReason =
|
|
493
|
+
}).map(function (_ref14) {
|
|
494
|
+
var targetName = _ref14.targetName,
|
|
495
|
+
ignoreReason = _ref14.ignoreReason;
|
|
494
496
|
return {
|
|
495
497
|
targetName: targetName,
|
|
496
498
|
ignoreReason: ignoreReason
|
|
@@ -538,7 +540,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
538
540
|
blocking: false
|
|
539
541
|
};
|
|
540
542
|
this.detachAbortListeners();
|
|
541
|
-
this.heatmap = this.getCleanHeatmap();
|
|
543
|
+
this.heatmap = (0, _platformFeatureFlags.fg)('platform_ufo_disable_ttvc_v1') ? [] : this.getCleanHeatmap();
|
|
542
544
|
this.heatmapNext = this.getCleanHeatmap();
|
|
543
545
|
this.multiHeatmap = new _heatmap.MultiRevisionHeatmap({
|
|
544
546
|
viewport: this.viewport,
|
|
@@ -610,12 +612,12 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
610
612
|
}
|
|
611
613
|
}], [{
|
|
612
614
|
key: "calculateVC",
|
|
613
|
-
value: function calculateVC(
|
|
614
|
-
var heatmap =
|
|
615
|
-
|
|
616
|
-
ssr =
|
|
617
|
-
componentsLog =
|
|
618
|
-
viewport =
|
|
615
|
+
value: function calculateVC(_ref15) {
|
|
616
|
+
var heatmap = _ref15.heatmap,
|
|
617
|
+
_ref15$ssr = _ref15.ssr,
|
|
618
|
+
ssr = _ref15$ssr === void 0 ? UNUSED_SECTOR : _ref15$ssr,
|
|
619
|
+
componentsLog = _ref15.componentsLog,
|
|
620
|
+
viewport = _ref15.viewport;
|
|
619
621
|
var lastUpdate = {};
|
|
620
622
|
var totalPainted = 0;
|
|
621
623
|
if (ssr !== UNUSED_SECTOR) {
|
|
@@ -684,11 +686,11 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
684
686
|
});
|
|
685
687
|
return VCRatio;
|
|
686
688
|
}, 0);
|
|
687
|
-
var VCEntries = entries.reduce(function (acc,
|
|
689
|
+
var VCEntries = entries.reduce(function (acc, _ref16, i) {
|
|
688
690
|
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
689
|
-
var
|
|
690
|
-
timestamp =
|
|
691
|
-
entryPainted =
|
|
691
|
+
var _ref17 = (0, _slicedToArray2.default)(_ref16, 2),
|
|
692
|
+
timestamp = _ref17[0],
|
|
693
|
+
entryPainted = _ref17[1];
|
|
692
694
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
693
695
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
694
696
|
var logEntry = (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
|
|
@@ -94,7 +94,7 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
94
94
|
renderStop: -1
|
|
95
95
|
};
|
|
96
96
|
(_this$mutationObserve = this.mutationObserver) === null || _this$mutationObserve === void 0 || _this$mutationObserve.observe(document.body, {
|
|
97
|
-
attributeFilter:
|
|
97
|
+
attributeFilter: ['hidden', 'style', 'src', 'class'],
|
|
98
98
|
attributeOldValue: true,
|
|
99
99
|
attributes: true,
|
|
100
100
|
childList: true,
|
|
@@ -211,13 +211,27 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
211
211
|
});
|
|
212
212
|
} else if (mutation.type === 'attributes') {
|
|
213
213
|
if (mutation.target instanceof HTMLElement) {
|
|
214
|
-
if ((0, _platformFeatureFlags.fg)('
|
|
214
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_vc_ignore_same_value_mutation')) {
|
|
215
|
+
var _mutation$oldValue;
|
|
216
|
+
/*
|
|
217
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
218
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
219
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
220
|
+
and whether or not they are the same doesn't really matter.
|
|
221
|
+
And Custom elements should work the same way as MutationObserver."
|
|
222
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
223
|
+
*/
|
|
224
|
+
var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
|
|
225
|
+
var newValue = mutation.attributeName ? mutation.target.getAttribute(mutation.attributeName) : undefined;
|
|
226
|
+
if (oldValue !== newValue) {
|
|
227
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
215
230
|
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
216
231
|
}
|
|
217
232
|
}
|
|
218
233
|
}
|
|
219
234
|
});
|
|
220
|
-
_this2.measureStop();
|
|
221
235
|
}) : null;
|
|
222
236
|
}
|
|
223
237
|
}, {
|
|
@@ -267,10 +281,8 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
267
281
|
// ignore intersection report without recent mutation
|
|
268
282
|
return;
|
|
269
283
|
}
|
|
270
|
-
if ((
|
|
271
|
-
|
|
272
|
-
data.ignoreReason = 'not-visible';
|
|
273
|
-
}
|
|
284
|
+
if (!isElementVisible(target)) {
|
|
285
|
+
data.ignoreReason = 'not-visible';
|
|
274
286
|
}
|
|
275
287
|
if ((0, _platformFeatureFlags.fg)('platform_editor_ed-25937_ignore_mutations_for_ttvc')) {
|
|
276
288
|
if (isInsideEditorContainer(target)) {
|
|
@@ -12,10 +12,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _fy25_ = require("./fy25_01");
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
16
|
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)); }
|
|
20
17
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
18
|
var FY25_02Classifier = exports.FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
|
|
@@ -46,21 +43,15 @@ var FY25_02Classifier = exports.FY25_02Classifier = /*#__PURE__*/function (_FY25
|
|
|
46
43
|
var componentsLog = _ref2.componentsLog,
|
|
47
44
|
ttai = _ref2.ttai;
|
|
48
45
|
var _componentsLog = {};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
_componentsLog[timestamp] = value;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
_componentsLog = _objectSpread({}, componentsLog);
|
|
63
|
-
}
|
|
46
|
+
Object.entries(componentsLog).forEach(function (_ref3) {
|
|
47
|
+
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
48
|
+
_timestamp = _ref4[0],
|
|
49
|
+
value = _ref4[1];
|
|
50
|
+
var timestamp = Number(_timestamp);
|
|
51
|
+
if (Math.ceil(ttai) >= timestamp) {
|
|
52
|
+
_componentsLog[timestamp] = value;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
64
55
|
return _componentsLog;
|
|
65
56
|
}
|
|
66
57
|
}]);
|