@atlaskit/react-ufo 4.1.5 → 4.1.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#190129](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/190129)
8
+ [`396971b979d5d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/396971b979d5d) -
9
+ FG cleanup - platform_ufo_ignore_extra_attributes
10
+ - [#190121](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/190121)
11
+ [`5541b82436020`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5541b82436020) -
12
+ FG cleanup - platform_ufo_timeout_simplification
13
+
14
+ ## 4.1.6
15
+
16
+ ### Patch Changes
17
+
18
+ - [#192382](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192382)
19
+ [`5f4f054f58647`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f4f054f58647) -
20
+ Add hard limit for findReactFiber
21
+
3
22
  ## 4.1.5
4
23
 
5
24
  ### Patch Changes
@@ -73,7 +73,6 @@ var postInteractionLog = exports.postInteractionLog = new _postInteractionLog.de
73
73
  var interactionQueue = [];
74
74
  var segmentCache = new Map();
75
75
  var CLEANUP_TIMEOUT = 60 * 1000;
76
- var CLEANUP_TIMEOUT_AFTER_APDEX = 15 * 1000;
77
76
  var segmentObservers = [];
78
77
  function getActiveInteraction() {
79
78
  var interactionId = (0, _interactionIdContext.getInteractionId)();
@@ -929,9 +928,6 @@ function addBrowserMetricEvent(event) {
929
928
  interaction.legacyMetrics = interaction.legacyMetrics || [];
930
929
  interaction.legacyMetrics.push(event);
931
930
  if ((interaction.type === 'page_load' || interaction.type === 'transition') && ((_event$config = event.config) === null || _event$config === void 0 ? void 0 : _event$config.type) === 'PAGE_LOAD') {
932
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_timeout_simplification')) {
933
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
934
- }
935
931
  removeHoldByID(interaction.id, interaction.ufoName);
936
932
  }
937
933
  }
@@ -950,9 +946,6 @@ function addApdexToAll(apdex) {
950
946
  // do nothing
951
947
  }
952
948
  if (interaction.type === 'page_load' || interaction.type === 'transition') {
953
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_timeout_simplification')) {
954
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
955
- }
956
949
  removeHoldByID(key, interaction.ufoName);
957
950
  }
958
951
  });
@@ -972,9 +965,6 @@ function addApdex(interactionId, apdexInfo) {
972
965
  // do nothing
973
966
  }
974
967
  if (interaction.type === 'page_load' || interaction.type === 'transition') {
975
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_timeout_simplification')) {
976
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
977
- }
978
968
  removeHoldByID(interactionId, interaction.ufoName);
979
969
  }
980
970
  }
@@ -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' || attributeName === 'data-is-ttvc-ready' || 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' || 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;
@@ -11,6 +11,7 @@ var _findReactFiber = _interopRequireDefault(require("./find-react-fiber"));
11
11
  var _getComponentName = _interopRequireDefault(require("./get-component-name"));
12
12
  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; }
13
13
  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; }
14
+ var DEFAULT_MAX_LEVEL = 20;
14
15
  // Using the React Fiber tree to traverse up the DOM and check if a node is within a specific component
15
16
  // and extract child component props if needed.
16
17
  function checkWithinComponentAndExtractChildProps(node, targetComponentName, childComponentConfig) {
@@ -18,11 +19,13 @@ function checkWithinComponentAndExtractChildProps(node, targetComponentName, chi
18
19
  if ((0, _platformFeatureFlags.fg)('platform_ufo_handle_non_react_element_for_3p')) {
19
20
  // Walk up the DOM tree to find React fiber (handles non-React-rendered elements)
20
21
  var currentElement = node;
21
- while (currentElement && !fiber) {
22
+ var levelsTraversed = 0;
23
+ while (currentElement && !fiber && levelsTraversed < DEFAULT_MAX_LEVEL) {
22
24
  fiber = (0, _findReactFiber.default)(currentElement);
23
25
  if (!fiber) {
24
26
  currentElement = currentElement.parentElement;
25
27
  }
28
+ levelsTraversed++;
26
29
  }
27
30
  } else {
28
31
  fiber = (0, _findReactFiber.default)(node);
@@ -17,7 +17,6 @@ export const postInteractionLog = new PostInteractionLog();
17
17
  const interactionQueue = [];
18
18
  const segmentCache = new Map();
19
19
  const CLEANUP_TIMEOUT = 60 * 1000;
20
- const CLEANUP_TIMEOUT_AFTER_APDEX = 15 * 1000;
21
20
  const segmentObservers = [];
22
21
  export function getActiveInteraction() {
23
22
  const interactionId = getInteractionId();
@@ -804,9 +803,6 @@ export function addBrowserMetricEvent(event) {
804
803
  interaction.legacyMetrics = interaction.legacyMetrics || [];
805
804
  interaction.legacyMetrics.push(event);
806
805
  if ((interaction.type === 'page_load' || interaction.type === 'transition') && ((_event$config = event.config) === null || _event$config === void 0 ? void 0 : _event$config.type) === 'PAGE_LOAD') {
807
- if (!fg('platform_ufo_timeout_simplification')) {
808
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
809
- }
810
806
  removeHoldByID(interaction.id, interaction.ufoName);
811
807
  }
812
808
  }
@@ -825,9 +821,6 @@ export function addApdexToAll(apdex) {
825
821
  // do nothing
826
822
  }
827
823
  if (interaction.type === 'page_load' || interaction.type === 'transition') {
828
- if (!fg('platform_ufo_timeout_simplification')) {
829
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
830
- }
831
824
  removeHoldByID(key, interaction.ufoName);
832
825
  }
833
826
  });
@@ -847,9 +840,6 @@ export function addApdex(interactionId, apdexInfo) {
847
840
  // do nothing
848
841
  }
849
842
  if (interaction.type === 'page_load' || interaction.type === 'transition') {
850
- if (!fg('platform_ufo_timeout_simplification')) {
851
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
852
- }
853
843
  removeHoldByID(interactionId, interaction.ufoName);
854
844
  }
855
845
  }
@@ -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' || attributeName === 'data-is-ttvc-ready' || 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' || 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;
@@ -1,7 +1,7 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
2
  import findReactFiber from './find-react-fiber';
3
3
  import getComponentName from './get-component-name';
4
-
4
+ const DEFAULT_MAX_LEVEL = 20;
5
5
  // Using the React Fiber tree to traverse up the DOM and check if a node is within a specific component
6
6
  // and extract child component props if needed.
7
7
  export default function checkWithinComponentAndExtractChildProps(node, targetComponentName, childComponentConfig) {
@@ -9,11 +9,13 @@ export default function checkWithinComponentAndExtractChildProps(node, targetCom
9
9
  if (fg('platform_ufo_handle_non_react_element_for_3p')) {
10
10
  // Walk up the DOM tree to find React fiber (handles non-React-rendered elements)
11
11
  let currentElement = node;
12
- while (currentElement && !fiber) {
12
+ let levelsTraversed = 0;
13
+ while (currentElement && !fiber && levelsTraversed < DEFAULT_MAX_LEVEL) {
13
14
  fiber = findReactFiber(currentElement);
14
15
  if (!fiber) {
15
16
  currentElement = currentElement.parentElement;
16
17
  }
18
+ levelsTraversed++;
17
19
  }
18
20
  } else {
19
21
  fiber = findReactFiber(node);
@@ -27,7 +27,6 @@ export var postInteractionLog = new PostInteractionLog();
27
27
  var interactionQueue = [];
28
28
  var segmentCache = new Map();
29
29
  var CLEANUP_TIMEOUT = 60 * 1000;
30
- var CLEANUP_TIMEOUT_AFTER_APDEX = 15 * 1000;
31
30
  var segmentObservers = [];
32
31
  export function getActiveInteraction() {
33
32
  var interactionId = getInteractionId();
@@ -883,9 +882,6 @@ export function addBrowserMetricEvent(event) {
883
882
  interaction.legacyMetrics = interaction.legacyMetrics || [];
884
883
  interaction.legacyMetrics.push(event);
885
884
  if ((interaction.type === 'page_load' || interaction.type === 'transition') && ((_event$config = event.config) === null || _event$config === void 0 ? void 0 : _event$config.type) === 'PAGE_LOAD') {
886
- if (!fg('platform_ufo_timeout_simplification')) {
887
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
888
- }
889
885
  removeHoldByID(interaction.id, interaction.ufoName);
890
886
  }
891
887
  }
@@ -904,9 +900,6 @@ export function addApdexToAll(apdex) {
904
900
  // do nothing
905
901
  }
906
902
  if (interaction.type === 'page_load' || interaction.type === 'transition') {
907
- if (!fg('platform_ufo_timeout_simplification')) {
908
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
909
- }
910
903
  removeHoldByID(key, interaction.ufoName);
911
904
  }
912
905
  });
@@ -926,9 +919,6 @@ export function addApdex(interactionId, apdexInfo) {
926
919
  // do nothing
927
920
  }
928
921
  if (interaction.type === 'page_load' || interaction.type === 'transition') {
929
- if (!fg('platform_ufo_timeout_simplification')) {
930
- interaction.changeTimeout(CLEANUP_TIMEOUT_AFTER_APDEX);
931
- }
932
922
  removeHoldByID(interactionId, interaction.ufoName);
933
923
  }
934
924
  }
@@ -49,7 +49,7 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
49
49
  if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
50
50
  return false;
51
51
  }
52
- 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)) {
52
+ 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' || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || attributeName === 'data-is-ttvc-ready' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
53
53
  return false;
54
54
  }
55
55
  return true;
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
5
  import findReactFiber from './find-react-fiber';
6
6
  import getComponentName from './get-component-name';
7
-
7
+ var DEFAULT_MAX_LEVEL = 20;
8
8
  // Using the React Fiber tree to traverse up the DOM and check if a node is within a specific component
9
9
  // and extract child component props if needed.
10
10
  export default function checkWithinComponentAndExtractChildProps(node, targetComponentName, childComponentConfig) {
@@ -12,11 +12,13 @@ export default function checkWithinComponentAndExtractChildProps(node, targetCom
12
12
  if (fg('platform_ufo_handle_non_react_element_for_3p')) {
13
13
  // Walk up the DOM tree to find React fiber (handles non-React-rendered elements)
14
14
  var currentElement = node;
15
- while (currentElement && !fiber) {
15
+ var levelsTraversed = 0;
16
+ while (currentElement && !fiber && levelsTraversed < DEFAULT_MAX_LEVEL) {
16
17
  fiber = findReactFiber(currentElement);
17
18
  if (!fiber) {
18
19
  currentElement = currentElement.parentElement;
19
20
  }
21
+ levelsTraversed++;
20
22
  }
21
23
  } else {
22
24
  fiber = findReactFiber(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.1.5",
3
+ "version": "4.1.7",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -165,9 +165,6 @@
165
165
  "platform_ufo_rll_placeholder_ignore": {
166
166
  "type": "boolean"
167
167
  },
168
- "platform_ufo_timeout_simplification": {
169
- "type": "boolean"
170
- },
171
168
  "platform_ufo_enable_timeout_config": {
172
169
  "type": "boolean"
173
170
  },
@@ -177,9 +174,6 @@
177
174
  "platform_ufo_enable_interactivity_jsm": {
178
175
  "type": "boolean"
179
176
  },
180
- "platform_ufo_ignore_extra_attributes": {
181
- "type": "boolean"
182
- },
183
177
  "platform_ufo_exclude_3p_elements_from_ttai": {
184
178
  "type": "boolean"
185
179
  },