@dynatrace/react-native-plugin 2.293.1 → 2.295.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 +22 -3
- package/android/build.gradle +1 -1
- package/files/plugin.gradle +1 -1
- package/lib/instrumentor/DynatraceInstrumentation.js +1 -1
- package/lib/instrumentor/base/configuration/Configuration.js +7 -2
- package/lib/instrumentor/base/configuration/ConfigurationBuilder.js +6 -1
- package/lib/instrumentor/base/configuration/ConfigurationHandler.js +1 -0
- package/lib/instrumentor/base/configuration/ConfigurationPreset.js +3 -0
- package/lib/react-native/Touchables.js +10 -3
- package/package.json +3 -3
- package/react-native-dynatrace.podspec +1 -1
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ If you want to start using this plugin and are not a Dynatrace customer yet, hea
|
|
|
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.295.1.1006
|
|
35
|
+
* iOS Agent: 8.295.1.1020
|
|
36
36
|
|
|
37
37
|
## Quick Setup
|
|
38
38
|
|
|
@@ -85,6 +85,7 @@ This agent versions are configured in this plugin:
|
|
|
85
85
|
## Troubleshooting
|
|
86
86
|
* [Documentation](#dynatrace-documentation)
|
|
87
87
|
* [Known issues](#troubleshooting-and-applicable-restrictions)
|
|
88
|
+
* [Supported and Unsupported libraries](#supported-and-unsupported-libraries)
|
|
88
89
|
* [Report bug / Get support](#report-a-bug-or-open-a-support-case)
|
|
89
90
|
* [Changelog](#changelog)
|
|
90
91
|
<br/><br/>
|
|
@@ -1403,6 +1404,19 @@ To resolve problems with the plugin, first look at creating logs and identify wh
|
|
|
1403
1404
|
* When using NodeJS version `15+` and version `2.231.1` of our plugin you could encounter the following error: `npm ERR! Could not resolve dependency: npm ERR! peer react@"^16.0" from @react-native-community/picker@1.8.1`. Using the old deprecrated [Picker dependency](https://www.npmjs.com/package/@react-native-community/picker) was causing peer dependency issues so we updated the auto-instrumentation to use the [new Picker dependency.](https://www.npmjs.com/package/@react-native-picker/picker) If you are still using this `@react-native-community/picker`, you can manually instrument the picker without issue ([create custom actions](#create-custom-actions)).
|
|
1404
1405
|
* To disable the error handler when using manual startup, you will need to use/migrate to the `ConfigurationBuilder` instead of the deprecated `ManualStartupConfiguration`. There is no option to disable the crash handler using `ManualStartupConfiguration`.
|
|
1405
1406
|
|
|
1407
|
+
## Supported and Unsupported libraries
|
|
1408
|
+
>**Important note:** If the library you are using is not on either the support or unsupported list, that does not mean that this plugin is not compatible with the library.
|
|
1409
|
+
|
|
1410
|
+
**Supported:**
|
|
1411
|
+
* @react-native-picker/picker
|
|
1412
|
+
* axios
|
|
1413
|
+
* react-native-gesture-handler
|
|
1414
|
+
* react-native-webview
|
|
1415
|
+
* Custom libraries that directly use the default React Native components (i.e. Button)
|
|
1416
|
+
|
|
1417
|
+
**Unsupported:**
|
|
1418
|
+
* NativeWind
|
|
1419
|
+
|
|
1406
1420
|
## Report a bug or open a support case
|
|
1407
1421
|
|
|
1408
1422
|
>**Attention:** If you think something is not working the way it should, ALWAYS try to reset the cache of metro first before starting a support case. You can do this via the CLI *react-native start --reset-cache*. If it still does not work feel free to open a support case.
|
|
@@ -1414,9 +1428,14 @@ If you are struggling with a problem, submit a support ticket to Dynatrace (supp
|
|
|
1414
1428
|
<br/><br/>
|
|
1415
1429
|
## Changelog
|
|
1416
1430
|
|
|
1417
|
-
2.
|
|
1431
|
+
2.295.1
|
|
1432
|
+
* Update Android (8.295.1.1006) & iOS Agent (8.295.1.1020)
|
|
1433
|
+
* Add list of supported/unsupported libraries to README
|
|
1434
|
+
|
|
1435
|
+
2.293.2
|
|
1418
1436
|
* Update Android (8.293.1.1003) & iOS Agent (8.293.1.1003)
|
|
1419
1437
|
* Preventing double instrumentation of touchables
|
|
1438
|
+
* Fixed instrumentation of Text component because of missing static access
|
|
1420
1439
|
|
|
1421
1440
|
2.291.2
|
|
1422
1441
|
* Update Android (8.291.1.1002) & iOS Agent (8.291.1.1004)
|
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.295.1.1006'
|
|
74
74
|
implementation "com.facebook.react:react-native:${safeExtGet('reactNative', '+')}"
|
|
75
75
|
}
|
|
76
76
|
|
package/files/plugin.gradle
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o,n=require("@babel/runtime/helpers/interopRequireDefault"),r=n(require("@babel/runtime/helpers/toConsumableArray")),a=(Object.defineProperty(exports,"t",{value:!0}),exports.instrument=void 0,require("path")),c=require("jscodeshift"),i=require("jscodeshift/src/Collection"),e=require("../../scripts/FileOperationHelper"),t=require("../../scripts/PathsConstants"),u=require("../react-native/Touchables.InstrInfo"),l=require("../react-native/RefreshControl.InstrInfo"),f=require("../react-native/Switch.InstrInfo"),s=require("../community/gesture-handler/Touchables.InstrInfo"),v=require("../community/Picker.InstrInfo"),d=require("./parser/Babel"),p=require("./model/Types"),m=(!function(n){n[n.i=-1]="Filtered",n[n.u=0]="Normal",n[n.o=1]="ReactNative",n[n.l=2]="React"}(o=o||{}),[]),y=(m.push.apply(m,(0,r.default)(u.instrumentationInfo)),m.push.apply(m,(0,r.default)(l.instrumentationInfo)),m.push.apply(m,(0,r.default)(f.instrumentationInfo)),m.push.apply(m,(0,r.default)(s.instrumentationInfo)),m.push.apply(m,(0,r.default)(v.instrumentationInfo)),["AppRegistry","renderApplication","setUpErrorHandling"]),instrument=function(n,r,e){r=P(r);var t=M(r);if(t!==o.i){var i=!1,u=N(r,n);if(t===o.l)T(u),i=!0;else if(t===o.o)r.endsWith("AppRegistry.js")?void 0!==e&&e.autoStart&&(U(u),i=!0):r.endsWith("renderApplication.js")?(q(u),i=!0):r.endsWith("setUpErrorHandling.js")&&void 0!==e&&e.autoStart&&e.errorHandler.enabled&&(B(u,e.autoStart,e.errorHandler.reportFatalErrorAsCrash),i=!0);else{var t=w(r,e);if(e.custom.reactnavigation&&g(r,u))i=!0;else{if(!t.input&&!t.lifecycle)return null!=e&&e.debug&&console.log("Dynatrace - Filtered All: ".concat(r)),E(r),n;t.lifecycle&&q(u)&&(i=!0),t.input&&m.forEach(function(n){n=G(u,n);u=n.root,i=i||n.v})}}i?(n=u.toSource({quote:"single"}),H(n,r)):E(r),null!=e&&e.debug&&i&&console.log("Dynatrace - Modified Filename: "+r)}else r.includes(a.join("@dynatrace","react-native-plugin"))&&r.endsWith(a.join("lib","instrumentor","base","configuration","ConfigurationPreset.js"))&&void 0!==e&&(t=N(r,n),void 0!==e.lifecycle&&h(t,"getLifecycleUpdate",e.lifecycle.includeUpdate),void 0!==e.debug&&h(t,"getLogLevel",e.debug?0:1),void 0!==e.bundleName&&h(t,"getBundleName",e.bundleName),void 0!==e.input&&void 0!==e.input.actionNamePrivacy&&h(t,"getActionNamePrivacy",e.input.actionNamePrivacy),void 0!==e.errorHandler&&(h(t,"isErrorHandlerEnabled",e.errorHandler.enabled),h(t,"isReportFatalErrorAsCrash",e.errorHandler.reportFatalErrorAsCrash)),e.autoStart&&h(t,"isAutoStartupEnabled",e.autoStart),n=t.toSource({quote:"single"}),H(n,r));return n},g=(exports.instrument=instrument,function(n,r){return!!b(n,r)&&(r.find(c.ImportDeclaration).at(0).insertBefore("import { registerListener } from '@dynatrace/react-native-plugin/lib/react-navigation/ReactNavigation';"),!0)}),b=function(n,r){var e=!1;return n.includes("react-navigation")&&n.includes("NavigationContainer.tsx")&&r.find(c.VariableDeclarator).forEach(function(n){e||null==n.value||null==n.value.id||"refContainer"!==n.value.id.name||null!=n.parent&&null!=n.parent.value&&null!=n.parent.value.type&&"VariableDeclaration"===n.parent.value.type&&(n.parent.insertAfter("registerListener(refContainer);"),e=!0)}),e},q=function(n){var r=n.findJSXElements(),t=!1;return 0<r.length&&(n.find(c.FunctionDeclaration).forEach(function(n){var r,e=(0,i.fromPaths)([n]);0<e.findJSXElements().length&&null!=n&&null!=n.value&&null!=n.value.id&&n.value.id.name&&(r=e.find(c.ClassDeclaration),e=e.find(c.ClassExpression),0===r.length)&&0===e.length&&(A(n,p.Types.FunctionalComponent,n.value.id.name),t=!0)}),n.find(c.ClassDeclaration).forEach(function(n){0<(0,i.fromPaths)([n]).findJSXElements().length&&null!=n&&null!=n.value&&n.value.id&&n.value.id.name&&(A(n,p.Types.ClassComponent,n.value.id.name),t=!0)}),n.find(c.ArrowFunctionExpression).forEach(function(n){0<(0,i.fromPaths)([n]).findJSXElements().length&&null!=n.parent&&null!=n.parent.value&&null!=n.parent.value.id&&null!=n.parent.value.id.name&&(A(n,p.Types.FunctionalComponent,n.parent.value.id.name),t=!0)})),t},A=function(n,r,e){for(r=c.expressionStatement(c.assignmentExpression("=",c.memberExpression(c.identifier(e),c.identifier("_dtInfo")),O(r,e)));void 0!==n.parentPath&&"body"!==n.parentPath.name;)n=n.parentPath;void 0!==n.parentPath&&n.insertAfter(r)},O=function(n,r){return c.objectExpression([c.objectProperty(c.identifier("type"),c.numericLiteral(n)),c.objectProperty(c.identifier("name"),c.stringLiteral(r))])},h=function(n,r,e){var n=n.find(c.Identifier).filter(function(n){return n.node.name===r});1===n.length&&"ReturnStatement"===(n=n.paths()[0].parent.value.body.body[0]).type&&("boolean"==typeof e&&(n.argument=c.booleanLiteral(e)),"string"==typeof e&&(n.argument=c.stringLiteral(e)),"number"==typeof e)&&(n.argument=c.numericLiteral(e))},N=function(n,r){return c.withParser((0,d.babelParser)(a.extname(n)))(r)},P=function(n){return a.isAbsolute(n)?n.replace(t.default.getApplicationPath()+a.sep,""):n},E=function(n){try{var r=a.join(t.default.getBuildPath(),n+".dtx");e.default.checkIfFileExistsSync(r),e.default.deleteFileSync(r)}catch(n){}},H=function(n,r){r=a.join(t.default.getBuildPath(),r);try{e.default.checkIfFileExistsSync(a.dirname(r))}catch(n){e.default.createDirectorySync(a.dirname(r))}e.default.writeTextToFileSync(r+".dtx",n)},w=function(n,r){var e={input:!1,lifecycle:!1};return void 0!==r&&(void 0!==r.lifecycle&&void 0!==r.lifecycle.instrument&&r.lifecycle.instrument(n)&&(e.lifecycle=!0),void 0!==r.input)&&void 0!==r.input.instrument&&r.input.instrument(n)&&(e.input=!0),e},T=function(n){var r,n=n.find(c.Program);1===n.length&&(r=c.expressionStatement(c.callExpression(c.memberExpression(c.callExpression(c.identifier("require"),[c.stringLiteral("@dynatrace/react-native-plugin/lib/instrumentor/base/ElementHelper")]),c.identifier("instrumentCreateElement")),[c.memberExpression(c.identifier("module"),c.identifier("exports"))])),n.paths()[0].node.body.push(r))},U=function(n){var r=J(n,"runApplication",!0);1===r.length&&(rn(n,{p:"_DynatraceApplicationHandler",module:"@dynatrace/react-native-plugin",reference:"ApplicationHandler"}),I(r.paths()[0].parent.value.body.body,0,D("_DynatraceApplicationHandler","startup",[])))},B=function(n,r,e){n=n.paths()[0].value.program.body;null!=n&&(I(n,n.length,_({p:"_DynatraceErrorHandler",module:"@dynatrace/react-native-plugin/lib/instrumentor/base/ErrorHandler",reference:""})),I(n,n.length,D("_DynatraceErrorHandler","registerErrorHandler",[c.literal(e)])))},I=function(n,r){for(var e=arguments.length,t=new Array(2<e?e-2:0),i=2;i<e;i++)t[i-2]=arguments[i];return n.splice.apply(n,[r,0].concat(t))},J=function(n,r,t){for(var e=arguments.length,i=new Array(3<e?e-3:0),u=3;u<e;u++)i[u-3]=arguments[u];return n.find(c.Identifier).filter(function(n){return n.node.name===r}).filter(function(n){return void 0!==n.parent&&void 0!==n.parent.value&&void 0!==n.parent.value.params}).filter(function(n){var r=void 0!==n.parent&&void 0!==n.parent.value;t||(r=r&&n.parent.value.params.length===i.length);for(var e=0;e<0;e++)r=r&&n.parent.value.params[e].name===i[e];return r})},M=function(n){if(n.includes("@dynatrace"))return o.i;var r=a.extname(n);if(".js"!==r&&".ts"!==r&&".tsx"!==r&&".jsx"!==r)return o.i;for(var e=a.parse(n),t=e.dir.split(a.sep),i=0;i<t.length;i++)if("node_modules"===t[i]){if("react-native"===t[i+1]||"create-react-class"===t[i+1]||"react-clone-referenced-element"===t[i+1])return y.includes(e.name)?o.o:o.i;if("react"===t[i+1]&&"index"===e.name)return o.l}return o.u},k=function(n,r,e){var t=V(n,r,e);return z(n,r,e)||t},V=function(n,r,e){var t=K(n,r);return 0<t.length&&(void 0!==(t=j(t,r.reference,!1))&&(e.p=t.localName),$(n,e),!0)},z=function(n,r,e){var t=C(n,r.module);if(1===t.length){t=j(t,r.reference,!0);if(void 0!==t)return nn(n,e.defaultImport,t.localName,"ImportNamespaceSpecifier"===t.type),!0}return!1},G=function(n,r){var e=JSON.parse(JSON.stringify(r.new));return{root:n,v:k(n,r.old,e)||Q(n,r.old,r.new.defaultImport)}},K=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r.module&&null!=n.node.specifiers&&n.node.specifiers.some(function(n){return x(n)&&n.imported.name===r.reference||n.local&&n.local.name===r.reference})})},x=function(n){return void 0!==n.imported},Q=function(n,r,e){var t=!1;return n.find(c.CallExpression).filter(function(n){return W(n.node.callee)&&X(n.node.arguments[0])&&n.node.arguments[0].value===r.module&&void 0!==n.parent}).forEach(function(n){(void 0===n.parent.value.property||void 0!==n.parent.value.property&&void 0!==n.parent.value.property.name&&n.parent.value.property.name===r.reference)&&(n.node.arguments[0].value=e,t=t||!0)}),t},W=function(n){return"require"===n.name},X=function(n){return"StringLiteral"===n.type||"Literal"===n.type},C=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r})},j=function(n,e,t){var i;return n.forEach(function(n){void 0!==n.node.specifiers&&(n.node.specifiers=n.node.specifiers.filter(function(n){var r;return x(n)&&!t?((r=n.imported.name!==e)||null==n.local||n.imported.name===n.local.name||(i={localName:n.local.name,type:n.type}),r):!(!x(n)&&t&&(null!=n.local&&(i={localName:n.local.name,type:n.type}),1))}),0===n.node.specifiers.length)&&n.prune()}),i},Y=function(n,r){n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r.module}).forEach(function(n){null!=n.node.specifiers&&n.node.specifiers.push(F(r))})},Z=function(n,r,e){n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r}).forEach(function(n){null!=n.node.specifiers&&n.node.specifiers.push(e)})},R=function(n,r,e){var t=n.find(c.ImportDeclaration);0<t.length?c(t.paths()[0]).insertAfter(S(r,e)):1===(t=n.find(c.Program)).length&&t.paths()[0].node.body.unshift(S(r,e))},$=function(n,r){0<C(n,r.module).length?Y(n,r):R(n,r.module,[F(r)])},nn=function(n,r,e,t){var i=C(n,r),t=(t?cn:an)(e);0<i.length?Z(n,r,t):R(n,r,[t])},rn=function(n,r){n=n.find(c.VariableDeclaration);0<n.length&&c(n.paths()[0]).insertAfter(_(r))},D=function(n,r,e){return c.expressionStatement(en(n,r,e))},en=function(n,r,e){return c.callExpression(on(n,r),e)},_=function(n){return c.variableDeclaration("var",[tn(n)])},tn=function(n){return c.variableDeclarator(void 0!==n.p?c.identifier(n.p):c.identifier(n.reference),(0<n.reference.length?un:L)(n))},un=function(n){return c.memberExpression(L(n),c.identifier(n.reference))},on=function(n,r){return c.memberExpression(c.identifier(n),c.identifier(r))},L=function(n){return c.callExpression(c.identifier("require"),[c.literal(n.module)])},S=function(n,r){return c.importDeclaration(r,c.literal(n))},F=function(n){return void 0!==n.p?c.importSpecifier(c.identifier(n.reference),c.identifier(n.p)):c.importSpecifier(c.identifier(n.reference))},an=function(n){return c.importDefaultSpecifier(c.identifier(n))},cn=function(n){return c.importNamespaceSpecifier(c.identifier(n))};
|
|
1
|
+
"use strict";var o,n=require("@babel/runtime/helpers/interopRequireDefault"),r=n(require("@babel/runtime/helpers/toConsumableArray")),a=(Object.defineProperty(exports,"t",{value:!0}),exports.instrument=void 0,require("path")),c=require("jscodeshift"),i=require("jscodeshift/src/Collection"),e=require("../../scripts/FileOperationHelper"),t=require("../../scripts/PathsConstants"),u=require("../react-native/Touchables.InstrInfo"),l=require("../react-native/RefreshControl.InstrInfo"),f=require("../react-native/Switch.InstrInfo"),s=require("../community/gesture-handler/Touchables.InstrInfo"),d=require("../community/Picker.InstrInfo"),v=require("./parser/Babel"),p=require("./model/Types"),m=(!function(n){n[n.i=-1]="Filtered",n[n.u=0]="Normal",n[n.o=1]="ReactNative",n[n.l=2]="React"}(o=o||{}),[]),y=(m.push.apply(m,(0,r.default)(u.instrumentationInfo)),m.push.apply(m,(0,r.default)(l.instrumentationInfo)),m.push.apply(m,(0,r.default)(f.instrumentationInfo)),m.push.apply(m,(0,r.default)(s.instrumentationInfo)),m.push.apply(m,(0,r.default)(d.instrumentationInfo)),["AppRegistry","renderApplication","setUpErrorHandling"]),instrument=function(n,r,e){r=P(r);var t=M(r);if(t!==o.i){var i=!1,u=N(r,n);if(t===o.l)B(u),i=!0;else if(t===o.o)r.endsWith("AppRegistry.js")?void 0!==e&&e.autoStart&&(T(u),i=!0):r.endsWith("renderApplication.js")?(q(u),i=!0):r.endsWith("setUpErrorHandling.js")&&void 0!==e&&e.autoStart&&e.errorHandler.enabled&&(U(u,e.autoStart,e.errorHandler.reportFatalErrorAsCrash),i=!0);else{var t=w(r,e);if(e.custom.reactnavigation&&g(r,u))i=!0;else{if(!t.input&&!t.lifecycle)return null!=e&&e.debug&&console.log("Dynatrace - Filtered All: ".concat(r)),E(r),n;t.lifecycle&&q(u)&&(i=!0),t.input&&m.forEach(function(n){n=G(u,n);u=n.root,i=i||n.v})}}i?(n=u.toSource({quote:"single"}),H(n,r)):E(r),null!=e&&e.debug&&i&&console.log("Dynatrace - Modified Filename: "+r)}else r.includes(a.join("@dynatrace","react-native-plugin"))&&r.endsWith(a.join("lib","instrumentor","base","configuration","ConfigurationPreset.js"))&&void 0!==e&&(t=N(r,n),void 0!==e.lifecycle&&h(t,"getLifecycleUpdate",e.lifecycle.includeUpdate),void 0!==e.debug&&h(t,"getLogLevel",e.debug?0:1),void 0!==e.bundleName&&h(t,"getBundleName",e.bundleName),void 0!==e.bundleVersion&&h(t,"getBundleVersion",e.bundleVersion),void 0!==e.input&&void 0!==e.input.actionNamePrivacy&&h(t,"getActionNamePrivacy",e.input.actionNamePrivacy),void 0!==e.errorHandler&&(h(t,"isErrorHandlerEnabled",e.errorHandler.enabled),h(t,"isReportFatalErrorAsCrash",e.errorHandler.reportFatalErrorAsCrash)),e.autoStart&&h(t,"isAutoStartupEnabled",e.autoStart),n=t.toSource({quote:"single"}),H(n,r));return n},g=(exports.instrument=instrument,function(n,r){return!!b(n,r)&&(r.find(c.ImportDeclaration).at(0).insertBefore("import { registerListener } from '@dynatrace/react-native-plugin/lib/react-navigation/ReactNavigation';"),!0)}),b=function(n,r){var e=!1;return n.includes("react-navigation")&&n.includes("NavigationContainer.tsx")&&r.find(c.VariableDeclarator).forEach(function(n){e||null==n.value||null==n.value.id||"refContainer"!==n.value.id.name||null!=n.parent&&null!=n.parent.value&&null!=n.parent.value.type&&"VariableDeclaration"===n.parent.value.type&&(n.parent.insertAfter("registerListener(refContainer);"),e=!0)}),e},q=function(n){var r=n.findJSXElements(),t=!1;return 0<r.length&&(n.find(c.FunctionDeclaration).forEach(function(n){var r,e=(0,i.fromPaths)([n]);0<e.findJSXElements().length&&null!=n&&null!=n.value&&null!=n.value.id&&n.value.id.name&&(r=e.find(c.ClassDeclaration),e=e.find(c.ClassExpression),0===r.length)&&0===e.length&&(A(n,p.Types.FunctionalComponent,n.value.id.name),t=!0)}),n.find(c.ClassDeclaration).forEach(function(n){0<(0,i.fromPaths)([n]).findJSXElements().length&&null!=n&&null!=n.value&&n.value.id&&n.value.id.name&&(A(n,p.Types.ClassComponent,n.value.id.name),t=!0)}),n.find(c.ArrowFunctionExpression).forEach(function(n){0<(0,i.fromPaths)([n]).findJSXElements().length&&null!=n.parent&&null!=n.parent.value&&null!=n.parent.value.id&&null!=n.parent.value.id.name&&(A(n,p.Types.FunctionalComponent,n.parent.value.id.name),t=!0)})),t},A=function(n,r,e){for(r=c.expressionStatement(c.assignmentExpression("=",c.memberExpression(c.identifier(e),c.identifier("_dtInfo")),O(r,e)));void 0!==n.parentPath&&"body"!==n.parentPath.name;)n=n.parentPath;void 0!==n.parentPath&&n.insertAfter(r)},O=function(n,r){return c.objectExpression([c.objectProperty(c.identifier("type"),c.numericLiteral(n)),c.objectProperty(c.identifier("name"),c.stringLiteral(r))])},h=function(n,r,e){var n=n.find(c.Identifier).filter(function(n){return n.node.name===r});1===n.length&&"ReturnStatement"===(n=n.paths()[0].parent.value.body.body[0]).type&&("boolean"==typeof e&&(n.argument=c.booleanLiteral(e)),"string"==typeof e&&(n.argument=c.stringLiteral(e)),"number"==typeof e)&&(n.argument=c.numericLiteral(e))},N=function(n,r){return c.withParser((0,v.babelParser)(a.extname(n)))(r)},P=function(n){return a.isAbsolute(n)?n.replace(t.default.getApplicationPath()+a.sep,""):n},E=function(n){try{var r=a.join(t.default.getBuildPath(),n+".dtx");e.default.checkIfFileExistsSync(r),e.default.deleteFileSync(r)}catch(n){}},H=function(n,r){r=a.join(t.default.getBuildPath(),r);try{e.default.checkIfFileExistsSync(a.dirname(r))}catch(n){e.default.createDirectorySync(a.dirname(r))}e.default.writeTextToFileSync(r+".dtx",n)},w=function(n,r){var e={input:!1,lifecycle:!1};return void 0!==r&&(void 0!==r.lifecycle&&void 0!==r.lifecycle.instrument&&r.lifecycle.instrument(n)&&(e.lifecycle=!0),void 0!==r.input)&&void 0!==r.input.instrument&&r.input.instrument(n)&&(e.input=!0),e},B=function(n){var r,n=n.find(c.Program);1===n.length&&(r=c.expressionStatement(c.callExpression(c.memberExpression(c.callExpression(c.identifier("require"),[c.stringLiteral("@dynatrace/react-native-plugin/lib/instrumentor/base/ElementHelper")]),c.identifier("instrumentCreateElement")),[c.memberExpression(c.identifier("module"),c.identifier("exports"))])),n.paths()[0].node.body.push(r))},T=function(n){var r=J(n,"runApplication",!0);1===r.length&&(rn(n,{p:"_DynatraceApplicationHandler",module:"@dynatrace/react-native-plugin",reference:"ApplicationHandler"}),I(r.paths()[0].parent.value.body.body,0,D("_DynatraceApplicationHandler","startup",[])))},U=function(n,r,e){n=n.paths()[0].value.program.body;null!=n&&(I(n,n.length,_({p:"_DynatraceErrorHandler",module:"@dynatrace/react-native-plugin/lib/instrumentor/base/ErrorHandler",reference:""})),I(n,n.length,D("_DynatraceErrorHandler","registerErrorHandler",[c.literal(e)])))},I=function(n,r){for(var e=arguments.length,t=new Array(2<e?e-2:0),i=2;i<e;i++)t[i-2]=arguments[i];return n.splice.apply(n,[r,0].concat(t))},J=function(n,r,t){for(var e=arguments.length,i=new Array(3<e?e-3:0),u=3;u<e;u++)i[u-3]=arguments[u];return n.find(c.Identifier).filter(function(n){return n.node.name===r}).filter(function(n){return void 0!==n.parent&&void 0!==n.parent.value&&void 0!==n.parent.value.params}).filter(function(n){var r=void 0!==n.parent&&void 0!==n.parent.value;t||(r=r&&n.parent.value.params.length===i.length);for(var e=0;e<0;e++)r=r&&n.parent.value.params[e].name===i[e];return r})},M=function(n){if(n.includes("@dynatrace"))return o.i;var r=a.extname(n);if(".js"!==r&&".ts"!==r&&".tsx"!==r&&".jsx"!==r)return o.i;for(var e=a.parse(n),t=e.dir.split(a.sep),i=0;i<t.length;i++)if("node_modules"===t[i]){if("react-native"===t[i+1]||"create-react-class"===t[i+1]||"react-clone-referenced-element"===t[i+1])return y.includes(e.name)?o.o:o.i;if("react"===t[i+1]&&"index"===e.name)return o.l}return o.u},V=function(n,r,e){var t=k(n,r,e);return z(n,r,e)||t},k=function(n,r,e){var t=K(n,r);return 0<t.length&&(void 0!==(t=j(t,r.reference,!1))&&(e.p=t.localName),$(n,e),!0)},z=function(n,r,e){var t=C(n,r.module);if(1===t.length){t=j(t,r.reference,!0);if(void 0!==t)return nn(n,e.defaultImport,t.localName,"ImportNamespaceSpecifier"===t.type),!0}return!1},G=function(n,r){var e=JSON.parse(JSON.stringify(r.new));return{root:n,v:V(n,r.old,e)||Q(n,r.old,r.new.defaultImport)}},K=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r.module&&null!=n.node.specifiers&&n.node.specifiers.some(function(n){return x(n)&&n.imported.name===r.reference||n.local&&n.local.name===r.reference})})},x=function(n){return void 0!==n.imported},Q=function(n,r,e){var t=!1;return n.find(c.CallExpression).filter(function(n){return W(n.node.callee)&&X(n.node.arguments[0])&&n.node.arguments[0].value===r.module&&void 0!==n.parent}).forEach(function(n){(void 0===n.parent.value.property||void 0!==n.parent.value.property&&void 0!==n.parent.value.property.name&&n.parent.value.property.name===r.reference)&&(n.node.arguments[0].value=e,t=t||!0)}),t},W=function(n){return"require"===n.name},X=function(n){return"StringLiteral"===n.type||"Literal"===n.type},C=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r})},j=function(n,e,t){var i;return n.forEach(function(n){void 0!==n.node.specifiers&&(n.node.specifiers=n.node.specifiers.filter(function(n){var r;return x(n)&&!t?((r=n.imported.name!==e)||null==n.local||n.imported.name===n.local.name||(i={localName:n.local.name,type:n.type}),r):!(!x(n)&&t&&(null!=n.local&&(i={localName:n.local.name,type:n.type}),1))}),0===n.node.specifiers.length)&&n.prune()}),i},Y=function(n,r){n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r.module}).forEach(function(n){null!=n.node.specifiers&&n.node.specifiers.push(F(r))})},Z=function(n,r,e){n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r}).forEach(function(n){null!=n.node.specifiers&&n.node.specifiers.push(e)})},R=function(n,r,e){var t=n.find(c.ImportDeclaration);0<t.length?c(t.paths()[0]).insertAfter(S(r,e)):1===(t=n.find(c.Program)).length&&t.paths()[0].node.body.unshift(S(r,e))},$=function(n,r){0<C(n,r.module).length?Y(n,r):R(n,r.module,[F(r)])},nn=function(n,r,e,t){var i=C(n,r),t=(t?cn:an)(e);0<i.length?Z(n,r,t):R(n,r,[t])},rn=function(n,r){n=n.find(c.VariableDeclaration);0<n.length&&c(n.paths()[0]).insertAfter(_(r))},D=function(n,r,e){return c.expressionStatement(en(n,r,e))},en=function(n,r,e){return c.callExpression(on(n,r),e)},_=function(n){return c.variableDeclaration("var",[tn(n)])},tn=function(n){return c.variableDeclarator(void 0!==n.p?c.identifier(n.p):c.identifier(n.reference),(0<n.reference.length?un:L)(n))},un=function(n){return c.memberExpression(L(n),c.identifier(n.reference))},on=function(n,r){return c.memberExpression(c.identifier(n),c.identifier(r))},L=function(n){return c.callExpression(c.identifier("require"),[c.literal(n.module)])},S=function(n,r){return c.importDeclaration(r,c.literal(n))},F=function(n){return void 0!==n.p?c.importSpecifier(c.identifier(n.reference),c.identifier(n.p)):c.importSpecifier(c.identifier(n.reference))},an=function(n){return c.importDefaultSpecifier(c.identifier(n))},cn=function(n){return c.importNamespaceSpecifier(c.identifier(n))};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Configuration = void 0;
|
|
4
4
|
const LogLevel_1 = require("../model/LogLevel");
|
|
5
5
|
class Configuration {
|
|
6
|
-
constructor(beaconUrl, applicationId, reportCrash, errorHandler, reportFatalErrorAsCrash, logLevel, lifecycleUpdate, userOptIn, actionNamePrivacy, bundleName) {
|
|
6
|
+
constructor(beaconUrl, applicationId, reportCrash, errorHandler, reportFatalErrorAsCrash, logLevel, lifecycleUpdate, userOptIn, actionNamePrivacy, bundleName, bundleVersion) {
|
|
7
7
|
this.beaconUrl = beaconUrl;
|
|
8
8
|
this.applicationId = applicationId;
|
|
9
9
|
this.reportCrash = reportCrash;
|
|
@@ -14,6 +14,7 @@ class Configuration {
|
|
|
14
14
|
this.userOptIn = userOptIn;
|
|
15
15
|
this.actionNamePrivacy = actionNamePrivacy;
|
|
16
16
|
this.bundleName = bundleName;
|
|
17
|
+
this.bundleVersion = bundleVersion;
|
|
17
18
|
}
|
|
18
19
|
toString() {
|
|
19
20
|
let configurationString;
|
|
@@ -23,12 +24,16 @@ class Configuration {
|
|
|
23
24
|
else {
|
|
24
25
|
configurationString = `{Startup: Manual Start, applicationId: ${this.applicationId}, beaconUrl: ${this.beaconUrl},`;
|
|
25
26
|
}
|
|
26
|
-
configurationString += ` reportCrash: ${this.reportCrash}, errorHandler: ${this.errorHandler}
|
|
27
|
+
configurationString += ` reportCrash: ${this.reportCrash}, errorHandler: ${this.errorHandler},`
|
|
28
|
+
+ ` reportFatalErrorAsCrash: ${this.reportFatalErrorAsCrash},`
|
|
27
29
|
+ ` lifecycleUpdate: ${this.lifecycleUpdate}, userOptIn: ${this.userOptIn},`
|
|
28
30
|
+ ` actionNamePrivacy: ${this.actionNamePrivacy}, logLevel: ${(0, LogLevel_1.LogLevelToString)(this.logLevel)}`;
|
|
29
31
|
if (this.bundleName !== undefined) {
|
|
30
32
|
configurationString += `, bundleName: ${this.bundleName}`;
|
|
31
33
|
}
|
|
34
|
+
if (this.bundleVersion !== undefined) {
|
|
35
|
+
configurationString += `, bundleVersion: ${this.bundleVersion}`;
|
|
36
|
+
}
|
|
32
37
|
configurationString += '}';
|
|
33
38
|
return configurationString;
|
|
34
39
|
}
|
|
@@ -19,6 +19,7 @@ class ConfigurationBuilder {
|
|
|
19
19
|
this.userOptIn = ConfigurationDefaults_1.DEFAULT_USER_OPT_IN;
|
|
20
20
|
this.actionNamePrivacy = preset.getActionNamePrivacy();
|
|
21
21
|
this.bundleName = preset.getBundleName();
|
|
22
|
+
this.bundleVersion = preset.getBundleVersion();
|
|
22
23
|
this.autoStartup = preset.isAutoStartupEnabled();
|
|
23
24
|
}
|
|
24
25
|
withCrashReporting(reportCrash) {
|
|
@@ -53,6 +54,10 @@ class ConfigurationBuilder {
|
|
|
53
54
|
this.bundleName = bundleName;
|
|
54
55
|
return this;
|
|
55
56
|
}
|
|
57
|
+
withBundleVersion(bundleVersion) {
|
|
58
|
+
this.bundleVersion = bundleVersion;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
56
61
|
buildConfiguration() {
|
|
57
62
|
if (!this.autoStartup && this.beaconUrl.length === 0) {
|
|
58
63
|
throw new Error('beaconUrl configuration property is empty. This configuration is not possible! Please use a proper beacon url.');
|
|
@@ -60,7 +65,7 @@ class ConfigurationBuilder {
|
|
|
60
65
|
if (!this.autoStartup && this.applicationId.length === 0) {
|
|
61
66
|
throw new Error('applicationId configuration property is empty. This configuration is not possible! Please use a proper application id.');
|
|
62
67
|
}
|
|
63
|
-
return new Configuration_1.Configuration(this.beaconUrl, this.applicationId, this.reportCrash, this.errorHandler, this.reportFatalErrorAsCrash, this.logLevel, this.lifecycleUpdate, this.userOptIn, this.actionNamePrivacy, this.bundleName);
|
|
68
|
+
return new Configuration_1.Configuration(this.beaconUrl, this.applicationId, this.reportCrash, this.errorHandler, this.reportFatalErrorAsCrash, this.logLevel, this.lifecycleUpdate, this.userOptIn, this.actionNamePrivacy, this.bundleName, this.bundleVersion);
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
exports.ConfigurationBuilder = ConfigurationBuilder;
|
|
@@ -14,4 +14,5 @@ exports.ConfigurationHandler = {
|
|
|
14
14
|
isLifecycleUpdateEnabled: () => _configuration.lifecycleUpdate,
|
|
15
15
|
isActionNamePrivacyEnabled: () => _configuration.actionNamePrivacy,
|
|
16
16
|
getBundleName: () => _configuration.bundleName,
|
|
17
|
+
getBundleVersion: () => _configuration.bundleVersion,
|
|
17
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b, _c;
|
|
2
|
+
var _a, _b, _c, _d;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Pressable = exports.Text = exports.TouchableWithoutFeedback = exports.TouchableNativeFeedback = exports.TouchableHighlight = exports.TouchableOpacity = exports.Button = void 0;
|
|
5
5
|
const ReactNative = require("react-native");
|
|
@@ -36,7 +36,14 @@ else {
|
|
|
36
36
|
}
|
|
37
37
|
exports.TouchableWithoutFeedback = React.forwardRef((props, ref) => React.createElement(ReactNative.TouchableWithoutFeedback, Object.assign({}, props, { ref: ref })));
|
|
38
38
|
exports.TouchableWithoutFeedback._dtInfo = { type: Types_1.Types.TouchableWithoutFeedback };
|
|
39
|
-
|
|
40
|
-
exports.Text
|
|
39
|
+
if (typeof ReactNative.Text === 'object') {
|
|
40
|
+
exports.Text = Object.assign({ _dtInfo: { type: Types_1.Types.Text } }, ReactNative.Text);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
exports.Text = (_d = class Text extends ReactNative.Text {
|
|
44
|
+
},
|
|
45
|
+
_d._dtInfo = { type: Types_1.Types.Text },
|
|
46
|
+
_d);
|
|
47
|
+
}
|
|
41
48
|
exports.Pressable = React.forwardRef((props, ref) => React.createElement(ReactNative.Pressable, Object.assign({}, props, { ref: ref })));
|
|
42
49
|
exports.Pressable._dtInfo = { type: Types_1.Types.Pressable };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace/react-native-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.295.1",
|
|
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",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"author": "Dynatrace",
|
|
72
72
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@babel/runtime": "^7.24.
|
|
75
|
-
"jscodeshift": "^0.16.
|
|
74
|
+
"@babel/runtime": "^7.24.8",
|
|
75
|
+
"jscodeshift": "^0.16.1",
|
|
76
76
|
"plist": "^3.1.0",
|
|
77
77
|
"proxy-polyfill": "^0.3.2",
|
|
78
78
|
"semver": "^7.6.2"
|
|
@@ -111,7 +111,7 @@ Pod::Spec.new do |s|
|
|
|
111
111
|
#
|
|
112
112
|
|
|
113
113
|
s.dependency "React"
|
|
114
|
-
s.dependency 'Dynatrace', '~> 8.
|
|
114
|
+
s.dependency 'Dynatrace', '~> 8.295.1.1020'
|
|
115
115
|
|
|
116
116
|
# Allows for better compatibility for older and newer versions
|
|
117
117
|
if defined?(install_modules_dependencies)
|