@atlaskit/react-ufo 3.9.2 → 3.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#148802](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148802)
8
+ [`47aa048599ddc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/47aa048599ddc) -
9
+ FF cleanup - ufo_capture_stylesheet_metrics
10
+
11
+ ## 3.9.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#149225](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149225)
16
+ [`212d1bc6cd2a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/212d1bc6cd2a7) -
17
+ set the FAILED status client side, and ignore BM3 TTI event status
18
+ - [#148864](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148864)
19
+ [`93b2b5271da55`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/93b2b5271da55) -
20
+ FF cleanup: platform_ufo_custom_data_structured_clone
21
+
3
22
  ## 3.9.2
4
23
 
5
24
  ### Patch Changes
@@ -14,7 +14,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
16
16
  var _bowserUltralight = _interopRequireDefault(require("bowser-ultralight"));
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var _additionalPayload = require("../additional-payload");
19
18
  var _assets = require("../assets");
20
19
  var bundleEvalTiming = _interopRequireWildcard(require("../bundle-eval-timing"));
@@ -652,10 +651,6 @@ function getPayloadSize(payload) {
652
651
  return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
653
652
  }
654
653
  function getStylesheetMetrics() {
655
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
656
- if (!(0, _platformFeatureFlags.fg)('ufo_capture_stylesheet_metrics')) {
657
- return {};
658
- }
659
654
  try {
660
655
  var stylesheets = Array.from(document.styleSheets);
661
656
  var stylesheetCount = stylesheets.length;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
7
8
  /**
8
9
  * Determines the interaction status based on abort reason and BM3 TTI presence.
9
10
  *
@@ -28,8 +29,12 @@ exports.default = void 0;
28
29
  */
29
30
  function getInteractionStatus(interaction) {
30
31
  var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
32
+ var hasErrors = interaction.errors.length > 0;
33
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_set_event_failed_status_in_client')) {
34
+ originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
35
+ }
31
36
  var hasBm3TTI = interaction.apdex.length > 0;
32
- var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
37
+ var overrideStatus = hasBm3TTI && !(0, _platformFeatureFlags.fg)('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
33
38
  return {
34
39
  originalInteractionStatus: originalInteractionStatus,
35
40
  overrideStatus: overrideStatus
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.addUFOCustomData = addUFOCustomData;
8
8
  exports.default = UFOCustomData;
9
9
  var _react = require("react");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _interactionContext = _interopRequireDefault(require("../interaction-context"));
12
11
  var _interactionIdContext = require("../interaction-id-context");
13
12
  var _interactionMetrics = require("../interaction-metrics");
@@ -18,7 +17,7 @@ function UFOCustomData(_ref) {
18
17
  if (!interactionContext) {
19
18
  return;
20
19
  }
21
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_custom_data_structured_clone')) {
20
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
22
21
  interactionContext.addCustomData(globalThis.structuredClone(data));
23
22
  } else {
24
23
  interactionContext.addCustomData(data);
@@ -32,7 +31,7 @@ function addUFOCustomData(data) {
32
31
  if (!currentInteractionId) {
33
32
  return;
34
33
  }
35
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_custom_data_structured_clone')) {
34
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
36
35
  (0, _interactionMetrics.addCustomData)(currentInteractionId, [], globalThis.structuredClone(data));
37
36
  } else {
38
37
  (0, _interactionMetrics.addCustomData)(currentInteractionId, [], data);
@@ -1,5 +1,4 @@
1
1
  import Bowser from 'bowser-ultralight';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { getLighthouseMetrics } from '../additional-payload';
4
3
  import { CHRReporter } from '../assets';
5
4
  import * as bundleEvalTiming from '../bundle-eval-timing';
@@ -626,10 +625,6 @@ function getPayloadSize(payload) {
626
625
  return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
627
626
  }
628
627
  function getStylesheetMetrics() {
629
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
630
- if (!fg('ufo_capture_stylesheet_metrics')) {
631
- return {};
632
- }
633
628
  try {
634
629
  const stylesheets = Array.from(document.styleSheets);
635
630
  const stylesheetCount = stylesheets.length;
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  /**
2
3
  * Determines the interaction status based on abort reason and BM3 TTI presence.
3
4
  *
@@ -21,9 +22,13 @@
21
22
  * // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
22
23
  */
23
24
  function getInteractionStatus(interaction) {
24
- const originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
25
+ let originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
26
+ const hasErrors = interaction.errors.length > 0;
27
+ if (fg('platform_ufo_set_event_failed_status_in_client')) {
28
+ originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
29
+ }
25
30
  const hasBm3TTI = interaction.apdex.length > 0;
26
- const overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
31
+ const overrideStatus = hasBm3TTI && !fg('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
27
32
  return {
28
33
  originalInteractionStatus,
29
34
  overrideStatus
@@ -1,5 +1,4 @@
1
1
  import { useContext, useMemo } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import UFOInteractionContext from '../interaction-context';
4
3
  import { getInteractionId } from '../interaction-id-context';
5
4
  import { addCustomData } from '../interaction-metrics';
@@ -11,7 +10,7 @@ export default function UFOCustomData({
11
10
  if (!interactionContext) {
12
11
  return;
13
12
  }
14
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
13
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
15
14
  interactionContext.addCustomData(globalThis.structuredClone(data));
16
15
  } else {
17
16
  interactionContext.addCustomData(data);
@@ -25,7 +24,7 @@ export function addUFOCustomData(data) {
25
24
  if (!currentInteractionId) {
26
25
  return;
27
26
  }
28
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
27
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
29
28
  addCustomData(currentInteractionId, [], globalThis.structuredClone(data));
30
29
  } else {
31
30
  addCustomData(currentInteractionId, [], data);
@@ -11,7 +11,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
  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; }
12
12
  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; }
13
13
  import Bowser from 'bowser-ultralight';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { getLighthouseMetrics } from '../additional-payload';
16
15
  import { CHRReporter } from '../assets';
17
16
  import * as bundleEvalTiming from '../bundle-eval-timing';
@@ -641,10 +640,6 @@ function getPayloadSize(payload) {
641
640
  return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
642
641
  }
643
642
  function getStylesheetMetrics() {
644
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
645
- if (!fg('ufo_capture_stylesheet_metrics')) {
646
- return {};
647
- }
648
643
  try {
649
644
  var stylesheets = Array.from(document.styleSheets);
650
645
  var stylesheetCount = stylesheets.length;
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  /**
2
3
  * Determines the interaction status based on abort reason and BM3 TTI presence.
3
4
  *
@@ -22,8 +23,12 @@
22
23
  */
23
24
  function getInteractionStatus(interaction) {
24
25
  var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
26
+ var hasErrors = interaction.errors.length > 0;
27
+ if (fg('platform_ufo_set_event_failed_status_in_client')) {
28
+ originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
29
+ }
25
30
  var hasBm3TTI = interaction.apdex.length > 0;
26
- var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
31
+ var overrideStatus = hasBm3TTI && !fg('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
27
32
  return {
28
33
  originalInteractionStatus: originalInteractionStatus,
29
34
  overrideStatus: overrideStatus
@@ -1,5 +1,4 @@
1
1
  import { useContext, useMemo } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import UFOInteractionContext from '../interaction-context';
4
3
  import { getInteractionId } from '../interaction-id-context';
5
4
  import { addCustomData } from '../interaction-metrics';
@@ -10,7 +9,7 @@ export default function UFOCustomData(_ref) {
10
9
  if (!interactionContext) {
11
10
  return;
12
11
  }
13
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
12
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
14
13
  interactionContext.addCustomData(globalThis.structuredClone(data));
15
14
  } else {
16
15
  interactionContext.addCustomData(data);
@@ -24,7 +23,7 @@ export function addUFOCustomData(data) {
24
23
  if (!currentInteractionId) {
25
24
  return;
26
25
  }
27
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
26
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
28
27
  addCustomData(currentInteractionId, [], globalThis.structuredClone(data));
29
28
  } else {
30
29
  addCustomData(currentInteractionId, [], data);