@dynatrace/react-native-plugin 2.305.1 → 2.309.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 +21 -10
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceAppStartModule.kt +128 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceInternalModule.kt +22 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +411 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.kt +54 -0
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +86 -0
- package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurement.kt +15 -0
- package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurementType.kt +18 -0
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +228 -0
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +258 -0
- package/files/plugin.gradle +1 -1
- package/index.js +10 -10
- package/instrumentation/DynatraceInstrumentation.js +1 -0
- package/{lib → instrumentation/jsx}/CreateElement.js +6 -5
- package/{lib/instrumentor/base → instrumentation/jsx}/ElementHelper.js +14 -12
- package/{lib/jsx-dev-runtime.js → instrumentation/jsx/JsxDevRuntime.js} +10 -19
- package/instrumentation/jsx/JsxRuntime.js +63 -0
- package/instrumentation/jsx/JsxRuntimeUtil.js +31 -0
- package/instrumentation/jsx/components/ClassComponent.js +49 -0
- package/instrumentation/jsx/components/ComponentUtil.js +33 -0
- package/instrumentation/jsx/components/FunctionalComponent.js +20 -0
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Picker.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/RefreshControl.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Switch.js +1 -1
- package/{lib/instrumentor/base → instrumentation/jsx/components}/Touchable.js +5 -5
- package/instrumentation/libs/community/Picker.InstrInfo.js +20 -0
- package/{lib → instrumentation/libs}/community/Picker.js +1 -1
- package/instrumentation/libs/community/gesture-handler/Touchables.InstrInfo.js +23 -0
- package/{lib → instrumentation/libs}/community/gesture-handler/Touchables.js +1 -1
- package/{lib → instrumentation/libs}/react-native/RefreshControl.InstrInfo.js +2 -2
- package/{lib → instrumentation/libs}/react-native/RefreshControl.js +5 -5
- package/{lib → instrumentation/libs}/react-native/Switch.InstrInfo.js +2 -2
- package/{lib → instrumentation/libs}/react-native/Switch.js +5 -5
- package/instrumentation/libs/react-native/Touchables.InstrInfo.js +25 -0
- package/{lib → instrumentation/libs}/react-native/Touchables.js +1 -1
- package/{lib → instrumentation/libs}/react-navigation/ReactNavigation.js +6 -5
- package/{lib/instrumentor → instrumentation}/model/Types.js +1 -14
- package/instrumentation/model/TypesUtil.js +17 -0
- package/ios/DynatraceRNBridge.h +10 -1
- package/ios/DynatraceRNBridge.mm +152 -0
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.js +1 -1
- package/lib/core/Application.js +20 -0
- package/lib/{instrumentor/base → core}/Dynatrace.js +57 -48
- package/lib/{instrumentor/base → core}/DynatraceAction.js +23 -22
- package/lib/core/DynatraceInternal.js +46 -0
- package/lib/{instrumentor/base → core}/DynatraceRootAction.js +5 -4
- package/lib/{instrumentor/base → core}/DynatraceWebRequestTiming.js +6 -5
- package/lib/{instrumentor/base → core}/ErrorHandler.js +6 -5
- package/lib/{instrumentor/base → core}/configuration/Configuration.js +1 -1
- package/lib/{instrumentor/base → core}/configuration/ConfigurationDefaults.js +1 -2
- package/lib/{instrumentor/base → core}/configuration/ConfigurationHandler.js +2 -2
- package/lib/{instrumentor/base → core}/configuration/ManualStartupConfiguration.js +1 -1
- package/lib/core/logging/ConsoleLogger.js +27 -0
- package/lib/core/logging/LogLevel.js +12 -0
- package/lib/dynatrace-transformer.js +1 -1
- package/lib/next/Dynatrace.js +86 -0
- package/lib/next/DynatraceSecondGenForwarder.js +17 -0
- package/lib/next/IDynatrace.js +2 -0
- package/lib/next/IDynatraceForwarder.js +2 -0
- package/lib/next/appstart/AppStartObserver.js +32 -0
- package/lib/next/appstart/AppStartType.js +38 -0
- package/lib/next/events/EventCreator.js +77 -0
- package/lib/next/events/EventPipeline.js +57 -0
- package/lib/next/events/EventTimestamp.js +24 -0
- package/lib/next/events/ViewInfoCreator.js +27 -0
- package/lib/next/events/modifier/BaseDataEventModifier.js +31 -0
- package/lib/next/events/modifier/EventLimitation.js +69 -0
- package/lib/next/events/modifier/EventModifierUtil.js +88 -0
- package/lib/next/events/modifier/IEventModifier.js +2 -0
- package/lib/next/events/modifier/ModifyEventValidation.js +187 -0
- package/lib/next/events/modifier/NonFiniteNumbersModifier.js +50 -0
- package/lib/next/events/modifier/SendEventValidation.js +84 -0
- package/lib/next/events/spec/EventFieldKeysEnum.js +2 -0
- package/lib/next/events/spec/EventSpecContstants.js +46 -0
- package/lib/next/events/spec/IAppStartEvent.js +2 -0
- package/lib/next/events/spec/ICrashEvent.js +2 -0
- package/lib/next/events/spec/IErrorCodeEvent.js +2 -0
- package/lib/next/events/spec/IErrorExceptionEvent.js +2 -0
- package/lib/next/events/spec/IReactNativeEvent.js +2 -0
- package/lib/next/events/spec/IRumEvent.js +2 -0
- package/lib/next/provider/ITimestampProvider.js +2 -0
- package/lib/next/provider/TimestampProvider.js +10 -0
- package/package.json +51 -40
- package/react-native-dynatrace.podspec +1 -1
- package/src/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.ts +10 -0
- package/typings/react-native-dynatrace.d.ts +0 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.java +0 -362
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.java +0 -67
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.java +0 -76
- package/android/src/main/java/com/dynatrace/android/agent/PrivateDTBridge.java +0 -28
- package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -187
- package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -189
- package/lib/community/Picker.InstrInfo.js +0 -20
- package/lib/community/gesture-handler/Touchables.InstrInfo.js +0 -56
- package/lib/instrumentor/DynatraceInstrumentation.js +0 -1
- package/lib/instrumentor/base/Application.js +0 -16
- package/lib/instrumentor/base/DynatraceInternal.js +0 -34
- package/lib/instrumentor/base/Logger.js +0 -16
- package/lib/instrumentor/base/model/LogLevel.js +0 -17
- package/lib/jsx-runtime.js +0 -69
- package/lib/react/Component.js +0 -90
- package/lib/react-native/Touchables.InstrInfo.js +0 -60
- /package/{lib/instrumentor/base/interface → instrumentation/jsx}/IDynatraceProperties.js +0 -0
- /package/{lib → instrumentation/libs}/community/gesture-handler/index.js +0 -0
- /package/{lib → instrumentation/libs}/gesture-handler.js +0 -0
- /package/{lib → instrumentation/libs}/react-native/index.js +0 -0
- /package/{lib → instrumentation/libs}/react-native.js +0 -0
- /package/{lib/instrumentor → instrumentation}/model/Reference.js +0 -0
- /package/{lib/instrumentor → instrumentation}/parser/Babel.js +0 -0
- /package/lib/{instrumentor/base → core}/DynatraceBridge.js +0 -0
- /package/lib/{instrumentor/base → core}/NullAction.js +0 -0
- /package/lib/{instrumentor/base → core}/NullRootAction.js +0 -0
- /package/lib/{instrumentor/base → core}/NullWebRequestTiming.js +0 -0
- /package/lib/{instrumentor/base → core}/UserPrivacyOptions.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/ConfigurationBuilder.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/ConfigurationPreset.js +0 -0
- /package/lib/{instrumentor/base → core}/configuration/IConfiguration.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatrace.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceAction.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceInternal.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IDynatraceRootAction.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/IWebRequestTiming.js +0 -0
- /package/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.js +0 -0
- /package/lib/{instrumentor/base/interface → core/logging}/ILogger.js +0 -0
- /package/lib/{instrumentor/base → core}/model/DataCollectionLevel.js +0 -0
- /package/lib/{instrumentor/base → core}/model/Json.js +0 -0
- /package/lib/{instrumentor/base → core}/model/Platform.js +0 -0
- /package/lib/{instrumentor/base → core}/util/StringUtils.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u,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"),o=require("./libs/react-native/Touchables.InstrInfo"),l=require("./libs/react-native/RefreshControl.InstrInfo"),f=require("./libs/react-native/Switch.InstrInfo"),s=require("./libs/community/gesture-handler/Touchables.InstrInfo"),d=require("./libs/community/Picker.InstrInfo"),v=require("./parser/Babel"),p=require("./model/Types"),m=(!function(n){n[n.i=-1]="Filtered",n[n.o=0]="Normal",n[n.u=1]="ReactNative",n[n.l=2]="React"}(u=u||{}),[]),y=(m.push.apply(m,(0,r.default)(o.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"]),g="@dynatrace/react-native-plugin/instrumentation/libs",instrument=function(n,r,e){r=w(r);var t=V(r);if(t!==u.i){var i=!1,o=N(r,n);if(t===u.l)T(o),i=!0;else if(t===u.u)r.endsWith("AppRegistry.js")?void 0!==e&&e.autoStart&&(U(o),i=!0):r.endsWith("renderApplication.js")?(q(o),i=!0):r.endsWith("setUpErrorHandling.js")&&void 0!==e&&e.autoStart&&e.errorHandler.enabled&&(J(o,e.autoStart,e.errorHandler.reportFatalErrorAsCrash),i=!0);else{var t=B(r,e);if(e.custom.reactnavigation&&b(r,o))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(o)&&(i=!0),t.input&&m.forEach(function(n){n=K(o,n);o=n.root,i=i||n.v})}}i?(n=o.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","core","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},b=(exports.instrument=instrument,function(n,r){return!!O(n,r)&&(n="import { registerListener } from '".concat(g,"/react-navigation/ReactNavigation';"),r.find(c.ImportDeclaration).at(0).insertBefore(n),!0)}),O=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")),P(r,e)));void 0!==n.parentPath&&"body"!==n.parentPath.name;)n=n.parentPath;void 0!==n.parentPath&&n.insertAfter(r)},P=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)},w=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)},B=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/instrumentation/jsx/ElementHelper")]),c.identifier("instrumentCreateElement")),[c.memberExpression(c.identifier("module"),c.identifier("exports"))])),n.paths()[0].node.body.push(r))},U=function(n){var r=M(n,"runApplication",!0);1===r.length&&(en(n,{p:"_DynatraceApplicationHandler",module:"@dynatrace/react-native-plugin",reference:"ApplicationHandler"}),I(r.paths()[0].parent.value.body.body,0,D("_DynatraceApplicationHandler","startup",[])))},J=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/core/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))},M=function(n,r,t){for(var e=arguments.length,i=new Array(3<e?e-3:0),o=3;o<e;o++)i[o-3]=arguments[o];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})},V=function(n){if(n.includes("@dynatrace"))return u.i;var r=a.extname(n);if(".js"!==r&&".ts"!==r&&".tsx"!==r&&".jsx"!==r)return u.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)?u.u:u.i;if("react"===t[i+1]&&"index"===e.name)return u.l}return u.o},k=function(n,r,e){var t=z(n,r,e);return G(n,r,e)||t},z=function(n,r,e){var t=Q(n,r);return 0<t.length&&(void 0!==(t=C(t,r.reference,!1))&&(e.p=t.localName),nn(n,e),!0)},G=function(n,r,e){var t=j(n,r.module);if(1===t.length){t=C(t,r.reference,!0);if(void 0!==t)return rn(n,e.defaultImport,t.localName,"ImportNamespaceSpecifier"===t.type),!0}return!1},K=function(n,r){var e=JSON.parse(JSON.stringify(r.new));return{root:n,v:k(n,r.old,e)||W(n,r.old,r.new.defaultImport)}},Q=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},W=function(n,r,e){var t=!1;return n.find(c.CallExpression).filter(function(n){return X(n.node.callee)&&Y(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},X=function(n){return"require"===n.name},Y=function(n){return"StringLiteral"===n.type||"Literal"===n.type},j=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r})},C=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},Z=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))})},$=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))},nn=function(n,r){0<j(n,r.module).length?Z(n,r):R(n,r.module,[F(r)])},rn=function(n,r,e,t){var i=j(n,r),t=(t?ln:cn)(e);0<i.length?$(n,r,t):R(n,r,[t])},en=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(tn(n,r,e))},tn=function(n,r,e){return c.callExpression(an(n,r),e)},_=function(n){return c.variableDeclaration("var",[on(n)])},on=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))},an=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))},cn=function(n){return c.importDefaultSpecifier(c.identifier(n))},ln=function(n){return c.importNamespaceSpecifier(c.identifier(n))};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
const Types_1 = require("../model/Types");
|
|
4
|
+
const ElementHelper_1 = require("./ElementHelper");
|
|
5
|
+
const ClassComponent_1 = require("./components/ClassComponent");
|
|
6
|
+
const FunctionalComponent_1 = require("./components/FunctionalComponent");
|
|
6
7
|
const _createElement = require('react').createElement;
|
|
7
8
|
const createElement = (type, props, ...children) => {
|
|
8
9
|
if (type != null && type._dtInfo != null && !(0, ElementHelper_1.isDtActionIgnore)(props)) {
|
|
9
10
|
if (type._dtInfo.type === Types_1.Types.FunctionalComponent) {
|
|
10
|
-
return _createElement(
|
|
11
|
+
return _createElement(FunctionalComponent_1.DynatraceFunctionalComponent, {}, _createElement(type, props, ...children));
|
|
11
12
|
}
|
|
12
13
|
else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
|
|
13
14
|
type.prototype !== undefined &&
|
|
14
15
|
type.prototype.isReactComponent !== undefined) {
|
|
15
|
-
return _createElement(
|
|
16
|
+
return _createElement(ClassComponent_1.DynatraceClassComponent, {}, _createElement(type, props, ...children));
|
|
16
17
|
}
|
|
17
18
|
else {
|
|
18
19
|
(0, ElementHelper_1.modifyElement)(type, props, ...children);
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isDtActionIgnore = exports.modifyElement = exports.instrumentCreateElement = void 0;
|
|
4
4
|
const Types_1 = require("../model/Types");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const RefreshControl_1 = require("./RefreshControl");
|
|
11
|
-
const Switch_1 = require("./Switch");
|
|
5
|
+
const TypesUtil_1 = require("../model/TypesUtil");
|
|
6
|
+
const Dynatrace_1 = require("../../lib/core/Dynatrace");
|
|
7
|
+
const ConsoleLogger_1 = require("../../lib/core/logging/ConsoleLogger");
|
|
8
|
+
const Picker_1 = require("./components/Picker");
|
|
9
|
+
const Touchable_1 = require("./components/Touchable");
|
|
10
|
+
const RefreshControl_1 = require("./components/RefreshControl");
|
|
11
|
+
const Switch_1 = require("./components/Switch");
|
|
12
|
+
const FunctionalComponent_1 = require("./components/FunctionalComponent");
|
|
13
|
+
const ClassComponent_1 = require("./components/ClassComponent");
|
|
12
14
|
const instrumentCreateElement = (reactModule) => {
|
|
13
15
|
if (reactModule != null && reactModule.createElement != null) {
|
|
14
16
|
const reactCreateElement = reactModule.createElement;
|
|
@@ -17,12 +19,12 @@ const instrumentCreateElement = (reactModule) => {
|
|
|
17
19
|
type._dtInfo != null &&
|
|
18
20
|
!(0, exports.isDtActionIgnore)(props)) {
|
|
19
21
|
if (type._dtInfo.type === Types_1.Types.FunctionalComponent) {
|
|
20
|
-
return reactCreateElement(
|
|
22
|
+
return reactCreateElement(FunctionalComponent_1.DynatraceFunctionalComponent, {}, reactCreateElement(type, props, ...children));
|
|
21
23
|
}
|
|
22
24
|
else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
|
|
23
25
|
type.prototype !== undefined &&
|
|
24
26
|
type.prototype.isReactComponent !== undefined) {
|
|
25
|
-
return reactCreateElement(
|
|
27
|
+
return reactCreateElement(ClassComponent_1.DynatraceClassComponent, {}, reactCreateElement(type, props, ...children));
|
|
26
28
|
}
|
|
27
29
|
else {
|
|
28
30
|
(0, exports.modifyElement)(type, props, ...children);
|
|
@@ -46,12 +48,12 @@ const modifyElement = (type, props, ...children) => {
|
|
|
46
48
|
else if (type._dtInfo.type === Types_1.Types.Button ||
|
|
47
49
|
type._dtInfo.type === Types_1.Types.Text ||
|
|
48
50
|
type._dtInfo.type === Types_1.Types.Pressable ||
|
|
49
|
-
(0,
|
|
51
|
+
(0, TypesUtil_1.isTypeTouchable)(type._dtInfo.type)) {
|
|
50
52
|
if (props.onPress != null) {
|
|
51
|
-
props.onPress = (0, Touchable_1.TouchableHelper)(Dynatrace_1.Dynatrace,
|
|
53
|
+
props.onPress = (0, Touchable_1.TouchableHelper)(Dynatrace_1.Dynatrace, new ConsoleLogger_1.ConsoleLogger('TouchableHelper')).attachOnPress(false, props, children);
|
|
52
54
|
}
|
|
53
55
|
if (props.onLongPress != null) {
|
|
54
|
-
props.onLongPress = (0, Touchable_1.TouchableHelper)(Dynatrace_1.Dynatrace,
|
|
56
|
+
props.onLongPress = (0, Touchable_1.TouchableHelper)(Dynatrace_1.Dynatrace, new ConsoleLogger_1.ConsoleLogger('TouchableHelper')).attachOnPress(true, props, children);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
else if (props.onValueChange != null &&
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
const Types_1 = require("../model/Types");
|
|
4
|
+
const JsxRuntimeUtil_1 = require("./JsxRuntimeUtil");
|
|
5
|
+
const FunctionalComponent_1 = require("./components/FunctionalComponent");
|
|
6
|
+
const ClassComponent_1 = require("./components/ClassComponent");
|
|
7
|
+
const ElementHelper_1 = require("./ElementHelper");
|
|
6
8
|
try {
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
_jsxDevRuntime = require('react/jsx-dev-runtime.js');
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
try {
|
|
13
|
-
_jsxDevRuntime = require('../../../react/jsx-dev-runtime');
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
_jsxDevRuntime = null;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
const _jsxDevRuntime = (0, JsxRuntimeUtil_1.dynamicRequireJSXDevRuntime)();
|
|
19
10
|
if (_jsxDevRuntime != null) {
|
|
20
11
|
const jsxDEV = (...args) => {
|
|
21
12
|
if (args[0] !== undefined &&
|
|
@@ -31,10 +22,10 @@ try {
|
|
|
31
22
|
? args[1].dtActionName
|
|
32
23
|
: args[0]._dtInfo.name;
|
|
33
24
|
if (args[2] !== undefined) {
|
|
34
|
-
return _jsxDevRuntime.jsxDEV(
|
|
25
|
+
return _jsxDevRuntime.jsxDEV(FunctionalComponent_1.DynatraceFunctionalComponent, wrapperProps, args[2] + '_dt');
|
|
35
26
|
}
|
|
36
27
|
else {
|
|
37
|
-
return _jsxDevRuntime.jsxDEV(
|
|
28
|
+
return _jsxDevRuntime.jsxDEV(FunctionalComponent_1.DynatraceFunctionalComponent, wrapperProps);
|
|
38
29
|
}
|
|
39
30
|
}
|
|
40
31
|
else if (args[0]._dtInfo.type === Types_1.Types.ClassComponent &&
|
|
@@ -44,10 +35,10 @@ try {
|
|
|
44
35
|
children: _jsxDevRuntime.jsxDEV(...args),
|
|
45
36
|
};
|
|
46
37
|
if (args[2] !== undefined) {
|
|
47
|
-
return _jsxDevRuntime.jsxDEV(
|
|
38
|
+
return _jsxDevRuntime.jsxDEV(ClassComponent_1.DynatraceClassComponent, wrapperProps, args[2] + '_dt');
|
|
48
39
|
}
|
|
49
40
|
else {
|
|
50
|
-
return _jsxDevRuntime.jsxDEV(
|
|
41
|
+
return _jsxDevRuntime.jsxDEV(ClassComponent_1.DynatraceClassComponent, wrapperProps);
|
|
51
42
|
}
|
|
52
43
|
}
|
|
53
44
|
if (Array.isArray(args[1].children)) {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Types_1 = require("../model/Types");
|
|
4
|
+
const JsxRuntimeUtil_1 = require("./JsxRuntimeUtil");
|
|
5
|
+
const FunctionalComponent_1 = require("./components/FunctionalComponent");
|
|
6
|
+
const ClassComponent_1 = require("./components/ClassComponent");
|
|
7
|
+
const ElementHelper_1 = require("./ElementHelper");
|
|
8
|
+
const instrumentJsxCall = (jsxFunction) => (...args) => {
|
|
9
|
+
if (args[0] !== undefined &&
|
|
10
|
+
args[0]._dtInfo !== undefined &&
|
|
11
|
+
!(0, ElementHelper_1.isDtActionIgnore)(args[1])) {
|
|
12
|
+
if (args[0]._dtInfo.type === Types_1.Types.FunctionalComponent) {
|
|
13
|
+
const wrapperProps = {
|
|
14
|
+
children: jsxFunction(...args),
|
|
15
|
+
};
|
|
16
|
+
wrapperProps.dtActionName =
|
|
17
|
+
args[1] !== undefined && args[1].dtActionName !== undefined
|
|
18
|
+
? args[1].dtActionName
|
|
19
|
+
: args[0]._dtInfo.name;
|
|
20
|
+
if (args[2] !== undefined) {
|
|
21
|
+
return jsxFunction(FunctionalComponent_1.DynatraceFunctionalComponent, wrapperProps, args[2] + '_dt');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return jsxFunction(FunctionalComponent_1.DynatraceFunctionalComponent, wrapperProps);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else if (args[0]._dtInfo.type === Types_1.Types.ClassComponent &&
|
|
28
|
+
args[0].prototype !== undefined &&
|
|
29
|
+
args[0].prototype.isReactComponent !== undefined) {
|
|
30
|
+
const wrapperProps = {
|
|
31
|
+
children: jsxFunction(...args),
|
|
32
|
+
};
|
|
33
|
+
if (args[2] !== undefined) {
|
|
34
|
+
return jsxFunction(ClassComponent_1.DynatraceClassComponent, wrapperProps, args[2] + '_dt');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return jsxFunction(ClassComponent_1.DynatraceClassComponent, wrapperProps);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (Array.isArray(args[1].children)) {
|
|
41
|
+
(0, ElementHelper_1.modifyElement)(args[0], args[1], ...args[1].children);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
(0, ElementHelper_1.modifyElement)(args[0], args[1], args[1].children);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return jsxFunction(...args);
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
const _jsxRuntime = (0, JsxRuntimeUtil_1.dynamicRequireJSXRuntime)();
|
|
51
|
+
if (_jsxRuntime != null) {
|
|
52
|
+
const jsx = instrumentJsxCall(_jsxRuntime.jsx);
|
|
53
|
+
const jsxs = instrumentJsxCall(_jsxRuntime.jsxs);
|
|
54
|
+
module.exports = Object.assign(Object.assign({}, _jsxRuntime), { jsx,
|
|
55
|
+
jsxs });
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
module.exports = {};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
module.exports = {};
|
|
63
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dynamicRequireJSXDevRuntime = exports.dynamicRequireJSXRuntime = void 0;
|
|
4
|
+
const dynamicRequireJSXRuntime = () => {
|
|
5
|
+
try {
|
|
6
|
+
return require('react/jsx-runtime.js');
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
try {
|
|
10
|
+
return require('../../../react/jsx-runtime');
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.dynamicRequireJSXRuntime = dynamicRequireJSXRuntime;
|
|
18
|
+
const dynamicRequireJSXDevRuntime = () => {
|
|
19
|
+
try {
|
|
20
|
+
return require('react/jsx-dev-runtime.js');
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
try {
|
|
24
|
+
return require('../../../react/jsx-dev-runtime');
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.dynamicRequireJSXDevRuntime = dynamicRequireJSXDevRuntime;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynatraceClassComponent = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ConfigurationHandler_1 = require("../../../lib/core/configuration/ConfigurationHandler");
|
|
6
|
+
const ConsoleLogger_1 = require("../../../lib/core/logging/ConsoleLogger");
|
|
7
|
+
const Dynatrace_1 = require("../../../lib/core/Dynatrace");
|
|
8
|
+
const ComponentUtil_1 = require("./ComponentUtil");
|
|
9
|
+
class DynatraceClassComponent extends react_1.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.wrappingName = (0, ComponentUtil_1.getNameFromComponent)(props);
|
|
13
|
+
this.componentMounted = false;
|
|
14
|
+
this.logger = new ConsoleLogger_1.ConsoleLogger(`Component ${this.wrappingName}`);
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
if (!ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
18
|
+
this.logger.info('React Native plugin has not been started yet! Component will not be reported!');
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (ConfigurationHandler_1.ConfigurationHandler.isLifecycleUpdateEnabled() ||
|
|
22
|
+
!this.componentMounted) {
|
|
23
|
+
const actionPrefix = !this.componentMounted
|
|
24
|
+
? 'Render '
|
|
25
|
+
: 'Update ';
|
|
26
|
+
this.internalAction = Dynatrace_1.Dynatrace.enterAutoAction(actionPrefix + this.wrappingName);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return this.props.children;
|
|
30
|
+
}
|
|
31
|
+
componentWillUnmount() {
|
|
32
|
+
this.componentMounted = false;
|
|
33
|
+
}
|
|
34
|
+
componentDidUpdate() {
|
|
35
|
+
this.reportFunctionEvent('componentDidUpdate()');
|
|
36
|
+
}
|
|
37
|
+
componentDidMount() {
|
|
38
|
+
this.componentMounted = true;
|
|
39
|
+
this.reportFunctionEvent('componentDidMount()');
|
|
40
|
+
}
|
|
41
|
+
reportFunctionEvent(event) {
|
|
42
|
+
if (this.internalAction !== undefined) {
|
|
43
|
+
this.internalAction.reportEvent(`${this.wrappingName}.${event}`);
|
|
44
|
+
this.internalAction.leaveAction();
|
|
45
|
+
this.internalAction = undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.DynatraceClassComponent = DynatraceClassComponent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNameFromComponent = void 0;
|
|
4
|
+
const getNameFromComponent = (props) => {
|
|
5
|
+
if (props !== undefined && props.children !== undefined) {
|
|
6
|
+
let child;
|
|
7
|
+
if (Array.isArray(props.children) && props.children.length === 1) {
|
|
8
|
+
child = props.children[0];
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
child = props.children;
|
|
12
|
+
}
|
|
13
|
+
if (child.props !== undefined &&
|
|
14
|
+
child.props.dtActionName !== undefined) {
|
|
15
|
+
return child.props.dtActionName;
|
|
16
|
+
}
|
|
17
|
+
else if (child.type !== undefined) {
|
|
18
|
+
if (child.type.displayName !== undefined) {
|
|
19
|
+
return child.type.displayName;
|
|
20
|
+
}
|
|
21
|
+
else if (child.type._dtInfo !== undefined) {
|
|
22
|
+
return child.type._dtInfo.name;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return child.type.name;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return 'Undefined Name';
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.getNameFromComponent = getNameFromComponent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynatraceFunctionalComponent = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Dynatrace_1 = require("../../../lib/core/Dynatrace");
|
|
6
|
+
const NullAction_1 = require("../../../lib/core/NullAction");
|
|
7
|
+
const ConsoleLogger_1 = require("../../../lib/core/logging/ConsoleLogger");
|
|
8
|
+
const ComponentUtil_1 = require("./ComponentUtil");
|
|
9
|
+
const DynatraceFunctionalComponent = (props) => {
|
|
10
|
+
const componentName = (0, ComponentUtil_1.getNameFromComponent)(props);
|
|
11
|
+
const action = Dynatrace_1.Dynatrace.enterAutoAction(`Render ${componentName}`);
|
|
12
|
+
if (action instanceof NullAction_1.NullAction) {
|
|
13
|
+
new ConsoleLogger_1.ConsoleLogger(`Component ${componentName}`).info('React Native plugin has not been started yet! Component will not be reported!');
|
|
14
|
+
}
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
action.leaveAction();
|
|
17
|
+
});
|
|
18
|
+
return props.children;
|
|
19
|
+
};
|
|
20
|
+
exports.DynatraceFunctionalComponent = DynatraceFunctionalComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PickerHelper = void 0;
|
|
4
|
-
const IDynatraceProperties_1 = require("
|
|
4
|
+
const IDynatraceProperties_1 = require("../IDynatraceProperties");
|
|
5
5
|
const PickerHelper = (Dynatrace) => ({
|
|
6
6
|
attachOnValueChange: (pickerProps) => {
|
|
7
7
|
if ((0, IDynatraceProperties_1.isDynatraceIgnored)(pickerProps)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RefreshControlHelper = void 0;
|
|
4
|
-
const IDynatraceProperties_1 = require("
|
|
4
|
+
const IDynatraceProperties_1 = require("../IDynatraceProperties");
|
|
5
5
|
const RefreshControlHelper = (Dynatrace) => ({
|
|
6
6
|
attachOnRefresh: (refreshControlProps) => {
|
|
7
7
|
if ((0, IDynatraceProperties_1.isDynatraceIgnored)(refreshControlProps)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SwitchHelper = void 0;
|
|
4
|
-
const IDynatraceProperties_1 = require("
|
|
4
|
+
const IDynatraceProperties_1 = require("../IDynatraceProperties");
|
|
5
5
|
const SwitchHelper = (Dynatrace) => ({
|
|
6
6
|
attachOnValueChange: (switchProps) => {
|
|
7
7
|
if ((0, IDynatraceProperties_1.isDynatraceIgnored)(switchProps)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TouchableHelper = void 0;
|
|
4
|
-
const ConfigurationHandler_1 = require("
|
|
5
|
-
const IDynatraceProperties_1 = require("
|
|
4
|
+
const ConfigurationHandler_1 = require("../../../lib/core/configuration/ConfigurationHandler");
|
|
5
|
+
const IDynatraceProperties_1 = require("../IDynatraceProperties");
|
|
6
6
|
const TouchableHelper = (Dynatrace, Logger) => ({
|
|
7
7
|
attachOnPress(longPress, props, children) {
|
|
8
8
|
const origFunction = longPress && this._isLongPress(props)
|
|
@@ -12,7 +12,7 @@ const TouchableHelper = (Dynatrace, Logger) => ({
|
|
|
12
12
|
const isButton = this._isPropsButton(props);
|
|
13
13
|
const wrappedFunction = (event) => {
|
|
14
14
|
if (nameOfAction == null) {
|
|
15
|
-
Logger.
|
|
15
|
+
Logger.debug('Skipping creation of action as no name was found!');
|
|
16
16
|
if (origFunction != null) {
|
|
17
17
|
return origFunction(event);
|
|
18
18
|
}
|
|
@@ -20,11 +20,11 @@ const TouchableHelper = (Dynatrace, Logger) => ({
|
|
|
20
20
|
else if (origFunction != null &&
|
|
21
21
|
origFunction._dtWrapped !== undefined &&
|
|
22
22
|
origFunction._dtWrapped === true) {
|
|
23
|
-
Logger.
|
|
23
|
+
Logger.debug(`Skip wrapping of ${nameOfAction} onPress as it is already wrapped!`);
|
|
24
24
|
return origFunction(event);
|
|
25
25
|
}
|
|
26
26
|
else if (!ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
|
|
27
|
-
Logger.
|
|
27
|
+
Logger.info('React Native plugin has not been started yet! Touch will not be reported!');
|
|
28
28
|
if (origFunction != null) {
|
|
29
29
|
return origFunction(event);
|
|
30
30
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.instrumentationDefaultImport = exports.instrumentationModule = exports.instrumentationFolder = exports.instrumentationInfo = void 0;
|
|
4
|
+
exports.instrumentationInfo = [];
|
|
5
|
+
exports.instrumentationFolder = '@dynatrace/react-native-plugin/instrumentation/libs';
|
|
6
|
+
exports.instrumentationModule = `${exports.instrumentationFolder}/community/Picker`;
|
|
7
|
+
exports.instrumentationDefaultImport = exports.instrumentationModule;
|
|
8
|
+
const generateInstrumentation = (name) => ({
|
|
9
|
+
old: {
|
|
10
|
+
module: '@react-native-picker/picker',
|
|
11
|
+
reference: name,
|
|
12
|
+
},
|
|
13
|
+
new: {
|
|
14
|
+
module: exports.instrumentationModule,
|
|
15
|
+
reference: name,
|
|
16
|
+
defaultImport: exports.instrumentationModule,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
exports.instrumentationInfo.push(generateInstrumentation('Picker'));
|
|
20
|
+
exports.instrumentationInfo.push(generateInstrumentation('PickerIOS'));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _a, _b;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
require("proxy-polyfill");
|
|
5
|
-
const Types_1 = require("
|
|
5
|
+
const Types_1 = require("../../model/Types");
|
|
6
6
|
const PickerRN = require('@react-native-picker/picker');
|
|
7
7
|
const dynatraceProxy = new Proxy(PickerRN, {
|
|
8
8
|
get: (target, property) => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.instrumentationDefaultImport = exports.instrumentationModule = exports.instrumentationFolder = exports.instrumentationInfo = void 0;
|
|
4
|
+
exports.instrumentationInfo = [];
|
|
5
|
+
exports.instrumentationFolder = '@dynatrace/react-native-plugin/instrumentation/libs';
|
|
6
|
+
exports.instrumentationModule = `${exports.instrumentationFolder}/community/gesture-handler/`;
|
|
7
|
+
exports.instrumentationDefaultImport = `${exports.instrumentationFolder}/gesture-handler`;
|
|
8
|
+
const generateInstrumentation = (name) => ({
|
|
9
|
+
old: {
|
|
10
|
+
module: 'react-native-gesture-handler',
|
|
11
|
+
reference: name,
|
|
12
|
+
},
|
|
13
|
+
new: {
|
|
14
|
+
module: exports.instrumentationModule,
|
|
15
|
+
reference: name,
|
|
16
|
+
defaultImport: exports.instrumentationDefaultImport,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableHighlight'));
|
|
20
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableOpacity'));
|
|
21
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableNativeFeedback'));
|
|
22
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableWithoutFeedback'));
|
|
23
|
+
exports.instrumentationInfo.push(generateInstrumentation('RectButton'));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _a, _b, _c, _d;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.RectButton = exports.TouchableWithoutFeedback = exports.TouchableNativeFeedback = exports.TouchableHighlight = exports.TouchableOpacity = void 0;
|
|
5
|
-
const Types_1 = require("
|
|
5
|
+
const Types_1 = require("../../../model/Types");
|
|
6
6
|
const gestureHandler = require('react-native-gesture-handler');
|
|
7
7
|
if (gestureHandler !== undefined) {
|
|
8
8
|
if (typeof gestureHandler.TouchableOpacity !== 'object') {
|
|
@@ -5,8 +5,8 @@ exports.instrumentationInfo = [];
|
|
|
5
5
|
exports.instrumentationInfo.push({
|
|
6
6
|
old: { module: 'react-native', reference: 'RefreshControl' },
|
|
7
7
|
new: {
|
|
8
|
-
module: '@dynatrace/react-native-plugin/
|
|
8
|
+
module: '@dynatrace/react-native-plugin/instrumentation/libs/react-native/',
|
|
9
9
|
reference: 'RefreshControl',
|
|
10
|
-
defaultImport: '@dynatrace/react-native-plugin/
|
|
10
|
+
defaultImport: '@dynatrace/react-native-plugin/instrumentation/libs/react-native',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.RefreshControl = void 0;
|
|
5
|
-
const
|
|
6
|
-
const Types_1 = require("
|
|
7
|
-
if (typeof
|
|
8
|
-
exports.RefreshControl = Object.assign({ _dtInfo: { type: Types_1.Types.RefreshControl } },
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const Types_1 = require("../../model/Types");
|
|
7
|
+
if (typeof react_native_1.RefreshControl === 'object') {
|
|
8
|
+
exports.RefreshControl = Object.assign({ _dtInfo: { type: Types_1.Types.RefreshControl } }, react_native_1.RefreshControl);
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
|
-
exports.RefreshControl = (_a = class RefreshControl extends
|
|
11
|
+
exports.RefreshControl = (_a = class RefreshControl extends react_native_1.RefreshControl {
|
|
12
12
|
},
|
|
13
13
|
_a._dtInfo = { type: Types_1.Types.RefreshControl },
|
|
14
14
|
_a);
|
|
@@ -5,8 +5,8 @@ exports.instrumentationInfo = [];
|
|
|
5
5
|
exports.instrumentationInfo.push({
|
|
6
6
|
old: { module: 'react-native', reference: 'Switch' },
|
|
7
7
|
new: {
|
|
8
|
-
module: '@dynatrace/react-native-plugin/
|
|
8
|
+
module: '@dynatrace/react-native-plugin/instrumentation/libs/react-native/',
|
|
9
9
|
reference: 'Switch',
|
|
10
|
-
defaultImport: '@dynatrace/react-native-plugin/
|
|
10
|
+
defaultImport: '@dynatrace/react-native-plugin/instrumentation/libs/react-native',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Switch = void 0;
|
|
5
|
-
const
|
|
6
|
-
const Types_1 = require("
|
|
7
|
-
if (typeof
|
|
8
|
-
exports.Switch = Object.assign({ _dtInfo: { type: Types_1.Types.Switch } },
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const Types_1 = require("../../model/Types");
|
|
7
|
+
if (typeof react_native_1.Switch === 'object') {
|
|
8
|
+
exports.Switch = Object.assign({ _dtInfo: { type: Types_1.Types.Switch } }, react_native_1.Switch);
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
|
-
exports.Switch = (_a = class Switch extends
|
|
11
|
+
exports.Switch = (_a = class Switch extends react_native_1.Switch {
|
|
12
12
|
},
|
|
13
13
|
_a._dtInfo = { type: Types_1.Types.Switch },
|
|
14
14
|
_a);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.instrumentationDefaultImport = exports.instrumentationModule = exports.instrumentationFolder = exports.instrumentationInfo = void 0;
|
|
4
|
+
exports.instrumentationInfo = [];
|
|
5
|
+
exports.instrumentationFolder = '@dynatrace/react-native-plugin/instrumentation/libs';
|
|
6
|
+
exports.instrumentationModule = `${exports.instrumentationFolder}/react-native/`;
|
|
7
|
+
exports.instrumentationDefaultImport = `${exports.instrumentationFolder}/react-native`;
|
|
8
|
+
const generateInstrumentation = (name) => ({
|
|
9
|
+
old: {
|
|
10
|
+
module: 'react-native',
|
|
11
|
+
reference: name,
|
|
12
|
+
},
|
|
13
|
+
new: {
|
|
14
|
+
module: exports.instrumentationModule,
|
|
15
|
+
reference: name,
|
|
16
|
+
defaultImport: exports.instrumentationDefaultImport,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableHighlight'));
|
|
20
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableOpacity'));
|
|
21
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableNativeFeedback'));
|
|
22
|
+
exports.instrumentationInfo.push(generateInstrumentation('TouchableWithoutFeedback'));
|
|
23
|
+
exports.instrumentationInfo.push(generateInstrumentation('Button'));
|
|
24
|
+
exports.instrumentationInfo.push(generateInstrumentation('Text'));
|
|
25
|
+
exports.instrumentationInfo.push(generateInstrumentation('Pressable'));
|
|
@@ -4,7 +4,7 @@ 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");
|
|
6
6
|
const React = require("react");
|
|
7
|
-
const Types_1 = require("
|
|
7
|
+
const Types_1 = require("../../model/Types");
|
|
8
8
|
exports.Button = React.forwardRef((props, ref) => (React.createElement(ReactNative.Button, Object.assign({}, props, { ref: ref }))));
|
|
9
9
|
exports.Button._dtInfo = { type: Types_1.Types.Button };
|
|
10
10
|
if (typeof ReactNative.TouchableOpacity === 'object') {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerListener = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ConsoleLogger_1 = require("../../../lib/core/logging/ConsoleLogger");
|
|
6
6
|
let isRegistered = false;
|
|
7
|
+
const logger = new ConsoleLogger_1.ConsoleLogger('ReactNavigation');
|
|
7
8
|
const registerListener = (navContainer) => {
|
|
8
|
-
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
9
10
|
if (isRegistered &&
|
|
10
11
|
navContainer.current != null &&
|
|
11
12
|
navContainer.current.addListener != null) {
|
|
@@ -14,11 +15,11 @@ const registerListener = (navContainer) => {
|
|
|
14
15
|
if (data != null &&
|
|
15
16
|
data.data != null &&
|
|
16
17
|
data.data.action != null) {
|
|
17
|
-
|
|
18
|
+
logger.debug(`Listener Dispatch: ${JSON.stringify(data.data.action)}`);
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
navContainer.current.addListener('state', (state) => {
|
|
21
|
-
|
|
22
|
+
logger.debug(`Listener State: ${JSON.stringify(state)}`);
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
});
|