@atlaskit/react-ufo 2.14.3 → 2.16.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 +20 -0
- package/dist/cjs/assets/index.js +96 -0
- package/dist/cjs/assets/utils.js +32 -0
- package/dist/cjs/common/assets/types.js +5 -0
- package/dist/cjs/create-payload/index.js +42 -5
- package/dist/cjs/experience-trace-id-context/index.js +5 -1
- package/dist/cjs/segment/segment.js +7 -1
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +264 -0
- package/dist/cjs/vc/vc-observer/index.js +119 -26
- package/dist/cjs/vc/vc-observer/revisions/ViewportUpdateClassifier.js +60 -0
- package/dist/cjs/vc/vc-observer/revisions/fy24_01.js +71 -0
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +39 -0
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +23 -0
- package/dist/cjs/vc/vc-observer/revisions/types.js +5 -0
- package/dist/es2019/assets/index.js +82 -0
- package/dist/es2019/assets/utils.js +26 -0
- package/dist/es2019/common/assets/types.js +1 -0
- package/dist/es2019/create-payload/index.js +43 -3
- package/dist/es2019/experience-trace-id-context/index.js +4 -0
- package/dist/es2019/segment/segment.js +11 -3
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +230 -0
- package/dist/es2019/vc/vc-observer/index.js +97 -3
- package/dist/es2019/vc/vc-observer/revisions/ViewportUpdateClassifier.js +41 -0
- package/dist/es2019/vc/vc-observer/revisions/fy24_01.js +50 -0
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +21 -0
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +19 -0
- package/dist/es2019/vc/vc-observer/revisions/types.js +1 -0
- package/dist/esm/assets/index.js +89 -0
- package/dist/esm/assets/utils.js +26 -0
- package/dist/esm/common/assets/types.js +1 -0
- package/dist/esm/create-payload/index.js +42 -5
- package/dist/esm/experience-trace-id-context/index.js +4 -0
- package/dist/esm/segment/segment.js +7 -1
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +257 -0
- package/dist/esm/vc/vc-observer/index.js +119 -26
- package/dist/esm/vc/vc-observer/revisions/ViewportUpdateClassifier.js +53 -0
- package/dist/esm/vc/vc-observer/revisions/fy24_01.js +64 -0
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +32 -0
- package/dist/esm/vc/vc-observer/revisions/revisions.js +17 -0
- package/dist/esm/vc/vc-observer/revisions/types.js +1 -0
- package/dist/types/assets/index.d.ts +25 -0
- package/dist/types/assets/utils.d.ts +6 -0
- package/dist/types/common/assets/types.d.ts +18 -0
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/vc/types.d.ts +27 -8
- package/dist/types/config/index.d.ts +2 -1
- package/dist/types/create-payload/index.d.ts +11616 -0
- package/dist/types/experience-trace-id-context/index.d.ts +1 -0
- package/dist/types/resource-timing/index.d.ts +1 -1
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +72 -0
- package/dist/types/vc/vc-observer/index.d.ts +5 -1
- package/dist/types/vc/vc-observer/revisions/ViewportUpdateClassifier.d.ts +30 -0
- package/dist/types/vc/vc-observer/revisions/fy24_01.d.ts +13 -0
- package/dist/types/vc/vc-observer/revisions/fy25_01.d.ts +13 -0
- package/dist/types/vc/vc-observer/revisions/revisions.d.ts +2 -0
- package/dist/types/vc/vc-observer/revisions/types.d.ts +23 -0
- package/dist/types-ts4.5/assets/index.d.ts +25 -0
- package/dist/types-ts4.5/assets/utils.d.ts +6 -0
- package/dist/types-ts4.5/common/assets/types.d.ts +18 -0
- package/dist/types-ts4.5/common/index.d.ts +1 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +27 -8
- package/dist/types-ts4.5/config/index.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/index.d.ts +11616 -0
- package/dist/types-ts4.5/experience-trace-id-context/index.d.ts +1 -0
- package/dist/types-ts4.5/resource-timing/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +72 -0
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +15 -1
- package/dist/types-ts4.5/vc/vc-observer/revisions/ViewportUpdateClassifier.d.ts +30 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/fy24_01.d.ts +13 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/fy25_01.d.ts +13 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/revisions.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/types.d.ts +23 -0
- package/package.json +11 -2
|
@@ -9,7 +9,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
11
11
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
12
|
+
import { MultiRevisionHeatmap } from './heatmap/heatmap';
|
|
12
13
|
import { Observers } from './observers';
|
|
14
|
+
import { getRevisions } from './revisions/revisions';
|
|
13
15
|
var abortReason = {
|
|
14
16
|
scroll: 'scroll',
|
|
15
17
|
keypress: 'keypress',
|
|
@@ -47,6 +49,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
47
49
|
});
|
|
48
50
|
/* heatmap */
|
|
49
51
|
_defineProperty(this, "arraySize", 0);
|
|
52
|
+
_defineProperty(this, "multiHeatmap", null);
|
|
50
53
|
_defineProperty(this, "componentsLog", {});
|
|
51
54
|
_defineProperty(this, "vcRatios", {});
|
|
52
55
|
_defineProperty(this, "active", false);
|
|
@@ -78,6 +81,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
78
81
|
abortReason: _objectSpread({}, _this.abortReason),
|
|
79
82
|
heatmap: _this.heatmap,
|
|
80
83
|
heatmapNext: _this.heatmapNext,
|
|
84
|
+
multiHeatmap: _this.multiHeatmap,
|
|
81
85
|
outOfBoundaryInfo: _this.outOfBoundaryInfo,
|
|
82
86
|
totalTime: Math.round(_this.totalTime + _this.observers.getTotalTime()),
|
|
83
87
|
componentsLog: _objectSpread({}, _this.componentsLog),
|
|
@@ -110,7 +114,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
110
114
|
componentsLog = rawData.componentsLog,
|
|
111
115
|
viewport = rawData.viewport,
|
|
112
116
|
devToolsEnabled = rawData.devToolsEnabled,
|
|
113
|
-
ratios = rawData.ratios
|
|
117
|
+
ratios = rawData.ratios,
|
|
118
|
+
multiHeatmap = rawData.multiHeatmap;
|
|
114
119
|
if (abortReasonInfo !== null && abortReason.blocking) {
|
|
115
120
|
// exposing data to devtools
|
|
116
121
|
try {
|
|
@@ -146,6 +151,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
146
151
|
/* empty */
|
|
147
152
|
}
|
|
148
153
|
var _componentsLog = {};
|
|
154
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
149
155
|
if (fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
150
156
|
Object.entries(_this.componentsLog).forEach(function (_ref5) {
|
|
151
157
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
@@ -202,9 +208,30 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
202
208
|
tti: tti,
|
|
203
209
|
ttai: stop - start
|
|
204
210
|
},
|
|
211
|
+
start: start,
|
|
212
|
+
stop: stop,
|
|
205
213
|
heatmap: heatmap,
|
|
206
214
|
ratios: ratios
|
|
207
215
|
};
|
|
216
|
+
window.__vcNext = {
|
|
217
|
+
entries: vcNext.VCEntries.rel,
|
|
218
|
+
log: componentsLog,
|
|
219
|
+
metrics: {
|
|
220
|
+
'75': vcNext.VC['75'],
|
|
221
|
+
'80': vcNext.VC['80'],
|
|
222
|
+
'85': vcNext.VC['85'],
|
|
223
|
+
'90': vcNext.VC['90'],
|
|
224
|
+
'95': vcNext.VC['95'],
|
|
225
|
+
'98': vcNext.VC['98'],
|
|
226
|
+
'99': vcNext.VC['99'],
|
|
227
|
+
tti: tti,
|
|
228
|
+
ttai: stop - start
|
|
229
|
+
},
|
|
230
|
+
start: start,
|
|
231
|
+
stop: stop,
|
|
232
|
+
heatmap: heatmapNext,
|
|
233
|
+
ratios: ratios
|
|
234
|
+
};
|
|
208
235
|
|
|
209
236
|
// Emitting a custom event to make it available in the Chrome extension
|
|
210
237
|
window.dispatchEvent(new CustomEvent('vcReady', {
|
|
@@ -217,13 +244,40 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
217
244
|
} catch (e) {
|
|
218
245
|
/* do nothing */
|
|
219
246
|
}
|
|
247
|
+
var isMultiHeatmapEnabled = fg('ufo_vc_multiheatmap');
|
|
248
|
+
var revisionsData = isMultiHeatmapEnabled && multiHeatmap !== null ? _defineProperty({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap.getPayloadShapedData({
|
|
249
|
+
VCParts: VCObserver.VCParts.map(function (v) {
|
|
250
|
+
return parseInt(v);
|
|
251
|
+
}),
|
|
252
|
+
VCCalculationMethods: getRevisions().map(function (_ref8) {
|
|
253
|
+
var classifier = _ref8.classifier;
|
|
254
|
+
return classifier.VCCalculationMethod;
|
|
255
|
+
}),
|
|
256
|
+
ssr: ssr,
|
|
257
|
+
clean: !abortReasonInfo
|
|
258
|
+
})) : null;
|
|
259
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
220
260
|
var isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
221
|
-
return _objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
261
|
+
return _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
222
262
|
'metrics:vc': VC
|
|
223
|
-
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), !abortReasonInfo), "".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(
|
|
263
|
+
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), !abortReasonInfo), "".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), {}, _defineProperty(_defineProperty({}, "ufo:speedIndex", isCalcSpeedIndexEnabled ? VCEntries.speedIndex : undefined), "ufo:next:speedIndex", isCalcSpeedIndexEnabled ? vcNext.VCEntries.speedIndex : undefined));
|
|
224
264
|
});
|
|
225
265
|
_defineProperty(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason) {
|
|
226
266
|
_this.measureStart();
|
|
267
|
+
_this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason);
|
|
268
|
+
if (fg('ufo_vc_multiheatmap')) {
|
|
269
|
+
_this.onViewportChangeDetected({
|
|
270
|
+
timestamp: rawTime,
|
|
271
|
+
intersectionRect: intersectionRect,
|
|
272
|
+
targetName: targetName,
|
|
273
|
+
element: element,
|
|
274
|
+
type: type,
|
|
275
|
+
ignoreReason: ignoreReason
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
_this.measureStop();
|
|
279
|
+
});
|
|
280
|
+
_defineProperty(this, "legacyHandleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason) {
|
|
227
281
|
if (_this.abortReason.reason === null || _this.abortReason.blocking === false) {
|
|
228
282
|
var time = Math.round(rawTime - _this.startTime);
|
|
229
283
|
var mappedValues = _this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
@@ -244,8 +298,38 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
244
298
|
ignoreReason: ignoreReason
|
|
245
299
|
});
|
|
246
300
|
}
|
|
247
|
-
|
|
248
|
-
|
|
301
|
+
});
|
|
302
|
+
_defineProperty(this, "onViewportChangeDetected", function (_ref10) {
|
|
303
|
+
var element = _ref10.element,
|
|
304
|
+
type = _ref10.type,
|
|
305
|
+
ignoreReason = _ref10.ignoreReason,
|
|
306
|
+
timestamp = _ref10.timestamp,
|
|
307
|
+
targetName = _ref10.targetName,
|
|
308
|
+
intersectionRect = _ref10.intersectionRect;
|
|
309
|
+
if (_this.multiHeatmap === null) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
// @todo add abort reason handling
|
|
313
|
+
var time = Math.round(timestamp - _this.startTime);
|
|
314
|
+
var revisions = getRevisions();
|
|
315
|
+
var revisionsClassification = revisions.map(function (revision) {
|
|
316
|
+
return revision.classifier.classifyUpdate({
|
|
317
|
+
element: element,
|
|
318
|
+
type: type,
|
|
319
|
+
ignoreReason: ignoreReason
|
|
320
|
+
});
|
|
321
|
+
}, []);
|
|
322
|
+
_this.multiHeatmap.handleUpdate({
|
|
323
|
+
time: time,
|
|
324
|
+
targetName: targetName,
|
|
325
|
+
intersectionRect: intersectionRect,
|
|
326
|
+
type: type,
|
|
327
|
+
element: element,
|
|
328
|
+
classification: revisionsClassification,
|
|
329
|
+
onError: function onError(error) {
|
|
330
|
+
_this.setAbortReason(abortReason.error, error.time, error.error);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
249
333
|
});
|
|
250
334
|
_defineProperty(this, "mapPixelsToHeatmap", function (left, top, width, height) {
|
|
251
335
|
var _this$viewport = _this.viewport,
|
|
@@ -303,10 +387,10 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
303
387
|
var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
|
|
304
388
|
if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
|
|
305
389
|
var _window2;
|
|
306
|
-
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (
|
|
307
|
-
var
|
|
308
|
-
key =
|
|
309
|
-
time =
|
|
390
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref11) {
|
|
391
|
+
var _ref12 = _slicedToArray(_ref11, 2),
|
|
392
|
+
key = _ref12[0],
|
|
393
|
+
time = _ref12[1];
|
|
310
394
|
if (time) {
|
|
311
395
|
_this.abortReasonCallback(key, time);
|
|
312
396
|
}
|
|
@@ -330,12 +414,19 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
330
414
|
});
|
|
331
415
|
this.heatmap = this.getCleanHeatmap();
|
|
332
416
|
this.heatmapNext = this.getCleanHeatmap();
|
|
417
|
+
if (fg('ufo_vc_multiheatmap')) {
|
|
418
|
+
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
419
|
+
viewport: this.viewport,
|
|
420
|
+
revisions: getRevisions(),
|
|
421
|
+
devToolsEnabled: this.devToolsEnabled
|
|
422
|
+
});
|
|
423
|
+
}
|
|
333
424
|
this.isPostInteraction = options.isPostInteraction || false;
|
|
334
425
|
}
|
|
335
426
|
return _createClass(VCObserver, [{
|
|
336
427
|
key: "start",
|
|
337
|
-
value: function start(
|
|
338
|
-
var startTime =
|
|
428
|
+
value: function start(_ref13) {
|
|
429
|
+
var startTime = _ref13.startTime;
|
|
339
430
|
this.active = true;
|
|
340
431
|
if (this.observers.isBrowserSupported()) {
|
|
341
432
|
this.setViewportSize();
|
|
@@ -357,12 +448,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
357
448
|
}, {
|
|
358
449
|
key: "getIgnoredElements",
|
|
359
450
|
value: function getIgnoredElements(componentsLog) {
|
|
360
|
-
return Object.values(componentsLog).flat().filter(function (
|
|
361
|
-
var ignoreReason =
|
|
451
|
+
return Object.values(componentsLog).flat().filter(function (_ref14) {
|
|
452
|
+
var ignoreReason = _ref14.ignoreReason;
|
|
362
453
|
return Boolean(ignoreReason);
|
|
363
|
-
}).map(function (
|
|
364
|
-
var targetName =
|
|
365
|
-
ignoreReason =
|
|
454
|
+
}).map(function (_ref15) {
|
|
455
|
+
var targetName = _ref15.targetName,
|
|
456
|
+
ignoreReason = _ref15.ignoreReason;
|
|
366
457
|
return {
|
|
367
458
|
targetName: targetName,
|
|
368
459
|
ignoreReason: ignoreReason
|
|
@@ -483,12 +574,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
483
574
|
}
|
|
484
575
|
}], [{
|
|
485
576
|
key: "calculateVC",
|
|
486
|
-
value: function calculateVC(
|
|
487
|
-
var heatmap =
|
|
488
|
-
|
|
489
|
-
ssr =
|
|
490
|
-
componentsLog =
|
|
491
|
-
viewport =
|
|
577
|
+
value: function calculateVC(_ref16) {
|
|
578
|
+
var heatmap = _ref16.heatmap,
|
|
579
|
+
_ref16$ssr = _ref16.ssr,
|
|
580
|
+
ssr = _ref16$ssr === void 0 ? UNUSED_SECTOR : _ref16$ssr,
|
|
581
|
+
componentsLog = _ref16.componentsLog,
|
|
582
|
+
viewport = _ref16.viewport;
|
|
492
583
|
var lastUpdate = {};
|
|
493
584
|
var totalPainted = 0;
|
|
494
585
|
if (ssr !== UNUSED_SECTOR) {
|
|
@@ -531,6 +622,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
531
622
|
});
|
|
532
623
|
var VC = VCObserver.makeVCReturnObj();
|
|
533
624
|
var VCBox = VCObserver.makeVCReturnObj();
|
|
625
|
+
|
|
626
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
534
627
|
var isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
535
628
|
entries.reduce(function () {
|
|
536
629
|
var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -555,11 +648,11 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
555
648
|
});
|
|
556
649
|
return VCRatio;
|
|
557
650
|
}, 0);
|
|
558
|
-
var VCEntries = entries.reduce(function (acc,
|
|
651
|
+
var VCEntries = entries.reduce(function (acc, _ref17, i) {
|
|
559
652
|
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
560
|
-
var
|
|
561
|
-
timestamp =
|
|
562
|
-
entryPainted =
|
|
653
|
+
var _ref18 = _slicedToArray(_ref17, 2),
|
|
654
|
+
timestamp = _ref18[0],
|
|
655
|
+
entryPainted = _ref18[1];
|
|
563
656
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
564
657
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
565
658
|
var logEntry = (_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
export var ViewportUpdateClassifier = /*#__PURE__*/function () {
|
|
6
|
+
function ViewportUpdateClassifier() {
|
|
7
|
+
_classCallCheck(this, ViewportUpdateClassifier);
|
|
8
|
+
_defineProperty(this, "types", []);
|
|
9
|
+
_defineProperty(this, "filters", []);
|
|
10
|
+
_defineProperty(this, "removedFilters", []);
|
|
11
|
+
_defineProperty(this, "__combinedTypes", []);
|
|
12
|
+
_defineProperty(this, "__combinedFilters", []);
|
|
13
|
+
}
|
|
14
|
+
return _createClass(ViewportUpdateClassifier, [{
|
|
15
|
+
key: "VCCalculationMethod",
|
|
16
|
+
value: function VCCalculationMethod(_) {
|
|
17
|
+
return {
|
|
18
|
+
VC: {},
|
|
19
|
+
VCBox: {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
key: "mergeConfig",
|
|
24
|
+
value: function mergeConfig() {
|
|
25
|
+
var _this = this;
|
|
26
|
+
this.__combinedTypes = [].concat(_toConsumableArray(this.types), _toConsumableArray((this === null || this === void 0 ? void 0 : this.__combinedTypes) || []));
|
|
27
|
+
var previousFilters = this.removedFilters.length === 0 ? this.__combinedFilters : this.__combinedFilters.filter(function (filter) {
|
|
28
|
+
return !_this.removedFilters.includes(filter.name);
|
|
29
|
+
});
|
|
30
|
+
this.__combinedFilters = [].concat(_toConsumableArray(this.filters), _toConsumableArray(previousFilters));
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
key: "classifyUpdate",
|
|
34
|
+
value: function classifyUpdate(_ref) {
|
|
35
|
+
var element = _ref.element,
|
|
36
|
+
type = _ref.type,
|
|
37
|
+
tags = _ref.tags,
|
|
38
|
+
ignoreReason = _ref.ignoreReason;
|
|
39
|
+
if (!this.__combinedTypes.includes(type)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return this.__combinedFilters.every(function (_ref2) {
|
|
43
|
+
var filter = _ref2.filter,
|
|
44
|
+
name = _ref2.name;
|
|
45
|
+
return filter({
|
|
46
|
+
type: type,
|
|
47
|
+
tags: tags,
|
|
48
|
+
ignoreReason: ignoreReason
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}]);
|
|
53
|
+
}();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
10
|
+
var legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view', 'editor-container-mutation'];
|
|
11
|
+
export var FY24_01Classifier = /*#__PURE__*/function (_ViewportUpdateClassi) {
|
|
12
|
+
function FY24_01Classifier() {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, FY24_01Classifier);
|
|
15
|
+
_this = _callSuper(this, FY24_01Classifier);
|
|
16
|
+
_defineProperty(_this, "revision", 'fy24.01');
|
|
17
|
+
_defineProperty(_this, "types", ['html', 'text']);
|
|
18
|
+
_defineProperty(_this, "filters", [{
|
|
19
|
+
name: 'default-ignore-reasons',
|
|
20
|
+
filter: function filter(_ref) {
|
|
21
|
+
var type = _ref.type,
|
|
22
|
+
ignoreReason = _ref.ignoreReason;
|
|
23
|
+
return !ignoreReason || !legacyIgnoreReasons.includes(ignoreReason);
|
|
24
|
+
}
|
|
25
|
+
}]);
|
|
26
|
+
_this.mergeConfig();
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(FY24_01Classifier, _ViewportUpdateClassi);
|
|
30
|
+
return _createClass(FY24_01Classifier, [{
|
|
31
|
+
key: "VCCalculationMethod",
|
|
32
|
+
value: function VCCalculationMethod(_ref2) {
|
|
33
|
+
var VCParts = _ref2.VCParts,
|
|
34
|
+
entries = _ref2.entries,
|
|
35
|
+
totalPainted = _ref2.totalPainted,
|
|
36
|
+
componentsLog = _ref2.componentsLog;
|
|
37
|
+
var VC = {};
|
|
38
|
+
var VCBox = {};
|
|
39
|
+
entries.reduce(function () {
|
|
40
|
+
var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
41
|
+
var v = arguments.length > 1 ? arguments[1] : undefined;
|
|
42
|
+
var VCRatio = v[1] / totalPainted + acc;
|
|
43
|
+
var time = v[0];
|
|
44
|
+
VCParts.forEach(function (value) {
|
|
45
|
+
if ((VC[value] === null || VC[value] === undefined) && VCRatio >= value / 100) {
|
|
46
|
+
var _componentsLog$time;
|
|
47
|
+
VC[value] = time;
|
|
48
|
+
VCBox[value] = new Set();
|
|
49
|
+
(_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 || _componentsLog$time.forEach(function (v) {
|
|
50
|
+
var _VCBox$value;
|
|
51
|
+
return (_VCBox$value = VCBox[value]) === null || _VCBox$value === void 0 ? void 0 : _VCBox$value.add(v.targetName);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return VCRatio;
|
|
56
|
+
}, 0);
|
|
57
|
+
return {
|
|
58
|
+
VC: VC,
|
|
59
|
+
VCBox: VCBox
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}]);
|
|
63
|
+
}(ViewportUpdateClassifier);
|
|
64
|
+
export var revFY24_01Classifier = new FY24_01Classifier();
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
import { FY24_01Classifier } from './fy24_01';
|
|
10
|
+
export var FY25_01Classifier = /*#__PURE__*/function (_FY24_01Classifier) {
|
|
11
|
+
function FY25_01Classifier() {
|
|
12
|
+
var _this;
|
|
13
|
+
_classCallCheck(this, FY25_01Classifier);
|
|
14
|
+
_this = _callSuper(this, FY25_01Classifier);
|
|
15
|
+
_defineProperty(_this, "revision", 'fy25.01');
|
|
16
|
+
_defineProperty(_this, "types", ['attr']);
|
|
17
|
+
_defineProperty(_this, "filters", [{
|
|
18
|
+
name: 'not-visible',
|
|
19
|
+
filter: function filter(_ref) {
|
|
20
|
+
var type = _ref.type,
|
|
21
|
+
ignoreReason = _ref.ignoreReason;
|
|
22
|
+
return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible'));
|
|
23
|
+
}
|
|
24
|
+
}]);
|
|
25
|
+
_defineProperty(_this, "removedFilters", []);
|
|
26
|
+
_this.mergeConfig();
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(FY25_01Classifier, _FY24_01Classifier);
|
|
30
|
+
return _createClass(FY25_01Classifier);
|
|
31
|
+
}(FY24_01Classifier);
|
|
32
|
+
export var revFY25_01Classifier = new FY25_01Classifier();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { revFY24_01Classifier } from './fy24_01';
|
|
2
|
+
import { revFY25_01Classifier } from './fy25_01';
|
|
3
|
+
var Revisions = [{
|
|
4
|
+
name: 'fy24.01',
|
|
5
|
+
classifier: revFY24_01Classifier
|
|
6
|
+
}, {
|
|
7
|
+
name: 'fy25.01',
|
|
8
|
+
classifier: revFY25_01Classifier
|
|
9
|
+
}];
|
|
10
|
+
var revisionResultCache = null;
|
|
11
|
+
export var getRevisions = function getRevisions() {
|
|
12
|
+
if (revisionResultCache !== null) {
|
|
13
|
+
return revisionResultCache;
|
|
14
|
+
}
|
|
15
|
+
revisionResultCache = [].concat(Revisions);
|
|
16
|
+
return revisionResultCache;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AssetsClassification, AssetsData, AssetsReporter } from '../common';
|
|
2
|
+
import type { ResourceTiming, ResourceTimings } from '../resource-timing';
|
|
3
|
+
export declare class CHRSummary {
|
|
4
|
+
bundles: {
|
|
5
|
+
mem: number;
|
|
6
|
+
disk: number;
|
|
7
|
+
net: number;
|
|
8
|
+
};
|
|
9
|
+
bundlesCount: number;
|
|
10
|
+
size: {
|
|
11
|
+
mem: number;
|
|
12
|
+
disk: number;
|
|
13
|
+
net: number;
|
|
14
|
+
};
|
|
15
|
+
sizeTotal: number;
|
|
16
|
+
add(asset: ResourceTiming): void;
|
|
17
|
+
static makePayload(summary: CHRSummary): AssetsReporter;
|
|
18
|
+
}
|
|
19
|
+
export declare class CHRReporter {
|
|
20
|
+
all: CHRSummary;
|
|
21
|
+
allAtlassian: CHRSummary;
|
|
22
|
+
preloaded: CHRSummary;
|
|
23
|
+
constructor();
|
|
24
|
+
get(resourceTimings: ResourceTimings, assetsClassification: AssetsClassification): AssetsData | null;
|
|
25
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const cacheableTypes: string[];
|
|
2
|
+
export declare const MEMORY_KEY = "mem";
|
|
3
|
+
export declare const DISK_KEY = "disk";
|
|
4
|
+
export declare const NETWORK_KEY = "net";
|
|
5
|
+
export declare const calculateTransferType: (type: string, duration: number, size: number | undefined) => "disk" | "mem" | "net" | null;
|
|
6
|
+
export declare const round: (n: number) => number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ResourceTiming } from '../../resource-timing';
|
|
2
|
+
export type AssetResourceEntry = {
|
|
3
|
+
label: string;
|
|
4
|
+
entry: ResourceTiming;
|
|
5
|
+
};
|
|
6
|
+
export type AssetsClassification = {
|
|
7
|
+
all: boolean;
|
|
8
|
+
allAtlassian: (entry: AssetResourceEntry) => boolean;
|
|
9
|
+
preloaded: (entry: AssetResourceEntry) => boolean;
|
|
10
|
+
};
|
|
11
|
+
export type AssetsReporter = {
|
|
12
|
+
size: number | null;
|
|
13
|
+
chr: number | null;
|
|
14
|
+
count: number;
|
|
15
|
+
};
|
|
16
|
+
export interface AssetsData {
|
|
17
|
+
[key: string]: AssetsReporter;
|
|
18
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { AssetResourceEntry, AssetsClassification, AssetsData, AssetsReporter, } from './assets/types';
|
|
1
2
|
export type { LifecycleMarkType, MarkType, SpanType, InteractionType, AbortReasonType, CustomTiming, HoldInfo, LoadProfilerEventInfo, ReactProfilerTiming, Span, Mark, InteractionError, RequestInfo, ApdexType, SegmentInfo, CustomData, HoldActive, Redirect, InteractionMetrics, EnhancedUFOInteractionContextType, BM3Event, PostInteractionLogOutput, LastInteractionFinishInfo, } from './common/types';
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated Prefer import from @atlaskit/react-ufo/interaction-context
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UnbindFn } from 'bind-event-listener';
|
|
2
|
+
import { MultiRevisionHeatmap } from '../../vc/vc-observer/heatmap/heatmap';
|
|
2
3
|
export declare const AbortEvent: {
|
|
3
4
|
readonly wheel: "wheel";
|
|
4
5
|
readonly keydown: "keydown";
|
|
@@ -29,6 +30,7 @@ export type VCRawDataType = {
|
|
|
29
30
|
oldDomUpdatesEnabled: boolean;
|
|
30
31
|
devToolsEnabled: boolean;
|
|
31
32
|
ratios: VCRatioType;
|
|
33
|
+
multiHeatmap: MultiRevisionHeatmap | null;
|
|
32
34
|
};
|
|
33
35
|
export type VCEntryType = {
|
|
34
36
|
time: number;
|
|
@@ -49,7 +51,7 @@ export type VCResult = {
|
|
|
49
51
|
h: number;
|
|
50
52
|
} | {
|
|
51
53
|
[key: string]: boolean | number | string[] | null | VCEntryType[];
|
|
52
|
-
};
|
|
54
|
+
} | MultiHeatmapPayload;
|
|
53
55
|
};
|
|
54
56
|
export type MetricsDevToolsTypes = {
|
|
55
57
|
'75': number | null;
|
|
@@ -68,15 +70,19 @@ export type ExperimentalVCDevToolsOptions = {
|
|
|
68
70
|
export type ComponentsLogType = {
|
|
69
71
|
[timestamp: number]: ComponentsLogEntry[];
|
|
70
72
|
};
|
|
73
|
+
interface VCDebugInfo {
|
|
74
|
+
entries: VCEntryType[];
|
|
75
|
+
log: ComponentsLogType;
|
|
76
|
+
metrics: MetricsDevToolsTypes;
|
|
77
|
+
heatmap: number[][];
|
|
78
|
+
ratios: VCRatioType;
|
|
79
|
+
start: number;
|
|
80
|
+
stop: number;
|
|
81
|
+
}
|
|
71
82
|
declare global {
|
|
72
83
|
interface Window {
|
|
73
|
-
__vc?:
|
|
74
|
-
|
|
75
|
-
log: ComponentsLogType;
|
|
76
|
-
metrics: MetricsDevToolsTypes;
|
|
77
|
-
heatmap: number[][];
|
|
78
|
-
ratios: VCRatioType;
|
|
79
|
-
};
|
|
84
|
+
__vc?: VCDebugInfo;
|
|
85
|
+
__vcNext?: VCDebugInfo;
|
|
80
86
|
__vcNotAvailableReason?: string;
|
|
81
87
|
__SSR_PLACEHOLDERS_DIMENSIONS__?: {
|
|
82
88
|
[key: string]: DOMRectReadOnly;
|
|
@@ -89,3 +95,16 @@ declare global {
|
|
|
89
95
|
};
|
|
90
96
|
}
|
|
91
97
|
}
|
|
98
|
+
type MultiHeatmapRevisionPayload = {
|
|
99
|
+
'metric:vc90': number | null;
|
|
100
|
+
revision: string;
|
|
101
|
+
clean: boolean;
|
|
102
|
+
vcDetails?: {
|
|
103
|
+
[key: string]: {
|
|
104
|
+
t: number;
|
|
105
|
+
e: string[];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export type MultiHeatmapPayload = MultiHeatmapRevisionPayload[];
|
|
110
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InteractionMetrics, InteractionType } from '../common';
|
|
1
|
+
import type { AssetsClassification, InteractionMetrics, InteractionType } from '../common';
|
|
2
2
|
export interface AdditionalData {
|
|
3
3
|
[key: string]: null | string | number | boolean | undefined | AdditionalData | Record<string, AdditionalData> | Array<AdditionalData>;
|
|
4
4
|
}
|
|
@@ -57,6 +57,7 @@ export type Config = {
|
|
|
57
57
|
readonly getSSRTimings?: () => SSRTiming[];
|
|
58
58
|
readonly getSSRDoneTime?: () => number | undefined;
|
|
59
59
|
};
|
|
60
|
+
readonly assetsClassification?: AssetsClassification;
|
|
60
61
|
readonly enableBetterPageVisibilityApi?: boolean;
|
|
61
62
|
readonly vc?: {
|
|
62
63
|
readonly enabled?: boolean;
|