@dynatrace/react-native-plugin 2.333.1 → 2.335.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.
@@ -11,9 +11,14 @@ const runDTUserInteraction = (root, filename, dynatraceOptions) => {
11
11
  if (!dtUiEnabled) {
12
12
  return { root, modified: false };
13
13
  }
14
- const shouldInjectPressableImport = typeof ((_a = dynatraceOptions === null || dynatraceOptions === void 0 ? void 0 : dynatraceOptions.input) === null || _a === void 0 ? void 0 : _a.instrument) === 'function'
15
- ? dynatraceOptions.input.instrument(filename) !== false
16
- : true;
14
+ const defaultConfig = (0, Config_1.getDTConfig)();
15
+ const defaultPathIdConfig = ((_a = defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.ui) === null || _a === void 0 ? void 0 : _a.pathId) || {};
16
+ const userPathIdConfig = (dynatraceOptions === null || dynatraceOptions === void 0 ? void 0 : dynatraceOptions.userInteractionPathId) || {};
17
+ const pathIdEnabledFromFlag = (dynatraceOptions === null || dynatraceOptions === void 0 ? void 0 : dynatraceOptions.userInteractionPathIds) !== false;
18
+ const mergedPathIdConfig = Object.assign(Object.assign(Object.assign({}, defaultPathIdConfig), userPathIdConfig), { enabled: typeof userPathIdConfig.enabled === 'boolean'
19
+ ? userPathIdConfig.enabled
20
+ : pathIdEnabledFromFlag });
21
+ const mergedDT = Object.assign(Object.assign({}, defaultConfig), { ui: Object.assign(Object.assign({}, ((defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.ui) || {})), { pathId: mergedPathIdConfig }) });
17
22
  let modified = false;
18
23
  const regs = (0, RootDetection_1.detectRootRegistrations)(root, filename);
19
24
  if (regs.length) {
@@ -23,10 +28,9 @@ const runDTUserInteraction = (root, filename, dynatraceOptions) => {
23
28
  modified = true;
24
29
  }
25
30
  }
26
- const mergedDT = Object.assign(Object.assign({}, (0, Config_1.getDTConfig)()), { shouldInjectPressableImport });
27
- const dt = (0, Plugin_1.default)(root, filename, mergedDT);
28
- root = dt.root;
29
- if (dt.changed) {
31
+ const pathIdResult = (0, Plugin_1.applyDTPathIdInstrumentation)(root, filename, mergedDT);
32
+ root = pathIdResult.root;
33
+ if (pathIdResult.changed) {
30
34
  modified = true;
31
35
  }
32
36
  return { root, modified };