@atlaskit/react-ufo 3.13.16 → 3.13.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/cjs/ssr/index.js +8 -2
- package/dist/cjs/vc/index.js +2 -1
- package/dist/cjs/vc/vc-observer/index.js +50 -43
- package/dist/cjs/vc/vc-observer-new/index.js +33 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +22 -14
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/es2019/ssr/index.js +5 -1
- package/dist/es2019/vc/index.js +2 -1
- package/dist/es2019/vc/vc-observer/index.js +31 -20
- package/dist/es2019/vc/vc-observer-new/index.js +28 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +20 -9
- package/dist/esm/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/esm/ssr/index.js +8 -2
- package/dist/esm/vc/index.js +2 -1
- package/dist/esm/vc/vc-observer/index.js +50 -43
- package/dist/esm/vc/vc-observer-new/index.js +33 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +22 -14
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/ssr/index.d.ts +1 -0
- package/dist/types/vc/index.d.ts +1 -0
- package/dist/types/vc/types.d.ts +1 -0
- package/dist/types/vc/vc-observer/getVCRevisionDebugDetails.d.ts +4 -5
- package/dist/types/vc/vc-observer/index.d.ts +7 -0
- package/dist/types/vc/vc-observer-new/index.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +7 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +1 -0
- package/dist/types-ts4.5/config/index.d.ts +1 -0
- package/dist/types-ts4.5/ssr/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionDebugDetails.d.ts +4 -5
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +7 -0
- package/dist/types-ts4.5/vc/vc-observer-new/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +7 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -0
- package/package.json +7 -1
|
@@ -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$vc2, _config$experimentalI, _result$ufoVcRev;
|
|
18
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3, _config$experimentalI, _result$ufoVcRev;
|
|
19
19
|
var config, interactionStatus, pageVisibilityUpToTTAI, shouldReportVCMetrics, isSSREnabled, ssr, tti, prefix, result, mostRecentVCRevision, mostRecentVCRevisionPayload;
|
|
20
20
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -56,11 +56,12 @@ function _getVCMetrics() {
|
|
|
56
56
|
stop: interaction.end,
|
|
57
57
|
tti: tti,
|
|
58
58
|
prefix: prefix,
|
|
59
|
+
includeSSRInV3: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRInV3,
|
|
59
60
|
vc: interaction.vc,
|
|
60
61
|
isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED',
|
|
61
62
|
experienceKey: interaction.ufoName,
|
|
62
63
|
interactionId: interaction.id,
|
|
63
|
-
includeSSRRatio: (_config$
|
|
64
|
+
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
64
65
|
}, ssr));
|
|
65
66
|
case 18:
|
|
66
67
|
result = _context.sent;
|
package/dist/esm/ssr/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
6
|
var NESTED_METRIC_SEPARATOR = '/';
|
|
3
7
|
function filterEntry(entry) {
|
|
4
8
|
return !(!entry || _typeof(entry) !== 'object' || entry.startTime < 0 || entry.duration < 0);
|
|
5
9
|
}
|
|
6
10
|
function mapEntry(entry) {
|
|
7
|
-
return {
|
|
11
|
+
return _objectSpread({
|
|
8
12
|
startTime: Math.round(entry.startTime),
|
|
9
13
|
duration: Math.round(entry.duration)
|
|
10
|
-
}
|
|
14
|
+
}, entry.size && fg('platform_ufo_ssr_size_field') ? {
|
|
15
|
+
size: Math.round(entry.size)
|
|
16
|
+
} : {});
|
|
11
17
|
}
|
|
12
18
|
var SSR_PREFIX = 'ssr';
|
|
13
19
|
function mapKey(key) {
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -120,7 +120,8 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
120
120
|
return (_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
121
121
|
start: param.start,
|
|
122
122
|
stop: param.stop,
|
|
123
|
-
interactionId: param.interactionId
|
|
123
|
+
interactionId: param.interactionId,
|
|
124
|
+
ssr: param.includeSSRInV3 ? param.ssr : undefined
|
|
124
125
|
});
|
|
125
126
|
case 12:
|
|
126
127
|
_context.t1 = _context.sent;
|
|
@@ -9,6 +9,7 @@ var _excluded = ["__debug__element"];
|
|
|
9
9
|
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
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { isVCRevisionEnabled } from '../../config';
|
|
13
14
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
14
15
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
@@ -95,7 +96,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
95
96
|
});
|
|
96
97
|
_defineProperty(this, "getVCResult", /*#__PURE__*/function () {
|
|
97
98
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
98
|
-
var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo,
|
|
99
|
+
var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
|
|
99
100
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
100
101
|
while (1) switch (_context.prev = _context.next) {
|
|
101
102
|
case 0:
|
|
@@ -264,30 +265,36 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
264
265
|
entries: isTTVCv1Disabled ? vcNext.VCEntries.rel : VCEntries.rel
|
|
265
266
|
}
|
|
266
267
|
}));
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
v1RevisionDebugDetails = getVCRevisionDebugDetails({
|
|
269
|
+
revision: 'fy25.01',
|
|
270
|
+
isClean: !abortReasonInfo,
|
|
271
|
+
abortReason: abortReason.reason,
|
|
272
|
+
VCEntries: VCEntries.rel,
|
|
273
|
+
componentsLog: componentsLog,
|
|
274
|
+
interactionId: interactionId
|
|
275
|
+
});
|
|
276
|
+
v2RevisionDebugDetails = getVCRevisionDebugDetails({
|
|
277
|
+
revision: 'fy25.02',
|
|
278
|
+
isClean: !abortReasonInfo,
|
|
279
|
+
abortReason: abortReason.reason,
|
|
280
|
+
VCEntries: vcNext.VCEntries.rel,
|
|
281
|
+
componentsLog: componentsLog,
|
|
282
|
+
interactionId: interactionId
|
|
283
|
+
}); // Add devtool callback for both v1 and v2
|
|
269
284
|
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
270
285
|
// Handle v1 if not disabled
|
|
271
286
|
if (!isTTVCv1Disabled) {
|
|
272
|
-
(
|
|
273
|
-
revision: 'fy25.01',
|
|
274
|
-
isClean: !abortReasonInfo,
|
|
275
|
-
abortReason: abortReason.reason,
|
|
276
|
-
VCEntries: VCEntries.rel,
|
|
277
|
-
componentsLog: componentsLog,
|
|
278
|
-
interactionId: interactionId
|
|
279
|
-
}));
|
|
287
|
+
(_window$__ufo_devtool = (_window = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool === void 0 || _window$__ufo_devtool.call(_window, v1RevisionDebugDetails);
|
|
280
288
|
}
|
|
281
289
|
|
|
282
290
|
// Handle v2
|
|
283
|
-
(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}));
|
|
291
|
+
(_window$__ufo_devtool2 = (_window2 = window).__ufo_devtool_onVCRevisionReady__) === null || _window$__ufo_devtool2 === void 0 || _window$__ufo_devtool2.call(_window2, v2RevisionDebugDetails);
|
|
292
|
+
}
|
|
293
|
+
if (typeof window.__on_ufo_vc_debug_data_ready === 'function' && fg('platform_ufo_emit_vc_debug_data')) {
|
|
294
|
+
if (!isTTVCv1Disabled) {
|
|
295
|
+
(_window$__on_ufo_vc_d = (_window3 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d === void 0 || _window$__on_ufo_vc_d.call(_window3, v1RevisionDebugDetails);
|
|
296
|
+
}
|
|
297
|
+
(_window$__on_ufo_vc_d2 = (_window4 = window).__on_ufo_vc_debug_data_ready) === null || _window$__on_ufo_vc_d2 === void 0 || _window$__on_ufo_vc_d2.call(_window4, v2RevisionDebugDetails);
|
|
291
298
|
}
|
|
292
299
|
}
|
|
293
300
|
} catch (e) {
|
|
@@ -416,14 +423,14 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
416
423
|
}
|
|
417
424
|
});
|
|
418
425
|
_defineProperty(this, "attachAbortListeners", function () {
|
|
419
|
-
var
|
|
426
|
+
var _window5;
|
|
420
427
|
_this.detachAbortListeners();
|
|
421
428
|
var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
|
|
422
|
-
if ((
|
|
423
|
-
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (
|
|
424
|
-
var
|
|
425
|
-
key =
|
|
426
|
-
time =
|
|
429
|
+
if ((_window5 = window) !== null && _window5 !== void 0 && _window5.__SSR_ABORT_LISTENERS__) {
|
|
430
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref9) {
|
|
431
|
+
var _ref0 = _slicedToArray(_ref9, 2),
|
|
432
|
+
key = _ref0[0],
|
|
433
|
+
time = _ref0[1];
|
|
427
434
|
if (time) {
|
|
428
435
|
_this.abortReasonCallback(key, time);
|
|
429
436
|
}
|
|
@@ -453,8 +460,8 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
453
460
|
}
|
|
454
461
|
return _createClass(VCObserver, [{
|
|
455
462
|
key: "start",
|
|
456
|
-
value: function start(
|
|
457
|
-
var startTime =
|
|
463
|
+
value: function start(_ref1) {
|
|
464
|
+
var startTime = _ref1.startTime;
|
|
458
465
|
this.active = true;
|
|
459
466
|
if (this.observers.isBrowserSupported()) {
|
|
460
467
|
this.setViewportSize();
|
|
@@ -476,12 +483,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
476
483
|
}, {
|
|
477
484
|
key: "getIgnoredElements",
|
|
478
485
|
value: function getIgnoredElements(componentsLog) {
|
|
479
|
-
return Object.values(componentsLog).flat().filter(function (
|
|
480
|
-
var ignoreReason =
|
|
486
|
+
return Object.values(componentsLog).flat().filter(function (_ref10) {
|
|
487
|
+
var ignoreReason = _ref10.ignoreReason;
|
|
481
488
|
return Boolean(ignoreReason);
|
|
482
|
-
}).map(function (
|
|
483
|
-
var targetName =
|
|
484
|
-
ignoreReason =
|
|
489
|
+
}).map(function (_ref11) {
|
|
490
|
+
var targetName = _ref11.targetName,
|
|
491
|
+
ignoreReason = _ref11.ignoreReason;
|
|
485
492
|
return {
|
|
486
493
|
targetName: targetName,
|
|
487
494
|
ignoreReason: ignoreReason
|
|
@@ -611,13 +618,13 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
611
618
|
}
|
|
612
619
|
}, {
|
|
613
620
|
key: "calculateVC",
|
|
614
|
-
value: function calculateVC(
|
|
615
|
-
var heatmap =
|
|
616
|
-
|
|
617
|
-
ssr =
|
|
618
|
-
componentsLog =
|
|
619
|
-
viewport =
|
|
620
|
-
fixSSRAttribution =
|
|
621
|
+
value: function calculateVC(_ref12) {
|
|
622
|
+
var heatmap = _ref12.heatmap,
|
|
623
|
+
_ref12$ssr = _ref12.ssr,
|
|
624
|
+
ssr = _ref12$ssr === void 0 ? UNUSED_SECTOR : _ref12$ssr,
|
|
625
|
+
componentsLog = _ref12.componentsLog,
|
|
626
|
+
viewport = _ref12.viewport,
|
|
627
|
+
fixSSRAttribution = _ref12.fixSSRAttribution;
|
|
621
628
|
var lastUpdate = {};
|
|
622
629
|
var totalPainted = 0;
|
|
623
630
|
var ssrTime = fixSSRAttribution ? Math.floor(ssr) : ssr;
|
|
@@ -684,11 +691,11 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
684
691
|
});
|
|
685
692
|
return VCRatio;
|
|
686
693
|
}, 0);
|
|
687
|
-
var VCEntries = entries.reduce(function (acc,
|
|
694
|
+
var VCEntries = entries.reduce(function (acc, _ref13, i) {
|
|
688
695
|
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
689
|
-
var
|
|
690
|
-
timestamp =
|
|
691
|
-
entryPainted =
|
|
696
|
+
var _ref14 = _slicedToArray(_ref13, 2),
|
|
697
|
+
timestamp = _ref14[0],
|
|
698
|
+
entryPainted = _ref14[1];
|
|
692
699
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
693
700
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
694
701
|
var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
|
|
@@ -9,6 +9,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
9
9
|
import EntriesTimeline from './entries-timeline';
|
|
10
10
|
import _getElementName from './get-element-name';
|
|
11
11
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
12
|
+
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
13
|
+
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
12
14
|
import ViewportObserver from './viewport-observer';
|
|
13
15
|
import WindowEventObserver from './window-event-observer';
|
|
14
16
|
var DEFAULT_SELECTOR_CONFIG = {
|
|
@@ -111,6 +113,31 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
111
113
|
(_this$viewportObserve2 = this.viewportObserver) === null || _this$viewportObserve2 === void 0 || _this$viewportObserve2.stop();
|
|
112
114
|
(_this$windowEventObse2 = this.windowEventObserver) === null || _this$windowEventObse2 === void 0 || _this$windowEventObse2.stop();
|
|
113
115
|
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "addSSR",
|
|
118
|
+
value: function addSSR(ssr) {
|
|
119
|
+
this.entriesTimeline.push({
|
|
120
|
+
time: ssr,
|
|
121
|
+
data: {
|
|
122
|
+
elementName: 'SSR',
|
|
123
|
+
type: 'mutation:element',
|
|
124
|
+
rect: {
|
|
125
|
+
height: getViewportHeight(),
|
|
126
|
+
width: getViewportWidth(),
|
|
127
|
+
left: 0,
|
|
128
|
+
top: 0,
|
|
129
|
+
x: 0,
|
|
130
|
+
y: 0,
|
|
131
|
+
bottom: getViewportHeight(),
|
|
132
|
+
right: getViewportWidth(),
|
|
133
|
+
toJSON: function toJSON() {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
visible: true
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
114
141
|
}, {
|
|
115
142
|
key: "getVCResult",
|
|
116
143
|
value: function () {
|
|
@@ -123,11 +150,14 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
123
150
|
results = [];
|
|
124
151
|
this.addStartEntry(start);
|
|
125
152
|
calculator_fy25_03 = new VCCalculator_FY25_03();
|
|
153
|
+
if (param.ssr) {
|
|
154
|
+
this.addSSR(param.ssr);
|
|
155
|
+
}
|
|
126
156
|
orderedEntries = this.entriesTimeline.getOrderedEntries({
|
|
127
157
|
start: start,
|
|
128
158
|
stop: stop
|
|
129
159
|
});
|
|
130
|
-
_context.next =
|
|
160
|
+
_context.next = 8;
|
|
131
161
|
return calculator_fy25_03.calculate({
|
|
132
162
|
orderedEntries: orderedEntries,
|
|
133
163
|
startTime: start,
|
|
@@ -135,13 +165,13 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
135
165
|
interactionId: interactionId,
|
|
136
166
|
isPostInteraction: this.isPostInteraction
|
|
137
167
|
});
|
|
138
|
-
case
|
|
168
|
+
case 8:
|
|
139
169
|
fy25_03 = _context.sent;
|
|
140
170
|
if (fy25_03) {
|
|
141
171
|
results.push(fy25_03);
|
|
142
172
|
}
|
|
143
173
|
return _context.abrupt("return", results);
|
|
144
|
-
case
|
|
174
|
+
case 11:
|
|
145
175
|
case "end":
|
|
146
176
|
return _context.stop();
|
|
147
177
|
}
|
|
@@ -73,7 +73,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
73
73
|
key: "calculateWithDebugInfo",
|
|
74
74
|
value: function () {
|
|
75
75
|
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
|
|
76
|
-
var
|
|
76
|
+
var _window, _window3;
|
|
77
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, v3RevisionDebugDetails, _window2, _window2$__ufo_devtoo, _window4, _window4$__on_ufo_vc_;
|
|
77
78
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
78
79
|
while (1) switch (_context.prev = _context.next) {
|
|
79
80
|
case 0:
|
|
@@ -163,25 +164,32 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
163
164
|
previousResult = vcDetails["".concat(percentile)];
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
v3RevisionDebugDetails = {
|
|
168
|
+
revision: this.revisionNo,
|
|
169
|
+
isClean: isVCClean,
|
|
170
|
+
abortReason: dirtyReason,
|
|
171
|
+
vcLogs: vcLogs,
|
|
172
|
+
interactionId: interactionId
|
|
173
|
+
}; // Handle devtool callback
|
|
174
|
+
if (!isPostInteraction && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function') {
|
|
169
175
|
try {
|
|
170
|
-
(
|
|
171
|
-
revision: this.revisionNo,
|
|
172
|
-
isClean: isVCClean,
|
|
173
|
-
abortReason: dirtyReason,
|
|
174
|
-
vcLogs: vcLogs,
|
|
175
|
-
interactionId: interactionId
|
|
176
|
-
});
|
|
176
|
+
(_window2 = window) === null || _window2 === void 0 || (_window2$__ufo_devtoo = _window2.__ufo_devtool_onVCRevisionReady__) === null || _window2$__ufo_devtoo === void 0 || _window2$__ufo_devtoo.call(_window2, v3RevisionDebugDetails);
|
|
177
177
|
} catch (e) {
|
|
178
178
|
// if any error communicating with devtool, we don't want to break the app
|
|
179
179
|
// eslint-disable-next-line no-console
|
|
180
180
|
console.error('Error in onVCRevisionReady', e);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
+
if (!isPostInteraction && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__on_ufo_vc_debug_data_ready) === 'function' && fg('platform_ufo_emit_vc_debug_data')) {
|
|
184
|
+
try {
|
|
185
|
+
(_window4 = window) === null || _window4 === void 0 || (_window4$__on_ufo_vc_ = _window4.__on_ufo_vc_debug_data_ready) === null || _window4$__on_ufo_vc_ === void 0 || _window4$__on_ufo_vc_.call(_window4, v3RevisionDebugDetails);
|
|
186
|
+
} catch (e) {
|
|
187
|
+
// eslint-disable-next-line no-console
|
|
188
|
+
console.error('Error in onVCRevisionReady', e);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
183
191
|
return _context.abrupt("return", vcDetails);
|
|
184
|
-
case
|
|
192
|
+
case 34:
|
|
185
193
|
case "end":
|
|
186
194
|
return _context.stop();
|
|
187
195
|
}
|
|
@@ -195,7 +203,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
195
203
|
}, {
|
|
196
204
|
key: "calculate",
|
|
197
205
|
value: function () {
|
|
198
|
-
var _calculate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
|
206
|
+
var _calculate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref) {
|
|
199
207
|
var _this = this,
|
|
200
208
|
_vcDetails$90$t,
|
|
201
209
|
_vcDetails$;
|
|
@@ -203,7 +211,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
203
211
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
204
212
|
while (1) switch (_context2.prev = _context2.next) {
|
|
205
213
|
case 0:
|
|
206
|
-
startTime =
|
|
214
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction;
|
|
207
215
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
208
216
|
return _this.isEntryIncluded(entry);
|
|
209
217
|
});
|
|
@@ -74,6 +74,7 @@ export type Config = {
|
|
|
74
74
|
readonly ssr?: boolean;
|
|
75
75
|
readonly ssrWhitelist?: string[];
|
|
76
76
|
readonly ssrEnablePageLayoutPlaceholder?: boolean;
|
|
77
|
+
readonly includeSSRInV3?: boolean;
|
|
77
78
|
readonly stopVCAtInteractionFinish?: boolean;
|
|
78
79
|
readonly includeSSRRatio?: boolean;
|
|
79
80
|
/**
|
package/dist/types/vc/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VCRawDataType, VCResult } from '../common/vc/types';
|
|
2
2
|
import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from './types';
|
|
3
|
+
export type { VCRevisionDebugDetails } from './vc-observer/getVCRevisionDebugDetails';
|
|
3
4
|
declare global {
|
|
4
5
|
var __vcObserver: VCObserverInterface;
|
|
5
6
|
}
|
package/dist/types/vc/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ComponentsLogType, VCEntryType } from '../../common/vc/types';
|
|
1
|
+
import type { ComponentsLogType, VCAbortReason, VCEntryType } from '../../common/vc/types';
|
|
2
2
|
import type { VCObserverEntryType } from '../vc-observer-new/types';
|
|
3
|
-
interface VCRevisionDebugDetails {
|
|
3
|
+
export interface VCRevisionDebugDetails {
|
|
4
4
|
revision: string;
|
|
5
5
|
isClean: boolean;
|
|
6
|
-
abortReason
|
|
6
|
+
abortReason?: VCAbortReason | null;
|
|
7
7
|
vcLogs: Array<{
|
|
8
8
|
time: number;
|
|
9
9
|
viewportPercentage: number;
|
|
@@ -22,9 +22,8 @@ interface VCRevisionDebugDetails {
|
|
|
22
22
|
export declare function getVCRevisionDebugDetails({ revision, isClean, abortReason, VCEntries, componentsLog, interactionId, }: {
|
|
23
23
|
revision: string;
|
|
24
24
|
isClean: boolean;
|
|
25
|
-
abortReason
|
|
25
|
+
abortReason?: VCAbortReason | null;
|
|
26
26
|
VCEntries: VCEntryType[];
|
|
27
27
|
componentsLog: ComponentsLogType;
|
|
28
28
|
interactionId?: string;
|
|
29
29
|
}): VCRevisionDebugDetails;
|
|
30
|
-
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { type UnbindFn } from 'bind-event-listener';
|
|
2
2
|
import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
3
3
|
import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
|
|
4
|
+
import { VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
|
|
4
5
|
import { Observers } from './observers';
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
__ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
9
|
+
__on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
5
12
|
export declare class VCObserver implements VCObserverInterface {
|
|
6
13
|
abortReason: VCAbortReasonType;
|
|
7
14
|
outOfBoundaryInfo: string;
|
|
@@ -16,6 +16,7 @@ export default class VCObserverNew {
|
|
|
16
16
|
startTime: DOMHighResTimeStamp;
|
|
17
17
|
}): void;
|
|
18
18
|
stop(): void;
|
|
19
|
+
addSSR(ssr: number): void;
|
|
19
20
|
getVCResult(param: VCObserverGetVCResultParam): Promise<RevisionPayloadEntry[]>;
|
|
20
21
|
private addStartEntry;
|
|
21
22
|
private getElementName;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
|
|
2
|
+
import { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
|
|
2
3
|
import type { VCObserverEntry } from '../types';
|
|
3
4
|
import type { VCCalculator, VCCalculatorParam } from './types';
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
__ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
8
|
+
__on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
4
11
|
export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
5
12
|
private revisionNo;
|
|
6
13
|
constructor(revisionNo: string);
|
|
@@ -74,6 +74,7 @@ export type Config = {
|
|
|
74
74
|
readonly ssr?: boolean;
|
|
75
75
|
readonly ssrWhitelist?: string[];
|
|
76
76
|
readonly ssrEnablePageLayoutPlaceholder?: boolean;
|
|
77
|
+
readonly includeSSRInV3?: boolean;
|
|
77
78
|
readonly stopVCAtInteractionFinish?: boolean;
|
|
78
79
|
readonly includeSSRRatio?: boolean;
|
|
79
80
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VCRawDataType, VCResult } from '../common/vc/types';
|
|
2
2
|
import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from './types';
|
|
3
|
+
export type { VCRevisionDebugDetails } from './vc-observer/getVCRevisionDebugDetails';
|
|
3
4
|
declare global {
|
|
4
5
|
var __vcObserver: VCObserverInterface;
|
|
5
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ComponentsLogType, VCEntryType } from '../../common/vc/types';
|
|
1
|
+
import type { ComponentsLogType, VCAbortReason, VCEntryType } from '../../common/vc/types';
|
|
2
2
|
import type { VCObserverEntryType } from '../vc-observer-new/types';
|
|
3
|
-
interface VCRevisionDebugDetails {
|
|
3
|
+
export interface VCRevisionDebugDetails {
|
|
4
4
|
revision: string;
|
|
5
5
|
isClean: boolean;
|
|
6
|
-
abortReason
|
|
6
|
+
abortReason?: VCAbortReason | null;
|
|
7
7
|
vcLogs: Array<{
|
|
8
8
|
time: number;
|
|
9
9
|
viewportPercentage: number;
|
|
@@ -22,9 +22,8 @@ interface VCRevisionDebugDetails {
|
|
|
22
22
|
export declare function getVCRevisionDebugDetails({ revision, isClean, abortReason, VCEntries, componentsLog, interactionId, }: {
|
|
23
23
|
revision: string;
|
|
24
24
|
isClean: boolean;
|
|
25
|
-
abortReason
|
|
25
|
+
abortReason?: VCAbortReason | null;
|
|
26
26
|
VCEntries: VCEntryType[];
|
|
27
27
|
componentsLog: ComponentsLogType;
|
|
28
28
|
interactionId?: string;
|
|
29
29
|
}): VCRevisionDebugDetails;
|
|
30
|
-
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { type UnbindFn } from 'bind-event-listener';
|
|
2
2
|
import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
3
3
|
import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
|
|
4
|
+
import { VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
|
|
4
5
|
import { Observers } from './observers';
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
__ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
9
|
+
__on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
5
12
|
export declare class VCObserver implements VCObserverInterface {
|
|
6
13
|
abortReason: VCAbortReasonType;
|
|
7
14
|
outOfBoundaryInfo: string;
|
|
@@ -16,6 +16,7 @@ export default class VCObserverNew {
|
|
|
16
16
|
startTime: DOMHighResTimeStamp;
|
|
17
17
|
}): void;
|
|
18
18
|
stop(): void;
|
|
19
|
+
addSSR(ssr: number): void;
|
|
19
20
|
getVCResult(param: VCObserverGetVCResultParam): Promise<RevisionPayloadEntry[]>;
|
|
20
21
|
private addStartEntry;
|
|
21
22
|
private getElementName;
|
package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
|
|
2
|
+
import { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
|
|
2
3
|
import type { VCObserverEntry } from '../types';
|
|
3
4
|
import type { VCCalculator, VCCalculatorParam } from './types';
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
__ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
8
|
+
__on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
4
11
|
export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
5
12
|
private revisionNo;
|
|
6
13
|
constructor(revisionNo: string);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.18",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -133,6 +133,9 @@
|
|
|
133
133
|
"platform_ufo_report_cpu_usage": {
|
|
134
134
|
"type": "boolean"
|
|
135
135
|
},
|
|
136
|
+
"platform_ufo_emit_vc_debug_data": {
|
|
137
|
+
"type": "boolean"
|
|
138
|
+
},
|
|
136
139
|
"ufo_return_relative_request_start": {
|
|
137
140
|
"type": "boolean"
|
|
138
141
|
},
|
|
@@ -159,6 +162,9 @@
|
|
|
159
162
|
},
|
|
160
163
|
"platform_ufo_rev_ratios": {
|
|
161
164
|
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"platform_ufo_ssr_size_field": {
|
|
167
|
+
"type": "boolean"
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
170
|
}
|