@dynatrace/react-native-plugin 2.301.2 → 2.303.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.
package/README.md CHANGED
@@ -23,16 +23,16 @@ If you want to start using this plugin and are not a Dynatrace customer yet, hea
23
23
  * React Native v0.60 or newer
24
24
  * For Android users:
25
25
  * SDK version 21+
26
- * Gradle version 6.1.1+ ([How to update?](#updating-to-gradle-6))
27
- * Android Gradle plugin version 4.0+
26
+ * Gradle version 7.0+ ([How to update?](#updating-to-gradle-7))
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.301.1.1004
35
- * iOS Agent: 8.301.1.1008
34
+ * Android Agent: 8.303.2.1014
35
+ * iOS Agent: 8.303.1.1004
36
36
 
37
37
  ## Quick Setup
38
38
 
@@ -78,7 +78,7 @@ This agent versions are configured in this plugin:
78
78
  * [How does Dynatrace automatically report crashes?](#how-does-dynatrace-automatically-report-crashes)
79
79
  * [React Automatic Runtime](#react-automatic-runtime)
80
80
  * [Using a second transformer besides the dynatrace transformer](#using-a-second-transformer-besides-the-dynatrace-transformer)
81
- * [Upgrading project to Gradle 6](#updating-to-gradle-6)
81
+ * [Upgrading project to Gradle 7](#updating-to-gradle-7)
82
82
  * [Maven Central in top-level gradle file](#maven-central-in-top-level-gradle-file)
83
83
  * [Configuration of standalone React Native project](#configuration-of-standalone-react-native-project)
84
84
  * [Instrumentation Overhead](#instrumentation-overhead)
@@ -1314,17 +1314,17 @@ The location of the [top-level build.gradle](https://dt-url.net/jm610pso) should
1314
1314
  **Note:**
1315
1315
  JCenter has noted its [sunset](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/) on May 1st. Though, JCenter is still syncing with Maven Central so having`jcenter()` in your **build.gradle** file without the use of `mavenCentral()` will retrieve the Dynatrace Android Gradle Plugin no problem.
1316
1316
 
1317
- ## Updating to Gradle 6
1317
+ ## Updating to Gradle 7
1318
1318
 
1319
- Updating Gradle only affects your Android build. To update your project to Gradle 6, modify the following 3 files in your Android folder.
1319
+ Updating Gradle only affects your Android build. To update your project to Gradle 7, modify the following 3 files in your Android folder.
1320
1320
 
1321
1321
  - `ProjectFolder\android\gradle\wrapper\gradle-wrapper.properties` Update the distributionUrl to get a newer gradle version.
1322
1322
 
1323
1323
  ```
1324
- distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
1324
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-all.zip
1325
1325
  ```
1326
1326
 
1327
- - `ProjectFolder\android\build.gradle` Update the version of your Android gradle plugin (minimum 4.x) as Gradle 6 needs a newer one. To get the newer versions, add `google()` in your repositories. Example of a build.gradle file:
1327
+ - `ProjectFolder\android\build.gradle` Update the version of your Android gradle plugin (minimum 7.x) as Gradle 7 needs a newer one. To get the newer versions, add `google()` in your repositories. Example of a build.gradle file:
1328
1328
 
1329
1329
  ```
1330
1330
  buildscript {
@@ -1332,7 +1332,7 @@ buildscript {
1332
1332
  google()
1333
1333
  }
1334
1334
  dependencies {
1335
- classpath 'com.android.tools.build:gradle:3.4.0'
1335
+ classpath 'com.android.tools.build:gradle:x.x.x'
1336
1336
  }
1337
1337
  }
1338
1338
 
@@ -1460,6 +1460,12 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
1460
1460
  <br/><br/>
1461
1461
  ## Changelog
1462
1462
 
1463
+ 2.303.2
1464
+ * Updated Android (8.303.2.1014) & iOS Agent (8.303.1.1004)
1465
+ * Android Gradle Plugin version requirement raised to 7.0+
1466
+ * Gradle Plugin version requirement raised to 7.0+
1467
+ * Fixed warnings for jsx runtime when using expo
1468
+
1463
1469
  2.301.2
1464
1470
  * Updated Android (8.301.1.1004) & iOS Agent (8.301.1.1008)
1465
1471
  * Fix iOS crashes to not report on session after crash
@@ -70,7 +70,7 @@ repositories {
70
70
  }
71
71
 
72
72
  dependencies {
73
- implementation 'com.dynatrace.agent:agent-android:8.301.1.1004'
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
 
@@ -262,12 +262,6 @@ public class DynatraceRNBridgeImpl {
262
262
  }
263
263
  }
264
264
 
265
- public void sendEvent(String name, ReadableMap attributes, String platform) {
266
- if(this.shouldWorkOnAndroid(platform)) {
267
- Dynatrace.sendEvent(name, new JSONObject(toHashMap(attributes)));
268
- }
269
- }
270
-
271
265
  public void sendBizEvent(String type, ReadableMap attributes, String platform) {
272
266
  if(this.shouldWorkOnAndroid(platform)) {
273
267
  Dynatrace.sendBizEvent(type, new JSONObject(toHashMap(attributes)));
@@ -135,11 +135,6 @@ public class DynatraceRNBridge extends NativeDynatraceBridgeSpec {
135
135
  this.impl.reportDoubleValueInAction(actionKey, name, value, platform);
136
136
  }
137
137
 
138
- @Override
139
- public void sendEvent(String name, ReadableMap attributes, String platform) {
140
- this.impl.sendEvent(name, attributes, platform);
141
- }
142
-
143
138
  @Override
144
139
  public void sendBizEvent(String type, ReadableMap attributes, String platform) {
145
140
  this.impl.sendBizEvent(type, attributes, platform);
@@ -137,11 +137,6 @@ public class DynatraceRNBridge extends ReactContextBaseJavaModule {
137
137
  this.impl.reportDoubleValueInAction(actionKey, name, value, platform);
138
138
  }
139
139
 
140
- @ReactMethod
141
- public void sendEvent(String name, ReadableMap attributes, String platform) {
142
- this.impl.sendEvent(name, attributes, platform);
143
- }
144
-
145
140
  @ReactMethod
146
141
  public void sendBizEvent(String type, ReadableMap attributes, String platform) {
147
142
  this.impl.sendBizEvent(type, attributes, platform);
@@ -1,3 +1,3 @@
1
1
  dependencies {
2
- classpath 'com.dynatrace.tools.android:gradle-plugin:8.301.1.1004'
2
+ classpath 'com.dynatrace.tools.android:gradle-plugin:8.303.2.1014'
3
3
  }
@@ -28,7 +28,6 @@ typedef enum : NSUInteger {
28
28
  @end
29
29
 
30
30
  @interface Dynatrace (Events)
31
- + (void)sendEventWithName:(NSString*)name attributes:(NSDictionary<NSString*,id>* _Nullable)attributes;
32
31
  + (void)sendBizEventWithType:(NSString *)type attributes:(NSDictionary<NSString *, id> *_Nullable)attributes;
33
32
  @end
34
33
 
@@ -301,14 +301,6 @@ RCT_EXPORT_METHOD(reportEventInAction:(nonnull NSString *)actionKey withName: (N
301
301
  }
302
302
  }
303
303
 
304
- RCT_EXPORT_METHOD(sendEvent:(NSString *)name withAttributes:(NSDictionary<NSString*, id>*) attributes platform: (NSString *) platform)
305
- {
306
- if ([self shouldWorkOnIosWithPlatform: platform])
307
- {
308
- [Dynatrace sendEventWithName:name attributes:attributes];
309
- }
310
- }
311
-
312
304
  RCT_EXPORT_METHOD(sendBizEvent:(NSString *)type withAttributes:(NSDictionary<NSString*, id>*) attributes platform: (NSString *) platform)
313
305
  {
314
306
  if ([self shouldWorkOnIosWithPlatform: platform])
@@ -191,26 +191,6 @@ exports.Dynatrace = {
191
191
  Logger_1.Logger.logInfo(`Dynatrace reportCrashWithException(${crashName}, ${crash}): React Native plugin has not been started yet! Crash will not be reported!`);
192
192
  }
193
193
  },
194
- sendEvent: (name, attributes = {}, platform) => {
195
- if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
196
- if (StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(name)) {
197
- Logger_1.Logger.logDebug(`Dynatrace sendEvent(${name}, ${attributes}): Name must be a non empty string`);
198
- return;
199
- }
200
- if (typeof attributes !== 'object' ||
201
- attributes === null ||
202
- Array.isArray(attributes)) {
203
- Logger_1.Logger.logDebug(`Dynatrace sendEvent(${name}, ${attributes}): Payload toplevel must be an object`);
204
- return;
205
- }
206
- const internalAttributes = Object.assign({}, attributes);
207
- Logger_1.Logger.logDebug(`Dynatrace sendEvent(${name}, ${internalAttributes})`);
208
- DynatraceBridge_1.DynatraceNative.sendEvent(name, internalAttributes, platform === null || platform === void 0 ? void 0 : platform.toString());
209
- }
210
- else {
211
- Logger_1.Logger.logInfo(`Dynatrace sendEvent(${name}, ${attributes}): React Native plugin has not been started yet! Event will not be reported!`);
212
- }
213
- },
214
194
  sendBizEvent: (type, attributes = {}, platform) => {
215
195
  if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
216
196
  if (StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(type)) {
@@ -23,24 +23,32 @@ try {
23
23
  !(0, ElementHelper_1.isDtActionIgnore)(args[1])) {
24
24
  if (args[0]._dtInfo.type === Types_1.Types.FunctionalComponent) {
25
25
  const wrapperProps = {
26
- children: [],
26
+ children: _jsxDevRuntime.jsxDEV(...args),
27
27
  };
28
28
  wrapperProps.dtActionName =
29
29
  args[1] !== undefined &&
30
30
  args[1].dtActionName !== undefined
31
31
  ? args[1].dtActionName
32
32
  : args[0]._dtInfo.name;
33
- wrapperProps.children.push(_jsxDevRuntime.jsxDEV(args[0], args[1], ...args));
34
- return _jsxDevRuntime.jsxDEV(Component_1.DynatraceFnWrapper, wrapperProps);
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
+ }
35
39
  }
36
40
  else if (args[0]._dtInfo.type === Types_1.Types.ClassComponent &&
37
41
  args[0].prototype !== undefined &&
38
42
  args[0].prototype.isReactComponent !== undefined) {
39
43
  const wrapperProps = {
40
- children: [],
44
+ children: _jsxDevRuntime.jsxDEV(...args),
41
45
  };
42
- wrapperProps.children.push(_jsxDevRuntime.jsxDEV(args[0], args[1], ...args));
43
- return _jsxDevRuntime.jsxDEV(Component_1.DynatraceClassWrapper, wrapperProps);
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
+ }
44
52
  }
45
53
  if (Array.isArray(args[1].children)) {
46
54
  (0, ElementHelper_1.modifyElement)(args[0], args[1], ...args[1].children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/react-native-plugin",
3
- "version": "2.301.2",
3
+ "version": "2.303.2",
4
4
  "description": "This plugin gives you the ability to use the Dynatrace Mobile agent in your react native application.",
5
5
  "main": "index.js",
6
6
  "types": "typings/react-native-dynatrace.d.ts",
@@ -111,7 +111,7 @@ Pod::Spec.new do |s|
111
111
  #
112
112
 
113
113
  s.dependency "React"
114
- s.dependency 'Dynatrace', '~> 8.301.1.1008'
114
+ s.dependency 'Dynatrace', '~> 8.303.1.1004'
115
115
 
116
116
  # Allows for better compatibility for older and newer versions
117
117
  if defined?(install_modules_dependencies)
@@ -103,8 +103,6 @@ export interface Spec extends TurboModule {
103
103
  platform?: string,
104
104
  ): void;
105
105
 
106
- sendEvent(name: string, attributes: UnsafeObject, plaform?: string): void;
107
-
108
106
  sendBizEvent(
109
107
  type: string,
110
108
  attributes: UnsafeObject,