@atlaskit/react-ufo 4.5.2 → 4.5.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,19 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f438ecb761bb1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f438ecb761bb1) -
8
+ Move check for initial page load earlier for React hydration stats
9
+
10
+ ## 4.5.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [`5c1bb03531687`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c1bb03531687) -
15
+ FG cleanup - platform_ufo_handle_non_react_element_for_3p
16
+
3
17
  ## 4.5.2
4
18
 
5
19
  ### Patch Changes
@@ -714,7 +714,7 @@ function _createInteractionMetricsPayload() {
714
714
  (0, _addPerformanceMeasures.addPerformanceMeasures)(interaction.start, (0, _toConsumableArray2.default)((finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev']) || []));
715
715
  }
716
716
  getReactHydrationStats = function getReactHydrationStats() {
717
- if (!isPageLoad || !hydration) {
717
+ if (!hydration) {
718
718
  return {};
719
719
  }
720
720
  return {
@@ -696,7 +696,9 @@ function finishInteraction(id, data) {
696
696
  data.vc = observer.getVCRawData();
697
697
  }
698
698
  }
699
- data.hydration = (0, _config.getReactHydrationStats)();
699
+ if (data.type === 'page_load') {
700
+ data.hydration = (0, _config.getReactHydrationStats)();
701
+ }
700
702
 
701
703
  // By this time, stop the post interaction log observer if coinflip rate is 0
702
704
  var sanitisedUfoName = (0, _utils.sanitizeUfoName)(data.ufoName);
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.cleanupCaches = cleanupCaches;
8
8
  exports.default = checkWithinComponent;
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
9
  var _coinflip = _interopRequireDefault(require("../../../../coinflip"));
11
10
  var _checkFiberWithinComponent = _interopRequireDefault(require("./check-fiber-within-component"));
12
11
  var _findFiberWithCache = _interopRequireDefault(require("./find-fiber-with-cache"));
13
- var _findReactFiber = _interopRequireDefault(require("./find-react-fiber"));
14
12
  var DEFAULT_MAX_LEVEL = 20;
15
13
 
16
14
  // Cache cleanup
@@ -37,27 +35,21 @@ function checkWithinComponent(node, targetComponentName, resultCache) {
37
35
  }
38
36
  var fiber = null;
39
37
  var checkedNodes = [];
40
- if ((0, _platformFeatureFlags.fg)('platform_ufo_handle_non_react_element_for_3p')) {
41
- fiber = (0, _findFiberWithCache.default)(node, DEFAULT_MAX_LEVEL, checkedNodes);
42
- } else {
43
- fiber = (0, _findReactFiber.default)(node);
44
- }
38
+
39
+ // Always use cached fiber strategy to handle non-React elements reliably
40
+ fiber = (0, _findFiberWithCache.default)(node, DEFAULT_MAX_LEVEL, checkedNodes);
45
41
  if (!fiber) {
46
- if ((0, _platformFeatureFlags.fg)('platform_ufo_handle_non_react_element_for_3p')) {
47
- checkedNodes.forEach(function (checkedNode) {
48
- resultCache.set(checkedNode, false);
49
- });
50
- }
42
+ checkedNodes.forEach(function (checkedNode) {
43
+ resultCache.set(checkedNode, false);
44
+ });
51
45
  return {
52
46
  isWithin: false
53
47
  };
54
48
  }
55
49
  var isWithin = (0, _checkFiberWithinComponent.default)(fiber, targetComponentName, DEFAULT_MAX_LEVEL);
56
- if ((0, _platformFeatureFlags.fg)('platform_ufo_handle_non_react_element_for_3p')) {
57
- checkedNodes.forEach(function (checkedNode) {
58
- resultCache.set(checkedNode, isWithin);
59
- });
60
- }
50
+ checkedNodes.forEach(function (checkedNode) {
51
+ resultCache.set(checkedNode, isWithin);
52
+ });
61
53
  return {
62
54
  isWithin: isWithin
63
55
  };
@@ -699,7 +699,7 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
699
699
  addPerformanceMeasures(interaction.start, [...((finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev']) || [])]);
700
700
  }
701
701
  const getReactHydrationStats = () => {
702
- if (!isPageLoad || !hydration) {
702
+ if (!hydration) {
703
703
  return {};
704
704
  }
705
705
  return {
@@ -614,7 +614,9 @@ function finishInteraction(id, data, endTime = performance.now()) {
614
614
  data.vc = observer.getVCRawData();
615
615
  }
616
616
  }
617
- data.hydration = getReactHydrationStats();
617
+ if (data.type === 'page_load') {
618
+ data.hydration = getReactHydrationStats();
619
+ }
618
620
 
619
621
  // By this time, stop the post interaction log observer if coinflip rate is 0
620
622
  const sanitisedUfoName = sanitizeUfoName(data.ufoName);
@@ -1,8 +1,6 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  import coinflip from '../../../../coinflip';
3
2
  import checkFiberWithinComponent from './check-fiber-within-component';
4
3
  import findFiberWithCache from './find-fiber-with-cache';
5
- import findReactFiber from './find-react-fiber';
6
4
  const DEFAULT_MAX_LEVEL = 20;
7
5
 
8
6
  // Cache cleanup
@@ -29,27 +27,21 @@ export default function checkWithinComponent(node, targetComponentName, resultCa
29
27
  }
30
28
  let fiber = null;
31
29
  let checkedNodes = [];
32
- if (fg('platform_ufo_handle_non_react_element_for_3p')) {
33
- fiber = findFiberWithCache(node, DEFAULT_MAX_LEVEL, checkedNodes);
34
- } else {
35
- fiber = findReactFiber(node);
36
- }
30
+
31
+ // Always use cached fiber strategy to handle non-React elements reliably
32
+ fiber = findFiberWithCache(node, DEFAULT_MAX_LEVEL, checkedNodes);
37
33
  if (!fiber) {
38
- if (fg('platform_ufo_handle_non_react_element_for_3p')) {
39
- checkedNodes.forEach(checkedNode => {
40
- resultCache.set(checkedNode, false);
41
- });
42
- }
34
+ checkedNodes.forEach(checkedNode => {
35
+ resultCache.set(checkedNode, false);
36
+ });
43
37
  return {
44
38
  isWithin: false
45
39
  };
46
40
  }
47
41
  const isWithin = checkFiberWithinComponent(fiber, targetComponentName, DEFAULT_MAX_LEVEL);
48
- if (fg('platform_ufo_handle_non_react_element_for_3p')) {
49
- checkedNodes.forEach(checkedNode => {
50
- resultCache.set(checkedNode, isWithin);
51
- });
52
- }
42
+ checkedNodes.forEach(checkedNode => {
43
+ resultCache.set(checkedNode, isWithin);
44
+ });
53
45
  return {
54
46
  isWithin
55
47
  };
@@ -705,7 +705,7 @@ function _createInteractionMetricsPayload() {
705
705
  addPerformanceMeasures(interaction.start, _toConsumableArray((finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev']) || []));
706
706
  }
707
707
  getReactHydrationStats = function getReactHydrationStats() {
708
- if (!isPageLoad || !hydration) {
708
+ if (!hydration) {
709
709
  return {};
710
710
  }
711
711
  return {
@@ -650,7 +650,9 @@ function finishInteraction(id, data) {
650
650
  data.vc = observer.getVCRawData();
651
651
  }
652
652
  }
653
- data.hydration = getReactHydrationStats();
653
+ if (data.type === 'page_load') {
654
+ data.hydration = getReactHydrationStats();
655
+ }
654
656
 
655
657
  // By this time, stop the post interaction log observer if coinflip rate is 0
656
658
  var sanitisedUfoName = sanitizeUfoName(data.ufoName);
@@ -1,8 +1,6 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  import coinflip from '../../../../coinflip';
3
2
  import checkFiberWithinComponent from './check-fiber-within-component';
4
3
  import findFiberWithCache from './find-fiber-with-cache';
5
- import findReactFiber from './find-react-fiber';
6
4
  var DEFAULT_MAX_LEVEL = 20;
7
5
 
8
6
  // Cache cleanup
@@ -29,27 +27,21 @@ export default function checkWithinComponent(node, targetComponentName, resultCa
29
27
  }
30
28
  var fiber = null;
31
29
  var checkedNodes = [];
32
- if (fg('platform_ufo_handle_non_react_element_for_3p')) {
33
- fiber = findFiberWithCache(node, DEFAULT_MAX_LEVEL, checkedNodes);
34
- } else {
35
- fiber = findReactFiber(node);
36
- }
30
+
31
+ // Always use cached fiber strategy to handle non-React elements reliably
32
+ fiber = findFiberWithCache(node, DEFAULT_MAX_LEVEL, checkedNodes);
37
33
  if (!fiber) {
38
- if (fg('platform_ufo_handle_non_react_element_for_3p')) {
39
- checkedNodes.forEach(function (checkedNode) {
40
- resultCache.set(checkedNode, false);
41
- });
42
- }
34
+ checkedNodes.forEach(function (checkedNode) {
35
+ resultCache.set(checkedNode, false);
36
+ });
43
37
  return {
44
38
  isWithin: false
45
39
  };
46
40
  }
47
41
  var isWithin = checkFiberWithinComponent(fiber, targetComponentName, DEFAULT_MAX_LEVEL);
48
- if (fg('platform_ufo_handle_non_react_element_for_3p')) {
49
- checkedNodes.forEach(function (checkedNode) {
50
- resultCache.set(checkedNode, isWithin);
51
- });
52
- }
42
+ checkedNodes.forEach(function (checkedNode) {
43
+ resultCache.set(checkedNode, isWithin);
44
+ });
53
45
  return {
54
46
  isWithin: isWithin
55
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.5.2",
3
+ "version": "4.5.4",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -25,55 +25,6 @@
25
25
  },
26
26
  "sideEffects": false,
27
27
  "atlaskit:src": "src/index.ts",
28
- "af:exports": {
29
- "./additional-payload": "./src/additional-payload/index.ts",
30
- "./bundle-eval-timing": "./src/bundle-eval-timing/index.ts",
31
- "./coinflip": "./src/coinflip/index.ts",
32
- "./common": "./src/common/index.ts",
33
- "./config": "./src/config/index.ts",
34
- "./create-experimental-interaction-metrics-payload": "./src/create-experimental-interaction-metrics-payload/index.ts",
35
- "./create-payload": "./src/create-payload/index.ts",
36
- "./create-post-interaction-log-payload": "./src/create-post-interaction-log-payload/index.ts",
37
- "./custom-data": "./src/custom-data/index.ts",
38
- "./custom-cohort-data": "./src/custom-cohort-data/index.ts",
39
- "./custom-mark": "./src/custom-mark/index.ts",
40
- "./custom-spans": "./src/custom-spans/index.ts",
41
- "./custom-timings": "./src/custom-timings/index.ts",
42
- "./experience-trace-id-context": "./src/experience-trace-id-context/index.ts",
43
- "./feature-flags-accessed": "./src/feature-flags-accessed/index.ts",
44
- "./generate-id": "./src/generate-id/index.ts",
45
- "./global-error-handler": "./src/global-error-handler/index.ts",
46
- "./hidden-timing": "./src/hidden-timing/index.ts",
47
- "./initial-page-load-extra-timing": "./src/initial-page-load-extra-timing/index.ts",
48
- "./interaction-context": "./src/interaction-context/index.ts",
49
- "./interaction-id-context": "./src/interaction-id-context/index.ts",
50
- "./interaction-ignore": "./src/interaction-ignore/index.ts",
51
- "./interaction-metrics": "./src/interaction-metrics/index.ts",
52
- "./interaction-metrics-init": "./src/interaction-metrics-init/index.ts",
53
- "./label": "./src/label/index.ts",
54
- "./load-hold": "./src/load-hold/index.ts",
55
- "./placeholder": "./src/placeholder/index.ts",
56
- "./resource-timing": "./src/resource-timing/index.ts",
57
- "./round-number": "./src/round-number/index.ts",
58
- "./route-name": "./src/route-name/index.ts",
59
- "./route-name-context": "./src/route-name-context/index.ts",
60
- "./segment": "./src/segment/index.ts",
61
- "./set-interaction-error": "./src/set-interaction-error/index.ts",
62
- "./short-id": "./src/short-id/index.ts",
63
- "./ssr": "./src/ssr/index.ts",
64
- "./ssr-scripts": "./src/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.ts",
65
- "./suspense": "./src/suspense/index.ts",
66
- "./trace-interaction": "./src/trace-interaction/index.ts",
67
- "./trace-pageload": "./src/trace-pageload/index.ts",
68
- "./trace-press": "./src/trace-press/index.ts",
69
- "./trace-redirect": "./src/trace-redirect/index.ts",
70
- "./trace-transition": "./src/trace-transition/index.ts",
71
- "./typing-performance-tracing": "./src/typing-performance-tracing/index.ts",
72
- "./use-press-tracing": "./src/use-press-tracing/index.ts",
73
- "./vc": "./src/vc/index.ts",
74
- "./vc-media": "./src/vc/vc-observer/media-wrapper/index.ts",
75
- ".": "./src/index.ts"
76
- },
77
28
  "dependencies": {
78
29
  "@atlaskit/browser-apis": "^0.0.1",
79
30
  "@atlaskit/feature-gate-js-client": "^5.5.0",
@@ -175,9 +126,6 @@
175
126
  "platform_ufo_enable_vc_press_interactions": {
176
127
  "type": "boolean"
177
128
  },
178
- "platform_ufo_handle_non_react_element_for_3p": {
179
- "type": "boolean"
180
- },
181
129
  "platform_ufo_segment_critical_metrics": {
182
130
  "type": "boolean"
183
131
  },