@atlaskit/react-ufo 3.14.15 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/config/index.js +14 -48
- package/dist/cjs/create-payload/index.js +18 -13
- package/dist/cjs/create-post-interaction-log-payload/get-late-mutations.js +1 -1
- package/dist/cjs/create-post-interaction-log-payload/index.js +2 -2
- package/dist/cjs/interaction-metrics/post-interaction-log.js +0 -1
- package/dist/cjs/interaction-metrics-init/index.js +3 -3
- package/dist/cjs/placeholder/Placeholder.js +3 -3
- package/dist/cjs/suspense/Suspense.js +20 -0
- package/dist/cjs/suspense/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -1
- package/dist/es2019/config/index.js +5 -39
- package/dist/es2019/create-payload/index.js +17 -12
- package/dist/es2019/create-post-interaction-log-payload/get-late-mutations.js +1 -1
- package/dist/es2019/create-post-interaction-log-payload/index.js +3 -3
- package/dist/es2019/interaction-metrics/post-interaction-log.js +0 -1
- package/dist/es2019/interaction-metrics-init/index.js +3 -3
- package/dist/es2019/placeholder/Placeholder.js +3 -3
- package/dist/es2019/suspense/Suspense.js +14 -0
- package/dist/es2019/suspense/index.js +2 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -1
- package/dist/esm/config/index.js +13 -45
- package/dist/esm/create-payload/index.js +18 -13
- package/dist/esm/create-post-interaction-log-payload/get-late-mutations.js +1 -1
- package/dist/esm/create-post-interaction-log-payload/index.js +3 -3
- package/dist/esm/interaction-metrics/post-interaction-log.js +0 -1
- package/dist/esm/interaction-metrics-init/index.js +3 -3
- package/dist/esm/placeholder/Placeholder.js +3 -3
- package/dist/esm/suspense/Suspense.js +13 -0
- package/dist/esm/suspense/index.js +2 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -1
- package/dist/types/common/assets/types.d.ts +1 -1
- package/dist/types/config/index.d.ts +16 -17
- package/dist/types/create-payload/index.d.ts +577 -577
- package/dist/types/create-post-interaction-log-payload/get-late-mutations.d.ts +1 -1
- package/dist/types/placeholder/Placeholder.d.ts +3 -3
- package/dist/types/suspense/Suspense.d.ts +7 -0
- package/dist/types/suspense/index.d.ts +2 -0
- package/dist/types-ts4.5/common/assets/types.d.ts +1 -1
- package/dist/types-ts4.5/config/index.d.ts +16 -17
- package/dist/types-ts4.5/create-payload/index.d.ts +577 -577
- package/dist/types-ts4.5/create-post-interaction-log-payload/get-late-mutations.d.ts +1 -1
- package/dist/types-ts4.5/placeholder/Placeholder.d.ts +3 -3
- package/dist/types-ts4.5/suspense/Suspense.d.ts +7 -0
- package/dist/types-ts4.5/suspense/index.d.ts +2 -0
- package/package.json +5 -4
- package/suspense/package.json +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#184818](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184818)
|
|
8
|
+
[`a4cc23a9d8a35`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4cc23a9d8a35) -
|
|
9
|
+
FG cleanup - platform_ufo_report_cpu_usage
|
|
10
|
+
|
|
11
|
+
## 4.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [#185849](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185849)
|
|
16
|
+
[`5570de66b8d30`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5570de66b8d30) -
|
|
17
|
+
change default TTVC version to v3, remove deprecated config fields, deprecate Placeholder
|
|
18
|
+
component
|
|
19
|
+
|
|
3
20
|
## 3.14.15
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.CLEANUP_TIMEOUT = void 0;
|
|
7
|
+
exports.DEFAULT_TTVC_REVISION = exports.CLEANUP_TIMEOUT = void 0;
|
|
8
8
|
exports.getAwaitBM3TTIList = getAwaitBM3TTIList;
|
|
9
9
|
exports.getCapabilityRate = getCapabilityRate;
|
|
10
10
|
exports.getConfig = getConfig;
|
|
@@ -16,8 +16,6 @@ exports.getInteractionRate = getInteractionRate;
|
|
|
16
16
|
exports.getInteractionTimeout = getInteractionTimeout;
|
|
17
17
|
exports.getMostRecentVCRevision = getMostRecentVCRevision;
|
|
18
18
|
exports.getPostInteractionRate = getPostInteractionRate;
|
|
19
|
-
exports.getRemoveInteractionsUFOPrefixes = getRemoveInteractionsUFOPrefixes;
|
|
20
|
-
exports.getRemovePageSegmentsUFOPrefixes = getRemovePageSegmentsUFOPrefixes;
|
|
21
19
|
exports.getTypingPerformanceTracingMethod = getTypingPerformanceTracingMethod;
|
|
22
20
|
exports.getUfoNameOverrides = getUfoNameOverrides;
|
|
23
21
|
exports.isVCRevisionEnabled = isVCRevisionEnabled;
|
|
@@ -25,10 +23,11 @@ exports.setUFOConfig = setUFOConfig;
|
|
|
25
23
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
26
24
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
25
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
26
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
27
|
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; }
|
|
29
28
|
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; }
|
|
30
29
|
var config;
|
|
31
|
-
var DEFAULT_TTVC_REVISION = 'fy25.
|
|
30
|
+
var DEFAULT_TTVC_REVISION = exports.DEFAULT_TTVC_REVISION = 'fy25.03';
|
|
32
31
|
|
|
33
32
|
// Defensively typed, since this is directly user-editable
|
|
34
33
|
// and they could delete empty members
|
|
@@ -192,6 +191,9 @@ function getPostInteractionRate(name, interactionType) {
|
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
193
|
function getCapabilityRate(capability) {
|
|
194
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_remove_deprecated_config_fields')) {
|
|
195
|
+
return 1;
|
|
196
|
+
}
|
|
195
197
|
try {
|
|
196
198
|
if (!config) {
|
|
197
199
|
return 0;
|
|
@@ -248,42 +250,6 @@ function getAwaitBM3TTIList() {
|
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
|
|
251
|
-
// Flag to remove ufo segments prefixes
|
|
252
|
-
function getRemovePageSegmentsUFOPrefixes() {
|
|
253
|
-
try {
|
|
254
|
-
if (!config) {
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
var _config7 = config,
|
|
258
|
-
removePageSegmentsUFOPrefixes = _config7.removePageSegmentsUFOPrefixes;
|
|
259
|
-
if (removePageSegmentsUFOPrefixes != null) {
|
|
260
|
-
return removePageSegmentsUFOPrefixes;
|
|
261
|
-
} else {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
} catch (e) {
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// Flag to remove ufo segments prefixes
|
|
270
|
-
function getRemoveInteractionsUFOPrefixes() {
|
|
271
|
-
try {
|
|
272
|
-
if (!config) {
|
|
273
|
-
return false;
|
|
274
|
-
}
|
|
275
|
-
var _config8 = config,
|
|
276
|
-
removeInteractionsUFOPrefixes = _config8.removeInteractionsUFOPrefixes;
|
|
277
|
-
if (removeInteractionsUFOPrefixes != null) {
|
|
278
|
-
return removeInteractionsUFOPrefixes;
|
|
279
|
-
} else {
|
|
280
|
-
return false;
|
|
281
|
-
}
|
|
282
|
-
} catch (e) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
253
|
// Will ask UFO to override ufoName => experienceKey to the apdex key
|
|
288
254
|
// This is to cover use cases where one rUFO route is split into multiple BM3 keys (1:N)
|
|
289
255
|
// This workaround should only be used as last resource,
|
|
@@ -293,8 +259,8 @@ function getUfoNameOverrides() {
|
|
|
293
259
|
if (!config) {
|
|
294
260
|
return undefined;
|
|
295
261
|
}
|
|
296
|
-
var
|
|
297
|
-
ufoNameOverrides =
|
|
262
|
+
var _config7 = config,
|
|
263
|
+
ufoNameOverrides = _config7.ufoNameOverrides;
|
|
298
264
|
if (ufoNameOverrides != null) {
|
|
299
265
|
return ufoNameOverrides;
|
|
300
266
|
}
|
|
@@ -310,8 +276,8 @@ function getDoNotAbortActivePressInteraction() {
|
|
|
310
276
|
if (!config) {
|
|
311
277
|
return undefined;
|
|
312
278
|
}
|
|
313
|
-
var
|
|
314
|
-
doNotAbortActivePressInteraction =
|
|
279
|
+
var _config8 = config,
|
|
280
|
+
doNotAbortActivePressInteraction = _config8.doNotAbortActivePressInteraction;
|
|
315
281
|
return doNotAbortActivePressInteraction;
|
|
316
282
|
} catch (e) {
|
|
317
283
|
return undefined;
|
|
@@ -324,8 +290,8 @@ function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
324
290
|
if (!config) {
|
|
325
291
|
return undefined;
|
|
326
292
|
}
|
|
327
|
-
var
|
|
328
|
-
doNotAbortActivePressInteractionOnTransition =
|
|
293
|
+
var _config9 = config,
|
|
294
|
+
doNotAbortActivePressInteractionOnTransition = _config9.doNotAbortActivePressInteractionOnTransition;
|
|
329
295
|
return doNotAbortActivePressInteractionOnTransition;
|
|
330
296
|
} catch (e) {
|
|
331
297
|
return undefined;
|
|
@@ -337,8 +303,8 @@ function getInteractionTimeout(ufoName) {
|
|
|
337
303
|
if (!config) {
|
|
338
304
|
return CLEANUP_TIMEOUT;
|
|
339
305
|
}
|
|
340
|
-
var
|
|
341
|
-
interactionTimeout =
|
|
306
|
+
var _config0 = config,
|
|
307
|
+
interactionTimeout = _config0.interactionTimeout;
|
|
342
308
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
343
309
|
return interactionTimeout[ufoName];
|
|
344
310
|
}
|
|
@@ -182,13 +182,19 @@ function getPPSMetrics(interaction) {
|
|
|
182
182
|
start: start,
|
|
183
183
|
stop: interaction.end
|
|
184
184
|
}) : null;
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_remove_deprecated_config_fields')) {
|
|
186
|
+
if (PPSMetricsAtTTAI !== null) {
|
|
187
|
+
return PPSMetricsAtTTAI;
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
if (config !== null && config !== void 0 && config.shouldCalculateLighthouseMetricsFromTTAI && PPSMetricsAtTTAI !== null) {
|
|
191
|
+
return PPSMetricsAtTTAI;
|
|
192
|
+
}
|
|
193
|
+
if (PPSMetricsAtTTI !== null) {
|
|
194
|
+
return _objectSpread(_objectSpread({}, PPSMetricsAtTTI), {}, {
|
|
195
|
+
'metrics@ttai': PPSMetricsAtTTAI
|
|
196
|
+
});
|
|
197
|
+
}
|
|
192
198
|
}
|
|
193
199
|
return {};
|
|
194
200
|
}
|
|
@@ -591,7 +597,7 @@ function _createInteractionMetricsPayload() {
|
|
|
591
597
|
end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, knownSegments = interaction.knownSegments, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, featureFlags = interaction.featureFlags, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName, responsiveness = interaction.responsiveness, unknownElementName = interaction.unknownElementName, unknownElementHierarchy = interaction.unknownElementHierarchy;
|
|
592
598
|
pageVisibilityAtTTI = getPageVisibilityUpToTTI(interaction);
|
|
593
599
|
pageVisibilityAtTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
594
|
-
segments = config.killswitchNestedSegments ? [] : knownSegments;
|
|
600
|
+
segments = !(0, _platformFeatureFlags.fg)('platform_ufo_remove_deprecated_config_fields') && config.killswitchNestedSegments ? [] : knownSegments;
|
|
595
601
|
segmentTree = (0, _getReactUfoPayloadVersion.getReactUFOPayloadVersion)(interaction.type) === '2.0.0' ? (0, _utils.buildSegmentTree)(segments.map(function (segment) {
|
|
596
602
|
return segment.labelStack;
|
|
597
603
|
})) : {};
|
|
@@ -691,7 +697,7 @@ function _createInteractionMetricsPayload() {
|
|
|
691
697
|
source: 'measured',
|
|
692
698
|
tags: ['observability'],
|
|
693
699
|
attributes: {
|
|
694
|
-
properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
700
|
+
properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
695
701
|
// basic
|
|
696
702
|
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
697
703
|
'event:product': config.product,
|
|
@@ -703,10 +709,9 @@ function _createInteractionMetricsPayload() {
|
|
|
703
709
|
},
|
|
704
710
|
'event:region': config.region || 'unknown',
|
|
705
711
|
'experience:key': experimental ? 'custom.experimental-interaction-metrics' : 'custom.interaction-metrics',
|
|
706
|
-
'experience:name': newUFOName
|
|
707
|
-
|
|
708
|
-
'event:cpu:usage': (0, _machineUtilisation.createPressureStateReport)(interaction.start, interaction.end)
|
|
709
|
-
} : {}), {}, {
|
|
712
|
+
'experience:name': newUFOName,
|
|
713
|
+
// Include CPU usage monitoring data
|
|
714
|
+
'event:cpu:usage': (0, _machineUtilisation.createPressureStateReport)(interaction.start, interaction.end),
|
|
710
715
|
'event:memory:usage': (0, _machineUtilisation.createMemoryStateReport)(interaction.start, interaction.end)
|
|
711
716
|
}, criticalPayloadCount !== undefined ? {
|
|
712
717
|
'ufo:multipayload': true,
|
|
@@ -32,7 +32,7 @@ function getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinis
|
|
|
32
32
|
result.push({
|
|
33
33
|
time: details.t,
|
|
34
34
|
element: element,
|
|
35
|
-
viewportHeatmapPercentage: postInteractionFinishVCRatios[element] || 0
|
|
35
|
+
viewportHeatmapPercentage: (postInteractionFinishVCRatios === null || postInteractionFinishVCRatios === void 0 ? void 0 : postInteractionFinishVCRatios[element]) || 0
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
} catch (err) {
|
|
@@ -154,7 +154,7 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
154
154
|
var lastInteractionFinishStart = Math.round(lastInteractionFinish.start);
|
|
155
155
|
var lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
|
|
156
156
|
var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
157
|
-
var mostRecentVCRevision = (0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_most_recent_vc_rev') ? (0, _config.getMostRecentVCRevision)(lastInteractionFinish.ufoName) :
|
|
157
|
+
var mostRecentVCRevision = (0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_most_recent_vc_rev') ? (0, _config.getMostRecentVCRevision)(lastInteractionFinish.ufoName) : _config.DEFAULT_TTVC_REVISION;
|
|
158
158
|
var lastInteractionFinishVC90 = null;
|
|
159
159
|
var lastInteractionFinishVCClean = false;
|
|
160
160
|
var lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
@@ -178,7 +178,7 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
178
178
|
});
|
|
179
179
|
if (postInteractionFinishRevision !== null && postInteractionFinishRevision !== void 0 && postInteractionFinishRevision.clean) {
|
|
180
180
|
postInteractionFinishVCClean = true;
|
|
181
|
-
postInteractionFinishVCRatios =
|
|
181
|
+
postInteractionFinishVCRatios = postInteractionFinishRevision.ratios;
|
|
182
182
|
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
183
183
|
var _postInteractionFinis;
|
|
184
184
|
revisedVC90 = (_postInteractionFinis = postInteractionFinishRevision['metric:vc90']) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
|
|
@@ -148,7 +148,6 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
148
148
|
this.sinkHandlerFn({
|
|
149
149
|
lastInteractionFinish: this.lastInteractionFinish,
|
|
150
150
|
reactProfilerTimings: this.reactProfilerTimings,
|
|
151
|
-
// NOTE: invoking `getVCResult` at latest possible point in time here (not earlier) to get the most accurate result (from performance.now())
|
|
152
151
|
postInteractionFinishVCResult: postInteractionFinishVCResult,
|
|
153
152
|
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
154
153
|
});
|
|
@@ -84,9 +84,9 @@ function init(analyticsWebClientAsync, config) {
|
|
|
84
84
|
if (initialized) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
|
|
88
|
+
// Initialize pressure observer for CPU usage monitoring
|
|
89
|
+
(0, _machineUtilisation.initialisePressureObserver)();
|
|
90
90
|
(0, _machineUtilisation.initialiseMemoryObserver)();
|
|
91
91
|
(0, _config.setUFOConfig)(config);
|
|
92
92
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
@@ -11,10 +11,10 @@ var _loadHold = _interopRequireDefault(require("../load-hold"));
|
|
|
11
11
|
var _looselyLazy = require("./loosely-lazy");
|
|
12
12
|
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); }
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* @private
|
|
15
|
+
* @deprecated Use `atlaskit/react-ufo/suspense` instead.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
* in performance monitoring tools like Performance Portal.
|
|
17
|
+
* Provides a placeholder for lazily loaded content (via react-loosely-lazy), improving perceived performance.
|
|
18
18
|
*/
|
|
19
19
|
function Placeholder(_ref) {
|
|
20
20
|
var name = _ref.name,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _loadHold = _interopRequireDefault(require("../load-hold"));
|
|
10
|
+
var Suspense = function Suspense(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
fallback = _ref.fallback,
|
|
13
|
+
interactionName = _ref.interactionName;
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Suspense, {
|
|
15
|
+
fallback: /*#__PURE__*/_react.default.createElement(_loadHold.default, {
|
|
16
|
+
name: interactionName
|
|
17
|
+
}, fallback)
|
|
18
|
+
}, children);
|
|
19
|
+
};
|
|
20
|
+
var _default = exports.default = Suspense;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _Suspense = _interopRequireDefault(require("./Suspense"));
|
|
9
|
+
var _default = exports.default = _Suspense.default;
|
|
@@ -56,7 +56,7 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
|
|
|
56
56
|
if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
|
-
if (attributeName.startsWith('data-test') && (0, _platformFeatureFlags.fg)('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && (0, _platformFeatureFlags.fg)('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
59
|
+
if (attributeName.startsWith('data-test') && (0, _platformFeatureFlags.fg)('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && (0, _platformFeatureFlags.fg)('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || attributeName === 'data-is-ttvc-ready' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
return true;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
let config;
|
|
2
|
-
const DEFAULT_TTVC_REVISION = 'fy25.
|
|
3
|
+
export const DEFAULT_TTVC_REVISION = 'fy25.03';
|
|
3
4
|
|
|
4
5
|
// Defensively typed, since this is directly user-editable
|
|
5
6
|
// and they could delete empty members
|
|
@@ -172,6 +173,9 @@ export function getPostInteractionRate(name, interactionType) {
|
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
export function getCapabilityRate(capability) {
|
|
176
|
+
if (fg('platform_ufo_remove_deprecated_config_fields')) {
|
|
177
|
+
return 1;
|
|
178
|
+
}
|
|
175
179
|
try {
|
|
176
180
|
if (!config) {
|
|
177
181
|
return 0;
|
|
@@ -229,44 +233,6 @@ export function getAwaitBM3TTIList() {
|
|
|
229
233
|
}
|
|
230
234
|
}
|
|
231
235
|
|
|
232
|
-
// Flag to remove ufo segments prefixes
|
|
233
|
-
export function getRemovePageSegmentsUFOPrefixes() {
|
|
234
|
-
try {
|
|
235
|
-
if (!config) {
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
const {
|
|
239
|
-
removePageSegmentsUFOPrefixes
|
|
240
|
-
} = config;
|
|
241
|
-
if (removePageSegmentsUFOPrefixes != null) {
|
|
242
|
-
return removePageSegmentsUFOPrefixes;
|
|
243
|
-
} else {
|
|
244
|
-
return false;
|
|
245
|
-
}
|
|
246
|
-
} catch (e) {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Flag to remove ufo segments prefixes
|
|
252
|
-
export function getRemoveInteractionsUFOPrefixes() {
|
|
253
|
-
try {
|
|
254
|
-
if (!config) {
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
const {
|
|
258
|
-
removeInteractionsUFOPrefixes
|
|
259
|
-
} = config;
|
|
260
|
-
if (removeInteractionsUFOPrefixes != null) {
|
|
261
|
-
return removeInteractionsUFOPrefixes;
|
|
262
|
-
} else {
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
} catch (e) {
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
236
|
// Will ask UFO to override ufoName => experienceKey to the apdex key
|
|
271
237
|
// This is to cover use cases where one rUFO route is split into multiple BM3 keys (1:N)
|
|
272
238
|
// This workaround should only be used as last resource,
|
|
@@ -166,14 +166,20 @@ function getPPSMetrics(interaction) {
|
|
|
166
166
|
start,
|
|
167
167
|
stop: interaction.end
|
|
168
168
|
}) : null;
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
169
|
+
if (fg('platform_ufo_remove_deprecated_config_fields')) {
|
|
170
|
+
if (PPSMetricsAtTTAI !== null) {
|
|
171
|
+
return PPSMetricsAtTTAI;
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
if (config !== null && config !== void 0 && config.shouldCalculateLighthouseMetricsFromTTAI && PPSMetricsAtTTAI !== null) {
|
|
175
|
+
return PPSMetricsAtTTAI;
|
|
176
|
+
}
|
|
177
|
+
if (PPSMetricsAtTTI !== null) {
|
|
178
|
+
return {
|
|
179
|
+
...PPSMetricsAtTTI,
|
|
180
|
+
'metrics@ttai': PPSMetricsAtTTAI
|
|
181
|
+
};
|
|
182
|
+
}
|
|
177
183
|
}
|
|
178
184
|
return {};
|
|
179
185
|
}
|
|
@@ -595,7 +601,7 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
595
601
|
} = interaction;
|
|
596
602
|
const pageVisibilityAtTTI = getPageVisibilityUpToTTI(interaction);
|
|
597
603
|
const pageVisibilityAtTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
598
|
-
const segments = config.killswitchNestedSegments ? [] : knownSegments;
|
|
604
|
+
const segments = !fg('platform_ufo_remove_deprecated_config_fields') && config.killswitchNestedSegments ? [] : knownSegments;
|
|
599
605
|
const segmentTree = getReactUFOPayloadVersion(interaction.type) === '2.0.0' ? buildSegmentTree(segments.map(segment => segment.labelStack)) : {};
|
|
600
606
|
const isDetailedPayload = pageVisibilityAtTTAI === 'visible';
|
|
601
607
|
const isPageLoad = type === 'page_load';
|
|
@@ -689,9 +695,8 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
689
695
|
'event:region': config.region || 'unknown',
|
|
690
696
|
'experience:key': experimental ? 'custom.experimental-interaction-metrics' : 'custom.interaction-metrics',
|
|
691
697
|
'experience:name': newUFOName,
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
} : {}),
|
|
698
|
+
// Include CPU usage monitoring data
|
|
699
|
+
'event:cpu:usage': createPressureStateReport(interaction.start, interaction.end),
|
|
695
700
|
'event:memory:usage': createMemoryStateReport(interaction.start, interaction.end),
|
|
696
701
|
...(criticalPayloadCount !== undefined ? {
|
|
697
702
|
'ufo:multipayload': true,
|
|
@@ -19,7 +19,7 @@ function getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinis
|
|
|
19
19
|
result.push({
|
|
20
20
|
time: details.t,
|
|
21
21
|
element,
|
|
22
|
-
viewportHeatmapPercentage: postInteractionFinishVCRatios[element] || 0
|
|
22
|
+
viewportHeatmapPercentage: (postInteractionFinishVCRatios === null || postInteractionFinishVCRatios === void 0 ? void 0 : postInteractionFinishVCRatios[element]) || 0
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import coinflip from '../coinflip';
|
|
3
|
-
import { getConfig, getMostRecentVCRevision, getPostInteractionRate } from '../config';
|
|
3
|
+
import { DEFAULT_TTVC_REVISION, getConfig, getMostRecentVCRevision, getPostInteractionRate } from '../config';
|
|
4
4
|
import { isSegmentLabel, sanitizeUfoName } from '../create-payload/common/utils';
|
|
5
5
|
import { getReactUFOPayloadVersion } from '../create-payload/utils/get-react-ufo-payload-version';
|
|
6
6
|
import { getPageVisibilityState } from '../hidden-timing';
|
|
@@ -139,7 +139,7 @@ function createPostInteractionLogPayload({
|
|
|
139
139
|
const lastInteractionFinishStart = Math.round(lastInteractionFinish.start);
|
|
140
140
|
const lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
|
|
141
141
|
const lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
142
|
-
const mostRecentVCRevision = fg('platform_ufo_post_interaction_most_recent_vc_rev') ? getMostRecentVCRevision(lastInteractionFinish.ufoName) :
|
|
142
|
+
const mostRecentVCRevision = fg('platform_ufo_post_interaction_most_recent_vc_rev') ? getMostRecentVCRevision(lastInteractionFinish.ufoName) : DEFAULT_TTVC_REVISION;
|
|
143
143
|
let lastInteractionFinishVC90 = null;
|
|
144
144
|
let lastInteractionFinishVCClean = false;
|
|
145
145
|
const lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
@@ -161,7 +161,7 @@ function createPostInteractionLogPayload({
|
|
|
161
161
|
}) => revision === mostRecentVCRevision);
|
|
162
162
|
if (postInteractionFinishRevision !== null && postInteractionFinishRevision !== void 0 && postInteractionFinishRevision.clean) {
|
|
163
163
|
postInteractionFinishVCClean = true;
|
|
164
|
-
postInteractionFinishVCRatios =
|
|
164
|
+
postInteractionFinishVCRatios = postInteractionFinishRevision.ratios;
|
|
165
165
|
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
166
166
|
var _postInteractionFinis;
|
|
167
167
|
revisedVC90 = (_postInteractionFinis = postInteractionFinishRevision['metric:vc90']) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
|
|
@@ -111,7 +111,6 @@ export default class PostInteractionLog {
|
|
|
111
111
|
this.sinkHandlerFn({
|
|
112
112
|
lastInteractionFinish: this.lastInteractionFinish,
|
|
113
113
|
reactProfilerTimings: this.reactProfilerTimings,
|
|
114
|
-
// NOTE: invoking `getVCResult` at latest possible point in time here (not earlier) to get the most accurate result (from performance.now())
|
|
115
114
|
postInteractionFinishVCResult,
|
|
116
115
|
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
117
116
|
});
|
|
@@ -74,9 +74,9 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
74
74
|
if (initialized) {
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
|
|
78
|
+
// Initialize pressure observer for CPU usage monitoring
|
|
79
|
+
initialisePressureObserver();
|
|
80
80
|
initialiseMemoryObserver();
|
|
81
81
|
setUFOConfig(config);
|
|
82
82
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
@@ -3,10 +3,10 @@ import UFOLoadHold from '../load-hold';
|
|
|
3
3
|
import { LazySuspense, WaitContext } from './loosely-lazy';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* @private
|
|
7
|
+
* @deprecated Use `atlaskit/react-ufo/suspense` instead.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* in performance monitoring tools like Performance Portal.
|
|
9
|
+
* Provides a placeholder for lazily loaded content (via react-loosely-lazy), improving perceived performance.
|
|
10
10
|
*/
|
|
11
11
|
export default function Placeholder({
|
|
12
12
|
name,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import UFOLoadHold from '../load-hold';
|
|
3
|
+
const Suspense = ({
|
|
4
|
+
children,
|
|
5
|
+
fallback,
|
|
6
|
+
interactionName
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Suspense, {
|
|
9
|
+
fallback: /*#__PURE__*/React.createElement(UFOLoadHold, {
|
|
10
|
+
name: interactionName
|
|
11
|
+
}, fallback)
|
|
12
|
+
}, children);
|
|
13
|
+
};
|
|
14
|
+
export default Suspense;
|
|
@@ -38,7 +38,7 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
38
38
|
if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
|
-
if (attributeName.startsWith('data-test') && fg('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && fg('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
41
|
+
if (attributeName.startsWith('data-test') && fg('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && fg('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || attributeName === 'data-is-ttvc-ready' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
return true;
|
package/dist/esm/config/index.js
CHANGED
|
@@ -3,8 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
var config;
|
|
7
|
-
var DEFAULT_TTVC_REVISION = 'fy25.
|
|
8
|
+
export var DEFAULT_TTVC_REVISION = 'fy25.03';
|
|
8
9
|
|
|
9
10
|
// Defensively typed, since this is directly user-editable
|
|
10
11
|
// and they could delete empty members
|
|
@@ -168,6 +169,9 @@ export function getPostInteractionRate(name, interactionType) {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
export function getCapabilityRate(capability) {
|
|
172
|
+
if (fg('platform_ufo_remove_deprecated_config_fields')) {
|
|
173
|
+
return 1;
|
|
174
|
+
}
|
|
171
175
|
try {
|
|
172
176
|
if (!config) {
|
|
173
177
|
return 0;
|
|
@@ -224,42 +228,6 @@ export function getAwaitBM3TTIList() {
|
|
|
224
228
|
}
|
|
225
229
|
}
|
|
226
230
|
|
|
227
|
-
// Flag to remove ufo segments prefixes
|
|
228
|
-
export function getRemovePageSegmentsUFOPrefixes() {
|
|
229
|
-
try {
|
|
230
|
-
if (!config) {
|
|
231
|
-
return false;
|
|
232
|
-
}
|
|
233
|
-
var _config7 = config,
|
|
234
|
-
removePageSegmentsUFOPrefixes = _config7.removePageSegmentsUFOPrefixes;
|
|
235
|
-
if (removePageSegmentsUFOPrefixes != null) {
|
|
236
|
-
return removePageSegmentsUFOPrefixes;
|
|
237
|
-
} else {
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
} catch (e) {
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// Flag to remove ufo segments prefixes
|
|
246
|
-
export function getRemoveInteractionsUFOPrefixes() {
|
|
247
|
-
try {
|
|
248
|
-
if (!config) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
var _config8 = config,
|
|
252
|
-
removeInteractionsUFOPrefixes = _config8.removeInteractionsUFOPrefixes;
|
|
253
|
-
if (removeInteractionsUFOPrefixes != null) {
|
|
254
|
-
return removeInteractionsUFOPrefixes;
|
|
255
|
-
} else {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
} catch (e) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
231
|
// Will ask UFO to override ufoName => experienceKey to the apdex key
|
|
264
232
|
// This is to cover use cases where one rUFO route is split into multiple BM3 keys (1:N)
|
|
265
233
|
// This workaround should only be used as last resource,
|
|
@@ -269,8 +237,8 @@ export function getUfoNameOverrides() {
|
|
|
269
237
|
if (!config) {
|
|
270
238
|
return undefined;
|
|
271
239
|
}
|
|
272
|
-
var
|
|
273
|
-
ufoNameOverrides =
|
|
240
|
+
var _config7 = config,
|
|
241
|
+
ufoNameOverrides = _config7.ufoNameOverrides;
|
|
274
242
|
if (ufoNameOverrides != null) {
|
|
275
243
|
return ufoNameOverrides;
|
|
276
244
|
}
|
|
@@ -286,8 +254,8 @@ export function getDoNotAbortActivePressInteraction() {
|
|
|
286
254
|
if (!config) {
|
|
287
255
|
return undefined;
|
|
288
256
|
}
|
|
289
|
-
var
|
|
290
|
-
doNotAbortActivePressInteraction =
|
|
257
|
+
var _config8 = config,
|
|
258
|
+
doNotAbortActivePressInteraction = _config8.doNotAbortActivePressInteraction;
|
|
291
259
|
return doNotAbortActivePressInteraction;
|
|
292
260
|
} catch (e) {
|
|
293
261
|
return undefined;
|
|
@@ -300,8 +268,8 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
300
268
|
if (!config) {
|
|
301
269
|
return undefined;
|
|
302
270
|
}
|
|
303
|
-
var
|
|
304
|
-
doNotAbortActivePressInteractionOnTransition =
|
|
271
|
+
var _config9 = config,
|
|
272
|
+
doNotAbortActivePressInteractionOnTransition = _config9.doNotAbortActivePressInteractionOnTransition;
|
|
305
273
|
return doNotAbortActivePressInteractionOnTransition;
|
|
306
274
|
} catch (e) {
|
|
307
275
|
return undefined;
|
|
@@ -313,8 +281,8 @@ export function getInteractionTimeout(ufoName) {
|
|
|
313
281
|
if (!config) {
|
|
314
282
|
return CLEANUP_TIMEOUT;
|
|
315
283
|
}
|
|
316
|
-
var
|
|
317
|
-
interactionTimeout =
|
|
284
|
+
var _config0 = config,
|
|
285
|
+
interactionTimeout = _config0.interactionTimeout;
|
|
318
286
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
319
287
|
return interactionTimeout[ufoName];
|
|
320
288
|
}
|