@atlaskit/react-ufo 5.2.5 → 5.2.7
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/config/index.js +48 -28
- package/dist/cjs/create-payload/index.js +2 -2
- package/dist/cjs/experience-trace-id-context/context-manager.js +4 -4
- package/dist/cjs/ignore-holds/index.js +1 -2
- package/dist/cjs/interaction-metrics-init/index.js +10 -1
- package/dist/cjs/load-hold/UFOLoadHold.js +9 -1
- package/dist/cjs/segment/segment.js +10 -2
- package/dist/cjs/segment/third-party-segment.js +1 -2
- package/dist/cjs/trace-interaction/internal/trace-ufo-interaction.js +4 -0
- package/dist/cjs/trace-pageload/index.js +8 -0
- package/dist/cjs/trace-transition/index.js +4 -0
- package/dist/es2019/config/index.js +21 -2
- package/dist/es2019/create-payload/index.js +1 -1
- package/dist/es2019/experience-trace-id-context/context-manager.js +4 -4
- package/dist/es2019/ignore-holds/index.js +1 -2
- package/dist/es2019/interaction-metrics-init/index.js +11 -2
- package/dist/es2019/load-hold/UFOLoadHold.js +9 -1
- package/dist/es2019/segment/segment.js +11 -3
- package/dist/es2019/segment/third-party-segment.js +1 -2
- package/dist/es2019/trace-interaction/internal/trace-ufo-interaction.js +5 -1
- package/dist/es2019/trace-pageload/index.js +9 -1
- package/dist/es2019/trace-transition/index.js +5 -1
- package/dist/esm/config/index.js +47 -28
- package/dist/esm/create-payload/index.js +2 -2
- package/dist/esm/experience-trace-id-context/context-manager.js +4 -4
- package/dist/esm/ignore-holds/index.js +1 -2
- package/dist/esm/interaction-metrics-init/index.js +11 -2
- package/dist/esm/load-hold/UFOLoadHold.js +9 -1
- package/dist/esm/segment/segment.js +11 -3
- package/dist/esm/segment/third-party-segment.js +1 -2
- package/dist/esm/trace-interaction/internal/trace-ufo-interaction.js +5 -1
- package/dist/esm/trace-pageload/index.js +9 -1
- package/dist/esm/trace-transition/index.js +5 -1
- package/dist/types/config/index.d.ts +10 -0
- package/dist/types/ignore-holds/index.d.ts +1 -5
- package/dist/types/segment/segment.d.ts +1 -5
- package/dist/types/segment/third-party-segment.d.ts +0 -3
- package/dist/types-ts4.5/config/index.d.ts +10 -0
- package/dist/types-ts4.5/ignore-holds/index.d.ts +1 -5
- package/dist/types-ts4.5/segment/segment.d.ts +1 -5
- package/dist/types-ts4.5/segment/third-party-segment.d.ts +0 -3
- package/package.json +4 -4
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
2
|
import { v4 as createUUID } from 'uuid';
|
|
3
3
|
import coinflip from '../../coinflip';
|
|
4
|
-
import { getDoNotAbortActivePressInteraction, getInteractionRate, getMinorInteractions } from '../../config';
|
|
4
|
+
import { getDoNotAbortActivePressInteraction, getInteractionRate, getMinorInteractions, isUFOEnabled } from '../../config';
|
|
5
5
|
import { getActiveTrace, setInteractionActiveTrace } from '../../experience-trace-id-context';
|
|
6
6
|
import { DefaultInteractionID } from '../../interaction-id-context';
|
|
7
7
|
import { abortAll, addNewInteraction, getActiveInteraction } from '../../interaction-metrics';
|
|
8
8
|
import UFORouteName from '../../route-name-context';
|
|
9
9
|
function traceUFOInteraction(name, interactionType, startTime) {
|
|
10
10
|
var _getMinorInteractions;
|
|
11
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
12
|
+
if (!isUFOEnabled()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
const rate = getInteractionRate(name, interactionType);
|
|
12
16
|
const pressInteractionsList = getDoNotAbortActivePressInteraction();
|
|
13
17
|
const minorInteractions = (pressInteractionsList !== null && pressInteractionsList !== void 0 ? pressInteractionsList : []).concat((_getMinorInteractions = getMinorInteractions()) !== null && _getMinorInteractions !== void 0 ? _getMinorInteractions : []);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
2
|
import { v4 as createUUID } from 'uuid';
|
|
3
3
|
import coinflip from '../coinflip';
|
|
4
|
-
import { getInteractionRate } from '../config';
|
|
4
|
+
import { getInteractionRate, isUFOEnabled } from '../config';
|
|
5
5
|
import { getActiveTrace } from '../experience-trace-id-context';
|
|
6
6
|
import { DefaultInteractionID } from '../interaction-id-context';
|
|
7
7
|
import { abort, addHoldByID, addNewInteraction, getActiveInteraction, removeHoldByID, updatePageLoadInteractionName } from '../interaction-metrics';
|
|
8
8
|
import UFORouteName from '../route-name-context';
|
|
9
9
|
const AWAITING_PAGELOAD_NAME = 'awaiting_pageload_name';
|
|
10
10
|
function traceUFOPageLoad(ufoName, routeName = ufoName) {
|
|
11
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
12
|
+
if (!isUFOEnabled()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
const activeInteraction = getActiveInteraction();
|
|
12
16
|
if (activeInteraction && !ufoName) {
|
|
13
17
|
return;
|
|
@@ -34,6 +38,10 @@ function traceUFOPageLoad(ufoName, routeName = ufoName) {
|
|
|
34
38
|
}
|
|
35
39
|
export default traceUFOPageLoad;
|
|
36
40
|
export function updatePageloadName(ufoName, routeName = ufoName) {
|
|
41
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
42
|
+
if (!isUFOEnabled()) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
37
45
|
const interaction = getActiveInteraction();
|
|
38
46
|
if (!interaction || interaction.type !== 'page_load' && interaction.type !== 'transition') {
|
|
39
47
|
return;
|
|
@@ -3,13 +3,17 @@ import { useContext, useEffect } from 'react';
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import { v4 as createUUID } from 'uuid';
|
|
5
5
|
import coinflip from '../coinflip';
|
|
6
|
-
import { getDoNotAbortActivePressInteractionOnTransition, getInteractionRate } from '../config';
|
|
6
|
+
import { getDoNotAbortActivePressInteractionOnTransition, getInteractionRate, isUFOEnabled } from '../config';
|
|
7
7
|
import { getActiveTrace } from '../experience-trace-id-context';
|
|
8
8
|
import UFOInteractionIDContext, { DefaultInteractionID } from '../interaction-id-context';
|
|
9
9
|
import { abortAll, addNewInteraction, addOnCancelCallback, getActiveInteraction, tryComplete } from '../interaction-metrics';
|
|
10
10
|
import UFORouteName from '../route-name-context';
|
|
11
11
|
import { setInteractionActiveTrace } from './utils/set-interaction-active-trace';
|
|
12
12
|
function traceUFOTransition(ufoName, routeName = ufoName) {
|
|
13
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
14
|
+
if (!isUFOEnabled()) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
13
17
|
const pressInteractionsList = getDoNotAbortActivePressInteractionOnTransition();
|
|
14
18
|
const interaction = getActiveInteraction();
|
|
15
19
|
if (pressInteractionsList && interaction) {
|
package/dist/esm/config/index.js
CHANGED
|
@@ -33,6 +33,25 @@ export function setUFOConfig(newConfig) {
|
|
|
33
33
|
export function getConfig() {
|
|
34
34
|
return config;
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check if UFO is enabled based on the config.enabled field.
|
|
39
|
+
*
|
|
40
|
+
* This function is gated behind the platform_ufo_enable_killswitch_config feature flag.
|
|
41
|
+
* When the feature flag is disabled, UFO is always considered enabled (default behavior).
|
|
42
|
+
* When the feature flag is enabled, the config.enabled field is respected.
|
|
43
|
+
*
|
|
44
|
+
* @returns true if UFO is enabled, false if disabled
|
|
45
|
+
*/
|
|
46
|
+
export function isUFOEnabled() {
|
|
47
|
+
var _config;
|
|
48
|
+
// Only respect the config.enabled field when the killswitch feature flag is enabled
|
|
49
|
+
if (!fg('platform_ufo_enable_killswitch_config')) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
// Default to enabled if config is not set or enabled is not explicitly false
|
|
53
|
+
return ((_config = config) === null || _config === void 0 ? void 0 : _config.enabled) !== false;
|
|
54
|
+
}
|
|
36
55
|
var isValidConfigArray = function isValidConfigArray(array) {
|
|
37
56
|
return Array.isArray(array) && array.length > 0;
|
|
38
57
|
};
|
|
@@ -74,8 +93,8 @@ export function getReactHydrationStats() {
|
|
|
74
93
|
return undefined;
|
|
75
94
|
}
|
|
76
95
|
try {
|
|
77
|
-
var
|
|
78
|
-
var stats = (
|
|
96
|
+
var _config2, _config2$getReactHydr;
|
|
97
|
+
var stats = (_config2 = config) === null || _config2 === void 0 || (_config2$getReactHydr = _config2.getReactHydrationStats) === null || _config2$getReactHydr === void 0 ? void 0 : _config2$getReactHydr.call(_config2);
|
|
79
98
|
return stats !== null && stats !== void 0 ? stats : undefined;
|
|
80
99
|
} catch (e) {
|
|
81
100
|
// eslint-disable-next-line no-console
|
|
@@ -88,12 +107,12 @@ export function getInteractionRate(name, interactionKind) {
|
|
|
88
107
|
if (!config) {
|
|
89
108
|
return 0;
|
|
90
109
|
}
|
|
91
|
-
var
|
|
92
|
-
killswitch =
|
|
93
|
-
rates =
|
|
94
|
-
rules =
|
|
95
|
-
kind =
|
|
96
|
-
autoGeneratedRate =
|
|
110
|
+
var _config3 = config,
|
|
111
|
+
killswitch = _config3.killswitch,
|
|
112
|
+
rates = _config3.rates,
|
|
113
|
+
rules = _config3.rules,
|
|
114
|
+
kind = _config3.kind,
|
|
115
|
+
autoGeneratedRate = _config3.autoGeneratedRate;
|
|
97
116
|
if (killswitch != null) {
|
|
98
117
|
// Specifically kill certain events
|
|
99
118
|
if (killswitch.includes(name)) {
|
|
@@ -151,8 +170,8 @@ export function getExperimentalInteractionRate(name, interactionType) {
|
|
|
151
170
|
if (!config) {
|
|
152
171
|
return 0;
|
|
153
172
|
}
|
|
154
|
-
var
|
|
155
|
-
experimentalInteractionMetrics =
|
|
173
|
+
var _config4 = config,
|
|
174
|
+
experimentalInteractionMetrics = _config4.experimentalInteractionMetrics;
|
|
156
175
|
if (!(experimentalInteractionMetrics !== null && experimentalInteractionMetrics !== void 0 && experimentalInteractionMetrics.enabled)) {
|
|
157
176
|
return 0;
|
|
158
177
|
}
|
|
@@ -187,8 +206,8 @@ export function getCapabilityRate(capability) {
|
|
|
187
206
|
if (!config) {
|
|
188
207
|
return 0;
|
|
189
208
|
}
|
|
190
|
-
var
|
|
191
|
-
capabilityRate =
|
|
209
|
+
var _config5 = config,
|
|
210
|
+
capabilityRate = _config5.capability;
|
|
192
211
|
if (capabilityRate != null) {
|
|
193
212
|
var rate = capabilityRate[capability];
|
|
194
213
|
if (rate != null) {
|
|
@@ -233,8 +252,8 @@ export function getTypingPerformanceTracingMethod() {
|
|
|
233
252
|
if (!config) {
|
|
234
253
|
return defaultMethod;
|
|
235
254
|
}
|
|
236
|
-
var
|
|
237
|
-
typingMethod =
|
|
255
|
+
var _config6 = config,
|
|
256
|
+
typingMethod = _config6.typingMethod;
|
|
238
257
|
if (typingMethod != null && validTypingMethods.find(function (m) {
|
|
239
258
|
return m === typingMethod;
|
|
240
259
|
})) {
|
|
@@ -253,8 +272,8 @@ export function getAwaitBM3TTIList() {
|
|
|
253
272
|
if (!config) {
|
|
254
273
|
return [];
|
|
255
274
|
}
|
|
256
|
-
var
|
|
257
|
-
awaitBM3TTI =
|
|
275
|
+
var _config7 = config,
|
|
276
|
+
awaitBM3TTI = _config7.awaitBM3TTI;
|
|
258
277
|
if (awaitBM3TTI != null) {
|
|
259
278
|
return awaitBM3TTI;
|
|
260
279
|
} else {
|
|
@@ -274,8 +293,8 @@ export function getUfoNameOverrides() {
|
|
|
274
293
|
if (!config) {
|
|
275
294
|
return undefined;
|
|
276
295
|
}
|
|
277
|
-
var
|
|
278
|
-
ufoNameOverrides =
|
|
296
|
+
var _config8 = config,
|
|
297
|
+
ufoNameOverrides = _config8.ufoNameOverrides;
|
|
279
298
|
if (ufoNameOverrides != null) {
|
|
280
299
|
return ufoNameOverrides;
|
|
281
300
|
}
|
|
@@ -289,8 +308,8 @@ export function getMinorInteractions() {
|
|
|
289
308
|
if (!config) {
|
|
290
309
|
return undefined;
|
|
291
310
|
}
|
|
292
|
-
var
|
|
293
|
-
minorInteractions =
|
|
311
|
+
var _config9 = config,
|
|
312
|
+
minorInteractions = _config9.minorInteractions;
|
|
294
313
|
return minorInteractions;
|
|
295
314
|
} catch (_unused9) {
|
|
296
315
|
return undefined;
|
|
@@ -303,8 +322,8 @@ export function getDoNotAbortActivePressInteraction() {
|
|
|
303
322
|
if (!config) {
|
|
304
323
|
return undefined;
|
|
305
324
|
}
|
|
306
|
-
var
|
|
307
|
-
doNotAbortActivePressInteraction =
|
|
325
|
+
var _config0 = config,
|
|
326
|
+
doNotAbortActivePressInteraction = _config0.doNotAbortActivePressInteraction;
|
|
308
327
|
return doNotAbortActivePressInteraction;
|
|
309
328
|
} catch (_unused0) {
|
|
310
329
|
return undefined;
|
|
@@ -317,8 +336,8 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
317
336
|
if (!config) {
|
|
318
337
|
return undefined;
|
|
319
338
|
}
|
|
320
|
-
var
|
|
321
|
-
doNotAbortActivePressInteractionOnTransition =
|
|
339
|
+
var _config1 = config,
|
|
340
|
+
doNotAbortActivePressInteractionOnTransition = _config1.doNotAbortActivePressInteractionOnTransition;
|
|
322
341
|
return doNotAbortActivePressInteractionOnTransition;
|
|
323
342
|
} catch (_unused1) {
|
|
324
343
|
return undefined;
|
|
@@ -331,8 +350,8 @@ export function getFinishInteractionOnTransition() {
|
|
|
331
350
|
if (!config) {
|
|
332
351
|
return undefined;
|
|
333
352
|
}
|
|
334
|
-
var
|
|
335
|
-
finishInteractionOnTransition =
|
|
353
|
+
var _config10 = config,
|
|
354
|
+
finishInteractionOnTransition = _config10.finishInteractionOnTransition;
|
|
336
355
|
return finishInteractionOnTransition;
|
|
337
356
|
} catch (_unused10) {
|
|
338
357
|
return undefined;
|
|
@@ -344,8 +363,8 @@ export function getInteractionTimeout(ufoName) {
|
|
|
344
363
|
if (!config) {
|
|
345
364
|
return CLEANUP_TIMEOUT;
|
|
346
365
|
}
|
|
347
|
-
var
|
|
348
|
-
interactionTimeout =
|
|
366
|
+
var _config11 = config,
|
|
367
|
+
interactionTimeout = _config11.interactionTimeout;
|
|
349
368
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
350
369
|
return interactionTimeout[ufoName];
|
|
351
370
|
}
|
|
@@ -9,9 +9,9 @@ try{return acc+item.cssRules.length;}catch(_unused3){return acc;}},0);var styleE
|
|
|
9
9
|
getInitialPageLoadSSRMetrics=function getInitialPageLoadSSRMetrics(){var _config$ssr;if(!isPageLoad){return{};}var config=getConfig();var SSRDoneTimeValue=getSSRDoneTimeValue(config);var SSRDoneTime=SSRDoneTimeValue!==undefined?{SSRDoneTime:Math.round(SSRDoneTimeValue)}:{};var isBM3ConfigSSRDoneAsFmp=interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp;var isUFOConfigSSRDoneAsFmp=interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp||!!(config!==null&&config!==void 0&&(_config$ssr=config.ssr)!==null&&_config$ssr!==void 0&&_config$ssr.getSSRDoneTime);if(!experimental&&(isBM3ConfigSSRDoneAsFmp||isUFOConfigSSRDoneAsFmp)&&SSRDoneTimeValue!==undefined){try{performance.mark("FMP",{startTime:SSRDoneTimeValue,detail:{devtools:{dataType:'marker'}}});}catch(_unused6){}}return _objectSpread(_objectSpread({},SSRDoneTime),{},{isBM3ConfigSSRDoneAsFmp:isBM3ConfigSSRDoneAsFmp,isUFOConfigSSRDoneAsFmp:isUFOConfigSSRDoneAsFmp});};pageLoadInteractionMetrics=getInitialPageLoadSSRMetrics();// Detailed payload. Page visibility = visible
|
|
10
10
|
getDetailedInteractionMetrics=function getDetailedInteractionMetrics(resourceTimings){if(experimental||window.__UFO_COMPACT_PAYLOAD__||!isDetailedPayload){return{};}var spans=[].concat(_toConsumableArray(interaction.spans),_toConsumableArray(atlaskitInteractionSpans));atlaskitInteractionSpans.length=0;var shouldInclude3pHolds=shouldUseRawDataThirdPartyBehavior(ufoName,type);var basePayload={errors:interaction.errors.map(function(_ref2){var labelStack=_ref2.labelStack,others=_objectWithoutProperties(_ref2,_excluded);return _objectSpread(_objectSpread({},others),{},{labelStack:labelStack&&optimizeLabelStack(labelStack,getReactUFOPayloadVersion(interaction.type))});}),holdActive:_toConsumableArray(interaction.holdActive.values()),redirects:optimizeRedirects(interaction.redirects,start),holdInfo:optimizeHoldInfo(experimental?interaction.holdExpInfo:interaction.holdInfo,start,getReactUFOPayloadVersion(interaction.type)),spans:optimizeSpans(spans,start,getReactUFOPayloadVersion(interaction.type)),requestInfo:optimizeRequestInfo(interaction.requestInfo,start,getReactUFOPayloadVersion(interaction.type)),customTimings:optimizeCustomTimings(interaction.customTimings,start),bundleEvalTimings:objectToArray(getBundleEvalTimings(start)),resourceTimings:objectToArray(resourceTimings)};// Include third-party holds when feature flag is active
|
|
11
11
|
if(shouldInclude3pHolds){var _interaction$hold3pIn;return _objectSpread(_objectSpread({},basePayload),{},{hold3pActive:interaction.hold3pActive?_toConsumableArray(interaction.hold3pActive.values()):[],hold3pInfo:optimizeHoldInfo((_interaction$hold3pIn=interaction.hold3pInfo)!==null&&_interaction$hold3pIn!==void 0?_interaction$hold3pIn:[],start,getReactUFOPayloadVersion(interaction.type))});}return basePayload;};// Page load & detailed payload
|
|
12
|
-
getPageLoadDetailedInteractionMetrics=function getPageLoadDetailedInteractionMetrics(){var _config$ssr2,_config$ssr2$getSSRTi;if(!isPageLoad||!isDetailedPayload){return{};}var initialPageLoadExtraTimings=objectToArray(initialPageLoadExtraTiming.getTimings());var config=getConfig();var defaultSSRTimings=objectToArray(ssr.getSSRTimings());var ssrTimingsFromConfig=config===null||config===void 0||(_config$ssr2=config.ssr)===null||_config$ssr2===void 0||(_config$ssr2$getSSRTi=_config$ssr2.getSSRTimings)===null||_config$ssr2$getSSRTi===void 0?void 0:_config$ssr2$getSSRTi.call(_config$ssr2);return{initialPageLoadExtraTimings:initialPageLoadExtraTimings,SSRTimings:ssrTimingsFromConfig?[].concat(_toConsumableArray(ssrTimingsFromConfig),_toConsumableArray(defaultSSRTimings)):defaultSSRTimings};};if(experimental){expTTAI=getTTAI(interaction);}else{regularTTAI=getTTAI(interaction);}newUFOName=sanitizeUfoName(ufoName);resourceTimings=getResourceTimings(start,end);_context.t0=Promise;_context.t1=vcMetrics;if(_context.t1){_context.next=29;break;}_context.next=28;return getVCMetrics(interaction);case 28:_context.t1=_context.sent;case 29:_context.t2=_context.t1;_context.t3=experimental?getExperimentalVCMetrics(interaction):Promise.resolve(undefined);_context.t4=getPaintMetricsToLegacyFormat(type,end);_context.t5=getBatteryInfoToLegacyFormat();_context.t6=[_context.t2,_context.t3,_context.t4,_context.t5];_context.next=36;return _context.t0.all.call(_context.t0,_context.t6);case 36:_yield$Promise$all=_context.sent;_yield$Promise$all2=_slicedToArray(_yield$Promise$all,4);finalVCMetrics=_yield$Promise$all2[0];experimentalMetrics=_yield$Promise$all2[1];paintMetrics=_yield$Promise$all2[2];batteryInfo=_yield$Promise$all2[3];if(!experimental){addPerformanceMeasures(interaction.start,_toConsumableArray((finalVCMetrics===null||finalVCMetrics===void 0?void 0:finalVCMetrics['ufo:vc:rev'])||[]));}getReactHydrationStats=function getReactHydrationStats(){if(!hydration){return{};}return{hydration:hydration};};payload={actionSubject:'experience',action:'measured',eventType:'operational',source:'measured',tags:['observability'],attributes:{properties:_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
12
|
+
getPageLoadDetailedInteractionMetrics=function getPageLoadDetailedInteractionMetrics(){var _config$ssr2,_config$ssr2$getSSRTi;if(!isPageLoad||!isDetailedPayload){return{};}var initialPageLoadExtraTimings=objectToArray(initialPageLoadExtraTiming.getTimings());var config=getConfig();var defaultSSRTimings=objectToArray(ssr.getSSRTimings());var ssrTimingsFromConfig=config===null||config===void 0||(_config$ssr2=config.ssr)===null||_config$ssr2===void 0||(_config$ssr2$getSSRTi=_config$ssr2.getSSRTimings)===null||_config$ssr2$getSSRTi===void 0?void 0:_config$ssr2$getSSRTi.call(_config$ssr2);return{initialPageLoadExtraTimings:initialPageLoadExtraTimings,SSRTimings:ssrTimingsFromConfig?[].concat(_toConsumableArray(ssrTimingsFromConfig),_toConsumableArray(defaultSSRTimings)):defaultSSRTimings};};if(experimental){expTTAI=getTTAI(interaction);}else{regularTTAI=getTTAI(interaction);}newUFOName=sanitizeUfoName(ufoName);resourceTimings=getResourceTimings(start,end);_context.t0=Promise;_context.t1=vcMetrics;if(_context.t1){_context.next=29;break;}_context.next=28;return getVCMetrics(interaction);case 28:_context.t1=_context.sent;case 29:_context.t2=_context.t1;_context.t3=experimental?getExperimentalVCMetrics(interaction):Promise.resolve(undefined);_context.t4=getPaintMetricsToLegacyFormat(type,end);_context.t5=getBatteryInfoToLegacyFormat();_context.t6=[_context.t2,_context.t3,_context.t4,_context.t5];_context.next=36;return _context.t0.all.call(_context.t0,_context.t6);case 36:_yield$Promise$all=_context.sent;_yield$Promise$all2=_slicedToArray(_yield$Promise$all,4);finalVCMetrics=_yield$Promise$all2[0];experimentalMetrics=_yield$Promise$all2[1];paintMetrics=_yield$Promise$all2[2];batteryInfo=_yield$Promise$all2[3];if(!experimental){addPerformanceMeasures(interaction.start,_toConsumableArray((finalVCMetrics===null||finalVCMetrics===void 0?void 0:finalVCMetrics['ufo:vc:rev'])||[]));}getReactHydrationStats=function getReactHydrationStats(){if(!hydration){return{};}return{hydration:hydration};};payload={actionSubject:'experience',action:'measured',eventType:'operational',source:'measured',tags:['observability'],attributes:{properties:_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({// basic
|
|
13
13
|
'event:hostname':((_window$location=window.location)===null||_window$location===void 0?void 0:_window$location.hostname)||'unknown','event:product':config.product,'event:population':config.population,'event:schema':'1.0.0','event:sizeInKb':0,'event:source':{name:'react-ufo/web',version:getReactUFOPayloadVersion(interaction.type)},'event:region':config.region||'unknown','experience:key':experimental?'custom.experimental-interaction-metrics':'custom.interaction-metrics','experience:name':newUFOName,// Include CPU usage monitoring data
|
|
14
|
-
'event:cpu:usage':createPressureStateReport(interaction.start,interaction.end),'event:memory:usage':createMemoryStateReport(interaction.start,interaction.end)},criticalPayloadCount!==undefined?{'ufo:multipayload':true,'ufo:criticalPayloadCount':criticalPayloadCount}:{}),
|
|
14
|
+
'event:cpu:usage':createPressureStateReport(interaction.start,interaction.end),'event:memory:usage':createMemoryStateReport(interaction.start,interaction.end)},criticalPayloadCount!==undefined?{'ufo:multipayload':true,'ufo:criticalPayloadCount':criticalPayloadCount}:{}),{},{'ufo:pageVisibilityHiddenTimestamp':getEarliestHiddenTiming(interaction.start,interaction.end),'ufo:wasPageHiddenBeforeInit':getHasHiddenTimingBeforeSetup(),'ufo:isOpenedInBackground':isOpenedInBackground(interaction.type)},fg('platform_ufo_is_tab_throttled')?{'ufo:isTabThrottled':isTabThrottled(start,end)}:{}),fg('ufo_detect_aborting_interaction_during_ssr')?{'ufo:hasAbortingInteractionDuringSSR':getHasAbortingEventDuringSSR()}:{}),getBrowserMetadataToLegacyFormat()),batteryInfo),getSSRProperties(type)),getAssetsMetrics(interaction,pageLoadInteractionMetrics===null||pageLoadInteractionMetrics===void 0?void 0:pageLoadInteractionMetrics.SSRDoneTime)),getPPSMetrics(interaction)),paintMetrics),getNavigationMetricsToLegacyFormat(type)),finalVCMetrics),experimentalMetrics),(_config$additionalPay=config.additionalPayloadData)===null||_config$additionalPay===void 0?void 0:_config$additionalPay.call(config,interaction)),getTracingContextData(interaction)),getStylesheetMetrics()),getErrorCounts(interaction)),getReactHydrationStats()),{},{interactionMetrics:_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({namePrefix:config.namePrefix||'',segmentPrefix:config.segmentPrefix||'',interactionId:interactionId,pageVisibilityAtTTI:pageVisibilityAtTTI,pageVisibilityAtTTAI:pageVisibilityAtTTAI,experimental__pageVisibilityAtTTI:moreAccuratePageVisibilityAtTTI,experimental__pageVisibilityAtTTAI:moreAccuratePageVisibilityAtTTAI,// raw interaction metrics
|
|
15
15
|
rate:rate,routeName:routeName,type:type,abortReason:abortReason,featureFlags:featureFlags,previousInteractionName:previousInteractionName,isPreviousInteractionAborted:isPreviousInteractionAborted,abortedByInteractionName:abortedByInteractionName,// performance
|
|
16
16
|
apdex:optimizeApdex(interaction.apdex,getReactUFOPayloadVersion(interaction.type)),end:Math.round(end)},interaction.end3p?{end3p:Math.round(interaction.end3p)}:{}),{},{start:Math.round(start),segments:getReactUFOPayloadVersion(interaction.type)==='2.0.0'?segmentTree:getOldSegmentsLabelStack(segments,interaction.type),marks:optimizeMarks(interaction.marks,getReactUFOPayloadVersion(interaction.type)),customData:optimizeCustomData(interaction),reactProfilerTimings:optimizeReactProfilerTimings(interaction.reactProfilerTimings,start,getReactUFOPayloadVersion(interaction.type)),minorInteractions:interaction.minorInteractions},responsiveness?{responsiveness:responsiveness}:{}),labelStack),pageLoadInteractionMetrics),getDetailedInteractionMetrics(resourceTimings)),getPageLoadDetailedInteractionMetrics()),getBm3TrackerTimings(interaction)),{},{'metric:ttai':experimental?regularTTAI||expTTAI:undefined,'metric:experimental:ttai':expTTAI},unknownElementName?{unknownElementName:unknownElementName}:{}),unknownElementHierarchy?{unknownElementHierarchy:unknownElementHierarchy}:{}),'ufo:payloadTime':roundEpsilon(performance.now()-interactionPayloadStart)})}};if(experimental){regularTTAI=undefined;expTTAI=undefined;}if(fg('platform_ufo_enable_vc_raw_data')){size=getPayloadSize(payload.attributes.properties);vcRev=payload.attributes.properties['ufo:vc:rev'];rawData=vcRev.find(function(item){return item.revision==='raw-handler';});if(rawData){rawDataSize=getPayloadSize(rawData);payload.attributes.properties['ufo:vc:raw:size']=rawDataSize;if(size>MAX_PAYLOAD_SIZE&&Array.isArray(vcRev)&&vcRev.length>0){payload.attributes.properties['ufo:vc:rev']=vcRev.filter(function(item){return item.revision!=='raw-handler';});payload.attributes.properties['ufo:vc:raw:removed']=true;}}payload.attributes.properties['event:sizeInKb']=getPayloadSize(payload.attributes.properties);}else{payload.attributes.properties['event:sizeInKb']=getPayloadSize(payload.attributes.properties);}// in order of importance, first one being least important
|
|
17
17
|
// we can add more fields as necessary
|
|
@@ -9,7 +9,7 @@ import { ROOT_CONTEXT } from '@opentelemetry/api';
|
|
|
9
9
|
* and we need to get it because we need to call a function that's not available in the OTel API:
|
|
10
10
|
* `setActive`. The OTel JS API design doesn't allow us to manually set the active context
|
|
11
11
|
* despite the spec allowing for the capability. Sigh.
|
|
12
|
-
*
|
|
12
|
+
*
|
|
13
13
|
* I imagine this situation might not be permanent if we can move to a system were we can rely
|
|
14
14
|
* solely on the API, but for the purposes of the first change being React UFO API compatible,
|
|
15
15
|
* we'll need to do this.
|
|
@@ -23,7 +23,7 @@ export function getContextManager() {
|
|
|
23
23
|
return contextManager;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
27
|
* The below is shamelessly borrowed from StackContextManager from @opentelemetry/sdk-trace-web
|
|
28
28
|
* Using this rather than importing the entire package because this is all we need for now
|
|
29
29
|
*/
|
|
@@ -157,9 +157,9 @@ export var UFOContextManager = /*#__PURE__*/function () {
|
|
|
157
157
|
* This function is an extension of the OTel spec, in order to facilitate the current API of React UFO trace context handling.
|
|
158
158
|
* It doesn't keep track of any previously set active contexts, because it's assumed (for now) that only one trace context
|
|
159
159
|
* will ever exist at a time.
|
|
160
|
-
* The next step in the work to improve tracing in the FE will likely remove this function as we need to track the
|
|
160
|
+
* The next step in the work to improve tracing in the FE will likely remove this function as we need to track the
|
|
161
161
|
* hierarchy of contexts (likely using the `with()` function above).
|
|
162
|
-
* @param context The context to be made the globally active one
|
|
162
|
+
* @param context The context to be made the globally active one
|
|
163
163
|
*/
|
|
164
164
|
}, {
|
|
165
165
|
key: "setActive",
|
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
import { context } from '@opentelemetry/api';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { startLighthouseObserver } from '../additional-payload';
|
|
7
|
-
import { setUFOConfig } from '../config';
|
|
7
|
+
import { isUFOEnabled, setUFOConfig } from '../config';
|
|
8
8
|
import { experimentalVC, sinkExperimentalHandler } from '../create-experimental-interaction-metrics-payload';
|
|
9
9
|
import { sinkExtraSearchPageInteractionHandler } from '../create-extra-search-page-interaction-payload';
|
|
10
10
|
import { setContextManager, UFOContextManager } from '../experience-trace-id-context/context-manager';
|
|
@@ -144,10 +144,19 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
// Always set config first so isUFOEnabled() can check config.enabled
|
|
148
|
+
setUFOConfig(config);
|
|
149
|
+
|
|
150
|
+
// If UFO is disabled via config, skip all initialization
|
|
151
|
+
// This is gated behind platform_ufo_enable_killswitch_config feature flag
|
|
152
|
+
if (!isUFOEnabled()) {
|
|
153
|
+
initialized = true;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
147
157
|
// Initialize pressure observer for CPU usage monitoring
|
|
148
158
|
initialisePressureObserver();
|
|
149
159
|
initialiseMemoryObserver();
|
|
150
|
-
setUFOConfig(config);
|
|
151
160
|
if (fg('platform_ufo_enable_otel_context_manager')) {
|
|
152
161
|
// Configure global OTel context manager
|
|
153
162
|
var contextManager = new UFOContextManager();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useContext, useEffect, useLayoutEffect, useState } from 'react';
|
|
3
|
+
import { isUFOEnabled } from '../config';
|
|
3
4
|
import UFOInteractionContext from '../interaction-context';
|
|
4
5
|
import UFOInteractionIDContext, { subscribeToInteractionIdChanges } from '../interaction-id-context';
|
|
5
6
|
var useLayoutEffectSAFE = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
@@ -76,18 +77,25 @@ export default function UFOLoadHold(_ref) {
|
|
|
76
77
|
hold = _ref$hold === void 0 ? true : _ref$hold,
|
|
77
78
|
_ref$experimental = _ref.experimental,
|
|
78
79
|
experimental = _ref$experimental === void 0 ? false : _ref$experimental;
|
|
80
|
+
// Check if UFO is enabled (gated behind platform_ufo_enable_killswitch_config feature flag)
|
|
81
|
+
// Note: isUFOEnabled() returns a stable value based on config, so it's safe to call before hooks
|
|
82
|
+
var ufoEnabled = isUFOEnabled();
|
|
79
83
|
var currentInteractionId = useInteractionIdValue();
|
|
80
84
|
|
|
81
85
|
// react-18: useId instead
|
|
82
86
|
var context = useContext(UFOInteractionContext);
|
|
83
87
|
useLayoutEffectSAFE(function () {
|
|
88
|
+
// Skip hold registration if UFO is disabled
|
|
89
|
+
if (!ufoEnabled) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
84
92
|
if (hold && context != null) {
|
|
85
93
|
if (experimental && context.holdExperimental) {
|
|
86
94
|
return context.holdExperimental(name);
|
|
87
95
|
}
|
|
88
96
|
return context.hold(name);
|
|
89
97
|
}
|
|
90
|
-
}, [hold, context, name, currentInteractionId]);
|
|
98
|
+
}, [hold, context, name, currentInteractionId, ufoEnabled]);
|
|
91
99
|
|
|
92
100
|
// react-18: can return children directly
|
|
93
101
|
return children != null ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;
|
|
@@ -8,7 +8,7 @@ import { unstable_NormalPriority as NormalPriority, unstable_scheduleCallback as
|
|
|
8
8
|
import { v4 as createUUID } from 'uuid';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import coinflip from '../coinflip';
|
|
11
|
-
import { getConfig, getDoNotAbortActivePressInteraction, getInteractionRate, getMinorInteractions } from '../config';
|
|
11
|
+
import { getConfig, getDoNotAbortActivePressInteraction, getInteractionRate, getMinorInteractions, isUFOEnabled } from '../config';
|
|
12
12
|
import { getActiveTrace, setInteractionActiveTrace } from '../experience-trace-id-context';
|
|
13
13
|
import UFOInteractionContext from '../interaction-context';
|
|
14
14
|
import UFOInteractionIDContext from '../interaction-id-context';
|
|
@@ -28,6 +28,10 @@ export default function UFOSegment(_ref) {
|
|
|
28
28
|
mode = _ref$mode === void 0 ? 'single' : _ref$mode,
|
|
29
29
|
_ref$type = _ref.type,
|
|
30
30
|
type = _ref$type === void 0 ? 'first-party' : _ref$type;
|
|
31
|
+
// If UFO is disabled, render children without any tracking overhead
|
|
32
|
+
// This is gated behind platform_ufo_enable_killswitch_config feature flag
|
|
33
|
+
// Note: isUFOEnabled() returns a stable value based on config, so it's safe to call before hooks
|
|
34
|
+
var ufoEnabled = isUFOEnabled();
|
|
31
35
|
var parentContext = useContext(UFOInteractionContext);
|
|
32
36
|
var segmentIdMap = useMemo(function () {
|
|
33
37
|
if (!(parentContext !== null && parentContext !== void 0 && parentContext.segmentIdMap)) {
|
|
@@ -271,6 +275,11 @@ export default function UFOSegment(_ref) {
|
|
|
271
275
|
return l.name;
|
|
272
276
|
}).join('/');
|
|
273
277
|
}, [labelStack]);
|
|
278
|
+
|
|
279
|
+
// If UFO is disabled, just render children without tracking overhead
|
|
280
|
+
if (!ufoEnabled) {
|
|
281
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
282
|
+
}
|
|
274
283
|
var ufoSegment = /*#__PURE__*/React.createElement(UFOInteractionContext.Provider, {
|
|
275
284
|
value: interactionContext
|
|
276
285
|
}, /*#__PURE__*/React.createElement(Profiler, {
|
|
@@ -284,5 +293,4 @@ export default function UFOSegment(_ref) {
|
|
|
284
293
|
}, ufoSegment);
|
|
285
294
|
}
|
|
286
295
|
return ufoSegment;
|
|
287
|
-
}
|
|
288
|
-
UFOSegment.displayName = 'UFOSegment';
|
|
296
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
2
|
import { v4 as createUUID } from 'uuid';
|
|
3
3
|
import coinflip from '../../coinflip';
|
|
4
|
-
import { getDoNotAbortActivePressInteraction, getInteractionRate, getMinorInteractions } from '../../config';
|
|
4
|
+
import { getDoNotAbortActivePressInteraction, getInteractionRate, getMinorInteractions, isUFOEnabled } from '../../config';
|
|
5
5
|
import { getActiveTrace, setInteractionActiveTrace } from '../../experience-trace-id-context';
|
|
6
6
|
import { DefaultInteractionID } from '../../interaction-id-context';
|
|
7
7
|
import { abortAll, addNewInteraction, getActiveInteraction } from '../../interaction-metrics';
|
|
8
8
|
import UFORouteName from '../../route-name-context';
|
|
9
9
|
function traceUFOInteraction(name, interactionType, startTime) {
|
|
10
10
|
var _getMinorInteractions;
|
|
11
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
12
|
+
if (!isUFOEnabled()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
var rate = getInteractionRate(name, interactionType);
|
|
12
16
|
var pressInteractionsList = getDoNotAbortActivePressInteraction();
|
|
13
17
|
var minorInteractions = (pressInteractionsList !== null && pressInteractionsList !== void 0 ? pressInteractionsList : []).concat((_getMinorInteractions = getMinorInteractions()) !== null && _getMinorInteractions !== void 0 ? _getMinorInteractions : []);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
2
|
import { v4 as createUUID } from 'uuid';
|
|
3
3
|
import coinflip from '../coinflip';
|
|
4
|
-
import { getInteractionRate } from '../config';
|
|
4
|
+
import { getInteractionRate, isUFOEnabled } from '../config';
|
|
5
5
|
import { getActiveTrace } from '../experience-trace-id-context';
|
|
6
6
|
import { DefaultInteractionID } from '../interaction-id-context';
|
|
7
7
|
import { abort, addHoldByID, addNewInteraction, getActiveInteraction, removeHoldByID, updatePageLoadInteractionName } from '../interaction-metrics';
|
|
@@ -9,6 +9,10 @@ import UFORouteName from '../route-name-context';
|
|
|
9
9
|
var AWAITING_PAGELOAD_NAME = 'awaiting_pageload_name';
|
|
10
10
|
function traceUFOPageLoad(ufoName) {
|
|
11
11
|
var routeName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ufoName;
|
|
12
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
13
|
+
if (!isUFOEnabled()) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
12
16
|
var activeInteraction = getActiveInteraction();
|
|
13
17
|
if (activeInteraction && !ufoName) {
|
|
14
18
|
return;
|
|
@@ -36,6 +40,10 @@ function traceUFOPageLoad(ufoName) {
|
|
|
36
40
|
export default traceUFOPageLoad;
|
|
37
41
|
export function updatePageloadName(ufoName) {
|
|
38
42
|
var routeName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ufoName;
|
|
43
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
44
|
+
if (!isUFOEnabled()) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
39
47
|
var interaction = getActiveInteraction();
|
|
40
48
|
if (!interaction || interaction.type !== 'page_load' && interaction.type !== 'transition') {
|
|
41
49
|
return;
|
|
@@ -3,7 +3,7 @@ import { useContext, useEffect } from 'react';
|
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import { v4 as createUUID } from 'uuid';
|
|
5
5
|
import coinflip from '../coinflip';
|
|
6
|
-
import { getDoNotAbortActivePressInteractionOnTransition, getInteractionRate } from '../config';
|
|
6
|
+
import { getDoNotAbortActivePressInteractionOnTransition, getInteractionRate, isUFOEnabled } from '../config';
|
|
7
7
|
import { getActiveTrace } from '../experience-trace-id-context';
|
|
8
8
|
import UFOInteractionIDContext, { DefaultInteractionID } from '../interaction-id-context';
|
|
9
9
|
import { abortAll, addNewInteraction, addOnCancelCallback, getActiveInteraction, tryComplete } from '../interaction-metrics';
|
|
@@ -11,6 +11,10 @@ import UFORouteName from '../route-name-context';
|
|
|
11
11
|
import { setInteractionActiveTrace } from './utils/set-interaction-active-trace';
|
|
12
12
|
function traceUFOTransition(ufoName) {
|
|
13
13
|
var routeName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ufoName;
|
|
14
|
+
// Skip if UFO is disabled (gated behind platform_ufo_enable_killswitch_config)
|
|
15
|
+
if (!isUFOEnabled()) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
14
18
|
var pressInteractionsList = getDoNotAbortActivePressInteractionOnTransition();
|
|
15
19
|
var interaction = getActiveInteraction();
|
|
16
20
|
if (pressInteractionsList && interaction) {
|
|
@@ -190,6 +190,16 @@ export type Config = {
|
|
|
190
190
|
};
|
|
191
191
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
192
192
|
export declare function getConfig(): Config | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Check if UFO is enabled based on the config.enabled field.
|
|
195
|
+
*
|
|
196
|
+
* This function is gated behind the platform_ufo_enable_killswitch_config feature flag.
|
|
197
|
+
* When the feature flag is disabled, UFO is always considered enabled (default behavior).
|
|
198
|
+
* When the feature flag is enabled, the config.enabled field is respected.
|
|
199
|
+
*
|
|
200
|
+
* @returns true if UFO is enabled, false if disabled
|
|
201
|
+
*/
|
|
202
|
+
export declare function isUFOEnabled(): boolean;
|
|
193
203
|
export declare function getEnabledVCRevisions(experienceKey?: string): readonly TTVCRevision[];
|
|
194
204
|
export declare function isVCRevisionEnabled(revision: TTVCRevision, experienceKey?: string): boolean;
|
|
195
205
|
export declare function getMostRecentVCRevision(experienceKey?: string): TTVCRevision;
|
|
@@ -24,8 +24,4 @@ export type UFOIgnoreHoldsProps = {
|
|
|
24
24
|
* Has an `ignore` prop, to allow you to use it conditionally
|
|
25
25
|
* Has a `reason` prop, to specify why the hold is being ignored
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
declare namespace UFOIgnoreHolds {
|
|
29
|
-
var displayName: string;
|
|
30
|
-
}
|
|
31
|
-
export default UFOIgnoreHolds;
|
|
27
|
+
export default function UFOIgnoreHolds({ children, ignore, }: UFOIgnoreHoldsProps): React.JSX.Element;
|
|
@@ -7,8 +7,4 @@ export type Props = {
|
|
|
7
7
|
type?: UFOSegmentType;
|
|
8
8
|
};
|
|
9
9
|
/** A portion of the page we apply measurement to */
|
|
10
|
-
|
|
11
|
-
declare namespace UFOSegment {
|
|
12
|
-
var displayName: string;
|
|
13
|
-
}
|
|
14
|
-
export default UFOSegment;
|
|
10
|
+
export default function UFOSegment({ name: segmentName, children, mode, type, }: Props): React.JSX.Element;
|
|
@@ -190,6 +190,16 @@ export type Config = {
|
|
|
190
190
|
};
|
|
191
191
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
192
192
|
export declare function getConfig(): Config | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Check if UFO is enabled based on the config.enabled field.
|
|
195
|
+
*
|
|
196
|
+
* This function is gated behind the platform_ufo_enable_killswitch_config feature flag.
|
|
197
|
+
* When the feature flag is disabled, UFO is always considered enabled (default behavior).
|
|
198
|
+
* When the feature flag is enabled, the config.enabled field is respected.
|
|
199
|
+
*
|
|
200
|
+
* @returns true if UFO is enabled, false if disabled
|
|
201
|
+
*/
|
|
202
|
+
export declare function isUFOEnabled(): boolean;
|
|
193
203
|
export declare function getEnabledVCRevisions(experienceKey?: string): readonly TTVCRevision[];
|
|
194
204
|
export declare function isVCRevisionEnabled(revision: TTVCRevision, experienceKey?: string): boolean;
|
|
195
205
|
export declare function getMostRecentVCRevision(experienceKey?: string): TTVCRevision;
|
|
@@ -24,8 +24,4 @@ export type UFOIgnoreHoldsProps = {
|
|
|
24
24
|
* Has an `ignore` prop, to allow you to use it conditionally
|
|
25
25
|
* Has a `reason` prop, to specify why the hold is being ignored
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
declare namespace UFOIgnoreHolds {
|
|
29
|
-
var displayName: string;
|
|
30
|
-
}
|
|
31
|
-
export default UFOIgnoreHolds;
|
|
27
|
+
export default function UFOIgnoreHolds({ children, ignore, }: UFOIgnoreHoldsProps): React.JSX.Element;
|
|
@@ -7,8 +7,4 @@ export type Props = {
|
|
|
7
7
|
type?: UFOSegmentType;
|
|
8
8
|
};
|
|
9
9
|
/** A portion of the page we apply measurement to */
|
|
10
|
-
|
|
11
|
-
declare namespace UFOSegment {
|
|
12
|
-
var displayName: string;
|
|
13
|
-
}
|
|
14
|
-
export default UFOSegment;
|
|
10
|
+
export default function UFOSegment({ name: segmentName, children, mode, type, }: Props): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.7",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -134,9 +134,6 @@
|
|
|
134
134
|
"platform_ufo_add_segments_count_threshold": {
|
|
135
135
|
"type": "boolean"
|
|
136
136
|
},
|
|
137
|
-
"platform_ufo_browser_backgrounded_abort_timestamp": {
|
|
138
|
-
"type": "boolean"
|
|
139
|
-
},
|
|
140
137
|
"platform_ufo_segment_unmount_count": {
|
|
141
138
|
"type": "boolean"
|
|
142
139
|
},
|
|
@@ -211,6 +208,9 @@
|
|
|
211
208
|
},
|
|
212
209
|
"ufo_vc_revision_trim_enabled": {
|
|
213
210
|
"type": "boolean"
|
|
211
|
+
},
|
|
212
|
+
"platform_ufo_enable_killswitch_config": {
|
|
213
|
+
"type": "boolean"
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
}
|