@dynatrace/react-native-plugin 2.225.0 → 2.231.0

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 (91) hide show
  1. package/README.md +31 -6
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridge.java +10 -0
  4. package/files/plugin.gradle +1 -1
  5. package/ios/DynatraceRNBridge.m +11 -0
  6. package/ios/lib/Dynatrace.xcframework/Info.plist +69 -0
  7. package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Dynatrace +0 -0
  8. package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Headers/Dynatrace.h +952 -0
  9. package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Headers/Framework.h +18 -0
  10. package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Info.plist +0 -0
  11. package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Modules/module.modulemap +6 -0
  12. package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
  13. package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +952 -0
  14. package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Headers/Framework.h +18 -0
  15. package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
  16. package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Modules/module.modulemap +6 -0
  17. package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +147 -0
  18. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Dynatrace +0 -0
  19. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Dynatrace.h +952 -0
  20. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Framework.h +18 -0
  21. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Info.plist +0 -0
  22. package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/module.modulemap +6 -0
  23. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
  24. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +952 -0
  25. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Framework.h +18 -0
  26. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
  27. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/module.modulemap +6 -0
  28. package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +135 -0
  29. package/lib/community/Picker.js +33 -0
  30. package/lib/dynatrace-reporter.js +30 -0
  31. package/lib/dynatrace-transformer.js +50 -0
  32. package/lib/instrumentor/base/Application.js +17 -0
  33. package/lib/instrumentor/base/Dynatrace.js +275 -0
  34. package/lib/instrumentor/base/DynatraceAction.js +66 -0
  35. package/lib/instrumentor/base/DynatraceBridge.js +5 -0
  36. package/lib/instrumentor/base/ElementHelper.js +58 -0
  37. package/lib/instrumentor/base/ErrorHandler.js +52 -0
  38. package/lib/instrumentor/base/Logger.js +15 -0
  39. package/lib/instrumentor/base/NullAction.js +27 -0
  40. package/lib/instrumentor/base/Picker.js +32 -0
  41. package/lib/instrumentor/base/RefreshControl.js +35 -0
  42. package/lib/instrumentor/base/Touchable.js +103 -0
  43. package/lib/instrumentor/base/UserPrivacyOptions.js +22 -0
  44. package/lib/instrumentor/base/configuration/AutoStartupConfiguration.js +17 -0
  45. package/lib/instrumentor/base/configuration/Configuration.js +26 -0
  46. package/lib/instrumentor/base/configuration/ConfigurationDefaults.js +13 -0
  47. package/lib/instrumentor/base/configuration/ManualStartupConfiguration.js +34 -0
  48. package/lib/instrumentor/base/interface/IAutoConfiguration.js +2 -0
  49. package/lib/instrumentor/base/interface/IDynatrace.js +2 -0
  50. package/lib/instrumentor/base/interface/IDynatraceAction.js +2 -0
  51. package/lib/instrumentor/base/interface/IDynatraceBridge.js +2 -0
  52. package/lib/instrumentor/base/interface/IDynatraceProperties.js +2 -0
  53. package/lib/instrumentor/base/interface/ILogger.js +2 -0
  54. package/lib/instrumentor/base/model/DataCollectionLevel.js +11 -0
  55. package/lib/instrumentor/base/model/LogLevel.js +8 -0
  56. package/lib/instrumentor/base/model/Platform.js +9 -0
  57. package/lib/instrumentor/base/util/StringUtils.js +8 -0
  58. package/lib/instrumentor/dynatrace-instrumentation.js +1 -0
  59. package/lib/instrumentor/model/reference.js +2 -0
  60. package/lib/instrumentor/model/types.js +16 -0
  61. package/lib/instrumentor/parser/babel.js +63 -0
  62. package/lib/jsx-runtime.js +41 -0
  63. package/lib/metro/getSourceMapInfo.js +22 -0
  64. package/lib/react/Component.js +68 -0
  65. package/lib/react-native/RefreshControl.js +14 -0
  66. package/lib/react-native/Touchables.js +63 -0
  67. package/lib/react-native/index.js +12 -0
  68. package/lib/react-native.js +25 -0
  69. package/package.json +155 -1
  70. package/scripts/android.js +123 -0
  71. package/scripts/api/CustomArguments.js +2 -0
  72. package/scripts/api/CustomArgumentsBuilder.js +2 -0
  73. package/scripts/api/model/Platform.js +8 -0
  74. package/scripts/config.js +73 -0
  75. package/scripts/core/CustomArgumentsBuilderImpl.js +22 -0
  76. package/scripts/core/CustomArgumentsImpl.js +33 -0
  77. package/scripts/core/InstrumentCall.js +89 -0
  78. package/scripts/fileOperationHelper.js +184 -0
  79. package/scripts/install.js +47 -0
  80. package/scripts/instrument.js +7 -0
  81. package/scripts/ios.js +179 -0
  82. package/scripts/logger.js +79 -0
  83. package/scripts/pathsConstants.js +60 -0
  84. package/scripts/start.js +6 -0
  85. package/scripts/uninstall.js +80 -0
  86. package/scripts/util/CustomArgumentUtil.js +57 -0
  87. package/scripts/util/SourceMapUtil.js +30 -0
  88. package/scripts/util/StartUtil.js +9 -0
  89. package/scripts/util/instrumentUtil.js +28 -0
  90. package/typings/react-native-dynatrace.d.ts +6 -0
  91. package/util/constants.js +0 -4
