@atlaskit/react-ufo 3.9.5 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +26 -5
- package/dist/cjs/config/index.js +22 -1
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +2 -2
- package/dist/cjs/vc/index.js +1 -4
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +2 -5
- package/dist/cjs/vc/vc-observer/index.js +47 -22
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +1 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +29 -9
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +24 -0
- package/dist/es2019/config/index.js +19 -0
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +3 -3
- package/dist/es2019/vc/index.js +2 -5
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +3 -6
- package/dist/es2019/vc/vc-observer/index.js +43 -15
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +24 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +22 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -2
- package/dist/esm/config/index.js +20 -1
- package/dist/esm/create-payload/utils/get-vc-metrics.js +3 -3
- package/dist/esm/vc/index.js +2 -5
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +3 -6
- package/dist/esm/vc/vc-observer/index.js +48 -23
- package/dist/esm/vc/vc-observer/revisions/revisions.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +29 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +24 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -2
- package/dist/types/common/vc/types.d.ts +2 -1
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/vc/vc-observer-new/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +6 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +7 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +1 -13
- package/dist/types-ts4.5/common/vc/types.d.ts +2 -1
- package/dist/types-ts4.5/config/index.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer-new/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +6 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +7 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +1 -13
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import {
|
|
3
|
+
import { isVCRevisionEnabled } from '../../config';
|
|
4
4
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
5
5
|
import { getVCRevisionsData } from './getVCRevisionsData';
|
|
6
6
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
@@ -25,7 +25,6 @@ function filterComponentsLog(log) {
|
|
|
25
25
|
}
|
|
26
26
|
export class VCObserver {
|
|
27
27
|
constructor(options) {
|
|
28
|
-
var _getConfig5, _getConfig5$vc, _getConfig5$vc$enable;
|
|
29
28
|
/* abort logic */
|
|
30
29
|
_defineProperty(this, "abortReason", {
|
|
31
30
|
reason: null,
|
|
@@ -97,7 +96,6 @@ export class VCObserver {
|
|
|
97
96
|
vc,
|
|
98
97
|
isEventAborted
|
|
99
98
|
}) => {
|
|
100
|
-
var _getConfig, _getConfig$vc, _getConfig$vc$enabled, _getConfig2, _getConfig2$vc, _getConfig2$vc$enable;
|
|
101
99
|
const startTime = performance.now();
|
|
102
100
|
// add local measurement
|
|
103
101
|
const fullPrefix = prefix !== undefined && prefix !== '' ? `${prefix}:` : '';
|
|
@@ -118,7 +116,39 @@ export class VCObserver {
|
|
|
118
116
|
ratios,
|
|
119
117
|
multiHeatmap
|
|
120
118
|
} = rawData;
|
|
121
|
-
|
|
119
|
+
const isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01');
|
|
120
|
+
|
|
121
|
+
// NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
|
|
122
|
+
// we want to report abort by scroll events the same way as other abort reasons
|
|
123
|
+
// i.e. not have the concept of `abortReason.blocking` anymore
|
|
124
|
+
if (abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
|
|
125
|
+
// exposing data to devtools
|
|
126
|
+
try {
|
|
127
|
+
if (devToolsEnabled && !this.isPostInteraction) {
|
|
128
|
+
window.__vcNotAvailableReason = abortReasonInfo;
|
|
129
|
+
}
|
|
130
|
+
} catch (e) {}
|
|
131
|
+
const vcAbortedResultWithRevisions = {
|
|
132
|
+
[`${fullPrefix}vc:state`]: false,
|
|
133
|
+
[`${fullPrefix}vc:abort:reason`]: abortReason.reason,
|
|
134
|
+
[`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp,
|
|
135
|
+
[`${fullPrefix}vc:rev`]: [{
|
|
136
|
+
revision: 'fy25.02',
|
|
137
|
+
clean: false,
|
|
138
|
+
'metric:vc90': null,
|
|
139
|
+
abortReason: abortReason.reason
|
|
140
|
+
}]
|
|
141
|
+
};
|
|
142
|
+
if (!isTTVCv1Disabled) {
|
|
143
|
+
vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
|
|
144
|
+
revision: 'fy25.01',
|
|
145
|
+
clean: false,
|
|
146
|
+
'metric:vc90': null,
|
|
147
|
+
abortReason: abortReason.reason
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return vcAbortedResultWithRevisions;
|
|
151
|
+
} else if (abortReasonInfo !== null && abortReason.blocking) {
|
|
122
152
|
// exposing data to devtools
|
|
123
153
|
try {
|
|
124
154
|
if (devToolsEnabled && !this.isPostInteraction) {
|
|
@@ -131,7 +161,6 @@ export class VCObserver {
|
|
|
131
161
|
[`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp
|
|
132
162
|
};
|
|
133
163
|
}
|
|
134
|
-
const isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig$vc = _getConfig.vc) !== null && _getConfig$vc !== void 0 && (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) !== null && _getConfig$vc$enabled !== void 0 && _getConfig$vc$enabled.includes('fy25.01'));
|
|
135
164
|
const ttvcV1Result = isTTVCv1Disabled ? {
|
|
136
165
|
VC: {},
|
|
137
166
|
VCBox: {},
|
|
@@ -306,7 +335,7 @@ export class VCObserver {
|
|
|
306
335
|
...speedIndex
|
|
307
336
|
};
|
|
308
337
|
}
|
|
309
|
-
const isTTVCv3Enabled =
|
|
338
|
+
const isTTVCv3Enabled = isVCRevisionEnabled('fy25.03');
|
|
310
339
|
return {
|
|
311
340
|
'metrics:vc': VC,
|
|
312
341
|
[`${fullPrefix}vc:state`]: true,
|
|
@@ -329,10 +358,9 @@ export class VCObserver {
|
|
|
329
358
|
};
|
|
330
359
|
});
|
|
331
360
|
_defineProperty(this, "handleUpdate", (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) => {
|
|
332
|
-
var _getConfig3, _getConfig3$vc, _getConfig3$vc$enable;
|
|
333
361
|
this.measureStart();
|
|
334
362
|
this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue);
|
|
335
|
-
if (!
|
|
363
|
+
if (!isVCRevisionEnabled('fy25.03')) {
|
|
336
364
|
this.onViewportChangeDetected({
|
|
337
365
|
timestamp: rawTime,
|
|
338
366
|
intersectionRect,
|
|
@@ -349,14 +377,13 @@ export class VCObserver {
|
|
|
349
377
|
});
|
|
350
378
|
_defineProperty(this, "legacyHandleUpdate", (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) => {
|
|
351
379
|
if (this.abortReason.reason === null || this.abortReason.blocking === false) {
|
|
352
|
-
var _getConfig4, _getConfig4$vc, _getConfig4$vc$enable;
|
|
353
380
|
const time = Math.round(rawTime - this.startTime);
|
|
354
381
|
const mappedValues = this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
355
382
|
this.vcRatios[targetName] = this.getElementRatio(mappedValues);
|
|
356
383
|
if (!ignoreReason) {
|
|
357
384
|
this.applyChangesToHeatMap(mappedValues, time, this.heatmapNext);
|
|
358
385
|
}
|
|
359
|
-
const isTTVCv1Disabled = !(
|
|
386
|
+
const isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01');
|
|
360
387
|
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
361
388
|
this.applyChangesToHeatMap(mappedValues, time, this.heatmap);
|
|
362
389
|
}
|
|
@@ -495,7 +522,7 @@ export class VCObserver {
|
|
|
495
522
|
dataVC: true
|
|
496
523
|
}
|
|
497
524
|
});
|
|
498
|
-
this.heatmap = !(
|
|
525
|
+
this.heatmap = !isVCRevisionEnabled('fy25.01') ? [] : this.getCleanHeatmap();
|
|
499
526
|
this.heatmapNext = this.getCleanHeatmap();
|
|
500
527
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
501
528
|
viewport: this.viewport,
|
|
@@ -644,7 +671,6 @@ export class VCObserver {
|
|
|
644
671
|
}
|
|
645
672
|
}
|
|
646
673
|
resetState() {
|
|
647
|
-
var _getConfig6, _getConfig6$vc, _getConfig6$vc$enable;
|
|
648
674
|
this.abortReason = {
|
|
649
675
|
reason: null,
|
|
650
676
|
info: '',
|
|
@@ -652,7 +678,7 @@ export class VCObserver {
|
|
|
652
678
|
blocking: false
|
|
653
679
|
};
|
|
654
680
|
this.detachAbortListeners();
|
|
655
|
-
this.heatmap = !(
|
|
681
|
+
this.heatmap = !isVCRevisionEnabled('fy25.01') ? [] : this.getCleanHeatmap();
|
|
656
682
|
this.heatmapNext = this.getCleanHeatmap();
|
|
657
683
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
658
684
|
viewport: this.viewport,
|
|
@@ -701,8 +727,10 @@ export class VCObserver {
|
|
|
701
727
|
return vc;
|
|
702
728
|
}
|
|
703
729
|
detachAbortListeners() {
|
|
704
|
-
this.unbind
|
|
705
|
-
|
|
730
|
+
if (Array.isArray(this.unbind)) {
|
|
731
|
+
this.unbind.forEach(fn => fn());
|
|
732
|
+
this.unbind = [];
|
|
733
|
+
}
|
|
706
734
|
}
|
|
707
735
|
measureStart() {
|
|
708
736
|
this._startMeasureTimestamp = performance.now();
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isVCRevisionEnabled } from '../../../config';
|
|
2
2
|
import { revFY25_01Classifier } from './fy25_01';
|
|
3
3
|
import { revFY25_02Classifier } from './fy25_02';
|
|
4
4
|
export function getRevisions() {
|
|
5
|
-
|
|
6
|
-
if (!((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig$vc = _getConfig.vc) !== null && _getConfig$vc !== void 0 && (_getConfig$vc$enabled = _getConfig$vc.enabledVCRevisions) !== null && _getConfig$vc$enabled !== void 0 && _getConfig$vc$enabled.includes('fy25.01'))) {
|
|
5
|
+
if (!isVCRevisionEnabled('fy25.01')) {
|
|
7
6
|
return [{
|
|
8
7
|
name: 'fy25.02',
|
|
9
8
|
classifier: revFY25_02Classifier
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import calculateTTVCPercentiles from './percentile-calc';
|
|
2
3
|
import getViewportHeight from './utils/get-viewport-height';
|
|
3
4
|
import getViewportWidth from './utils/get-viewport-width';
|
|
@@ -14,13 +15,28 @@ export default class AbstractVCCalculatorBase {
|
|
|
14
15
|
const filteredEntries = orderedEntries.filter(entry => {
|
|
15
16
|
return this.isEntryIncluded(entry);
|
|
16
17
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
if (fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
|
|
19
|
+
const {
|
|
20
|
+
isVCClean,
|
|
21
|
+
dirtyReason
|
|
22
|
+
} = this.getVCCleanStatus(filteredEntries);
|
|
23
|
+
if (!isVCClean) {
|
|
24
|
+
return {
|
|
25
|
+
revision: this.revisionNo,
|
|
26
|
+
'metric:vc90': null,
|
|
27
|
+
clean: false,
|
|
28
|
+
abortReason: dirtyReason
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
const isVCClean = this.isVCClean(filteredEntries);
|
|
33
|
+
if (!isVCClean) {
|
|
34
|
+
return {
|
|
35
|
+
revision: this.revisionNo,
|
|
36
|
+
'metric:vc90': null,
|
|
37
|
+
clean: false
|
|
38
|
+
};
|
|
39
|
+
}
|
|
24
40
|
}
|
|
25
41
|
const vcDetails = await calculateTTVCPercentiles({
|
|
26
42
|
viewport: {
|
|
@@ -35,7 +51,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
35
51
|
return {
|
|
36
52
|
revision: this.revisionNo,
|
|
37
53
|
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
|
|
38
|
-
clean:
|
|
54
|
+
clean: true,
|
|
39
55
|
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 ? void 0 : (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null
|
|
40
56
|
};
|
|
41
57
|
}
|
|
@@ -41,4 +41,26 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
41
41
|
});
|
|
42
42
|
return !hasAbortEvent;
|
|
43
43
|
}
|
|
44
|
+
getVCCleanStatus(filteredEntries) {
|
|
45
|
+
let dirtyReason = '';
|
|
46
|
+
const hasAbortEvent = filteredEntries.some(entry => {
|
|
47
|
+
if (entry.type === 'window:event') {
|
|
48
|
+
const data = entry.data;
|
|
49
|
+
if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
|
|
50
|
+
dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
});
|
|
56
|
+
if (hasAbortEvent && dirtyReason) {
|
|
57
|
+
return {
|
|
58
|
+
isVCClean: false,
|
|
59
|
+
dirtyReason
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
isVCClean: true
|
|
64
|
+
};
|
|
65
|
+
}
|
|
44
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import calcUsingCanvas from './canvas-heatmap';
|
|
2
|
-
import
|
|
2
|
+
import calcUsingOldHeatmap from './heatmap';
|
|
3
3
|
import calcUsingRectSweepingLine from './rect-sweeping-line';
|
|
4
4
|
async function calculateTTVCPercentiles(arg) {
|
|
5
5
|
const algo = 'canvas_heatmap';
|
|
@@ -12,7 +12,7 @@ async function calculateTTVCPercentiles(arg) {
|
|
|
12
12
|
return vcDetails;
|
|
13
13
|
}
|
|
14
14
|
if (algo === 'old_heatmap') {
|
|
15
|
-
const vcDetails = await
|
|
15
|
+
const vcDetails = await calcUsingOldHeatmap(arg);
|
|
16
16
|
return vcDetails;
|
|
17
17
|
}
|
|
18
18
|
throw new Error('unexpected Error algo not chosen correctly');
|
package/dist/esm/config/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var config;
|
|
2
|
+
var DEFAULT_TTVC_REVISION = 'fy25.02';
|
|
2
3
|
|
|
3
4
|
// Defensively typed, since this is directly user-editable
|
|
4
5
|
// and they could delete empty members
|
|
@@ -9,6 +10,24 @@ export function setUFOConfig(newConfig) {
|
|
|
9
10
|
export function getConfig() {
|
|
10
11
|
return config;
|
|
11
12
|
}
|
|
13
|
+
export function getEnabledVCRevisions() {
|
|
14
|
+
try {
|
|
15
|
+
var _config$vc;
|
|
16
|
+
if (!config) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
20
|
+
var _config$vc2, _config$vc3;
|
|
21
|
+
return Array.isArray((_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.enabledVCRevisions) && ((_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.enabledVCRevisions.length) > 0 ? config.vc.enabledVCRevisions : [DEFAULT_TTVC_REVISION];
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
} catch (_unused) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function isVCRevisionEnabled(revision) {
|
|
29
|
+
return getEnabledVCRevisions().includes(revision);
|
|
30
|
+
}
|
|
12
31
|
export function getInteractionRate(name, interactionKind) {
|
|
13
32
|
try {
|
|
14
33
|
if (!config) {
|
|
@@ -120,7 +139,7 @@ export function getCapabilityRate(capability) {
|
|
|
120
139
|
}
|
|
121
140
|
}
|
|
122
141
|
return 0;
|
|
123
|
-
} catch (
|
|
142
|
+
} catch (_unused2) {
|
|
124
143
|
return 0;
|
|
125
144
|
}
|
|
126
145
|
}
|
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { getConfig } from '../../config';
|
|
7
|
+
import { getConfig, isVCRevisionEnabled } from '../../config';
|
|
8
8
|
import { postInteractionLog } from '../../interaction-metrics';
|
|
9
9
|
import { getVCObserver } from '../../vc';
|
|
10
10
|
import getInteractionStatus from './get-interaction-status';
|
|
@@ -15,7 +15,7 @@ function getVCMetrics(_x) {
|
|
|
15
15
|
}
|
|
16
16
|
function _getVCMetrics() {
|
|
17
17
|
_getVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
|
|
18
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI
|
|
18
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
|
|
19
19
|
var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, _result$ufoVcRev, ttvcV2Revision, VC;
|
|
20
20
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -64,7 +64,7 @@ function _getVCMetrics() {
|
|
|
64
64
|
getVCObserver().stop();
|
|
65
65
|
}
|
|
66
66
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
67
|
-
if (
|
|
67
|
+
if (isVCRevisionEnabled('fy25.01')) {
|
|
68
68
|
_context.next = 27;
|
|
69
69
|
break;
|
|
70
70
|
}
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -7,19 +7,16 @@ var _process;
|
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
import {
|
|
11
|
-
import { getConfig } from '../config';
|
|
10
|
+
import { isVCRevisionEnabled } from '../config';
|
|
12
11
|
import { VCObserverNOOP } from './no-op-vc-observer';
|
|
13
12
|
import { VCObserver } from './vc-observer';
|
|
14
13
|
import VCObserverNew from './vc-observer-new';
|
|
15
14
|
var VCObserverWrapper = /*#__PURE__*/function () {
|
|
16
15
|
function VCObserverWrapper() {
|
|
17
|
-
var _getConfig;
|
|
18
16
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19
17
|
_classCallCheck(this, VCObserverWrapper);
|
|
20
18
|
this.newVCObserver = null;
|
|
21
|
-
|
|
22
|
-
if (isNewVCObserverEnabled) {
|
|
19
|
+
if (isVCRevisionEnabled('fy25.03')) {
|
|
23
20
|
this.newVCObserver = new VCObserverNew({
|
|
24
21
|
selectorConfig: opts.selectorConfig
|
|
25
22
|
});
|
|
@@ -2,8 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
3
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
import {
|
|
6
|
-
import { getConfig } from '../../config';
|
|
5
|
+
import { isVCRevisionEnabled } from '../../config';
|
|
7
6
|
import { getPageVisibilityState } from '../../hidden-timing';
|
|
8
7
|
import { getRevisions } from './revisions/revisions';
|
|
9
8
|
var VCParts = ['25', '50', '75', '80', '85', '90', '95', '98', '99'];
|
|
@@ -39,7 +38,6 @@ function createVCDetails(calculatedVC, shouldHaveVCmetric) {
|
|
|
39
38
|
|
|
40
39
|
// Optimized implementation (current one)
|
|
41
40
|
export function getVCRevisionsData(_ref) {
|
|
42
|
-
var _ufoConfig$vc, _ufoConfig$vc2;
|
|
43
41
|
var fullPrefix = _ref.fullPrefix,
|
|
44
42
|
interaction = _ref.interaction,
|
|
45
43
|
isVCClean = _ref.isVCClean,
|
|
@@ -48,8 +46,7 @@ export function getVCRevisionsData(_ref) {
|
|
|
48
46
|
ssr = _ref.ssr,
|
|
49
47
|
calculatedVC = _ref.calculatedVC,
|
|
50
48
|
calculatedVCNext = _ref.calculatedVCNext;
|
|
51
|
-
|
|
52
|
-
if (!fg('platform_ufo_vc_observer_new') && !(ufoConfig !== null && ufoConfig !== void 0 && (_ufoConfig$vc = ufoConfig.vc) !== null && _ufoConfig$vc !== void 0 && (_ufoConfig$vc = _ufoConfig$vc.enabledVCRevisions) !== null && _ufoConfig$vc !== void 0 && _ufoConfig$vc.includes('fy25.03'))) {
|
|
49
|
+
if (!isVCRevisionEnabled('fy25.03')) {
|
|
53
50
|
if (!multiHeatmap) {
|
|
54
51
|
return null;
|
|
55
52
|
}
|
|
@@ -85,7 +82,7 @@ export function getVCRevisionsData(_ref) {
|
|
|
85
82
|
'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
|
|
86
83
|
vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
|
|
87
84
|
};
|
|
88
|
-
if (!(
|
|
85
|
+
if (!isVCRevisionEnabled('fy25.01')) {
|
|
89
86
|
return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [ttvcV2Revision]);
|
|
90
87
|
}
|
|
91
88
|
|
|
@@ -10,7 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import {
|
|
13
|
+
import { isVCRevisionEnabled } from '../../config';
|
|
14
14
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
15
15
|
import { getVCRevisionsData } from './getVCRevisionsData';
|
|
16
16
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
@@ -38,8 +38,7 @@ function filterComponentsLog(log) {
|
|
|
38
38
|
}
|
|
39
39
|
export var VCObserver = /*#__PURE__*/function () {
|
|
40
40
|
function VCObserver(options) {
|
|
41
|
-
var _this = this
|
|
42
|
-
_getConfig5;
|
|
41
|
+
var _this = this;
|
|
43
42
|
_classCallCheck(this, VCObserver);
|
|
44
43
|
/* abort logic */
|
|
45
44
|
_defineProperty(this, "abortReason", {
|
|
@@ -99,8 +98,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
99
98
|
});
|
|
100
99
|
_defineProperty(this, "getVCResult", /*#__PURE__*/function () {
|
|
101
100
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
102
|
-
var
|
|
103
|
-
var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
|
|
101
|
+
var start, stop, tti, prefix, ssr, vc, isEventAborted, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
|
|
104
102
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
105
103
|
while (1) switch (_context.prev = _context.next) {
|
|
106
104
|
case 0:
|
|
@@ -115,8 +113,37 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
115
113
|
return _context.abrupt("return", {});
|
|
116
114
|
case 6:
|
|
117
115
|
abortReason = rawData.abortReason, abortReasonInfo = rawData.abortReasonInfo, heatmap = rawData.heatmap, heatmapNext = rawData.heatmapNext, outOfBoundaryInfo = rawData.outOfBoundaryInfo, totalTime = rawData.totalTime, componentsLog = rawData.componentsLog, viewport = rawData.viewport, devToolsEnabled = rawData.devToolsEnabled, ratios = rawData.ratios, multiHeatmap = rawData.multiHeatmap;
|
|
116
|
+
isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01'); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
|
|
117
|
+
// we want to report abort by scroll events the same way as other abort reasons
|
|
118
|
+
// i.e. not have the concept of `abortReason.blocking` anymore
|
|
119
|
+
if (!(abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions'))) {
|
|
120
|
+
_context.next = 15;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
// exposing data to devtools
|
|
124
|
+
try {
|
|
125
|
+
if (devToolsEnabled && !_this.isPostInteraction) {
|
|
126
|
+
window.__vcNotAvailableReason = abortReasonInfo;
|
|
127
|
+
}
|
|
128
|
+
} catch (e) {}
|
|
129
|
+
vcAbortedResultWithRevisions = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReason.reason), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), "".concat(fullPrefix, "vc:rev"), [{
|
|
130
|
+
revision: 'fy25.02',
|
|
131
|
+
clean: false,
|
|
132
|
+
'metric:vc90': null,
|
|
133
|
+
abortReason: abortReason.reason
|
|
134
|
+
}]);
|
|
135
|
+
if (!isTTVCv1Disabled) {
|
|
136
|
+
vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
|
|
137
|
+
revision: 'fy25.01',
|
|
138
|
+
clean: false,
|
|
139
|
+
'metric:vc90': null,
|
|
140
|
+
abortReason: abortReason.reason
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return _context.abrupt("return", vcAbortedResultWithRevisions);
|
|
144
|
+
case 15:
|
|
118
145
|
if (!(abortReasonInfo !== null && abortReason.blocking)) {
|
|
119
|
-
_context.next =
|
|
146
|
+
_context.next = 18;
|
|
120
147
|
break;
|
|
121
148
|
}
|
|
122
149
|
// exposing data to devtools
|
|
@@ -126,8 +153,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
126
153
|
}
|
|
127
154
|
} catch (e) {}
|
|
128
155
|
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));
|
|
129
|
-
case
|
|
130
|
-
isTTVCv1Disabled = !((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'));
|
|
156
|
+
case 18:
|
|
131
157
|
ttvcV1Result = isTTVCv1Disabled ? {
|
|
132
158
|
VC: {},
|
|
133
159
|
VCBox: {},
|
|
@@ -279,16 +305,16 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
279
305
|
});
|
|
280
306
|
speedIndex = _defineProperty(_defineProperty({}, "ufo:speedIndex", isTTVCv1Disabled ? vcNext.VCEntries.speedIndex : VCEntries.speedIndex), "ufo:next:speedIndex", vcNext.VCEntries.speedIndex);
|
|
281
307
|
if (!isTTVCv1Disabled) {
|
|
282
|
-
_context.next =
|
|
308
|
+
_context.next = 32;
|
|
283
309
|
break;
|
|
284
310
|
}
|
|
285
311
|
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), speedIndex));
|
|
286
|
-
case
|
|
287
|
-
isTTVCv3Enabled =
|
|
312
|
+
case 32:
|
|
313
|
+
isTTVCv3Enabled = isVCRevisionEnabled('fy25.03');
|
|
288
314
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
289
315
|
'metrics:vc': VC
|
|
290
316
|
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
|
|
291
|
-
case
|
|
317
|
+
case 34:
|
|
292
318
|
case "end":
|
|
293
319
|
return _context.stop();
|
|
294
320
|
}
|
|
@@ -299,10 +325,9 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
299
325
|
};
|
|
300
326
|
}());
|
|
301
327
|
_defineProperty(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
|
|
302
|
-
var _getConfig3;
|
|
303
328
|
_this.measureStart();
|
|
304
329
|
_this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue);
|
|
305
|
-
if (!
|
|
330
|
+
if (!isVCRevisionEnabled('fy25.03')) {
|
|
306
331
|
_this.onViewportChangeDetected({
|
|
307
332
|
timestamp: rawTime,
|
|
308
333
|
intersectionRect: intersectionRect,
|
|
@@ -319,14 +344,13 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
319
344
|
});
|
|
320
345
|
_defineProperty(this, "legacyHandleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
|
|
321
346
|
if (_this.abortReason.reason === null || _this.abortReason.blocking === false) {
|
|
322
|
-
var _getConfig4;
|
|
323
347
|
var time = Math.round(rawTime - _this.startTime);
|
|
324
348
|
var mappedValues = _this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
325
349
|
_this.vcRatios[targetName] = _this.getElementRatio(mappedValues);
|
|
326
350
|
if (!ignoreReason) {
|
|
327
351
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
|
|
328
352
|
}
|
|
329
|
-
var isTTVCv1Disabled = !(
|
|
353
|
+
var isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01');
|
|
330
354
|
if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
|
|
331
355
|
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
|
|
332
356
|
}
|
|
@@ -464,7 +488,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
464
488
|
dataVC: true
|
|
465
489
|
}
|
|
466
490
|
});
|
|
467
|
-
this.heatmap = !(
|
|
491
|
+
this.heatmap = !isVCRevisionEnabled('fy25.01') ? [] : this.getCleanHeatmap();
|
|
468
492
|
this.heatmapNext = this.getCleanHeatmap();
|
|
469
493
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
470
494
|
viewport: this.viewport,
|
|
@@ -544,7 +568,6 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
544
568
|
}, {
|
|
545
569
|
key: "resetState",
|
|
546
570
|
value: function resetState() {
|
|
547
|
-
var _getConfig6;
|
|
548
571
|
this.abortReason = {
|
|
549
572
|
reason: null,
|
|
550
573
|
info: '',
|
|
@@ -552,7 +575,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
552
575
|
blocking: false
|
|
553
576
|
};
|
|
554
577
|
this.detachAbortListeners();
|
|
555
|
-
this.heatmap = !(
|
|
578
|
+
this.heatmap = !isVCRevisionEnabled('fy25.01') ? [] : this.getCleanHeatmap();
|
|
556
579
|
this.heatmapNext = this.getCleanHeatmap();
|
|
557
580
|
this.multiHeatmap = new MultiRevisionHeatmap({
|
|
558
581
|
viewport: this.viewport,
|
|
@@ -603,10 +626,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
603
626
|
}, {
|
|
604
627
|
key: "detachAbortListeners",
|
|
605
628
|
value: function detachAbortListeners() {
|
|
606
|
-
this.unbind
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
629
|
+
if (Array.isArray(this.unbind)) {
|
|
630
|
+
this.unbind.forEach(function (fn) {
|
|
631
|
+
return fn();
|
|
632
|
+
});
|
|
633
|
+
this.unbind = [];
|
|
634
|
+
}
|
|
610
635
|
}
|
|
611
636
|
}, {
|
|
612
637
|
key: "measureStart",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isVCRevisionEnabled } from '../../../config';
|
|
2
2
|
import { revFY25_01Classifier } from './fy25_01';
|
|
3
3
|
import { revFY25_02Classifier } from './fy25_02';
|
|
4
4
|
export function getRevisions() {
|
|
5
|
-
|
|
6
|
-
if (!((_getConfig = getConfig()) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.vc) !== null && _getConfig !== void 0 && (_getConfig = _getConfig.enabledVCRevisions) !== null && _getConfig !== void 0 && _getConfig.includes('fy25.01'))) {
|
|
5
|
+
if (!isVCRevisionEnabled('fy25.01')) {
|
|
7
6
|
return [{
|
|
8
7
|
name: 'fy25.02',
|
|
9
8
|
classifier: revFY25_02Classifier
|
|
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import calculateTTVCPercentiles from './percentile-calc';
|
|
6
7
|
import getViewportHeight from './utils/get-viewport-height';
|
|
7
8
|
import getViewportWidth from './utils/get-viewport-width';
|
|
@@ -17,7 +18,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
17
18
|
var _this = this,
|
|
18
19
|
_vcDetails$90$t,
|
|
19
20
|
_vcDetails$;
|
|
20
|
-
var startTime, stopTime, orderedEntries, filteredEntries,
|
|
21
|
+
var startTime, stopTime, orderedEntries, filteredEntries, _this$getVCCleanStatu, _isVCClean, dirtyReason, _isVCClean2, vcDetails;
|
|
21
22
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
23
|
while (1) switch (_context.prev = _context.next) {
|
|
23
24
|
case 0:
|
|
@@ -25,9 +26,28 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
25
26
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
26
27
|
return _this.isEntryIncluded(entry);
|
|
27
28
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (!fg('platform_ufo_add_vc_abort_reason_by_revisions')) {
|
|
30
|
+
_context.next = 8;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
_this$getVCCleanStatu = this.getVCCleanStatus(filteredEntries), _isVCClean = _this$getVCCleanStatu.isVCClean, dirtyReason = _this$getVCCleanStatu.dirtyReason;
|
|
34
|
+
if (_isVCClean) {
|
|
35
|
+
_context.next = 6;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return _context.abrupt("return", {
|
|
39
|
+
revision: this.revisionNo,
|
|
40
|
+
'metric:vc90': null,
|
|
41
|
+
clean: false,
|
|
42
|
+
abortReason: dirtyReason
|
|
43
|
+
});
|
|
44
|
+
case 6:
|
|
45
|
+
_context.next = 11;
|
|
46
|
+
break;
|
|
47
|
+
case 8:
|
|
48
|
+
_isVCClean2 = this.isVCClean(filteredEntries);
|
|
49
|
+
if (_isVCClean2) {
|
|
50
|
+
_context.next = 11;
|
|
31
51
|
break;
|
|
32
52
|
}
|
|
33
53
|
return _context.abrupt("return", {
|
|
@@ -35,8 +55,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
35
55
|
'metric:vc90': null,
|
|
36
56
|
clean: false
|
|
37
57
|
});
|
|
38
|
-
case
|
|
39
|
-
_context.next =
|
|
58
|
+
case 11:
|
|
59
|
+
_context.next = 13;
|
|
40
60
|
return calculateTTVCPercentiles({
|
|
41
61
|
viewport: {
|
|
42
62
|
width: getViewportWidth(),
|
|
@@ -47,15 +67,15 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
47
67
|
orderedEntries: filteredEntries,
|
|
48
68
|
percentiles: [25, 50, 75, 80, 85, 90, 95, 98, 99]
|
|
49
69
|
});
|
|
50
|
-
case
|
|
70
|
+
case 13:
|
|
51
71
|
vcDetails = _context.sent;
|
|
52
72
|
return _context.abrupt("return", {
|
|
53
73
|
revision: this.revisionNo,
|
|
54
74
|
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
|
|
55
|
-
clean:
|
|
75
|
+
clean: true,
|
|
56
76
|
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null
|
|
57
77
|
});
|
|
58
|
-
case
|
|
78
|
+
case 15:
|
|
59
79
|
case "end":
|
|
60
80
|
return _context.stop();
|
|
61
81
|
}
|