@atlaskit/react-ufo 3.13.20 → 3.13.21
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 +8 -0
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +23 -10
- package/dist/cjs/interaction-metrics/index.js +15 -0
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +9 -3
- package/dist/es2019/interaction-metrics/index.js +15 -0
- package/dist/esm/create-payload/utils/get-vc-metrics.js +23 -10
- package/dist/esm/interaction-metrics/index.js +15 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.13.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#169263](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/169263)
|
|
8
|
+
[`42bff795e359c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/42bff795e359c) -
|
|
9
|
+
Add vc to interactions
|
|
10
|
+
|
|
3
11
|
## 3.13.20
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -34,30 +34,43 @@ function _getVCMetrics() {
|
|
|
34
34
|
}
|
|
35
35
|
return _context.abrupt("return", {});
|
|
36
36
|
case 3:
|
|
37
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_enable_interactions_vc')) {
|
|
38
|
+
_context.next = 8;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
if (!(interaction.type !== 'page_load' && interaction.type !== 'transition' && interaction.type !== 'press')) {
|
|
42
|
+
_context.next = 6;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
return _context.abrupt("return", {});
|
|
46
|
+
case 6:
|
|
47
|
+
_context.next = 10;
|
|
48
|
+
break;
|
|
49
|
+
case 8:
|
|
37
50
|
if (!(interaction.type !== 'page_load' && interaction.type !== 'transition')) {
|
|
38
|
-
_context.next =
|
|
51
|
+
_context.next = 10;
|
|
39
52
|
break;
|
|
40
53
|
}
|
|
41
54
|
return _context.abrupt("return", {});
|
|
42
|
-
case
|
|
55
|
+
case 10:
|
|
43
56
|
interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
44
57
|
pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
45
58
|
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && pageVisibilityUpToTTAI === 'visible';
|
|
46
59
|
if (!(!shouldReportVCMetrics && (0, _platformFeatureFlags.fg)('platform_ufo_no_vc_on_aborted'))) {
|
|
47
|
-
_context.next =
|
|
60
|
+
_context.next = 16;
|
|
48
61
|
break;
|
|
49
62
|
}
|
|
50
63
|
(0, _vc.getVCObserver)().stop(interaction.ufoName);
|
|
51
64
|
return _context.abrupt("return", {});
|
|
52
|
-
case
|
|
53
|
-
isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
65
|
+
case 16:
|
|
66
|
+
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
54
67
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
55
68
|
ssr: (0, _getSsrDoneTimeValue.default)(config)
|
|
56
69
|
} : null;
|
|
57
70
|
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
58
71
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
59
72
|
prefix = 'ufo';
|
|
60
|
-
_context.next =
|
|
73
|
+
_context.next = 23;
|
|
61
74
|
return (0, _vc.getVCObserver)().getVCResult(_objectSpread({
|
|
62
75
|
start: interaction.start,
|
|
63
76
|
stop: interaction.end,
|
|
@@ -70,7 +83,7 @@ function _getVCMetrics() {
|
|
|
70
83
|
interactionId: interaction.id,
|
|
71
84
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
72
85
|
}, ssr));
|
|
73
|
-
case
|
|
86
|
+
case 23:
|
|
74
87
|
result = _context.sent;
|
|
75
88
|
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
76
89
|
(0, _vc.getVCObserver)().stop(interaction.ufoName);
|
|
@@ -82,15 +95,15 @@ function _getVCMetrics() {
|
|
|
82
95
|
return revision === mostRecentVCRevision;
|
|
83
96
|
});
|
|
84
97
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
85
|
-
_context.next =
|
|
98
|
+
_context.next = 30;
|
|
86
99
|
break;
|
|
87
100
|
}
|
|
88
101
|
return _context.abrupt("return", result);
|
|
89
|
-
case
|
|
102
|
+
case 30:
|
|
90
103
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
91
104
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
92
105
|
}));
|
|
93
|
-
case
|
|
106
|
+
case 31:
|
|
94
107
|
case "end":
|
|
95
108
|
return _context.stop();
|
|
96
109
|
}
|
|
@@ -856,6 +856,21 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
+
if (type === 'press' && (0, _platformFeatureFlags.fg)('platform_ufo_enable_interactions_vc')) {
|
|
860
|
+
var _getConfig13;
|
|
861
|
+
(0, _vc.getVCObserver)().start({
|
|
862
|
+
startTime: startTime,
|
|
863
|
+
experienceKey: ufoName
|
|
864
|
+
});
|
|
865
|
+
postInteractionLog.startVCObserver({
|
|
866
|
+
startTime: startTime
|
|
867
|
+
});
|
|
868
|
+
if ((_getConfig13 = (0, _config.getConfig)()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.experimentalInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
|
|
869
|
+
_createExperimentalInteractionMetricsPayload.experimentalVC.start({
|
|
870
|
+
startTime: startTime
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
}
|
|
859
874
|
}
|
|
860
875
|
function addBrowserMetricEvent(event) {
|
|
861
876
|
var interaction = getActiveInteraction();
|
|
@@ -11,8 +11,14 @@ async function getVCMetrics(interaction) {
|
|
|
11
11
|
if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
|
|
12
12
|
return {};
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (fg('platform_ufo_enable_interactions_vc')) {
|
|
15
|
+
if (interaction.type !== 'page_load' && interaction.type !== 'transition' && interaction.type !== 'press') {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
if (interaction.type !== 'page_load' && interaction.type !== 'transition') {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
const interactionStatus = getInteractionStatus(interaction);
|
|
18
24
|
const pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
@@ -21,7 +27,7 @@ async function getVCMetrics(interaction) {
|
|
|
21
27
|
getVCObserver().stop(interaction.ufoName);
|
|
22
28
|
return {};
|
|
23
29
|
}
|
|
24
|
-
const isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 ? void 0 : (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
30
|
+
const isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 ? void 0 : (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
25
31
|
const ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
26
32
|
ssr: getSSRDoneTimeValue(config)
|
|
27
33
|
} : null;
|
|
@@ -732,6 +732,21 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
732
732
|
});
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
+
if (type === 'press' && fg('platform_ufo_enable_interactions_vc')) {
|
|
736
|
+
var _getConfig13, _getConfig13$experime;
|
|
737
|
+
getVCObserver().start({
|
|
738
|
+
startTime,
|
|
739
|
+
experienceKey: ufoName
|
|
740
|
+
});
|
|
741
|
+
postInteractionLog.startVCObserver({
|
|
742
|
+
startTime
|
|
743
|
+
});
|
|
744
|
+
if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13$experime = _getConfig13.experimentalInteractionMetrics) !== null && _getConfig13$experime !== void 0 && _getConfig13$experime.enabled) {
|
|
745
|
+
experimentalVC.start({
|
|
746
|
+
startTime
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
}
|
|
735
750
|
}
|
|
736
751
|
export function addBrowserMetricEvent(event) {
|
|
737
752
|
const interaction = getActiveInteraction();
|
|
@@ -27,30 +27,43 @@ function _getVCMetrics() {
|
|
|
27
27
|
}
|
|
28
28
|
return _context.abrupt("return", {});
|
|
29
29
|
case 3:
|
|
30
|
+
if (!fg('platform_ufo_enable_interactions_vc')) {
|
|
31
|
+
_context.next = 8;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
if (!(interaction.type !== 'page_load' && interaction.type !== 'transition' && interaction.type !== 'press')) {
|
|
35
|
+
_context.next = 6;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return _context.abrupt("return", {});
|
|
39
|
+
case 6:
|
|
40
|
+
_context.next = 10;
|
|
41
|
+
break;
|
|
42
|
+
case 8:
|
|
30
43
|
if (!(interaction.type !== 'page_load' && interaction.type !== 'transition')) {
|
|
31
|
-
_context.next =
|
|
44
|
+
_context.next = 10;
|
|
32
45
|
break;
|
|
33
46
|
}
|
|
34
47
|
return _context.abrupt("return", {});
|
|
35
|
-
case
|
|
48
|
+
case 10:
|
|
36
49
|
interactionStatus = getInteractionStatus(interaction);
|
|
37
50
|
pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
38
51
|
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && pageVisibilityUpToTTAI === 'visible';
|
|
39
52
|
if (!(!shouldReportVCMetrics && fg('platform_ufo_no_vc_on_aborted'))) {
|
|
40
|
-
_context.next =
|
|
53
|
+
_context.next = 16;
|
|
41
54
|
break;
|
|
42
55
|
}
|
|
43
56
|
getVCObserver().stop(interaction.ufoName);
|
|
44
57
|
return _context.abrupt("return", {});
|
|
45
|
-
case
|
|
46
|
-
isSSREnabled = (config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName));
|
|
58
|
+
case 16:
|
|
59
|
+
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
47
60
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
48
61
|
ssr: getSSRDoneTimeValue(config)
|
|
49
62
|
} : null;
|
|
50
63
|
postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
51
64
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
52
65
|
prefix = 'ufo';
|
|
53
|
-
_context.next =
|
|
66
|
+
_context.next = 23;
|
|
54
67
|
return getVCObserver().getVCResult(_objectSpread({
|
|
55
68
|
start: interaction.start,
|
|
56
69
|
stop: interaction.end,
|
|
@@ -63,7 +76,7 @@ function _getVCMetrics() {
|
|
|
63
76
|
interactionId: interaction.id,
|
|
64
77
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
65
78
|
}, ssr));
|
|
66
|
-
case
|
|
79
|
+
case 23:
|
|
67
80
|
result = _context.sent;
|
|
68
81
|
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
69
82
|
getVCObserver().stop(interaction.ufoName);
|
|
@@ -75,15 +88,15 @@ function _getVCMetrics() {
|
|
|
75
88
|
return revision === mostRecentVCRevision;
|
|
76
89
|
});
|
|
77
90
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
78
|
-
_context.next =
|
|
91
|
+
_context.next = 30;
|
|
79
92
|
break;
|
|
80
93
|
}
|
|
81
94
|
return _context.abrupt("return", result);
|
|
82
|
-
case
|
|
95
|
+
case 30:
|
|
83
96
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
84
97
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
85
98
|
}));
|
|
86
|
-
case
|
|
99
|
+
case 31:
|
|
87
100
|
case "end":
|
|
88
101
|
return _context.stop();
|
|
89
102
|
}
|
|
@@ -811,6 +811,21 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
+
if (type === 'press' && fg('platform_ufo_enable_interactions_vc')) {
|
|
815
|
+
var _getConfig13;
|
|
816
|
+
getVCObserver().start({
|
|
817
|
+
startTime: startTime,
|
|
818
|
+
experienceKey: ufoName
|
|
819
|
+
});
|
|
820
|
+
postInteractionLog.startVCObserver({
|
|
821
|
+
startTime: startTime
|
|
822
|
+
});
|
|
823
|
+
if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.experimentalInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
|
|
824
|
+
experimentalVC.start({
|
|
825
|
+
startTime: startTime
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
}
|
|
814
829
|
}
|
|
815
830
|
export function addBrowserMetricEvent(event) {
|
|
816
831
|
var interaction = getActiveInteraction();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.21",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -171,6 +171,9 @@
|
|
|
171
171
|
},
|
|
172
172
|
"platform_ufo_timeout_simplification": {
|
|
173
173
|
"type": "boolean"
|
|
174
|
+
},
|
|
175
|
+
"platform_ufo_enable_interactions_vc": {
|
|
176
|
+
"type": "boolean"
|
|
174
177
|
}
|
|
175
178
|
}
|
|
176
179
|
}
|