package/README.md CHANGED
@@ -26,8 +26,8 @@ If you want to start using this plugin and are not a Dynatrace customer yet, hea
26
26
  ## Agent Versions
27
27
  This agent versions are configured in this plugin:
28
28
 
29
- * iOS Agent: 8.223.1.1006
30
- * Android Agent: 8.223.1.1003
29
+ * iOS Agent: 8.231.1.1009
30
+ * Android Agent: 8.231.1.1004
31
31
 
32
32
  ## Quick Setup
33
33
 
@@ -42,11 +42,12 @@ This agent versions are configured in this plugin:
42
42
  * [Plugin Startup](#plugin-startup)
43
43
  * [Monitor a Component](#monitor-a-component)
44
44
  * [Create Manual Action](#create-manual-actions)
45
+ * [Cancel Actions](#cancel-actions)
45
46
  * [Report Values](#report-values)
46
47
  * [Report Stacktrace](#report-an-error-stacktrace)
47
48
  * [Identify User](#identify-a-user)
48
- * [Crash Reporting](#crash-reporting)
49
- * [User Privacy Options](#data-collection)
49
+ * [Crash Reporting](#manually-report-a-crash)
50
+ * [User Privacy Options](#user-privacy-options)
50
51
  * [Report GPS Position](#report-gps-location)
51
52
  * [Platform independent reporting](#platform-independent-reporting)
52
53
  * [Set beacon headers](#setting-beacon-headers)
@@ -165,8 +166,8 @@ module.exports = {
165
166
 
166
167
  Example of a startup call:
167
168
 
168
- ```dart
169
- import { Dynatrace } from '@dynatrace/react-native-plugin';
169
+ ```js
170
+ import { Dynatrace, ManualStartupConfiguration } from '@dynatrace/react-native-plugin';
170
171
 
171
172
  Dynatrace.start(new ManualStartupConfiguration("beaconUrl", "applicationId"));
172
173
  ```
@@ -253,6 +254,19 @@ mySubAction.leaveAction();
253
254
  myAction.leaveAction();
254
255
  ```
255
256
 
257
+ ### Cancel actions
258
+
259
+ Actions can be canceled. That means they will not be sent and discarded fully. This also means that any values and sub actions attached to the action will be removed.
260
+
261
+ ```js
262
+ let myAction = Dynatrace.enterAction("MyButton tapped");
263
+ // Action will be canceled
264
+ myAction.cancel();
265
+
266
+ // Has no impact as the action is already canceled
267
+ myAction.leaveAction();
268
+ ```
269
+
256
270
  ### Report values
257
271
 
258
272
  For any open action you can report certain values. The following API is available for action:
@@ -442,6 +456,8 @@ If you want to set this property and use typescript you can use the following wo
442
456
 
443
457
  > **Note:** This feature works directly on run-android, run-ios or start command only for RN 60.1 or higher.
444
458
 
459
+ > **MacOS Users:** This feature is not working correctly on MacOS. Arguments are not passed between run-ios and starting the webserver. If you still want to use custom arguments you need to start the webserver first with custom arguments and later on executing run-ios, which will then no longer create a webserver as it is already running in background.
460
+
445
461
  Our scripts assumes that the usual React Native project structure is given. The following arguments can be specified for our instrumentation script if the project structure is different.
446
462
 
447
463
  * `gradle=C:\MyReactAndroidProject\build.gradle`: The location of the root build.gradle file. We will assume that the other gradle file resides in `/app/build.gradle`. This will add the whole agent dependencies automatically for you and will update the configuration.
@@ -950,6 +966,15 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
950
966
  <br/><br/>
951
967
  ## Changelog
952
968
 
969
+ 2.231.0
970
+ * Added [cancel API for actions](#cancel-actions)
971
+ * Updated Android Agent (8.231.1.1004) & iOS Agent (8.231.1.1009)
972
+ * React Native 0.66.0 compatibility
973
+
974
+ 2.227.0
975
+ * Fixed auto start in React Native 0.65.x
976
+ * Updated Android Agent (8.225.1.1004)
977
+
953
978
  2.225.0
954
979
  * [Custom config](#custom-arguments-for-instrumentation-script) argument fixed for transformer
955
980
  * Fixed infite loop of HOC with React Redux & Functional component
@@ -36,7 +36,7 @@ repositories {
36
36
  }
37
37
 
38
38
  dependencies {
39
- implementation 'com.dynatrace.agent:agent-android:8.223.1.1003'
39
+ implementation 'com.dynatrace.agent:agent-android:8.231.1.1004'
40
40
  implementation "com.facebook.react:react-native:${safeExtGet('reactNative', '+')}"
41
41
  }
42
42
 
@@ -104,6 +104,16 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
104
104
  }
105
105
  }
106
106
 
107
+ @ReactMethod
108
+ public void cancelAction(int key, String platform) {
109
+ if (this.shouldWorkOnAndroid(platform)) {
110
+ DTXAction action = getAction(key);
111
+ if (action == null) return;
112
+ action.cancel();
113
+ actions.remove(Integer.valueOf(key));
114
+ }
115
+ }
116
+
107
117
  @ReactMethod
108
118
  public void endVisit(String platform) {
109
119
  if (this.shouldWorkOnAndroid(platform)) {
@@ -1,3 +1,3 @@
1
1
  dependencies {
2
- classpath 'com.dynatrace.tools.android:gradle-plugin:8.223.1.1003'
2
+ classpath 'com.dynatrace.tools.android:gradle-plugin:8.231.1.1004'
3
3
  }
@@ -99,6 +99,17 @@ RCT_EXPORT_METHOD(leaveAction:(nonnull NSNumber *)key platform: (NSString *) pla
99
99
  }
100
100
  }
101
101
 
102
+ RCT_EXPORT_METHOD(cancelAction:(nonnull NSNumber *)key platform: (NSString *) platform)
103
+ {
104
+ if ([self shouldWorkOnIosWithPlatform: platform])
105
+ {
106
+ DTXAction *action = [self getAction:key];
107
+ if (action == nil) return;
108
+ [actionDict removeObjectForKey:key];
109
+ [action cancelAction];
110
+ }
111
+ }
112
+
102
113
  RCT_EXPORT_METHOD(endVisit: (NSString *) platform)
103
114
  {
104
115
  if ([self shouldWorkOnIosWithPlatform: platform])
@@ -0,0 +1,69 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>LibraryIdentifier</key>
9
+ <string>tvos-arm64_x86_64-simulator</string>
10
+ <key>LibraryPath</key>
11
+ <string>Dynatrace.framework</string>
12
+ <key>SupportedArchitectures</key>
13
+ <array>
14
+ <string>arm64</string>
15
+ <string>x86_64</string>
16
+ </array>
17
+ <key>SupportedPlatform</key>
18
+ <string>tvos</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
21
+ </dict>
22
+ <dict>
23
+ <key>LibraryIdentifier</key>
24
+ <string>ios-arm64_armv7</string>
25
+ <key>LibraryPath</key>
26
+ <string>Dynatrace.framework</string>
27
+ <key>SupportedArchitectures</key>
28
+ <array>
29
+ <string>arm64</string>
30
+ <string>armv7</string>
31
+ </array>
32
+ <key>SupportedPlatform</key>
33
+ <string>ios</string>
34
+ </dict>
35
+ <dict>
36
+ <key>LibraryIdentifier</key>
37
+ <string>tvos-arm64</string>
38
+ <key>LibraryPath</key>
39
+ <string>Dynatrace.framework</string>
40
+ <key>SupportedArchitectures</key>
41
+ <array>
42
+ <string>arm64</string>
43
+ </array>
44
+ <key>SupportedPlatform</key>
45
+ <string>tvos</string>
46
+ </dict>
47
+ <dict>
48
+ <key>LibraryIdentifier</key>
49
+ <string>ios-arm64_i386_x86_64-simulator</string>
50
+ <key>LibraryPath</key>
51
+ <string>Dynatrace.framework</string>
52
+ <key>SupportedArchitectures</key>
53
+ <array>
54
+ <string>arm64</string>
55
+ <string>i386</string>
56
+ <string>x86_64</string>
57
+ </array>
58
+ <key>SupportedPlatform</key>
59
+ <string>ios</string>
60
+ <key>SupportedPlatformVariant</key>
61
+ <string>simulator</string>
62
+ </dict>
63
+ </array>
64
+ <key>CFBundlePackageType</key>
65
+ <string>XFWK</string>
66
+ <key>XCFrameworkFormatVersion</key>
67
+ <string>1.0</string>
68
+ </dict>
69
+ </plist>