@atlaskit/react-ufo 3.13.16 → 3.13.17
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 +3 -2
- package/dist/cjs/vc/index.js +2 -1
- package/dist/cjs/vc/vc-observer-new/index.js +33 -3
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/es2019/vc/index.js +2 -1
- package/dist/es2019/vc/vc-observer-new/index.js +28 -0
- package/dist/esm/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/esm/vc/index.js +2 -1
- package/dist/esm/vc/vc-observer-new/index.js +33 -3
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/vc/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/index.d.ts +1 -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/vc/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.13.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#160542](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160542)
|
|
8
|
+
[`eadf6fec0762d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eadf6fec0762d) -
|
|
9
|
+
Added extension to VC v3 to include SSR
|
|
10
|
+
|
|
3
11
|
## 3.13.16
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -22,7 +22,7 @@ function getVCMetrics(_x) {
|
|
|
22
22
|
}
|
|
23
23
|
function _getVCMetrics() {
|
|
24
24
|
_getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
25
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$experimentalI, _result$ufoVcRev;
|
|
25
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3, _config$experimentalI, _result$ufoVcRev;
|
|
26
26
|
var config, interactionStatus, pageVisibilityUpToTTAI, shouldReportVCMetrics, isSSREnabled, ssr, tti, prefix, result, mostRecentVCRevision, mostRecentVCRevisionPayload;
|
|
27
27
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -63,11 +63,12 @@ function _getVCMetrics() {
|
|
|
63
63
|
stop: interaction.end,
|
|
64
64
|
tti: tti,
|
|
65
65
|
prefix: prefix,
|
|
66
|
+
includeSSRInV3: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRInV3,
|
|
66
67
|
vc: interaction.vc,
|
|
67
68
|
isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED',
|
|
68
69
|
experienceKey: interaction.ufoName,
|
|
69
70
|
interactionId: interaction.id,
|
|
70
|
-
includeSSRRatio: (_config$
|
|
71
|
+
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
71
72
|
}, ssr));
|
|
72
73
|
case 18:
|
|
73
74
|
result = _context.sent;
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -129,7 +129,8 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
129
129
|
return (_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
130
130
|
start: param.start,
|
|
131
131
|
stop: param.stop,
|
|
132
|
-
interactionId: param.interactionId
|
|
132
|
+
interactionId: param.interactionId,
|
|
133
|
+
ssr: param.includeSSRInV3 ? param.ssr : undefined
|
|
133
134
|
});
|
|
134
135
|
case 12:
|
|
135
136
|
_context.t1 = _context.sent;
|
|
@@ -16,6 +16,8 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
16
16
|
var _entriesTimeline = _interopRequireDefault(require("./entries-timeline"));
|
|
17
17
|
var _getElementName2 = _interopRequireDefault(require("./get-element-name"));
|
|
18
18
|
var _fy25_ = _interopRequireDefault(require("./metric-calculator/fy25_03"));
|
|
19
|
+
var _getViewportHeight = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-height"));
|
|
20
|
+
var _getViewportWidth = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-width"));
|
|
19
21
|
var _viewportObserver = _interopRequireDefault(require("./viewport-observer"));
|
|
20
22
|
var _windowEventObserver = _interopRequireDefault(require("./window-event-observer"));
|
|
21
23
|
var DEFAULT_SELECTOR_CONFIG = {
|
|
@@ -118,6 +120,31 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
118
120
|
(_this$viewportObserve2 = this.viewportObserver) === null || _this$viewportObserve2 === void 0 || _this$viewportObserve2.stop();
|
|
119
121
|
(_this$windowEventObse2 = this.windowEventObserver) === null || _this$windowEventObse2 === void 0 || _this$windowEventObse2.stop();
|
|
120
122
|
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "addSSR",
|
|
125
|
+
value: function addSSR(ssr) {
|
|
126
|
+
this.entriesTimeline.push({
|
|
127
|
+
time: ssr,
|
|
128
|
+
data: {
|
|
129
|
+
elementName: 'SSR',
|
|
130
|
+
type: 'mutation:element',
|
|
131
|
+
rect: {
|
|
132
|
+
height: (0, _getViewportHeight.default)(),
|
|
133
|
+
width: (0, _getViewportWidth.default)(),
|
|
134
|
+
left: 0,
|
|
135
|
+
top: 0,
|
|
136
|
+
x: 0,
|
|
137
|
+
y: 0,
|
|
138
|
+
bottom: (0, _getViewportHeight.default)(),
|
|
139
|
+
right: (0, _getViewportWidth.default)(),
|
|
140
|
+
toJSON: function toJSON() {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
visible: true
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
121
148
|
}, {
|
|
122
149
|
key: "getVCResult",
|
|
123
150
|
value: function () {
|
|
@@ -130,11 +157,14 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
130
157
|
results = [];
|
|
131
158
|
this.addStartEntry(start);
|
|
132
159
|
calculator_fy25_03 = new _fy25_.default();
|
|
160
|
+
if (param.ssr) {
|
|
161
|
+
this.addSSR(param.ssr);
|
|
162
|
+
}
|
|
133
163
|
orderedEntries = this.entriesTimeline.getOrderedEntries({
|
|
134
164
|
start: start,
|
|
135
165
|
stop: stop
|
|
136
166
|
});
|
|
137
|
-
_context.next =
|
|
167
|
+
_context.next = 8;
|
|
138
168
|
return calculator_fy25_03.calculate({
|
|
139
169
|
orderedEntries: orderedEntries,
|
|
140
170
|
startTime: start,
|
|
@@ -142,13 +172,13 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
142
172
|
interactionId: interactionId,
|
|
143
173
|
isPostInteraction: this.isPostInteraction
|
|
144
174
|
});
|
|
145
|
-
case
|
|
175
|
+
case 8:
|
|
146
176
|
fy25_03 = _context.sent;
|
|
147
177
|
if (fy25_03) {
|
|
148
178
|
results.push(fy25_03);
|
|
149
179
|
}
|
|
150
180
|
return _context.abrupt("return", results);
|
|
151
|
-
case
|
|
181
|
+
case 11:
|
|
152
182
|
case "end":
|
|
153
183
|
return _context.stop();
|
|
154
184
|
}
|
|
@@ -6,7 +6,7 @@ import getInteractionStatus from './get-interaction-status';
|
|
|
6
6
|
import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
|
|
7
7
|
import getSSRDoneTimeValue from './get-ssr-done-time-value';
|
|
8
8
|
async function getVCMetrics(interaction) {
|
|
9
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$experimentalI, _result$ufoVcRev;
|
|
9
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$vc3, _config$experimentalI, _result$ufoVcRev;
|
|
10
10
|
const config = getConfig();
|
|
11
11
|
if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
|
|
12
12
|
return {};
|
|
@@ -33,11 +33,12 @@ async function getVCMetrics(interaction) {
|
|
|
33
33
|
stop: interaction.end,
|
|
34
34
|
tti,
|
|
35
35
|
prefix,
|
|
36
|
+
includeSSRInV3: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRInV3,
|
|
36
37
|
vc: interaction.vc,
|
|
37
38
|
isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED',
|
|
38
39
|
experienceKey: interaction.ufoName,
|
|
39
40
|
interactionId: interaction.id,
|
|
40
|
-
includeSSRRatio: (_config$
|
|
41
|
+
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio,
|
|
41
42
|
...ssr
|
|
42
43
|
});
|
|
43
44
|
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -80,7 +80,8 @@ export class VCObserverWrapper {
|
|
|
80
80
|
const v3Result = isVCRevisionEnabled('fy25.03', experienceKey) ? await ((_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
81
81
|
start: param.start,
|
|
82
82
|
stop: param.stop,
|
|
83
|
-
interactionId: param.interactionId
|
|
83
|
+
interactionId: param.interactionId,
|
|
84
|
+
ssr: param.includeSSRInV3 ? param.ssr : undefined
|
|
84
85
|
})) : [];
|
|
85
86
|
if (!v3Result) {
|
|
86
87
|
return v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {};
|
|
@@ -3,6 +3,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import EntriesTimeline from './entries-timeline';
|
|
4
4
|
import getElementName from './get-element-name';
|
|
5
5
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
6
|
+
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
7
|
+
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
6
8
|
import ViewportObserver from './viewport-observer';
|
|
7
9
|
import WindowEventObserver from './window-event-observer';
|
|
8
10
|
const DEFAULT_SELECTOR_CONFIG = {
|
|
@@ -96,6 +98,29 @@ export default class VCObserverNew {
|
|
|
96
98
|
(_this$viewportObserve2 = this.viewportObserver) === null || _this$viewportObserve2 === void 0 ? void 0 : _this$viewportObserve2.stop();
|
|
97
99
|
(_this$windowEventObse2 = this.windowEventObserver) === null || _this$windowEventObse2 === void 0 ? void 0 : _this$windowEventObse2.stop();
|
|
98
100
|
}
|
|
101
|
+
addSSR(ssr) {
|
|
102
|
+
this.entriesTimeline.push({
|
|
103
|
+
time: ssr,
|
|
104
|
+
data: {
|
|
105
|
+
elementName: 'SSR',
|
|
106
|
+
type: 'mutation:element',
|
|
107
|
+
rect: {
|
|
108
|
+
height: getViewportHeight(),
|
|
109
|
+
width: getViewportWidth(),
|
|
110
|
+
left: 0,
|
|
111
|
+
top: 0,
|
|
112
|
+
x: 0,
|
|
113
|
+
y: 0,
|
|
114
|
+
bottom: getViewportHeight(),
|
|
115
|
+
right: getViewportWidth(),
|
|
116
|
+
toJSON() {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
visible: true
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
99
124
|
async getVCResult(param) {
|
|
100
125
|
const {
|
|
101
126
|
start,
|
|
@@ -105,6 +130,9 @@ export default class VCObserverNew {
|
|
|
105
130
|
const results = [];
|
|
106
131
|
this.addStartEntry(start);
|
|
107
132
|
const calculator_fy25_03 = new VCCalculator_FY25_03();
|
|
133
|
+
if (param.ssr) {
|
|
134
|
+
this.addSSR(param.ssr);
|
|
135
|
+
}
|
|
108
136
|
const orderedEntries = this.entriesTimeline.getOrderedEntries({
|
|
109
137
|
start,
|
|
110
138
|
stop
|
|
@@ -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/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,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
|
}
|
|
@@ -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/types.d.ts
CHANGED
|
@@ -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;
|
|
@@ -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
|
/**
|
|
@@ -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;
|