@atlaskit/react-ufo 3.4.10 → 3.4.12
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/index.js +1 -1
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +24 -6
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +80 -0
- package/dist/cjs/vc/vc-observer/index.js +119 -117
- package/dist/cjs/vc/vc-observer/observers/index.js +3 -5
- 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/es2019/create-payload/index.js +1 -1
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +23 -10
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +75 -0
- package/dist/es2019/vc/vc-observer/index.js +96 -93
- package/dist/es2019/vc/vc-observer/observers/index.js +3 -5
- 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/esm/create-payload/index.js +1 -1
- package/dist/esm/create-payload/utils/get-vc-metrics.js +24 -6
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +73 -0
- package/dist/esm/vc/vc-observer/index.js +119 -117
- package/dist/esm/vc/vc-observer/observers/index.js +3 -5
- 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/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 +4 -10
|
@@ -10,8 +10,8 @@ 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 { getPageVisibilityState } from '../../hidden-timing';
|
|
14
13
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
14
|
+
import { getVCRevisionsData } from './getVCRevisionsData';
|
|
15
15
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
16
16
|
import { MultiRevisionHeatmap } from './heatmap/heatmap';
|
|
17
17
|
import { Observers } from './observers';
|
|
@@ -97,7 +97,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
97
97
|
});
|
|
98
98
|
_defineProperty(this, "getVCResult", /*#__PURE__*/function () {
|
|
99
99
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
100
|
-
var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap,
|
|
100
|
+
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;
|
|
101
101
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
102
102
|
while (1) switch (_context.prev = _context.next) {
|
|
103
103
|
case 0:
|
|
@@ -124,41 +124,33 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
124
124
|
} catch (e) {}
|
|
125
125
|
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
126
|
case 10:
|
|
127
|
-
|
|
127
|
+
isTTVCv1Disabled = fg('platform_ufo_disable_ttvc_v1');
|
|
128
|
+
ttvcV1Result = isTTVCv1Disabled ? {
|
|
129
|
+
VC: {},
|
|
130
|
+
VCBox: {},
|
|
131
|
+
VCEntries: {
|
|
132
|
+
abs: [],
|
|
133
|
+
rel: [],
|
|
134
|
+
speedIndex: -1
|
|
135
|
+
},
|
|
136
|
+
totalPainted: -1
|
|
137
|
+
} : VCObserver.calculateVC({
|
|
128
138
|
heatmap: heatmap,
|
|
129
139
|
ssr: ssr,
|
|
130
140
|
componentsLog: _objectSpread({}, componentsLog),
|
|
131
141
|
viewport: viewport
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
});
|
|
142
|
+
});
|
|
143
|
+
VC = ttvcV1Result.VC, VCBox = ttvcV1Result.VCBox, VCEntries = ttvcV1Result.VCEntries, totalPainted = ttvcV1Result.totalPainted;
|
|
144
|
+
_componentsLog = {};
|
|
145
|
+
Object.entries(_this.componentsLog).forEach(function (_ref6) {
|
|
146
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
147
|
+
_timestamp = _ref7[0],
|
|
148
|
+
value = _ref7[1];
|
|
149
|
+
var timestamp = Number(_timestamp);
|
|
150
|
+
if (stop > timestamp) {
|
|
151
|
+
_componentsLog[timestamp] = value;
|
|
144
152
|
}
|
|
145
|
-
}
|
|
146
|
-
/* empty */
|
|
147
|
-
}
|
|
148
|
-
_componentsLog = {}; // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
149
|
-
if (fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
150
|
-
Object.entries(_this.componentsLog).forEach(function (_ref6) {
|
|
151
|
-
var _ref7 = _slicedToArray(_ref6, 2),
|
|
152
|
-
_timestamp = _ref7[0],
|
|
153
|
-
value = _ref7[1];
|
|
154
|
-
var timestamp = Number(_timestamp);
|
|
155
|
-
if (stop > timestamp) {
|
|
156
|
-
_componentsLog[timestamp] = value;
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
} else {
|
|
160
|
-
_componentsLog = _objectSpread({}, componentsLog);
|
|
161
|
-
}
|
|
153
|
+
});
|
|
162
154
|
vcNext = VCObserver.calculateVC({
|
|
163
155
|
heatmap: heatmapNext,
|
|
164
156
|
ssr: ssr,
|
|
@@ -168,12 +160,33 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
168
160
|
try {
|
|
169
161
|
if (!_this.isPostInteraction) {
|
|
170
162
|
VCObserver.VCParts.forEach(function (key) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
163
|
+
if (isTTVCv1Disabled) {
|
|
164
|
+
var duration = vcNext.VC[key];
|
|
165
|
+
if (duration !== null && duration !== undefined) {
|
|
166
|
+
performance.measure("VC".concat(key), {
|
|
167
|
+
start: start,
|
|
168
|
+
duration: duration
|
|
169
|
+
});
|
|
170
|
+
performance.measure("VC_Next".concat(key), {
|
|
171
|
+
start: start,
|
|
172
|
+
duration: duration
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
var ttvcV1duration = VC[key];
|
|
177
|
+
if (ttvcV1duration !== null && ttvcV1duration !== undefined) {
|
|
178
|
+
performance.measure("VC".concat(key), {
|
|
179
|
+
start: start,
|
|
180
|
+
duration: ttvcV1duration
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
var ttvcV2duration = vcNext.VC[key];
|
|
184
|
+
if (ttvcV2duration !== null && ttvcV2duration !== undefined) {
|
|
185
|
+
performance.measure("VC_Next".concat(key), {
|
|
186
|
+
start: start,
|
|
187
|
+
duration: ttvcV2duration
|
|
188
|
+
});
|
|
189
|
+
}
|
|
177
190
|
}
|
|
178
191
|
});
|
|
179
192
|
}
|
|
@@ -184,7 +197,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
184
197
|
stopTime = performance.now(); // exposing data to devtools
|
|
185
198
|
try {
|
|
186
199
|
if (!_this.isPostInteraction && devToolsEnabled) {
|
|
187
|
-
|
|
200
|
+
ttvcV1DevToolInfo = isTTVCv1Disabled ? undefined : {
|
|
188
201
|
entries: VCEntries.rel,
|
|
189
202
|
log: componentsLog,
|
|
190
203
|
metrics: {
|
|
@@ -203,7 +216,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
203
216
|
heatmap: heatmap,
|
|
204
217
|
ratios: ratios
|
|
205
218
|
};
|
|
206
|
-
|
|
219
|
+
ttvcV2DevToolInfo = {
|
|
207
220
|
entries: vcNext.VCEntries.rel,
|
|
208
221
|
log: componentsLog,
|
|
209
222
|
metrics: {
|
|
@@ -222,12 +235,19 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
222
235
|
heatmap: heatmapNext,
|
|
223
236
|
ratios: ratios
|
|
224
237
|
};
|
|
238
|
+
if (isTTVCv1Disabled) {
|
|
239
|
+
window.__vc = ttvcV2DevToolInfo;
|
|
240
|
+
window.__vcNext = ttvcV2DevToolInfo;
|
|
241
|
+
} else {
|
|
242
|
+
window.__vc = ttvcV1DevToolInfo;
|
|
243
|
+
window.__vcNext = ttvcV2DevToolInfo;
|
|
244
|
+
}
|
|
225
245
|
|
|
226
246
|
// Emitting a custom event to make it available in the Chrome extension
|
|
227
247
|
window.dispatchEvent(new CustomEvent('vcReady', {
|
|
228
248
|
detail: {
|
|
229
249
|
log: filterComponentsLog(componentsLog),
|
|
230
|
-
entries: VCEntries.rel
|
|
250
|
+
entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
|
|
231
251
|
}
|
|
232
252
|
}));
|
|
233
253
|
}
|
|
@@ -235,56 +255,37 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
235
255
|
/* do nothing */
|
|
236
256
|
}
|
|
237
257
|
isVCClean = !abortReasonInfo;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCObserver.VCParts.map(function (key) {
|
|
247
|
-
var _VCBox$key;
|
|
248
|
-
return [key, {
|
|
249
|
-
t: VC[key],
|
|
250
|
-
e: (_VCBox$key = VCBox[key]) !== null && _VCBox$key !== void 0 ? _VCBox$key : []
|
|
251
|
-
}];
|
|
252
|
-
})) : []
|
|
253
|
-
}, {
|
|
254
|
-
revision: 'fy25.02',
|
|
255
|
-
clean: isVCClean,
|
|
256
|
-
'metric:vc90': shouldHaveVCmetric ? VC['90'] : null,
|
|
257
|
-
vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCObserver.VCParts.map(function (key) {
|
|
258
|
-
var _vcNext$VCBox$key;
|
|
259
|
-
return [key, {
|
|
260
|
-
t: vcNext.VC[key],
|
|
261
|
-
e: (_vcNext$VCBox$key = vcNext.VCBox[key]) !== null && _vcNext$VCBox$key !== void 0 ? _vcNext$VCBox$key : []
|
|
262
|
-
}];
|
|
263
|
-
})) : []
|
|
264
|
-
}]) : multiHeatmap !== null ? _defineProperty({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap === null || multiHeatmap === void 0 ? void 0 : multiHeatmap.getPayloadShapedData({
|
|
265
|
-
VCParts: VCObserver.VCParts.map(function (v) {
|
|
266
|
-
return parseInt(v);
|
|
267
|
-
}),
|
|
268
|
-
VCCalculationMethods: getRevisions().map(function (_ref10) {
|
|
269
|
-
var classifier = _ref10.classifier;
|
|
270
|
-
return classifier.VCCalculationMethod;
|
|
271
|
-
}),
|
|
272
|
-
filterComponentsLog: getRevisions().map(function (_ref11) {
|
|
273
|
-
var classifier = _ref11.classifier;
|
|
274
|
-
return classifier.filterComponentsLog;
|
|
275
|
-
}),
|
|
276
|
-
isEventAborted: isEventAborted,
|
|
277
|
-
interactionStart: start,
|
|
278
|
-
ttai: stop,
|
|
258
|
+
revisionsData = getVCRevisionsData({
|
|
259
|
+
fullPrefix: fullPrefix,
|
|
260
|
+
interaction: {
|
|
261
|
+
start: start,
|
|
262
|
+
end: stop
|
|
263
|
+
},
|
|
264
|
+
isVCClean: isVCClean,
|
|
265
|
+
multiHeatmap: multiHeatmap,
|
|
279
266
|
ssr: ssr,
|
|
280
|
-
|
|
281
|
-
|
|
267
|
+
calculatedVC: {
|
|
268
|
+
VC: VC,
|
|
269
|
+
VCBox: VCBox
|
|
270
|
+
},
|
|
271
|
+
calculatedVCNext: {
|
|
272
|
+
VC: vcNext.VC,
|
|
273
|
+
VCBox: vcNext.VCBox
|
|
274
|
+
},
|
|
275
|
+
isEventAborted: isEventAborted
|
|
276
|
+
}); // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
282
277
|
isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
283
|
-
speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
|
|
278
|
+
speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
|
|
279
|
+
if (!isTTVCv1Disabled) {
|
|
280
|
+
_context.next = 26;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
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
|
+
case 26:
|
|
284
285
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
285
286
|
'metrics:vc': VC
|
|
286
287
|
}, "".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), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".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 : {}));
|
|
287
|
-
case
|
|
288
|
+
case 27:
|
|
288
289
|
case "end":
|
|
289
290
|
return _context.stop();
|
|
290
291
|
}
|
|
@@ -317,7 +318,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
317
318
|
if (!ignoreReason) {
|
|
318
319
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
|
|
319
320
|
}
|
|
320
|
-
|
|
321
|
+
var isTTVCv1Disabled = fg('platform_ufo_disable_ttvc_v1');
|
|
322
|
+
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
321
323
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
|
|
322
324
|
}
|
|
323
325
|
if (!_this.componentsLog[time]) {
|
|
@@ -331,13 +333,13 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
331
333
|
});
|
|
332
334
|
}
|
|
333
335
|
});
|
|
334
|
-
_defineProperty(this, "onViewportChangeDetected", function (
|
|
335
|
-
var element =
|
|
336
|
-
type =
|
|
337
|
-
ignoreReason =
|
|
338
|
-
timestamp =
|
|
339
|
-
targetName =
|
|
340
|
-
intersectionRect =
|
|
336
|
+
_defineProperty(this, "onViewportChangeDetected", function (_ref9) {
|
|
337
|
+
var element = _ref9.element,
|
|
338
|
+
type = _ref9.type,
|
|
339
|
+
ignoreReason = _ref9.ignoreReason,
|
|
340
|
+
timestamp = _ref9.timestamp,
|
|
341
|
+
targetName = _ref9.targetName,
|
|
342
|
+
intersectionRect = _ref9.intersectionRect;
|
|
341
343
|
if (_this.multiHeatmap === null) {
|
|
342
344
|
return;
|
|
343
345
|
}
|
|
@@ -419,10 +421,10 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
419
421
|
var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
|
|
420
422
|
if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
|
|
421
423
|
var _window2;
|
|
422
|
-
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (
|
|
423
|
-
var
|
|
424
|
-
key =
|
|
425
|
-
time =
|
|
424
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref10) {
|
|
425
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
426
|
+
key = _ref11[0],
|
|
427
|
+
time = _ref11[1];
|
|
426
428
|
if (time) {
|
|
427
429
|
_this.abortReasonCallback(key, time);
|
|
428
430
|
}
|
|
@@ -444,7 +446,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
444
446
|
dataVC: true
|
|
445
447
|
}
|
|
446
448
|
});
|
|
447
|
-
this.heatmap = this.getCleanHeatmap();
|
|
449
|
+
this.heatmap = fg('platform_ufo_disable_ttvc_v1') ? [] : this.getCleanHeatmap();
|
|
448
450
|
this.heatmapNext = this.getCleanHeatmap();
|
|
449
451
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
450
452
|
viewport: this.viewport,
|
|
@@ -455,8 +457,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
455
457
|
}
|
|
456
458
|
return _createClass(VCObserver, [{
|
|
457
459
|
key: "start",
|
|
458
|
-
value: function start(
|
|
459
|
-
var startTime =
|
|
460
|
+
value: function start(_ref12) {
|
|
461
|
+
var startTime = _ref12.startTime;
|
|
460
462
|
this.active = true;
|
|
461
463
|
if (this.observers.isBrowserSupported()) {
|
|
462
464
|
this.setViewportSize();
|
|
@@ -478,12 +480,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
478
480
|
}, {
|
|
479
481
|
key: "getIgnoredElements",
|
|
480
482
|
value: function getIgnoredElements(componentsLog) {
|
|
481
|
-
return Object.values(componentsLog).flat().filter(function (
|
|
482
|
-
var ignoreReason =
|
|
483
|
+
return Object.values(componentsLog).flat().filter(function (_ref13) {
|
|
484
|
+
var ignoreReason = _ref13.ignoreReason;
|
|
483
485
|
return Boolean(ignoreReason);
|
|
484
|
-
}).map(function (
|
|
485
|
-
var targetName =
|
|
486
|
-
ignoreReason =
|
|
486
|
+
}).map(function (_ref14) {
|
|
487
|
+
var targetName = _ref14.targetName,
|
|
488
|
+
ignoreReason = _ref14.ignoreReason;
|
|
487
489
|
return {
|
|
488
490
|
targetName: targetName,
|
|
489
491
|
ignoreReason: ignoreReason
|
|
@@ -531,7 +533,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
531
533
|
blocking: false
|
|
532
534
|
};
|
|
533
535
|
this.detachAbortListeners();
|
|
534
|
-
this.heatmap = this.getCleanHeatmap();
|
|
536
|
+
this.heatmap = fg('platform_ufo_disable_ttvc_v1') ? [] : this.getCleanHeatmap();
|
|
535
537
|
this.heatmapNext = this.getCleanHeatmap();
|
|
536
538
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
537
539
|
viewport: this.viewport,
|
|
@@ -603,12 +605,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
603
605
|
}
|
|
604
606
|
}], [{
|
|
605
607
|
key: "calculateVC",
|
|
606
|
-
value: function calculateVC(
|
|
607
|
-
var heatmap =
|
|
608
|
-
|
|
609
|
-
ssr =
|
|
610
|
-
componentsLog =
|
|
611
|
-
viewport =
|
|
608
|
+
value: function calculateVC(_ref15) {
|
|
609
|
+
var heatmap = _ref15.heatmap,
|
|
610
|
+
_ref15$ssr = _ref15.ssr,
|
|
611
|
+
ssr = _ref15$ssr === void 0 ? UNUSED_SECTOR : _ref15$ssr,
|
|
612
|
+
componentsLog = _ref15.componentsLog,
|
|
613
|
+
viewport = _ref15.viewport;
|
|
612
614
|
var lastUpdate = {};
|
|
613
615
|
var totalPainted = 0;
|
|
614
616
|
if (ssr !== UNUSED_SECTOR) {
|
|
@@ -677,11 +679,11 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
677
679
|
});
|
|
678
680
|
return VCRatio;
|
|
679
681
|
}, 0);
|
|
680
|
-
var VCEntries = entries.reduce(function (acc,
|
|
682
|
+
var VCEntries = entries.reduce(function (acc, _ref16, i) {
|
|
681
683
|
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
682
|
-
var
|
|
683
|
-
timestamp =
|
|
684
|
-
entryPainted =
|
|
684
|
+
var _ref17 = _slicedToArray(_ref16, 2),
|
|
685
|
+
timestamp = _ref17[0],
|
|
686
|
+
entryPainted = _ref17[1];
|
|
685
687
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
686
688
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
687
689
|
var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
|
|
@@ -87,7 +87,7 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
87
87
|
renderStop: -1
|
|
88
88
|
};
|
|
89
89
|
(_this$mutationObserve = this.mutationObserver) === null || _this$mutationObserve === void 0 || _this$mutationObserve.observe(document.body, {
|
|
90
|
-
attributeFilter:
|
|
90
|
+
attributeFilter: ['hidden', 'style', 'src', 'class'],
|
|
91
91
|
attributeOldValue: true,
|
|
92
92
|
attributes: true,
|
|
93
93
|
childList: true,
|
|
@@ -274,10 +274,8 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
274
274
|
// ignore intersection report without recent mutation
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
if (
|
|
278
|
-
|
|
279
|
-
data.ignoreReason = 'not-visible';
|
|
280
|
-
}
|
|
277
|
+
if (!isElementVisible(target)) {
|
|
278
|
+
data.ignoreReason = 'not-visible';
|
|
281
279
|
}
|
|
282
280
|
if (fg('platform_editor_ed-25937_ignore_mutations_for_ttvc')) {
|
|
283
281
|
if (isInsideEditorContainer(target)) {
|
|
@@ -5,11 +5,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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; }
|
|
10
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
10
|
import { FY25_01Classifier } from './fy25_01';
|
|
14
11
|
export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
|
|
15
12
|
function FY25_02Classifier() {
|
|
@@ -39,21 +36,15 @@ export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
|
|
|
39
36
|
var componentsLog = _ref2.componentsLog,
|
|
40
37
|
ttai = _ref2.ttai;
|
|
41
38
|
var _componentsLog = {};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_componentsLog[timestamp] = value;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
_componentsLog = _objectSpread({}, componentsLog);
|
|
56
|
-
}
|
|
39
|
+
Object.entries(componentsLog).forEach(function (_ref3) {
|
|
40
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
41
|
+
_timestamp = _ref4[0],
|
|
42
|
+
value = _ref4[1];
|
|
43
|
+
var timestamp = Number(_timestamp);
|
|
44
|
+
if (Math.ceil(ttai) >= timestamp) {
|
|
45
|
+
_componentsLog[timestamp] = value;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
57
48
|
return _componentsLog;
|
|
58
49
|
}
|
|
59
50
|
}]);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { revFY25_01Classifier } from './fy25_01';
|
|
2
3
|
import { revFY25_02Classifier } from './fy25_02';
|
|
3
|
-
var Revisions = [{
|
|
4
|
-
name: 'fy25.01',
|
|
5
|
-
classifier: revFY25_01Classifier
|
|
6
|
-
}, {
|
|
7
|
-
name: 'fy25.02',
|
|
8
|
-
classifier: revFY25_02Classifier
|
|
9
|
-
}];
|
|
10
|
-
var revisionResultCache = null;
|
|
11
4
|
export var getRevisions = function getRevisions() {
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
5
|
+
if (fg('platform_ufo_disable_ttvc_v1')) {
|
|
6
|
+
return [{
|
|
7
|
+
name: 'fy25.02',
|
|
8
|
+
classifier: revFY25_02Classifier
|
|
9
|
+
}];
|
|
14
10
|
}
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
return [{
|
|
12
|
+
name: 'fy25.01',
|
|
13
|
+
classifier: revFY25_01Classifier
|
|
14
|
+
}, {
|
|
15
|
+
name: 'fy25.02',
|
|
16
|
+
classifier: revFY25_02Classifier
|
|
17
|
+
}];
|
|
17
18
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InteractionMetrics } from '../../common/common/types';
|
|
2
|
+
import type { MultiRevisionHeatmap } from './heatmap/heatmap';
|
|
3
|
+
type CalculatedVC = {
|
|
4
|
+
VC: {
|
|
5
|
+
[key: string]: number | null;
|
|
6
|
+
};
|
|
7
|
+
VCBox: {
|
|
8
|
+
[key: string]: string[] | null;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, multiHeatmap, ssr, calculatedVC, calculatedVCNext, }: {
|
|
12
|
+
fullPrefix?: string;
|
|
13
|
+
interaction: Pick<InteractionMetrics, 'start' | 'end'>;
|
|
14
|
+
isVCClean: boolean;
|
|
15
|
+
isEventAborted: boolean;
|
|
16
|
+
multiHeatmap: MultiRevisionHeatmap | null;
|
|
17
|
+
calculatedVC: CalculatedVC;
|
|
18
|
+
calculatedVCNext: CalculatedVC;
|
|
19
|
+
ssr?: number;
|
|
20
|
+
}): {
|
|
21
|
+
[x: string]: import("../../common").MultiHeatmapPayload;
|
|
22
|
+
} | {
|
|
23
|
+
[x: string]: {
|
|
24
|
+
revision: string;
|
|
25
|
+
clean: boolean;
|
|
26
|
+
'metric:vc90': number | null;
|
|
27
|
+
vcDetails: {
|
|
28
|
+
[k: string]: {
|
|
29
|
+
t: number | null;
|
|
30
|
+
e: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}[];
|
|
34
|
+
} | null;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InteractionMetrics } from '../../common/common/types';
|
|
2
|
+
import type { MultiRevisionHeatmap } from './heatmap/heatmap';
|
|
3
|
+
type CalculatedVC = {
|
|
4
|
+
VC: {
|
|
5
|
+
[key: string]: number | null;
|
|
6
|
+
};
|
|
7
|
+
VCBox: {
|
|
8
|
+
[key: string]: string[] | null;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, multiHeatmap, ssr, calculatedVC, calculatedVCNext, }: {
|
|
12
|
+
fullPrefix?: string;
|
|
13
|
+
interaction: Pick<InteractionMetrics, 'start' | 'end'>;
|
|
14
|
+
isVCClean: boolean;
|
|
15
|
+
isEventAborted: boolean;
|
|
16
|
+
multiHeatmap: MultiRevisionHeatmap | null;
|
|
17
|
+
calculatedVC: CalculatedVC;
|
|
18
|
+
calculatedVCNext: CalculatedVC;
|
|
19
|
+
ssr?: number;
|
|
20
|
+
}): {
|
|
21
|
+
[x: string]: import("../../common").MultiHeatmapPayload;
|
|
22
|
+
} | {
|
|
23
|
+
[x: string]: {
|
|
24
|
+
revision: string;
|
|
25
|
+
clean: boolean;
|
|
26
|
+
'metric:vc90': number | null;
|
|
27
|
+
vcDetails: {
|
|
28
|
+
[k: string]: {
|
|
29
|
+
t: number | null;
|
|
30
|
+
e: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}[];
|
|
34
|
+
} | null;
|
|
35
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.12",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -136,21 +136,12 @@
|
|
|
136
136
|
"platform_editor_ed-25937_ignore_mutations_for_ttvc": {
|
|
137
137
|
"type": "boolean"
|
|
138
138
|
},
|
|
139
|
-
"platform-ufo-invisible-element-vc-calculations": {
|
|
140
|
-
"type": "boolean"
|
|
141
|
-
},
|
|
142
|
-
"platform-ufo-vc-observe-attributes": {
|
|
143
|
-
"type": "boolean"
|
|
144
|
-
},
|
|
145
139
|
"enable-react-ufo-payload-segment-compressed": {
|
|
146
140
|
"type": "boolean"
|
|
147
141
|
},
|
|
148
142
|
"ufo_capture_stylesheet_metrics": {
|
|
149
143
|
"type": "boolean"
|
|
150
144
|
},
|
|
151
|
-
"ufo-remove-vc-component-observations-after-ttai": {
|
|
152
|
-
"type": "boolean"
|
|
153
|
-
},
|
|
154
145
|
"ufo-calc-speed-index": {
|
|
155
146
|
"type": "boolean"
|
|
156
147
|
},
|
|
@@ -189,6 +180,9 @@
|
|
|
189
180
|
},
|
|
190
181
|
"platform_ufo_vc_ignore_same_value_mutation": {
|
|
191
182
|
"type": "boolean"
|
|
183
|
+
},
|
|
184
|
+
"platform_ufo_disable_ttvc_v1": {
|
|
185
|
+
"type": "boolean"
|
|
192
186
|
}
|
|
193
187
|
}
|
|
194
188
|
}
|