@dynatrace/react-native-plugin 2.301.1 → 2.301.2

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.
Files changed (30) hide show
  1. package/README.md +35 -12
  2. package/ios/DynatraceRNBridge.mm +1 -1
  3. package/lib/CreateElement.js +2 -1
  4. package/lib/community/gesture-handler/Touchables.InstrInfo.js +16 -4
  5. package/lib/community/gesture-handler/Touchables.js +4 -2
  6. package/lib/instrumentor/base/Dynatrace.js +10 -3
  7. package/lib/instrumentor/base/DynatraceBridge.js +6 -2
  8. package/lib/instrumentor/base/DynatraceRootAction.js +4 -1
  9. package/lib/instrumentor/base/DynatraceWebRequestTiming.js +6 -3
  10. package/lib/instrumentor/base/ElementHelper.js +11 -5
  11. package/lib/instrumentor/base/ErrorHandler.js +1 -1
  12. package/lib/instrumentor/base/Logger.js +2 -1
  13. package/lib/instrumentor/base/Picker.js +7 -6
  14. package/lib/instrumentor/base/RefreshControl.js +3 -1
  15. package/lib/instrumentor/base/Switch.js +3 -3
  16. package/lib/instrumentor/base/Touchable.js +9 -8
  17. package/lib/instrumentor/base/configuration/Configuration.js +11 -10
  18. package/lib/instrumentor/base/configuration/ConfigurationPreset.js +0 -1
  19. package/lib/instrumentor/base/configuration/IConfiguration.js +0 -1
  20. package/lib/instrumentor/base/configuration/ManualStartupConfiguration.js +3 -3
  21. package/lib/instrumentor/base/interface/IDynatraceProperties.js +3 -3
  22. package/lib/instrumentor/model/Types.js +10 -11
  23. package/lib/jsx-dev-runtime.js +16 -6
  24. package/lib/jsx-runtime.js +21 -7
  25. package/lib/metro/getSourceMapInfo.js +2 -1
  26. package/lib/react/Component.js +7 -3
  27. package/lib/react-native/Touchables.js +6 -4
  28. package/lib/react-navigation/ReactNavigation.js +6 -2
  29. package/package.json +175 -171
  30. package/src/lib/instrumentor/base/interface/NativeDynatraceBridge.ts +150 -78
