@dynatrace/react-native-plugin 2.301.1 → 2.303.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.
- package/README.md +43 -15
- package/android/build.gradle +1 -1
- package/files/plugin.gradle +1 -1
- package/ios/DynatraceRNBridge.mm +1 -1
- package/lib/CreateElement.js +2 -1
- package/lib/community/gesture-handler/Touchables.InstrInfo.js +16 -4
- package/lib/community/gesture-handler/Touchables.js +4 -2
- package/lib/instrumentor/base/Dynatrace.js +10 -3
- package/lib/instrumentor/base/DynatraceBridge.js +6 -2
- package/lib/instrumentor/base/DynatraceRootAction.js +4 -1
- package/lib/instrumentor/base/DynatraceWebRequestTiming.js +6 -3
- package/lib/instrumentor/base/ElementHelper.js +11 -5
- package/lib/instrumentor/base/ErrorHandler.js +1 -1
- package/lib/instrumentor/base/Logger.js +2 -1
- package/lib/instrumentor/base/Picker.js +7 -6
- package/lib/instrumentor/base/RefreshControl.js +3 -1
- package/lib/instrumentor/base/Switch.js +3 -3
- package/lib/instrumentor/base/Touchable.js +9 -8
- package/lib/instrumentor/base/configuration/Configuration.js +11 -10
- package/lib/instrumentor/base/configuration/ConfigurationPreset.js +0 -1
- package/lib/instrumentor/base/configuration/IConfiguration.js +0 -1
- package/lib/instrumentor/base/configuration/ManualStartupConfiguration.js +3 -3
- package/lib/instrumentor/base/interface/IDynatraceProperties.js +3 -3
- package/lib/instrumentor/model/Types.js +10 -11
- package/lib/jsx-dev-runtime.js +28 -10
- package/lib/jsx-runtime.js +21 -7
- package/lib/metro/getSourceMapInfo.js +2 -1
- package/lib/react/Component.js +7 -3
- package/lib/react-native/Touchables.js +6 -4
- package/lib/react-navigation/ReactNavigation.js +6 -2
- package/package.json +175 -171
- package/react-native-dynatrace.podspec +1 -1
- package/src/lib/instrumentor/base/interface/NativeDynatraceBridge.ts +150 -78
package/README.md
CHANGED
|
@@ -24,15 +24,15 @@ If you want to start using this plugin and are not a Dynatrace customer yet, hea
|
|
|
24
24
|
* For Android users:
|
|
25
25
|
* SDK version 21+
|
|
26
26
|
* Gradle version 6.1.1+ ([How to update?](#updating-to-gradle-6))
|
|
27
|
-
* Android Gradle plugin version
|
|
27
|
+
* Android Gradle plugin version 7.0+
|
|
28
28
|
* Java 11
|
|
29
29
|
* For iOS users: Minimum iOS 12
|
|
30
30
|
|
|
31
31
|
## Agent Versions
|
|
32
32
|
This agent versions are configured in this plugin:
|
|
33
33
|
|
|
34
|
-
* Android Agent: 8.
|
|
35
|
-
* iOS Agent: 8.
|
|
34
|
+
* Android Agent: 8.303.2.1014
|
|
35
|
+
* iOS Agent: 8.303.1.1004
|
|
36
36
|
|
|
37
37
|
## Quick Setup
|
|
38
38
|
|
|
@@ -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.
|
|
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`.
|
|
195
|
+
|
|
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.
|
|
178
197
|
|
|
179
|
-
|
|
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).
|
|
180
199
|
|
|
181
|
-
|
|
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
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
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,17 @@ 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.
|
|
1463
|
+
2.303.1
|
|
1464
|
+
* Updated Android (8.303.2.1014) & iOS Agent (8.303.1.1004)
|
|
1465
|
+
* Android Gradle Plugin version requirement raised to 7.0+
|
|
1466
|
+
* Fixed warnings for jsx runtime when using expo
|
|
1467
|
+
|
|
1468
|
+
2.301.2
|
|
1442
1469
|
* Updated Android (8.301.1.1004) & iOS Agent (8.301.1.1008)
|
|
1443
1470
|
* Fix iOS crashes to not report on session after crash
|
|
1444
1471
|
* RectButton check/logic updated
|
|
1445
1472
|
* Improved startup log line
|
|
1473
|
+
* Updated crash type for [manually reported iOS crashes](#manually-report-a-crash) using `reportCrashWithException`
|
|
1446
1474
|
|
|
1447
1475
|
2.299.1
|
|
1448
1476
|
* Updated Android (8.299.1.1004) & iOS Agent (8.299.1.1003)
|
package/android/build.gradle
CHANGED
|
@@ -70,7 +70,7 @@ repositories {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
dependencies {
|
|
73
|
-
implementation 'com.dynatrace.agent:agent-android:8.
|
|
73
|
+
implementation 'com.dynatrace.agent:agent-android:8.303.2.1014'
|
|
74
74
|
implementation "com.facebook.react:react-native:${safeExtGet('reactNative', '+')}"
|
|
75
75
|
}
|
|
76
76
|
|
package/files/plugin.gradle
CHANGED
package/ios/DynatraceRNBridge.mm
CHANGED
|
@@ -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:
|
|
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
|
}
|
package/lib/CreateElement.js
CHANGED
|
@@ -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 &&
|
|
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: {
|
|
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: {
|
|
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: {
|
|
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: {
|
|
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 = {
|
|
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
|
|
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 &&
|
|
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 =
|
|
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 =
|
|
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
|
|
8
|
-
|
|
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 =
|
|
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) &&
|
|
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) &&
|
|
25
|
-
|
|
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 &&
|
|
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 &&
|
|
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 &&
|
|
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 &&
|
|
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 &&
|
|
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 :
|
|
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() &&
|
|
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}`
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
-
|
|
57
|
-
|
|
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 &&
|
|
21
|
-
|
|
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) &&
|
|
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
|
-
|
|
150
|
-
|
|
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 =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
}
|
|
@@ -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
|
-
|
|
45
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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;
|
package/lib/jsx-dev-runtime.js
CHANGED
|
@@ -18,19 +18,37 @@ try {
|
|
|
18
18
|
}
|
|
19
19
|
if (_jsxDevRuntime != null) {
|
|
20
20
|
const jsxDEV = (...args) => {
|
|
21
|
-
if (args[0] !== undefined &&
|
|
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 = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
wrapperProps.
|
|
27
|
-
|
|
25
|
+
const wrapperProps = {
|
|
26
|
+
children: _jsxDevRuntime.jsxDEV(...args),
|
|
27
|
+
};
|
|
28
|
+
wrapperProps.dtActionName =
|
|
29
|
+
args[1] !== undefined &&
|
|
30
|
+
args[1].dtActionName !== undefined
|
|
31
|
+
? args[1].dtActionName
|
|
32
|
+
: args[0]._dtInfo.name;
|
|
33
|
+
if (args[2] !== undefined) {
|
|
34
|
+
return _jsxDevRuntime.jsxDEV(Component_1.DynatraceFnWrapper, wrapperProps, args[2] + '_dt');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return _jsxDevRuntime.jsxDEV(Component_1.DynatraceFnWrapper, wrapperProps);
|
|
38
|
+
}
|
|
28
39
|
}
|
|
29
40
|
else if (args[0]._dtInfo.type === Types_1.Types.ClassComponent &&
|
|
30
|
-
args[0].prototype !== undefined &&
|
|
31
|
-
|
|
32
|
-
wrapperProps
|
|
33
|
-
|
|
41
|
+
args[0].prototype !== undefined &&
|
|
42
|
+
args[0].prototype.isReactComponent !== undefined) {
|
|
43
|
+
const wrapperProps = {
|
|
44
|
+
children: _jsxDevRuntime.jsxDEV(...args),
|
|
45
|
+
};
|
|
46
|
+
if (args[2] !== undefined) {
|
|
47
|
+
return _jsxDevRuntime.jsxDEV(Component_1.DynatraceClassWrapper, wrapperProps, args[2] + '_dt');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return _jsxDevRuntime.jsxDEV(Component_1.DynatraceClassWrapper, wrapperProps);
|
|
51
|
+
}
|
|
34
52
|
}
|
|
35
53
|
if (Array.isArray(args[1].children)) {
|
|
36
54
|
(0, ElementHelper_1.modifyElement)(args[0], args[1], ...args[1].children);
|