@atlaskit/react-ufo 4.11.2 → 4.11.4
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 +14 -0
- package/dist/cjs/create-interaction-extra-metrics-payload/index.js +58 -11
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +1 -0
- package/dist/cjs/interaction-metrics/index.js +7 -6
- package/dist/cjs/interaction-metrics/interaction-extra-metrics.js +17 -10
- package/dist/cjs/interaction-metrics-init/index.js +2 -2
- package/dist/cjs/segment/segment.js +3 -19
- package/dist/cjs/vc/index.js +8 -4
- package/dist/cjs/vc/vc-observer-new/index.js +4 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +46 -30
- package/dist/es2019/create-interaction-extra-metrics-payload/index.js +40 -5
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -1
- package/dist/es2019/interaction-metrics/index.js +7 -5
- package/dist/es2019/interaction-metrics/interaction-extra-metrics.js +14 -9
- package/dist/es2019/interaction-metrics-init/index.js +2 -2
- package/dist/es2019/segment/segment.js +2 -12
- package/dist/es2019/vc/index.js +7 -1
- package/dist/es2019/vc/vc-observer-new/index.js +3 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +17 -3
- package/dist/esm/create-interaction-extra-metrics-payload/index.js +58 -11
- package/dist/esm/create-payload/utils/get-vc-metrics.js +2 -1
- package/dist/esm/interaction-metrics/index.js +7 -6
- package/dist/esm/interaction-metrics/interaction-extra-metrics.js +17 -10
- package/dist/esm/interaction-metrics-init/index.js +2 -2
- package/dist/esm/segment/segment.js +2 -16
- package/dist/esm/vc/index.js +8 -4
- package/dist/esm/vc/vc-observer-new/index.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +46 -30
- package/dist/types/common/vc/types.d.ts +5 -0
- package/dist/types/config/index.d.ts +4 -0
- package/dist/types/create-interaction-extra-metrics-payload/index.d.ts +9 -1
- package/dist/types/interaction-metrics/interaction-extra-metrics.d.ts +6 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +1 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +5 -0
- package/dist/types-ts4.5/config/index.d.ts +4 -0
- package/dist/types-ts4.5/create-interaction-extra-metrics-payload/index.d.ts +9 -1
- package/dist/types-ts4.5/interaction-metrics/interaction-extra-metrics.d.ts +6 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -0
- package/package.json +4 -1
- package/dist/cjs/segment/segment-highlight.js +0 -39
- package/dist/es2019/segment/segment-highlight.js +0 -27
- package/dist/esm/segment/segment-highlight.js +0 -30
- package/dist/types/segment/segment-highlight.d.ts +0 -6
- package/dist/types-ts4.5/segment/segment-highlight.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.11.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0e311a2eaf943`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e311a2eaf943) -
|
|
8
|
+
Fixed reporting ssrRatio in v3
|
|
9
|
+
|
|
10
|
+
## 4.11.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`be9b699c35606`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be9b699c35606) -
|
|
15
|
+
deprecate UFO segment highlighting
|
|
16
|
+
|
|
3
17
|
## 4.11.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -31,13 +31,13 @@ var _interactionMetrics = require("../interaction-metrics");
|
|
|
31
31
|
var _excluded = ["labelStack"];
|
|
32
32
|
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; }
|
|
33
33
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
34
|
-
function createInteractionExtraLogPayload(_x, _x2) {
|
|
34
|
+
function createInteractionExtraLogPayload(_x, _x2, _x3, _x4) {
|
|
35
35
|
return _createInteractionExtraLogPayload.apply(this, arguments);
|
|
36
36
|
}
|
|
37
37
|
function _createInteractionExtraLogPayload() {
|
|
38
|
-
_createInteractionExtraLogPayload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interactionId, interaction) {
|
|
39
|
-
var _getTTAI, _window$location;
|
|
40
|
-
var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, knownSegments, sanitisedUfoName, configRate, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, vcRevisionPayload, effectiveVCRevisionPayload, isThirdParty, filteredData, getDetailedInteractionMetrics, segments3p, segmentTree, payload;
|
|
38
|
+
_createInteractionExtraLogPayload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interactionId, interaction, lastInteractionFinish, lastInteractionFinishVCResult) {
|
|
39
|
+
var _getTTAI, _lastInteractionFinis, _getTTAI2, _window$location;
|
|
40
|
+
var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, knownSegments, minorInteractions, sanitisedUfoName, configRate, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, vcRevisionPayload, effectiveVCRevisionPayload, normalTTAI, lastInteractionFinishStart, lastInteractionFinishEnd, lastInteractionFinishVC90, lastInteractionFinishVCClean, lastInteractionFinishVCRev, lastInteractionFinishRevision, isThirdParty, filteredData, getDetailedInteractionMetrics, segments3p, segmentTree, payload;
|
|
41
41
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
42
42
|
while (1) switch (_context.prev = _context.next) {
|
|
43
43
|
case 0:
|
|
@@ -48,7 +48,7 @@ function _createInteractionExtraLogPayload() {
|
|
|
48
48
|
}
|
|
49
49
|
throw Error('UFO Configuration not provided');
|
|
50
50
|
case 3:
|
|
51
|
-
end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName, knownSegments = interaction.knownSegments;
|
|
51
|
+
end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName, knownSegments = interaction.knownSegments, minorInteractions = interaction.minorInteractions;
|
|
52
52
|
sanitisedUfoName = (0, _utils.sanitizeUfoName)(ufoName);
|
|
53
53
|
configRate = (0, _config.getExtraInteractionRate)(sanitisedUfoName, type);
|
|
54
54
|
if ((0, _coinflip.default)(configRate)) {
|
|
@@ -59,7 +59,7 @@ function _createInteractionExtraLogPayload() {
|
|
|
59
59
|
case 8:
|
|
60
60
|
pageVisibilityAtTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
61
61
|
isPageLoad = type === 'page_load' || type === 'transition';
|
|
62
|
-
if (isPageLoad) {
|
|
62
|
+
if (!(!isPageLoad || minorInteractions !== undefined && minorInteractions.length > 0)) {
|
|
63
63
|
_context.next = 12;
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
@@ -85,6 +85,46 @@ function _createInteractionExtraLogPayload() {
|
|
|
85
85
|
}
|
|
86
86
|
return _context.abrupt("return", null);
|
|
87
87
|
case 23:
|
|
88
|
+
if (!(!lastInteractionFinish || lastInteractionFinish !== null && lastInteractionFinish !== void 0 && lastInteractionFinish.abortReason || lastInteractionFinish !== null && lastInteractionFinish !== void 0 && (_lastInteractionFinis = lastInteractionFinish.errors) !== null && _lastInteractionFinis !== void 0 && _lastInteractionFinis.length)) {
|
|
89
|
+
_context.next = 25;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return _context.abrupt("return", null);
|
|
93
|
+
case 25:
|
|
94
|
+
normalTTAI = (_getTTAI2 = (0, _getTtai.default)(lastInteractionFinish)) !== null && _getTTAI2 !== void 0 ? _getTTAI2 : undefined;
|
|
95
|
+
lastInteractionFinishStart = typeof lastInteractionFinish.start === 'number' ? Math.round(lastInteractionFinish.start) : undefined;
|
|
96
|
+
lastInteractionFinishEnd = typeof lastInteractionFinish.end === 'number' ? Math.round(lastInteractionFinish.end) : undefined;
|
|
97
|
+
lastInteractionFinishVC90 = null;
|
|
98
|
+
lastInteractionFinishVCClean = false;
|
|
99
|
+
if (!lastInteractionFinishVCResult) {
|
|
100
|
+
_context.next = 41;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
lastInteractionFinishVCRev = lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
104
|
+
lastInteractionFinishRevision = lastInteractionFinishVCRev === null || lastInteractionFinishVCRev === void 0 ? void 0 : lastInteractionFinishVCRev.find(function (_ref2) {
|
|
105
|
+
var revision = _ref2.revision;
|
|
106
|
+
return revision === _config.DEFAULT_TTVC_REVISION;
|
|
107
|
+
});
|
|
108
|
+
if (!(lastInteractionFinishRevision !== null && lastInteractionFinishRevision !== void 0 && lastInteractionFinishRevision.clean)) {
|
|
109
|
+
_context.next = 38;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
lastInteractionFinishVCClean = true;
|
|
113
|
+
lastInteractionFinishVC90 = lastInteractionFinishRevision['metric:vc90'];
|
|
114
|
+
_context.next = 39;
|
|
115
|
+
break;
|
|
116
|
+
case 38:
|
|
117
|
+
return _context.abrupt("return", null);
|
|
118
|
+
case 39:
|
|
119
|
+
_context.next = 42;
|
|
120
|
+
break;
|
|
121
|
+
case 41:
|
|
122
|
+
if (normalTTAI !== undefined && typeof normalTTAI === 'number' && normalTTAI === extraTTAI) {
|
|
123
|
+
// Because TTAI is equal between with and without 3p, we can assume VC90 is also equal
|
|
124
|
+
lastInteractionFinishVC90 = effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90'];
|
|
125
|
+
lastInteractionFinishVCClean = effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload.clean;
|
|
126
|
+
}
|
|
127
|
+
case 42:
|
|
88
128
|
// Helper function to check if labelStack contains third-party type
|
|
89
129
|
isThirdParty = function isThirdParty(labelStack) {
|
|
90
130
|
var _labelStack$some;
|
|
@@ -127,9 +167,9 @@ function _createInteractionExtraLogPayload() {
|
|
|
127
167
|
getDetailedInteractionMetrics = function getDetailedInteractionMetrics() {
|
|
128
168
|
var _interaction$hold3pIn;
|
|
129
169
|
return {
|
|
130
|
-
errors: filteredData.errors.map(function (
|
|
131
|
-
var labelStack =
|
|
132
|
-
others = (0, _objectWithoutProperties2.default)(
|
|
170
|
+
errors: filteredData.errors.map(function (_ref3) {
|
|
171
|
+
var labelStack = _ref3.labelStack,
|
|
172
|
+
others = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
133
173
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
134
174
|
labelStack: labelStack && (0, _utils.optimizeLabelStack)(labelStack, (0, _getReactUfoPayloadVersion.getReactUFOPayloadVersion)(interaction.type))
|
|
135
175
|
});
|
|
@@ -190,13 +230,20 @@ function _createInteractionExtraLogPayload() {
|
|
|
190
230
|
reactProfilerTimings: (0, _optimizeReactProfilerTimings.optimizeReactProfilerTimings)(filteredData.reactProfilerTimings, start, (0, _getReactUfoPayloadVersion.getReactUFOPayloadVersion)(interaction.type)),
|
|
191
231
|
customData: filteredData.customData
|
|
192
232
|
}, getDetailedInteractionMetrics()),
|
|
193
|
-
'vc:effective:revision': _config.DEFAULT_TTVC_REVISION
|
|
233
|
+
'vc:effective:revision': _config.DEFAULT_TTVC_REVISION,
|
|
234
|
+
lastInteractionFinish: {
|
|
235
|
+
start: lastInteractionFinishStart,
|
|
236
|
+
end: lastInteractionFinishEnd,
|
|
237
|
+
ttai: normalTTAI,
|
|
238
|
+
vc90: lastInteractionFinishVC90,
|
|
239
|
+
vcClean: lastInteractionFinishVCClean
|
|
240
|
+
}
|
|
194
241
|
}
|
|
195
242
|
}
|
|
196
243
|
};
|
|
197
244
|
payload.attributes.properties['event:sizeInKb'] = (0, _getPayloadSize.default)(payload.attributes.properties);
|
|
198
245
|
return _context.abrupt("return", payload);
|
|
199
|
-
case
|
|
246
|
+
case 51:
|
|
200
247
|
case "end":
|
|
201
248
|
return _context.stop();
|
|
202
249
|
}
|
|
@@ -97,6 +97,7 @@ function _getVCMetrics() {
|
|
|
97
97
|
if (!include3p) {
|
|
98
98
|
// For Post Interaction, last interaction should be without 3p
|
|
99
99
|
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
100
|
+
_interactionMetrics.interactionExtraMetrics.setLastInteractionFinishVCResult(result);
|
|
100
101
|
}
|
|
101
102
|
mostRecentVCRevision = (0, _config.getMostRecentVCRevision)(interaction.ufoName);
|
|
102
103
|
mostRecentVCRevisionPayload = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
|
|
@@ -734,7 +734,8 @@ function finishInteraction(id, data) {
|
|
|
734
734
|
PreviousInteractionLog.isAborted = data.abortReason != null;
|
|
735
735
|
if (data.ufoName) {
|
|
736
736
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
737
|
-
|
|
737
|
+
var _interactionExtraMetr;
|
|
738
|
+
if (((_interactionExtraMetr = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr === void 0 ? void 0 : _interactionExtraMetr.id) !== id) {
|
|
738
739
|
// If this same interaction was not already handled, handle it
|
|
739
740
|
handleInteraction(id, data);
|
|
740
741
|
}
|
|
@@ -819,7 +820,7 @@ function tryComplete(interactionId, endTime) {
|
|
|
819
820
|
var postInteraction = /*#__PURE__*/function () {
|
|
820
821
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
821
822
|
var _getConfig7;
|
|
822
|
-
var _getConfig8, experimentalVC90, experimentalTTAI, _yield$getExperimenta, start, end, _getConfig9, _getConfig0;
|
|
823
|
+
var _getConfig8, experimentalVC90, experimentalTTAI, _yield$getExperimenta, start, end, _interactionExtraMetr2, _getConfig9, _getConfig0;
|
|
823
824
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
824
825
|
while (1) switch (_context.prev = _context.next) {
|
|
825
826
|
case 0:
|
|
@@ -862,7 +863,7 @@ function tryComplete(interactionId, endTime) {
|
|
|
862
863
|
}));
|
|
863
864
|
case 17:
|
|
864
865
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
865
|
-
if (interactionExtraMetrics.
|
|
866
|
+
if (((_interactionExtraMetr2 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr2 === void 0 ? void 0 : _interactionExtraMetr2.id) !== interactionId) {
|
|
866
867
|
// If interactionExtraMetrics is not waiting for measuring this interaction
|
|
867
868
|
if ((_getConfig9 = (0, _config.getConfig)()) !== null && _getConfig9 !== void 0 && (_getConfig9 = _getConfig9.experimentalInteractionMetrics) !== null && _getConfig9 !== void 0 && _getConfig9.enabled) {
|
|
868
869
|
remove(interactionId);
|
|
@@ -885,15 +886,15 @@ function tryComplete(interactionId, endTime) {
|
|
|
885
886
|
};
|
|
886
887
|
}();
|
|
887
888
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
888
|
-
var _interaction$hold3pAc;
|
|
889
|
+
var _interaction$hold3pAc, _interactionExtraMetr3;
|
|
889
890
|
var noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
|
|
890
|
-
if (noMoreActiveHolds && interactionExtraMetrics.
|
|
891
|
+
if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
|
|
891
892
|
// If it's not waiting for extra metrics to complete, finish the interaction as normal
|
|
892
893
|
if (!activeSubmitted) {
|
|
893
894
|
var _getConfig1, _getConfig10, _getConfig11;
|
|
894
895
|
finishInteraction(interactionId, interaction, endTime);
|
|
895
896
|
if ((_getConfig1 = (0, _config.getConfig)()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.extraInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
|
|
896
|
-
interactionExtraMetrics.
|
|
897
|
+
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
897
898
|
}
|
|
898
899
|
if ((_getConfig10 = (0, _config.getConfig)()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10 !== void 0 && _getConfig10.enabled && interaction.ufoName === ((_getConfig11 = (0, _config.getConfig)()) === null || _getConfig11 === void 0 || (_getConfig11 = _getConfig11.extraSearchPageInteraction) === null || _getConfig11 === void 0 ? void 0 : _getConfig11.searchPageMetricName) && (0, _platformFeatureFlags.fg)('react_ufo_unified_search_ignoring_sain_metric')) {
|
|
899
900
|
(0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
|
|
@@ -16,8 +16,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
var InteractionExtraMetrics = exports.default = /*#__PURE__*/function () {
|
|
17
17
|
function InteractionExtraMetrics() {
|
|
18
18
|
(0, _classCallCheck2.default)(this, InteractionExtraMetrics);
|
|
19
|
-
// Store the finished interaction
|
|
20
|
-
(0, _defineProperty2.default)(this, "
|
|
19
|
+
// Store the finished interaction (as non-3p interaction)
|
|
20
|
+
(0, _defineProperty2.default)(this, "finishedInteraction", null);
|
|
21
21
|
// independent VC observer, that observes until `custom.post-interaction-logs` event is sent
|
|
22
22
|
(0, _defineProperty2.default)(this, "vcObserver", null);
|
|
23
23
|
(0, _defineProperty2.default)(this, "sinkHandlerFn", function () {});
|
|
@@ -55,12 +55,17 @@ var InteractionExtraMetrics = exports.default = /*#__PURE__*/function () {
|
|
|
55
55
|
return (interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'page_load' || (interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'transition';
|
|
56
56
|
}
|
|
57
57
|
}, {
|
|
58
|
-
key: "
|
|
59
|
-
value: function
|
|
60
|
-
if (
|
|
61
|
-
this.
|
|
58
|
+
key: "updateFinishedInteraction",
|
|
59
|
+
value: function updateFinishedInteraction(interaction) {
|
|
60
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'page_load' || (interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'transition') {
|
|
61
|
+
this.finishedInteraction = interaction;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "setLastInteractionFinishVCResult",
|
|
66
|
+
value: function setLastInteractionFinishVCResult(result) {
|
|
67
|
+
this.lastInteractionFinishVCResult = result;
|
|
68
|
+
}
|
|
64
69
|
}, {
|
|
65
70
|
key: "sinkHandler",
|
|
66
71
|
value: function sinkHandler(fn) {
|
|
@@ -74,7 +79,7 @@ var InteractionExtraMetrics = exports.default = /*#__PURE__*/function () {
|
|
|
74
79
|
var updatedData = _objectSpread(_objectSpread({}, data), {}, {
|
|
75
80
|
vcObserver: (_this$vcObserver3 = this.vcObserver) !== null && _this$vcObserver3 !== void 0 ? _this$vcObserver3 : undefined
|
|
76
81
|
});
|
|
77
|
-
this.sinkHandlerFn(id, updatedData);
|
|
82
|
+
this.sinkHandlerFn(id, updatedData, this.finishedInteraction, this.lastInteractionFinishVCResult);
|
|
78
83
|
}
|
|
79
84
|
this.stopVCObserver();
|
|
80
85
|
(0, _index.remove)(id);
|
|
@@ -83,11 +88,13 @@ var InteractionExtraMetrics = exports.default = /*#__PURE__*/function () {
|
|
|
83
88
|
}, {
|
|
84
89
|
key: "reset",
|
|
85
90
|
value: function reset() {
|
|
91
|
+
var _this$finishedInterac;
|
|
86
92
|
this.stopVCObserver();
|
|
87
|
-
if (this.
|
|
88
|
-
(0, _index.remove)(this.
|
|
93
|
+
if ((_this$finishedInterac = this.finishedInteraction) !== null && _this$finishedInterac !== void 0 && _this$finishedInterac.id) {
|
|
94
|
+
(0, _index.remove)(this.finishedInteraction.id);
|
|
89
95
|
}
|
|
90
|
-
this.
|
|
96
|
+
this.finishedInteraction = null;
|
|
97
|
+
this.lastInteractionFinishVCResult = undefined;
|
|
91
98
|
}
|
|
92
99
|
}, {
|
|
93
100
|
key: "stopAll",
|
|
@@ -82,14 +82,14 @@ function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function sinkInteractionExtraMetrics(instance, createInteractionExtraLogPayload) {
|
|
85
|
-
_interactionMetrics.interactionExtraMetrics.sinkHandler(function (interactionId, interaction) {
|
|
85
|
+
_interactionMetrics.interactionExtraMetrics.sinkHandler(function (interactionId, interaction, lastInteractionFinish, lastInteractionFinishVCResult) {
|
|
86
86
|
(0, _scheduleIdleCallback.default)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
87
87
|
var payload, devToolObserver;
|
|
88
88
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
89
89
|
while (1) switch (_context.prev = _context.next) {
|
|
90
90
|
case 0:
|
|
91
91
|
_context.next = 2;
|
|
92
|
-
return createInteractionExtraLogPayload(interactionId, interaction);
|
|
92
|
+
return createInteractionExtraLogPayload(interactionId, interaction, lastInteractionFinish, lastInteractionFinishVCResult);
|
|
93
93
|
case 2:
|
|
94
94
|
payload = _context.sent;
|
|
95
95
|
if (payload) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = UFOSegment;
|
|
8
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -21,24 +21,13 @@ var _interactionMetrics = require("../interaction-metrics");
|
|
|
21
21
|
var _routeNameContext = _interopRequireDefault(require("../route-name-context"));
|
|
22
22
|
var _shortId = _interopRequireDefault(require("../short-id"));
|
|
23
23
|
var _scheduleOnPaint = _interopRequireDefault(require("./schedule-on-paint"));
|
|
24
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
25
|
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; }
|
|
25
26
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
27
|
var tryCompleteHandle;
|
|
28
|
-
var AsyncSegmentHighlight = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
29
|
-
return Promise.resolve().then(function () {
|
|
30
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_ufo-segment-highlight" */'./segment-highlight'));
|
|
31
|
-
}).then(function (module) {
|
|
32
|
-
return {
|
|
33
|
-
default: module.SegmentHighlight
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
28
|
|
|
38
|
-
// KARL TODO: finish self profiling
|
|
39
29
|
/** A portion of the page we apply measurement to */
|
|
40
30
|
function UFOSegment(_ref) {
|
|
41
|
-
var _getConfig2;
|
|
42
31
|
var segmentName = _ref.name,
|
|
43
32
|
children = _ref.children,
|
|
44
33
|
_ref$mode = _ref.mode,
|
|
@@ -289,16 +278,11 @@ function UFOSegment(_ref) {
|
|
|
289
278
|
return l.name;
|
|
290
279
|
}).join('/');
|
|
291
280
|
}, [labelStack]);
|
|
292
|
-
var enableSegmentHighlighting = (_getConfig2 = (0, _config.getConfig)()) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.enableSegmentHighlighting;
|
|
293
281
|
return /*#__PURE__*/_react.default.createElement(_interactionContext.default.Provider, {
|
|
294
282
|
value: interactionContext
|
|
295
283
|
}, /*#__PURE__*/_react.default.createElement(_react.Profiler, {
|
|
296
284
|
id: reactProfilerId,
|
|
297
285
|
onRender: onRender
|
|
298
|
-
}, children
|
|
299
|
-
fallback: null
|
|
300
|
-
}, /*#__PURE__*/_react.default.createElement(AsyncSegmentHighlight, {
|
|
301
|
-
segmentName: segmentName
|
|
302
|
-
}))));
|
|
286
|
+
}, children));
|
|
303
287
|
}
|
|
304
288
|
UFOSegment.displayName = 'UFOSegment';
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -122,11 +122,11 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
122
122
|
value: function () {
|
|
123
123
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
124
124
|
var _this$oldVCObserver4, _this$newVCObserver3, _ref2;
|
|
125
|
-
var experienceKey, include3p, excludeSmartAnswersInSearch, v1v2Result, v3Result;
|
|
125
|
+
var experienceKey, include3p, excludeSmartAnswersInSearch, includeSSRRatio, v1v2Result, v3Result, ssrRatio;
|
|
126
126
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
127
|
while (1) switch (_context.prev = _context.next) {
|
|
128
128
|
case 0:
|
|
129
|
-
experienceKey = param.experienceKey, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
129
|
+
experienceKey = param.experienceKey, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch, includeSSRRatio = param.includeSSRRatio;
|
|
130
130
|
if (!((0, _config.isVCRevisionEnabled)('fy25.01', experienceKey) || (0, _config.isVCRevisionEnabled)('fy25.02', experienceKey))) {
|
|
131
131
|
_context.next = 7;
|
|
132
132
|
break;
|
|
@@ -153,6 +153,7 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
153
153
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
154
154
|
include3p: include3p,
|
|
155
155
|
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
156
|
+
includeSSRRatio: includeSSRRatio,
|
|
156
157
|
interactionType: param.interactionType,
|
|
157
158
|
isPageVisible: param.isPageVisible,
|
|
158
159
|
interactionAbortReason: param.interactionAbortReason
|
|
@@ -171,10 +172,13 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
171
172
|
}
|
|
172
173
|
return _context.abrupt("return", v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {});
|
|
173
174
|
case 19:
|
|
174
|
-
|
|
175
|
+
ssrRatio = v3Result[0].ssrRatio;
|
|
176
|
+
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, includeSSRRatio && ssrRatio !== undefined ? {
|
|
177
|
+
'ufo:vc:ssrRatio': ssrRatio
|
|
178
|
+
} : {}), v1v2Result), {}, {
|
|
175
179
|
'ufo:vc:rev': [].concat((0, _toConsumableArray2.default)((_ref2 = v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) !== null && _ref2 !== void 0 ? _ref2 : []), (0, _toConsumableArray2.default)(v3Result !== null && v3Result !== void 0 ? v3Result : []))
|
|
176
180
|
}));
|
|
177
|
-
case
|
|
181
|
+
case 21:
|
|
178
182
|
case "end":
|
|
179
183
|
return _context.stop();
|
|
180
184
|
}
|
|
@@ -238,11 +238,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
238
238
|
key: "getVCResult",
|
|
239
239
|
value: function () {
|
|
240
240
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
241
|
-
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
241
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
242
242
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
243
243
|
while (1) switch (_context.prev = _context.next) {
|
|
244
244
|
case 0:
|
|
245
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
245
|
+
start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, includeSSRRatio = param.includeSSRRatio, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
246
246
|
results = [];
|
|
247
247
|
this.addStartEntry(start);
|
|
248
248
|
calculator_fy25_03 = new _fy25_.default();
|
|
@@ -263,6 +263,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
263
263
|
isPostInteraction: this.isPostInteraction,
|
|
264
264
|
include3p: include3p,
|
|
265
265
|
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
266
|
+
includeSSRRatio: includeSSRRatio,
|
|
266
267
|
isPageVisible: isPageVisible,
|
|
267
268
|
interactionAbortReason: interactionAbortReason
|
|
268
269
|
});
|
|
@@ -287,6 +288,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
287
288
|
interactionType: interactionType,
|
|
288
289
|
isPostInteraction: this.isPostInteraction,
|
|
289
290
|
include3p: include3p,
|
|
291
|
+
includeSSRRatio: includeSSRRatio,
|
|
290
292
|
isPageVisible: isPageVisible,
|
|
291
293
|
interactionAbortReason: interactionAbortReason
|
|
292
294
|
});
|
|
@@ -108,9 +108,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
108
108
|
}, {
|
|
109
109
|
key: "calculateWithDebugInfo",
|
|
110
110
|
value: function () {
|
|
111
|
-
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
111
|
+
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio) {
|
|
112
112
|
var _window, _window2, _window6, _window8;
|
|
113
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
113
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, ssrRatio, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
114
114
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
115
115
|
while (1) switch (_context.prev = _context.next) {
|
|
116
116
|
case 0:
|
|
@@ -131,26 +131,34 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
131
131
|
vcDetails = {};
|
|
132
132
|
percentileIndex = 0;
|
|
133
133
|
entryDataBuffer = new Set();
|
|
134
|
+
ssrRatio = -1;
|
|
134
135
|
if (!vcLogs) {
|
|
135
|
-
_context.next =
|
|
136
|
+
_context.next = 30;
|
|
136
137
|
break;
|
|
137
138
|
}
|
|
138
139
|
_iterator4 = _createForOfIteratorHelper(vcLogs);
|
|
139
|
-
_context.prev =
|
|
140
|
+
_context.prev = 11;
|
|
140
141
|
_iterator4.s();
|
|
141
|
-
case
|
|
142
|
+
case 13:
|
|
142
143
|
if ((_step4 = _iterator4.n()).done) {
|
|
143
|
-
_context.next =
|
|
144
|
+
_context.next = 22;
|
|
144
145
|
break;
|
|
145
146
|
}
|
|
146
147
|
_entry3 = _step4.value;
|
|
147
|
-
time = _entry3.time, viewportPercentage = _entry3.viewportPercentage, entries = _entry3.entries;
|
|
148
|
+
time = _entry3.time, viewportPercentage = _entry3.viewportPercentage, entries = _entry3.entries;
|
|
149
|
+
if (includeSSRRatio && ssrRatio === -1 && entries.some(function (e) {
|
|
150
|
+
return e.elementName === 'SSR';
|
|
151
|
+
}) && (0, _platformFeatureFlags.fg)('platform_report_ssr_ratio_in_v3')) {
|
|
152
|
+
ssrRatio = viewportPercentage / 100;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Only process entries if we haven't reached all percentiles
|
|
148
156
|
if (!(percentileIndex >= percentiles.length)) {
|
|
149
|
-
_context.next =
|
|
157
|
+
_context.next = 19;
|
|
150
158
|
break;
|
|
151
159
|
}
|
|
152
|
-
return _context.abrupt("break",
|
|
153
|
-
case
|
|
160
|
+
return _context.abrupt("break", 22);
|
|
161
|
+
case 19:
|
|
154
162
|
// Check if this entry matches any checkpoint percentiles
|
|
155
163
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
156
164
|
elementNames = entries.map(function (e) {
|
|
@@ -172,21 +180,21 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
172
180
|
return entryDataBuffer.add(e);
|
|
173
181
|
});
|
|
174
182
|
}
|
|
175
|
-
case 18:
|
|
176
|
-
_context.next = 12;
|
|
177
|
-
break;
|
|
178
183
|
case 20:
|
|
179
|
-
_context.next =
|
|
184
|
+
_context.next = 13;
|
|
180
185
|
break;
|
|
181
186
|
case 22:
|
|
182
|
-
_context.
|
|
183
|
-
|
|
187
|
+
_context.next = 27;
|
|
188
|
+
break;
|
|
189
|
+
case 24:
|
|
190
|
+
_context.prev = 24;
|
|
191
|
+
_context.t0 = _context["catch"](11);
|
|
184
192
|
_iterator4.e(_context.t0);
|
|
185
|
-
case
|
|
186
|
-
_context.prev =
|
|
193
|
+
case 27:
|
|
194
|
+
_context.prev = 27;
|
|
187
195
|
_iterator4.f();
|
|
188
|
-
return _context.finish(
|
|
189
|
-
case
|
|
196
|
+
return _context.finish(27);
|
|
197
|
+
case 30:
|
|
190
198
|
// Fill in any missing percentiles with the last known values
|
|
191
199
|
previousResult = {
|
|
192
200
|
t: 0,
|
|
@@ -347,14 +355,17 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
347
355
|
console.error('Error in 3pDebugData', e);
|
|
348
356
|
}
|
|
349
357
|
}
|
|
350
|
-
return _context.abrupt("return",
|
|
351
|
-
|
|
358
|
+
return _context.abrupt("return", {
|
|
359
|
+
vcDetails: vcDetails,
|
|
360
|
+
ssrRatio: ssrRatio
|
|
361
|
+
});
|
|
362
|
+
case 43:
|
|
352
363
|
case "end":
|
|
353
364
|
return _context.stop();
|
|
354
365
|
}
|
|
355
|
-
}, _callee, this, [[
|
|
366
|
+
}, _callee, this, [[11, 24, 27, 30]]);
|
|
356
367
|
}));
|
|
357
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
368
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11, _x12) {
|
|
358
369
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
359
370
|
}
|
|
360
371
|
return calculateWithDebugInfo;
|
|
@@ -366,11 +377,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
366
377
|
var _this = this,
|
|
367
378
|
_vcDetails$90$t,
|
|
368
379
|
_vcDetails$;
|
|
369
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
380
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, includeSSRRatio, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, _yield$this$calculate, vcDetails, ssrRatio, result;
|
|
370
381
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
371
382
|
while (1) switch (_context2.prev = _context2.next) {
|
|
372
383
|
case 0:
|
|
373
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
384
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, includeSSRRatio = _ref.includeSSRRatio, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
374
385
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
375
386
|
return _this.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
376
387
|
});
|
|
@@ -390,9 +401,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
390
401
|
});
|
|
391
402
|
case 7:
|
|
392
403
|
_context2.next = 9;
|
|
393
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
404
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio);
|
|
394
405
|
case 9:
|
|
395
|
-
|
|
406
|
+
_yield$this$calculate = _context2.sent;
|
|
407
|
+
vcDetails = _yield$this$calculate.vcDetails;
|
|
408
|
+
ssrRatio = _yield$this$calculate.ssrRatio;
|
|
396
409
|
result = {
|
|
397
410
|
revision: this.revisionNo,
|
|
398
411
|
clean: true,
|
|
@@ -400,6 +413,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
400
413
|
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
401
414
|
};
|
|
402
415
|
result.ratios = this.calculateRatios(filteredEntries);
|
|
416
|
+
if (ssrRatio !== -1) {
|
|
417
|
+
result.ssrRatio = ssrRatio;
|
|
418
|
+
}
|
|
403
419
|
if (isPostInteraction) {
|
|
404
420
|
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
405
421
|
}
|
|
@@ -407,13 +423,13 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
407
423
|
result.displayContentsOccurrence = _trackDisplayContentOccurrence.cssIssueOccurrence;
|
|
408
424
|
}
|
|
409
425
|
return _context2.abrupt("return", result);
|
|
410
|
-
case
|
|
426
|
+
case 18:
|
|
411
427
|
case "end":
|
|
412
428
|
return _context2.stop();
|
|
413
429
|
}
|
|
414
430
|
}, _callee2, this);
|
|
415
431
|
}));
|
|
416
|
-
function calculate(
|
|
432
|
+
function calculate(_x13) {
|
|
417
433
|
return _calculate.apply(this, arguments);
|
|
418
434
|
}
|
|
419
435
|
return calculate;
|