package/README.md CHANGED
@@ -138,6 +138,21 @@ const config = {
138
138
  module.exports = mergeConfig(defaultConfig, config);
139
139
  ```
140
140
 
141
+ #### For Expo
142
+
143
+ ```js
144
+ const {getDefaultConfig} = require('expo/metro-config');
145
+ const config = getDefaultConfig(__dirname);
146
+
147
+ config.transformer.babelTransformerPath = require.resolve(
148
+ '@dynatrace/react-native-plugin/lib/dynatrace-transformer',
149
+ );
150
+
151
+ config.reporter = require('@dynatrace/react-native-plugin/lib/dynatrace-reporter');
152
+
153
+ module.exports = config;
154
+ ```
155
+
141
156
  #### For React Native v0.59 or newer
142
157
 
143
158
  ```js
@@ -159,6 +174,8 @@ Define a mobile app in Dynatrace and open the Mobile app instrumentation setting
159
174
 
160
175
  > **Note**: Define the components that you want to see lifecycle instrumented ([example](#lifecycle)). This is important as you will only see Application startup and Touches out of the box.
161
176
 
177
+ > **Note for Expo**: If you are using expo make sure to use the upstreamTransformer property in the `dynatrace.config.js` file: `upstreamTransformer: require.resolve('@expo/metro-config/babel-transformer')`
178
+
162
179
  For more details about the configuration, see [Advanced topics](#structure-of-the-dynatracejs-file).
163
180
 
164
181
  ## 4. Update Babel Configuration
@@ -174,11 +191,13 @@ The required changes for the versions above can be found [here](#react-automatic
174
191
 
175
192
  ## 5. Build and run your app
176
193
 
177
- 1. Execute [`npx instrumentDynatrace`](#npx-instrumentdynatrace) or `react-native instrument-dynatrace` in the root of your React Native project. This will configure both Android and iOS projects with the settings from `dynatrace.config.js`. You can use the same [custom arguments](#customizing-paths-for-configuration) as mentioned above.
194
+ 1. Only for Expo: If using expo make sure that your project is containing a "android" and/or "ios" folder. This can be done by using `npx expo prebuild`.
178
195
 
179
- 2. Use `react-native run-android` or `react-native run-ios` to rebuild and run your app. Specify custom paths via [custom arguments.](#customizing-paths-for-configuration).
196
+ 2. Execute [`npx instrumentDynatrace`](#npx-instrumentdynatrace) or `react-native instrument-dynatrace` in the root of your React Native project. This will configure both Android and iOS projects with the settings from `dynatrace.config.js`. You can use the same [custom arguments](#customizing-paths-for-configuration) as mentioned above.
180
197
 
181
- 3. **Attention:** Whenever you change your configuration in dynatrace.config.js please use `react-native start --reset-cache` option. Metro caches all files and a configuration change might lead to a different situation. Not resetting the cache might result in an mixture of old and new configuration.
198
+ 1. Use `react-native run-android` or `react-native run-ios` to rebuild and run your app. Specify custom paths via [custom arguments.](#customizing-paths-for-configuration).
199
+
200
+ 4. **Attention:** Whenever you change your configuration in dynatrace.config.js please use `react-native start --reset-cache` option. Metro caches all files and a configuration change might lead to a different situation. Not resetting the cache might result in an mixture of old and new configuration.
182
201
 
183
202
  # Advanced topics
184
203
 
@@ -1160,15 +1179,18 @@ module.exports = {
1160
1179
  Using `babel-preset-expo`:
1161
1180
 
1162
1181
  ```js
1163
- module.exports = {
1164
- presets: [
1165
- ['babel-preset-expo',
1166
- {
1167
- jsxRuntime: 'automatic',
1168
- jsxImportSource: '@dynatrace/react-native-plugin',
1169
- },
1182
+ module.exports = function (api) {
1183
+ api.cache(true);
1184
+ return {
1185
+ presets: [
1186
+ ['babel-preset-expo',
1187
+ {
1188
+ jsxRuntime: 'automatic',
1189
+ jsxImportSource: '@dynatrace/react-native-plugin',
1190
+ },
1191
+ ],
1170
1192
  ],
1171
- ],
1193
+ };
1172
1194
  };
1173
1195
  ```
1174
1196
 
@@ -1438,11 +1460,12 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
1438
1460
  <br/><br/>
1439
1461
  ## Changelog
1440
1462
 
1441
- 2.301.1
1463
+ 2.301.2
1442
1464
  * Updated Android (8.301.1.1004) & iOS Agent (8.301.1.1008)
1443
1465
  * Fix iOS crashes to not report on session after crash
1444
1466
  * RectButton check/logic updated
1445
1467
  * Improved startup log line
1468
+ * Updated crash type for [manually reported iOS crashes](#manually-report-a-crash) using `reportCrashWithException`
1446
1469
 
1447
1470
  2.299.1
1448
1471
  * Updated Android (8.299.1.1004) & iOS Agent (8.299.1.1003)
@@ -177,7 +177,7 @@ RCT_EXPORT_METHOD(reportCrash:(NSString *)errorName errorReason:(NSString *)erro
177
177
  if ([self shouldWorkOnIosWithPlatform: platform])
178
178
  {
179
179
  if(isRealError){
180
- [DTXAction reportExternalCrashForPlatformType:DTXActionPlatformCustom crashName:errorName reason:errorReason stacktrace:stacktrace];
180
+ [DTXAction reportExternalCrashForPlatformType:DTXActionPlatformJavaScript crashName:errorName reason:errorReason stacktrace:stacktrace];
181
181
  }else{
182
182
  [DTXAction reportExternalCrashForPlatformType:DTXActionPlatformCustom crashName:errorName reason:errorReason stacktrace:stacktrace];
183
183
  }
@@ -10,7 +10,8 @@ const createElement = (type, props, ...children) => {
10
10
  return _createElement(Component_1.DynatraceFnWrapper, {}, _createElement(type, props, ...children));
11
11
  }
12
12
  else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
13
- type.prototype !== undefined && type.prototype.isReactComponent !== undefined) {
13
+ type.prototype !== undefined &&
14
+ type.prototype.isReactComponent !== undefined) {
14
15
  return _createElement(Component_1.DynatraceClassWrapper, {}, _createElement(type, props, ...children));
15
16
  }
16
17
  else {
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.instrumentationInfo = void 0;
4
4
  exports.instrumentationInfo = [];
5
5
  exports.instrumentationInfo.push({
6
- old: { module: 'react-native-gesture-handler', reference: 'TouchableHighlight' },
6
+ old: {
7
+ module: 'react-native-gesture-handler',
8
+ reference: 'TouchableHighlight',
9
+ },
7
10
  new: {
8
11
  module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
9
12
  reference: 'TouchableHighlight',
@@ -11,7 +14,10 @@ exports.instrumentationInfo.push({
11
14
  },
12
15
  });
13
16
  exports.instrumentationInfo.push({
14
- old: { module: 'react-native-gesture-handler', reference: 'TouchableOpacity' },
17
+ old: {
18
+ module: 'react-native-gesture-handler',
19
+ reference: 'TouchableOpacity',
20
+ },
15
21
  new: {
16
22
  module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
17
23
  reference: 'TouchableOpacity',
@@ -19,7 +25,10 @@ exports.instrumentationInfo.push({
19
25
  },
20
26
  });
21
27
  exports.instrumentationInfo.push({
22
- old: { module: 'react-native-gesture-handler', reference: 'TouchableNativeFeedback' },
28
+ old: {
29
+ module: 'react-native-gesture-handler',
30
+ reference: 'TouchableNativeFeedback',
31
+ },
23
32
  new: {
24
33
  module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
25
34
  reference: 'TouchableNativeFeedback',
@@ -27,7 +36,10 @@ exports.instrumentationInfo.push({
27
36
  },
28
37
  });
29
38
  exports.instrumentationInfo.push({
30
- old: { module: 'react-native-gesture-handler', reference: 'TouchableWithoutFeedback' },
39
+ old: {
40
+ module: 'react-native-gesture-handler',
41
+ reference: 'TouchableWithoutFeedback',
42
+ },
31
43
  new: {
32
44
  module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
33
45
  reference: 'TouchableWithoutFeedback',
@@ -20,14 +20,16 @@ if (gestureHandler !== undefined) {
20
20
  if (typeof gestureHandler.TouchableNativeFeedback !== 'object') {
21
21
  exports.TouchableNativeFeedback = (_c = class TouchableNativeFeedback extends (gestureHandler.TouchableNativeFeedback) {
22
22
  },
23
- _c._dtInfo = { type: Types_1.Types.TouchableNativeFeedbackGestureHandler },
23
+ _c._dtInfo = {
24
+ type: Types_1.Types.TouchableNativeFeedbackGestureHandler,
25
+ },
24
26
  _c);
25
27
  }
26
28
  if (typeof gestureHandler.TouchableWithoutFeedback === 'object') {
27
29
  exports.TouchableWithoutFeedback = Object.assign({ _dtInfo: { type: Types_1.Types.TouchableWithoutFeedbackGestureHandler } }, gestureHandler.TouchableWithoutFeedback);
28
30
  }
29
31
  if (typeof gestureHandler.RectButton !== 'object') {
30
- exports.RectButton = (_d = class RectButton extends (gestureHandler.RectButton) {
32
+ exports.RectButton = (_d = class RectButton extends gestureHandler.RectButton {
31
33
  },
32
34
  _d._dtInfo = { type: Types_1.Types.RectButtonGestureHandler },
33
35
  _d);
@@ -45,7 +45,8 @@ exports.Dynatrace = {
45
45
  }),
46
46
  withMonitoring: (Component, name) => {
47
47
  if (Component !== undefined) {
48
- if (Component.prototype !== undefined && Component.prototype.isReactComponent !== undefined) {
48
+ if (Component.prototype !== undefined &&
49
+ Component.prototype.isReactComponent !== undefined) {
49
50
  Component._dtInfo = {
50
51
  type: Types_1.Types.ClassComponent,
51
52
  name,
@@ -65,7 +66,10 @@ exports.Dynatrace = {
65
66
  if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
66
67
  let key;
67
68
  if (ConfigurationHandler_1.ConfigurationHandler.getBundleName() != null) {
68
- key = ConfigurationHandler_1.ConfigurationHandler.getBundleName() + '_' + DynatraceInternal_1.DynatraceInternal.getCounter();
69
+ key =
70
+ ConfigurationHandler_1.ConfigurationHandler.getBundleName() +
71
+ '_' +
72
+ DynatraceInternal_1.DynatraceInternal.getCounter();
69
73
  }
70
74
  else {
71
75
  key = 'DEFAULT_' + DynatraceInternal_1.DynatraceInternal.getCounter();
@@ -89,7 +93,10 @@ exports.Dynatrace = {
89
93
  if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
90
94
  let key;
91
95
  if (ConfigurationHandler_1.ConfigurationHandler.getBundleName() != null) {
92
- key = ConfigurationHandler_1.ConfigurationHandler.getBundleName() + '_' + DynatraceInternal_1.DynatraceInternal.getCounter();
96
+ key =
97
+ ConfigurationHandler_1.ConfigurationHandler.getBundleName() +
98
+ '_' +
99
+ DynatraceInternal_1.DynatraceInternal.getCounter();
93
100
  }
94
101
  else {
95
102
  key = 'DEFAULT_' + DynatraceInternal_1.DynatraceInternal.getCounter();
@@ -4,5 +4,9 @@ exports.DynatraceNative = void 0;
4
4
  const react_native_1 = require("react-native");
5
5
  const isTurboModuleEnabled = globalThis.__turboModuleProxy != null;
6
6
  exports.DynatraceNative = isTurboModuleEnabled
7
- ? react_native_1.TurboModuleRegistry.get('DynatraceBridge') !== undefined ? react_native_1.TurboModuleRegistry.get('DynatraceBridge') : {}
8
- : react_native_1.NativeModules.DynatraceBridge !== undefined ? react_native_1.NativeModules.DynatraceBridge : {};
7
+ ? react_native_1.TurboModuleRegistry.get('DynatraceBridge') !== undefined
8
+ ? react_native_1.TurboModuleRegistry.get('DynatraceBridge')
9
+ : {}
10
+ : react_native_1.NativeModules.DynatraceBridge !== undefined
11
+ ? react_native_1.NativeModules.DynatraceBridge
12
+ : {};
@@ -19,7 +19,10 @@ class DynatraceRootAction extends DynatraceAction_1.DynatraceAction {
19
19
  }
20
20
  let childKey;
21
21
  if (ConfigurationHandler_1.ConfigurationHandler.getBundleName() != null) {
22
- childKey = ConfigurationHandler_1.ConfigurationHandler.getBundleName() + '_' + DynatraceInternal_1.DynatraceInternal.getCounter();
22
+ childKey =
23
+ ConfigurationHandler_1.ConfigurationHandler.getBundleName() +
24
+ '_' +
25
+ DynatraceInternal_1.DynatraceInternal.getCounter();
23
26
  }
24
27
  else {
25
28
  childKey = 'DEFAULT_' + DynatraceInternal_1.DynatraceInternal.getCounter();
@@ -10,7 +10,8 @@ class DynatraceWebRequestTiming {
10
10
  this.url = url;
11
11
  }
12
12
  startWebRequestTiming() {
13
- if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.requestTag) && !StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.url)) {
13
+ if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.requestTag) &&
14
+ !StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.url)) {
14
15
  DynatraceBridge_1.DynatraceNative.startWebRequestTiming(this.requestTag, this.url);
15
16
  }
16
17
  else {
@@ -21,8 +22,10 @@ class DynatraceWebRequestTiming {
21
22
  this.stopWebRequestTimingWithSize(responseCode, responseMessage, -1, -1);
22
23
  }
23
24
  stopWebRequestTimingWithSize(responseCode, responseMessage, requestSize, responseSize) {
24
- if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.requestTag) && !StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.url) &&
25
- responseCode != null && !StringUtils_1.StringUtils.isStringNullOrUndefined(responseMessage)) {
25
+ if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.requestTag) &&
26
+ !StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(this.url) &&
27
+ responseCode != null &&
28
+ !StringUtils_1.StringUtils.isStringNullOrUndefined(responseMessage)) {
26
29
  DynatraceBridge_1.DynatraceNative.stopWebRequestTimingWithSize(this.requestTag, this.url, responseCode, responseMessage, requestSize, responseSize);
27
30
  }
28
31
  else {
@@ -13,12 +13,15 @@ const instrumentCreateElement = (reactModule) => {
13
13
  if (reactModule != null && reactModule.createElement != null) {
14
14
  const reactCreateElement = reactModule.createElement;
15
15
  reactModule.createElement = (type, props, ...children) => {
16
- if (type != null && type._dtInfo != null && !(0, exports.isDtActionIgnore)(props)) {
16
+ if (type != null &&
17
+ type._dtInfo != null &&
18
+ !(0, exports.isDtActionIgnore)(props)) {
17
19
  if (type._dtInfo.type === Types_1.Types.FunctionalComponent) {
18
20
  return reactCreateElement(Component_1.DynatraceFnWrapper, {}, reactCreateElement(type, props, ...children));
19
21
  }
20
22
  else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
21
- type.prototype !== undefined && type.prototype.isReactComponent !== undefined) {
23
+ type.prototype !== undefined &&
24
+ type.prototype.isReactComponent !== undefined) {
22
25
  return reactCreateElement(Component_1.DynatraceClassWrapper, {}, reactCreateElement(type, props, ...children));
23
26
  }
24
27
  else {
@@ -32,10 +35,12 @@ const instrumentCreateElement = (reactModule) => {
32
35
  exports.instrumentCreateElement = instrumentCreateElement;
33
36
  const modifyElement = (type, props, ...children) => {
34
37
  if (props != null) {
35
- if (type._dtInfo.type === Types_1.Types.RefreshControl && props.onRefresh != null) {
38
+ if (type._dtInfo.type === Types_1.Types.RefreshControl &&
39
+ props.onRefresh != null) {
36
40
  (0, RefreshControl_1.RefreshControlHelper)(Dynatrace_1.Dynatrace).attachOnRefresh(props);
37
41
  }
38
- else if (type._dtInfo.type === Types_1.Types.Switch && props.onValueChange != null) {
42
+ else if (type._dtInfo.type === Types_1.Types.Switch &&
43
+ props.onValueChange != null) {
39
44
  (0, Switch_1.SwitchHelper)(Dynatrace_1.Dynatrace).attachOnValueChange(props);
40
45
  }
41
46
  else if (type._dtInfo.type === Types_1.Types.Button ||
@@ -49,7 +54,8 @@ const modifyElement = (type, props, ...children) => {
49
54
  props.onLongPress = (0, Touchable_1.TouchableHelper)(Dynatrace_1.Dynatrace, Logger_1.Logger).attachOnPress(true, props, children);
50
55
  }
51
56
  }
52
- else if (props.onValueChange != null && type._dtInfo.type === Types_1.Types.Picker) {
57
+ else if (props.onValueChange != null &&
58
+ type._dtInfo.type === Types_1.Types.Picker) {
53
59
  (0, Picker_1.PickerHelper)(Dynatrace_1.Dynatrace).attachOnValueChange(props);
54
60
  }
55
61
  }
@@ -30,7 +30,7 @@ const _reportErrorToDynatrace = (exception, isFatal, oldHandler) => {
30
30
  if (isFatal === undefined) {
31
31
  isFatal = false;
32
32
  }
33
- DynatraceInternal_1.DynatraceInternal.reportErrorFromHandler(isFatal, String(exception.name), adjustedReason(exception.message), exception.stack != null ? exception.stack : "", _isReportFatalErrorAsCrash);
33
+ DynatraceInternal_1.DynatraceInternal.reportErrorFromHandler(isFatal, String(exception.name), adjustedReason(exception.message), exception.stack != null ? exception.stack : '', _isReportFatalErrorAsCrash);
34
34
  Logger_1.Logger.logDebug(`ErrorHandler _reportErrorToDynatrace(${exception}, ${isFatal})`);
35
35
  }
36
36
  }
@@ -5,7 +5,8 @@ const ConfigurationHandler_1 = require("./configuration/ConfigurationHandler");
5
5
  const LOG_PREFIX = 'DYNATRACE: ';
6
6
  exports.Logger = {
7
7
  logDebug: (message) => {
8
- if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable() && ConfigurationHandler_1.ConfigurationHandler.isDebugEnabled()) {
8
+ if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable() &&
9
+ ConfigurationHandler_1.ConfigurationHandler.isDebugEnabled()) {
9
10
  console.log(LOG_PREFIX + message);
10
11
  }
11
12
  },
@@ -13,8 +13,9 @@ const PickerHelper = (Dynatrace) => ({
13
13
  pickerProps.onValueChange = (itemValue, itemNumber) => {
14
14
  const value = _getPickerItemValue(itemNumber, itemValue, pickerProps.children);
15
15
  if (value !== undefined) {
16
- const finalNameOfAction = nameOfAction == null ?
17
- `Picked Value: ${value}` : `Picker ${nameOfAction} Picked Value: ${value}`;
16
+ const finalNameOfAction = nameOfAction == null
17
+ ? `Picked Value: ${value}`
18
+ : `Picker ${nameOfAction} Picked Value: ${value}`;
18
19
  const action = Dynatrace.enterAutoAction(finalNameOfAction);
19
20
  try {
20
21
  origOnValueChange(itemValue, itemNumber);
@@ -39,10 +40,10 @@ const _findActionName = (pickerProps) => {
39
40
  return null;
40
41
  };
41
42
  const _getPickerItemValue = (index, value, children) => {
42
- if (children != null
43
- && index >= 0
44
- && children.length > index
45
- && isPickerItemProps(children[index].props)) {
43
+ if (children != null &&
44
+ index >= 0 &&
45
+ children.length > index &&
46
+ isPickerItemProps(children[index].props)) {
46
47
  return children[index].props.label;
47
48
  }
48
49
  return value;
@@ -11,7 +11,9 @@ const RefreshControlHelper = (Dynatrace) => ({
11
11
  const nameOfAction = _findActionName(refreshControlProps);
12
12
  if (origOnRefresh != null) {
13
13
  refreshControlProps.onRefresh = () => {
14
- const finalNameOfAction = nameOfAction == null ? 'Swipe to Refesh' : `Swipe to Refesh ${nameOfAction}`;
14
+ const finalNameOfAction = nameOfAction == null
15
+ ? 'Swipe to Refesh'
16
+ : `Swipe to Refesh ${nameOfAction}`;
15
17
  const action = Dynatrace.enterAutoAction(finalNameOfAction);
16
18
  try {
17
19
  if (origOnRefresh != null) {
@@ -52,6 +52,6 @@ const _findActionName = (switchProps) => {
52
52
  }
53
53
  return null;
54
54
  };
55
- const _isPromise = (object) => object != null
56
- && typeof object.then === 'function'
57
- && typeof object.catch === 'function';
55
+ const _isPromise = (object) => object != null &&
56
+ typeof object.then === 'function' &&
57
+ typeof object.catch === 'function';
@@ -17,8 +17,9 @@ const TouchableHelper = (Dynatrace, Logger) => ({
17
17
  return origFunction(event);
18
18
  }
19
19
  }
20
- else if (origFunction != null && origFunction._dtWrapped !== undefined
21
- && origFunction._dtWrapped === true) {
20
+ else if (origFunction != null &&
21
+ origFunction._dtWrapped !== undefined &&
22
+ origFunction._dtWrapped === true) {
22
23
  Logger.logDebug(`TouchableHelper: Skip wrapping of ${nameOfAction} onPress as it is already wrapped!`);
23
24
  return origFunction(event);
24
25
  }
@@ -30,7 +31,8 @@ const TouchableHelper = (Dynatrace, Logger) => ({
30
31
  }
31
32
  else {
32
33
  let finalNameOfAction = nameOfAction;
33
- if (!(0, IDynatraceProperties_1.isDynatraceNaming)(props) && ConfigurationHandler_1.ConfigurationHandler.isActionNamePrivacyEnabled()) {
34
+ if (!(0, IDynatraceProperties_1.isDynatraceNaming)(props) &&
35
+ ConfigurationHandler_1.ConfigurationHandler.isActionNamePrivacyEnabled()) {
34
36
  finalNameOfAction = isButton ? 'Button' : 'Touchable';
35
37
  }
36
38
  const action = Dynatrace.enterAutoAction(`Touch on ${finalNameOfAction}`);
@@ -74,8 +76,7 @@ const TouchableHelper = (Dynatrace, Logger) => ({
74
76
  return props.accessibilityLabel;
75
77
  }
76
78
  else if (children != null && children.length > 0) {
77
- if (children.length === 1 &&
78
- typeof children[0] === 'string') {
79
+ if (children.length === 1 && typeof children[0] === 'string') {
79
80
  return children[0];
80
81
  }
81
82
  else {
@@ -145,6 +146,6 @@ const TouchableHelper = (Dynatrace, Logger) => ({
145
146
  _isReactElement: (node) => node != null && node.props != null,
146
147
  });
147
148
  exports.TouchableHelper = TouchableHelper;
148
- const _isPromise = (object) => object != null
149
- && typeof object.then === 'function'
150
- && typeof object.catch === 'function';
149
+ const _isPromise = (object) => object != null &&
150
+ typeof object.then === 'function' &&
151
+ typeof object.catch === 'function';
@@ -19,16 +19,17 @@ class Configuration {
19
19
  toString() {
20
20
  let configurationString;
21
21
  const isAutoStart = this.beaconUrl === '' && this.applicationId === '';
22
- configurationString = `{Startup: ${isAutoStart ? 'Auto' : 'Manual'} Start`
23
- + (isAutoStart ? '' : `, applicationId: ${this.applicationId}`)
24
- + (isAutoStart ? '' : `, beaconUrl: ${this.beaconUrl}`)
25
- + `, reportCrash: ${this.reportCrash}`
26
- + `, errorHandler: ${this.errorHandler}`
27
- + `, reportFatalErrorAsCrash: ${this.reportFatalErrorAsCrash}`
28
- + `, lifecycleUpdate: ${this.lifecycleUpdate}`
29
- + (isAutoStart ? '' : `, userOptIn: ${this.userOptIn}`)
30
- + `, actionNamePrivacy: ${this.actionNamePrivacy}`
31
- + `, logLevel: ${(0, LogLevel_1.LogLevelToString)(this.logLevel)}`;
22
+ configurationString =
23
+ `{Startup: ${isAutoStart ? 'Auto' : 'Manual'} Start` +
24
+ (isAutoStart ? '' : `, applicationId: ${this.applicationId}`) +
25
+ (isAutoStart ? '' : `, beaconUrl: ${this.beaconUrl}`) +
26
+ `, reportCrash: ${this.reportCrash}` +
27
+ `, errorHandler: ${this.errorHandler}` +
28
+ `, reportFatalErrorAsCrash: ${this.reportFatalErrorAsCrash}` +
29
+ `, lifecycleUpdate: ${this.lifecycleUpdate}` +
30
+ (isAutoStart ? '' : `, userOptIn: ${this.userOptIn}`) +
31
+ `, actionNamePrivacy: ${this.actionNamePrivacy}` +
32
+ `, logLevel: ${(0, LogLevel_1.LogLevelToString)(this.logLevel)}`;
32
33
  if (this.bundleName !== undefined) {
33
34
  configurationString += `, bundleName: ${this.bundleName}`;
34
35
  }
@@ -29,4 +29,3 @@ class ConfigurationPreset {
29
29
  }
30
30
  }
31
31
  exports.ConfigurationPreset = ConfigurationPreset;
32
- ;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -40,9 +40,9 @@ class ManualStartupConfiguration {
40
40
  }
41
41
  }
42
42
  toString() {
43
- let configurationString = `{Startup: Manual Start, applicationId: ${this.applicationId}, beaconUrl: ${this.beaconUrl},`
44
- + ` reportCrash: ${this.reportCrash}, errorHandler: ${this.errorHandler}, reportFatalErrorAsCrash: ${this.reportFatalErrorAsCrash},`
45
- + ` lifecycleUpdate: ${this.lifecycleUpdate}, userOptIn: ${this.userOptIn}, actionNamePrivacy: ${this.actionNamePrivacy}, logLevel: ${(0, LogLevel_1.LogLevelToString)(this.logLevel)}`;
43
+ let configurationString = `{Startup: Manual Start, applicationId: ${this.applicationId}, beaconUrl: ${this.beaconUrl},` +
44
+ ` reportCrash: ${this.reportCrash}, errorHandler: ${this.errorHandler}, reportFatalErrorAsCrash: ${this.reportFatalErrorAsCrash},` +
45
+ ` lifecycleUpdate: ${this.lifecycleUpdate}, userOptIn: ${this.userOptIn}, actionNamePrivacy: ${this.actionNamePrivacy}, logLevel: ${(0, LogLevel_1.LogLevelToString)(this.logLevel)}`;
46
46
  if (this.bundleName !== undefined) {
47
47
  configurationString += `, bundleName: ${this.bundleName}`;
48
48
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isDynatraceIgnored = exports.isDynatraceNaming = void 0;
4
4
  const isDynatraceNaming = (properties) => properties.dtActionName !== undefined;
5
5
  exports.isDynatraceNaming = isDynatraceNaming;
6
- const isDynatraceIgnored = (properties) => properties.dtActionIgnore !== undefined
7
- && properties.dtActionIgnore === true
8
- || properties.dtActionIgnore === 'true';
6
+ const isDynatraceIgnored = (properties) => (properties.dtActionIgnore !== undefined &&
7
+ properties.dtActionIgnore === true) ||
8
+ properties.dtActionIgnore === 'true';
9
9
  exports.isDynatraceIgnored = isDynatraceIgnored;
@@ -21,17 +21,16 @@ var Types;
21
21
  Types[Types["RefreshControl"] = 15] = "RefreshControl";
22
22
  Types[Types["Switch"] = 16] = "Switch";
23
23
  })(Types = exports.Types || (exports.Types = {}));
24
- const isTypeReactNativeTouchable = (type) => type === Types.TouchableHighlight
25
- || type === Types.TouchableNativeFeedback
26
- || type === Types.TouchableOpacity
27
- || type === Types.TouchableWithoutFeedback;
24
+ const isTypeReactNativeTouchable = (type) => type === Types.TouchableHighlight ||
25
+ type === Types.TouchableNativeFeedback ||
26
+ type === Types.TouchableOpacity ||
27
+ type === Types.TouchableWithoutFeedback;
28
28
  exports.isTypeReactNativeTouchable = isTypeReactNativeTouchable;
29
- const isTypeGestureHandlerTouchable = (type) => type === Types.TouchableHighlightGestureHandler
30
- || type === Types.TouchableNativeFeedbackGestureHandler
31
- || type === Types.TouchableOpacityGestureHandler
32
- || type === Types.TouchableWithoutFeedbackGestureHandler
33
- || type === Types.RectButtonGestureHandler;
29
+ const isTypeGestureHandlerTouchable = (type) => type === Types.TouchableHighlightGestureHandler ||
30
+ type === Types.TouchableNativeFeedbackGestureHandler ||
31
+ type === Types.TouchableOpacityGestureHandler ||
32
+ type === Types.TouchableWithoutFeedbackGestureHandler ||
33
+ type === Types.RectButtonGestureHandler;
34
34
  exports.isTypeGestureHandlerTouchable = isTypeGestureHandlerTouchable;
35
- const isTypeTouchable = (type) => (0, exports.isTypeGestureHandlerTouchable)(type)
36
- || (0, exports.isTypeReactNativeTouchable)(type);
35
+ const isTypeTouchable = (type) => (0, exports.isTypeGestureHandlerTouchable)(type) || (0, exports.isTypeReactNativeTouchable)(type);
37
36
  exports.isTypeTouchable = isTypeTouchable;
@@ -18,17 +18,27 @@ try {
18
18
  }
19
19
  if (_jsxDevRuntime != null) {
20
20
  const jsxDEV = (...args) => {
21
- if (args[0] !== undefined && args[0]._dtInfo !== undefined && !(0, ElementHelper_1.isDtActionIgnore)(args[1])) {
21
+ if (args[0] !== undefined &&
22
+ args[0]._dtInfo !== undefined &&
23
+ !(0, ElementHelper_1.isDtActionIgnore)(args[1])) {
22
24
  if (args[0]._dtInfo.type === Types_1.Types.FunctionalComponent) {
23
- const wrapperProps = { children: [] };
24
- wrapperProps.dtActionName = (args[1] !== undefined &&
25
- args[1].dtActionName !== undefined) ? args[1].dtActionName : args[0]._dtInfo.name;
25
+ const wrapperProps = {
26
+ children: [],
27
+ };
28
+ wrapperProps.dtActionName =
29
+ args[1] !== undefined &&
30
+ args[1].dtActionName !== undefined
31
+ ? args[1].dtActionName
32
+ : args[0]._dtInfo.name;
26
33
  wrapperProps.children.push(_jsxDevRuntime.jsxDEV(args[0], args[1], ...args));
27
34
  return _jsxDevRuntime.jsxDEV(Component_1.DynatraceFnWrapper, wrapperProps);
28
35
  }
29
36
  else if (args[0]._dtInfo.type === Types_1.Types.ClassComponent &&
30
- args[0].prototype !== undefined && args[0].prototype.isReactComponent !== undefined) {
31
- const wrapperProps = { children: [] };
37
+ args[0].prototype !== undefined &&
38
+ args[0].prototype.isReactComponent !== undefined) {
39
+ const wrapperProps = {
40
+ children: [],
41
+ };
32
42
  wrapperProps.children.push(_jsxDevRuntime.jsxDEV(args[0], args[1], ...args));
33
43
  return _jsxDevRuntime.jsxDEV(Component_1.DynatraceClassWrapper, wrapperProps);
34
44
  }
@@ -19,19 +19,33 @@ try {
19
19
  if (_jsxRuntime != null) {
20
20
  const jsxProd = (type, config, maybeKey) => jsxHelper(_jsxRuntime.jsx, type, config, [maybeKey]);
21
21
  const jsxDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsx, type, config, [maybeKey, source, self]);
22
- const jsxsDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsxs, type, config, [maybeKey, source, self]);
22
+ const jsxsDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsxs, type, config, [
23
+ maybeKey,
24
+ source,
25
+ self,
26
+ ]);
23
27
  const jsxHelper = (jsxFn, type, config, args) => {
24
- if (type !== undefined && type._dtInfo !== undefined && !(0, ElementHelper_1.isDtActionIgnore)(config)) {
28
+ if (type !== undefined &&
29
+ type._dtInfo !== undefined &&
30
+ !(0, ElementHelper_1.isDtActionIgnore)(config)) {
25
31
  if (type._dtInfo.type === Types_1.Types.FunctionalComponent) {
26
- const wrapperProps = { children: [] };
27
- wrapperProps.dtActionName = (config !== undefined &&
28
- config.dtActionName !== undefined) ? config.dtActionName : type._dtInfo.name;
32
+ const wrapperProps = {
33
+ children: [],
34
+ };
35
+ wrapperProps.dtActionName =
36
+ config !== undefined &&
37
+ config.dtActionName !== undefined
38
+ ? config.dtActionName
39
+ : type._dtInfo.name;
29
40
  wrapperProps.children.push(jsxFn(type, config, ...args));
30
41
  return _jsxRuntime.jsxs(Component_1.DynatraceFnWrapper, wrapperProps);
31
42
  }
32
43
  else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
33
- type.prototype !== undefined && type.prototype.isReactComponent !== undefined) {
34
- const wrapperProps = { children: [] };
44
+ type.prototype !== undefined &&
45
+ type.prototype.isReactComponent !== undefined) {
46
+ const wrapperProps = {
47
+ children: [],
48
+ };
35
49
  wrapperProps.children.push(jsxFn(type, config, ...args));
36
50
  return _jsxRuntime.jsxs(Component_1.DynatraceClassWrapper, wrapperProps);
37
51
  }
@@ -7,7 +7,8 @@ const getSourceMapInfo = (module, options) => {
7
7
  const dataOrig = originalSourceMapInfo(module, options);
8
8
  try {
9
9
  if (!Boolean(options.excludeSource)) {
10
- const correctPath = module.path.replace(pathsConstants.getApplicationPath(), '') + '.dtx';
10
+ const correctPath = module.path.replace(pathsConstants.getApplicationPath(), '') +
11
+ '.dtx';
11
12
  dataOrig.source = fileOperation.readTextFromFileSync(pathNode.join(pathsConstants.getBuildPath(), correctPath));
12
13
  }
13
14
  }
@@ -29,9 +29,12 @@ class DynatraceClassWrapper extends react_1.Component {
29
29
  Logger_1.Logger.logInfo(`Component ${this.wrappingName}: React Native plugin has not been started yet! Component will not be reported!`);
30
30
  }
31
31
  else {
32
- if ((this.componentMounted && ConfigurationHandler_1.ConfigurationHandler.isLifecycleUpdateEnabled()) ||
32
+ if ((this.componentMounted &&
33
+ ConfigurationHandler_1.ConfigurationHandler.isLifecycleUpdateEnabled()) ||
33
34
  !this.componentMounted) {
34
- const actionPrefix = !this.componentMounted ? 'Render ' : 'Update ';
35
+ const actionPrefix = !this.componentMounted
36
+ ? 'Render '
37
+ : 'Update ';
35
38
  this.internalAction = Dynatrace_1.Dynatrace.enterAutoAction(actionPrefix + this.wrappingName);
36
39
  }
37
40
  }
@@ -65,7 +68,8 @@ const getNameFromComponent = (props) => {
65
68
  else {
66
69
  child = props.children;
67
70
  }
68
- if (child.props !== undefined && child.props.dtActionName !== undefined) {
71
+ if (child.props !== undefined &&
72
+ child.props.dtActionName !== undefined) {
69
73
  return child.props.dtActionName;
70
74
  }
71
75
  else if (child.type !== undefined) {