@dynatrace/react-native-plugin 2.307.1 → 2.311.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.
Files changed (134) hide show
  1. package/README.md +13 -4
  2. package/android/build.gradle +3 -1
  3. package/android/src/main/java/com/dynatrace/android/agent/DynatraceAppStartModule.kt +128 -0
  4. package/android/src/main/java/com/dynatrace/android/agent/DynatraceInternalModule.kt +22 -0
  5. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +411 -0
  6. package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.kt +54 -0
  7. package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +86 -0
  8. package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurement.kt +15 -0
  9. package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurementType.kt +18 -0
  10. package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +228 -0
  11. package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +258 -0
  12. package/files/plugin.gradle +1 -1
  13. package/index.js +10 -10
  14. package/instrumentation/DynatraceInstrumentation.js +1 -0
  15. package/{lib → instrumentation/jsx}/CreateElement.js +6 -5
  16. package/{lib/instrumentor/base → instrumentation/jsx}/ElementHelper.js +14 -12
  17. package/instrumentation/jsx/JsxDevRuntime.js +54 -0
  18. package/instrumentation/jsx/JsxRuntime.js +57 -0
  19. package/instrumentation/jsx/JsxRuntimeUtil.js +31 -0
  20. package/instrumentation/jsx/components/ClassComponent.js +49 -0
  21. package/instrumentation/jsx/components/ComponentUtil.js +33 -0
  22. package/instrumentation/jsx/components/FunctionalComponent.js +15 -0
  23. package/{lib/instrumentor/base → instrumentation/jsx/components}/Picker.js +1 -1
  24. package/{lib/instrumentor/base → instrumentation/jsx/components}/RefreshControl.js +1 -1
  25. package/{lib/instrumentor/base → instrumentation/jsx/components}/Switch.js +8 -8
  26. package/{lib/instrumentor/base → instrumentation/jsx/components}/Touchable.js +8 -8
  27. package/instrumentation/libs/community/Picker.InstrInfo.js +20 -0
  28. package/{lib → instrumentation/libs}/community/Picker.js +1 -1
  29. package/instrumentation/libs/community/gesture-handler/Touchables.InstrInfo.js +23 -0
  30. package/{lib → instrumentation/libs}/community/gesture-handler/Touchables.js +1 -1
  31. package/{lib → instrumentation/libs}/react-native/RefreshControl.InstrInfo.js +2 -2
  32. package/{lib → instrumentation/libs}/react-native/RefreshControl.js +5 -5
  33. package/{lib → instrumentation/libs}/react-native/Switch.InstrInfo.js +2 -2
  34. package/{lib → instrumentation/libs}/react-native/Switch.js +5 -5
  35. package/instrumentation/libs/react-native/Touchables.InstrInfo.js +25 -0
  36. package/{lib → instrumentation/libs}/react-native/Touchables.js +1 -1
  37. package/{lib → instrumentation/libs}/react-navigation/ReactNavigation.js +6 -5
  38. package/{lib/instrumentor → instrumentation}/model/Types.js +1 -14
  39. package/instrumentation/model/TypesUtil.js +50 -0
  40. package/ios/DynatraceRNBridge.h +10 -1
  41. package/ios/DynatraceRNBridge.mm +152 -1
  42. package/jsx-dev-runtime.js +1 -1
  43. package/jsx-runtime.js +1 -1
  44. package/lib/core/Application.js +20 -0
  45. package/lib/{instrumentor/base → core}/Dynatrace.js +72 -48
  46. package/lib/{instrumentor/base → core}/DynatraceAction.js +23 -22
  47. package/lib/core/DynatraceInternal.js +46 -0
  48. package/lib/{instrumentor/base → core}/DynatraceRootAction.js +5 -4
  49. package/lib/{instrumentor/base → core}/DynatraceWebRequestTiming.js +6 -5
  50. package/lib/{instrumentor/base → core}/ErrorHandler.js +6 -5
  51. package/lib/{instrumentor/base → core}/configuration/Configuration.js +1 -1
  52. package/lib/{instrumentor/base → core}/configuration/ConfigurationDefaults.js +1 -2
  53. package/lib/{instrumentor/base → core}/configuration/ConfigurationHandler.js +2 -2
  54. package/lib/{instrumentor/base → core}/configuration/ManualStartupConfiguration.js +1 -1
  55. package/lib/core/logging/ConsoleLogger.js +27 -0
  56. package/lib/core/logging/LogLevel.js +12 -0
  57. package/lib/dynatrace-transformer.js +1 -1
  58. package/lib/next/Dynatrace.js +88 -0
  59. package/lib/next/DynatraceSecondGenForwarder.js +35 -0
  60. package/lib/next/IDynatrace.js +2 -0
  61. package/lib/next/IDynatraceForwarder.js +2 -0
  62. package/lib/next/appstart/AppStartObserver.js +34 -0
  63. package/lib/next/appstart/AppStartType.js +38 -0
  64. package/lib/next/events/EventCreator.js +77 -0
  65. package/lib/next/events/EventPipeline.js +58 -0
  66. package/lib/next/events/EventTimestamp.js +27 -0
  67. package/lib/next/events/ViewInfoCreator.js +27 -0
  68. package/lib/next/events/modifier/BaseDataEventModifier.js +31 -0
  69. package/lib/next/events/modifier/EventLimitation.js +69 -0
  70. package/lib/next/events/modifier/EventModifierUtil.js +89 -0
  71. package/lib/next/events/modifier/IEventModifier.js +2 -0
  72. package/lib/next/events/modifier/ModifyEventValidation.js +189 -0
  73. package/lib/next/events/modifier/SendEventValidation.js +86 -0
  74. package/lib/next/events/modifier/ValueRestrictionModifier.js +56 -0
  75. package/lib/next/events/spec/EventFieldKeysEnum.js +2 -0
  76. package/lib/next/events/spec/EventSpecContstants.js +47 -0
  77. package/lib/next/events/spec/IAppStartEvent.js +2 -0
  78. package/lib/next/events/spec/ICrashEvent.js +2 -0
  79. package/lib/next/events/spec/IErrorCodeEvent.js +2 -0
  80. package/lib/next/events/spec/IErrorExceptionEvent.js +2 -0
  81. package/lib/next/events/spec/IReactNativeEvent.js +2 -0
  82. package/lib/next/events/spec/IRumEvent.js +2 -0
  83. package/lib/next/provider/ITimestampProvider.js +2 -0
  84. package/lib/next/provider/TimestampProvider.js +10 -0
  85. package/package.json +42 -33
  86. package/react-native-dynatrace.podspec +1 -1
  87. package/scripts/Android.js +10 -4
  88. package/scripts/PathsConstants.js +3 -1
  89. package/scripts/core/InstrumentCall.js +1 -0
  90. package/src/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.ts +8 -0
  91. package/typings/react-native-dynatrace.d.ts +73 -0
  92. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.java +0 -366
  93. package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.java +0 -67
  94. package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.java +0 -108
  95. package/android/src/main/java/com/dynatrace/android/agent/PrivateDTBridge.java +0 -28
  96. package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -192
  97. package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -194
  98. package/lib/community/Picker.InstrInfo.js +0 -20
  99. package/lib/community/gesture-handler/Touchables.InstrInfo.js +0 -56
  100. package/lib/instrumentor/DynatraceInstrumentation.js +0 -1
  101. package/lib/instrumentor/base/Application.js +0 -16
  102. package/lib/instrumentor/base/DynatraceInternal.js +0 -34
  103. package/lib/instrumentor/base/Logger.js +0 -16
  104. package/lib/instrumentor/base/model/LogLevel.js +0 -17
  105. package/lib/jsx-dev-runtime.js +0 -70
  106. package/lib/jsx-runtime.js +0 -69
  107. package/lib/react/Component.js +0 -90
  108. package/lib/react-native/Touchables.InstrInfo.js +0 -60
  109. /package/{lib/instrumentor/base/interface → instrumentation/jsx}/IDynatraceProperties.js +0 -0
  110. /package/{lib → instrumentation/libs}/community/gesture-handler/index.js +0 -0
  111. /package/{lib → instrumentation/libs}/gesture-handler.js +0 -0
  112. /package/{lib → instrumentation/libs}/react-native/index.js +0 -0
  113. /package/{lib → instrumentation/libs}/react-native.js +0 -0
  114. /package/{lib/instrumentor → instrumentation}/model/Reference.js +0 -0
  115. /package/{lib/instrumentor → instrumentation}/parser/Babel.js +0 -0
  116. /package/lib/{instrumentor/base → core}/DynatraceBridge.js +0 -0
  117. /package/lib/{instrumentor/base → core}/NullAction.js +0 -0
  118. /package/lib/{instrumentor/base → core}/NullRootAction.js +0 -0
  119. /package/lib/{instrumentor/base → core}/NullWebRequestTiming.js +0 -0
  120. /package/lib/{instrumentor/base → core}/UserPrivacyOptions.js +0 -0
  121. /package/lib/{instrumentor/base → core}/configuration/ConfigurationBuilder.js +0 -0
  122. /package/lib/{instrumentor/base → core}/configuration/ConfigurationPreset.js +0 -0
  123. /package/lib/{instrumentor/base → core}/configuration/IConfiguration.js +0 -0
  124. /package/lib/{instrumentor/base → core}/interface/IDynatrace.js +0 -0
  125. /package/lib/{instrumentor/base → core}/interface/IDynatraceAction.js +0 -0
  126. /package/lib/{instrumentor/base → core}/interface/IDynatraceInternal.js +0 -0
  127. /package/lib/{instrumentor/base → core}/interface/IDynatraceRootAction.js +0 -0
  128. /package/lib/{instrumentor/base → core}/interface/IWebRequestTiming.js +0 -0
  129. /package/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.js +0 -0
  130. /package/lib/{instrumentor/base/interface → core/logging}/ILogger.js +0 -0
  131. /package/lib/{instrumentor/base → core}/model/DataCollectionLevel.js +0 -0
  132. /package/lib/{instrumentor/base → core}/model/Json.js +0 -0
  133. /package/lib/{instrumentor/base → core}/model/Platform.js +0 -0
  134. /package/lib/{instrumentor/base → core}/util/StringUtils.js +0 -0
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ElementHelper_1 = require("./instrumentor/base/ElementHelper");
4
- const Types_1 = require("./instrumentor/model/Types");
5
- const Component_1 = require("./react/Component");
6
- try {
7
- let _jsxRuntime;
8
- try {
9
- _jsxRuntime = require('react/jsx-runtime.js');
10
- }
11
- catch (error) {
12
- try {
13
- _jsxRuntime = require('../../../react/jsx-runtime');
14
- }
15
- catch (error) {
16
- _jsxRuntime = null;
17
- }
18
- }
19
- if (_jsxRuntime != null) {
20
- const jsxProd = (type, config, maybeKey) => jsxHelper(_jsxRuntime.jsx, type, config, [maybeKey]);
21
- const jsxDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsx, type, config, [maybeKey, source, self]);
22
- const jsxsDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsxs, type, config, [
23
- maybeKey,
24
- source,
25
- self,
26
- ]);
27
- const jsxHelper = (jsxFn, type, config, args) => {
28
- if (type !== undefined &&
29
- type._dtInfo !== undefined &&
30
- !(0, ElementHelper_1.isDtActionIgnore)(config)) {
31
- if (type._dtInfo.type === Types_1.Types.FunctionalComponent) {
32
- const wrapperProps = {
33
- children: [],
34
- };
35
- wrapperProps.dtActionName =
36
- config !== undefined &&
37
- config.dtActionName !== undefined
38
- ? config.dtActionName
39
- : type._dtInfo.name;
40
- wrapperProps.children.push(jsxFn(type, config, ...args));
41
- return _jsxRuntime.jsxs(Component_1.DynatraceFnWrapper, wrapperProps);
42
- }
43
- else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
44
- type.prototype !== undefined &&
45
- type.prototype.isReactComponent !== undefined) {
46
- const wrapperProps = {
47
- children: [],
48
- };
49
- wrapperProps.children.push(jsxFn(type, config, ...args));
50
- return _jsxRuntime.jsxs(Component_1.DynatraceClassWrapper, wrapperProps);
51
- }
52
- if (Array.isArray(config.children)) {
53
- (0, ElementHelper_1.modifyElement)(type, config, ...config.children);
54
- }
55
- else {
56
- (0, ElementHelper_1.modifyElement)(type, config, config.children);
57
- }
58
- }
59
- return jsxFn(type, config, ...args);
60
- };
61
- module.exports = Object.assign(Object.assign({}, _jsxRuntime), { jsx: __DEV__ ? jsxDev : jsxProd, jsxs: __DEV__ ? jsxsDev : jsxProd });
62
- }
63
- else {
64
- module.exports = {};
65
- }
66
- }
67
- catch (error) {
68
- module.exports = {};
69
- }
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DynatraceClassWrapper = exports.DynatraceFnWrapper = void 0;
4
- const react_1 = require("react");
5
- const ConfigurationHandler_1 = require("../instrumentor/base/configuration/ConfigurationHandler");
6
- const Logger_1 = require("../instrumentor/base/Logger");
7
- const NullAction_1 = require("../instrumentor/base/NullAction");
8
- const Dynatrace_1 = require("../instrumentor/base/Dynatrace");
9
- const DynatraceFnWrapper = (props) => {
10
- const componentName = getNameFromComponent(props);
11
- const action = Dynatrace_1.Dynatrace.enterAutoAction(`Render ${componentName}`);
12
- if (action instanceof NullAction_1.NullAction) {
13
- Logger_1.Logger.logInfo(`Component ${componentName}: 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.DynatraceFnWrapper = DynatraceFnWrapper;
21
- class DynatraceClassWrapper extends react_1.Component {
22
- constructor(props) {
23
- super(props);
24
- this.wrappingName = getNameFromComponent(props);
25
- this.componentMounted = false;
26
- }
27
- render() {
28
- if (!ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
29
- Logger_1.Logger.logInfo(`Component ${this.wrappingName}: React Native plugin has not been started yet! Component will not be reported!`);
30
- }
31
- else {
32
- if ((this.componentMounted &&
33
- ConfigurationHandler_1.ConfigurationHandler.isLifecycleUpdateEnabled()) ||
34
- !this.componentMounted) {
35
- const actionPrefix = !this.componentMounted
36
- ? 'Render '
37
- : 'Update ';
38
- this.internalAction = Dynatrace_1.Dynatrace.enterAutoAction(actionPrefix + this.wrappingName);
39
- }
40
- }
41
- return this.props.children;
42
- }
43
- componentWillUnmount() {
44
- this.componentMounted = false;
45
- }
46
- componentDidUpdate() {
47
- this.reportFunctionEvent('componentDidUpdate()');
48
- }
49
- componentDidMount() {
50
- this.componentMounted = true;
51
- this.reportFunctionEvent('componentDidMount()');
52
- }
53
- reportFunctionEvent(event) {
54
- if (this.internalAction !== undefined) {
55
- this.internalAction.reportEvent(`${this.wrappingName}.${event}`);
56
- this.internalAction.leaveAction();
57
- this.internalAction = undefined;
58
- }
59
- }
60
- }
61
- exports.DynatraceClassWrapper = DynatraceClassWrapper;
62
- const getNameFromComponent = (props) => {
63
- if (props !== undefined && props.children !== undefined) {
64
- let child;
65
- if (Array.isArray(props.children) && props.children.length === 1) {
66
- child = props.children[0];
67
- }
68
- else {
69
- child = props.children;
70
- }
71
- if (child.props !== undefined &&
72
- child.props.dtActionName !== undefined) {
73
- return child.props.dtActionName;
74
- }
75
- else if (child.type !== undefined) {
76
- if (child.type.displayName !== undefined) {
77
- return child.type.displayName;
78
- }
79
- else if (child.type._dtInfo !== undefined) {
80
- return child.type._dtInfo.name;
81
- }
82
- else {
83
- return child.type.name;
84
- }
85
- }
86
- }
87
- else {
88
- return 'Undefined Name';
89
- }
90
- };
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.instrumentationInfo = void 0;
4
- exports.instrumentationInfo = [];
5
- exports.instrumentationInfo.push({
6
- old: { module: 'react-native', reference: 'TouchableHighlight' },
7
- new: {
8
- module: '@dynatrace/react-native-plugin/lib/react-native/',
9
- reference: 'TouchableHighlight',
10
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
11
- },
12
- });
13
- exports.instrumentationInfo.push({
14
- old: { module: 'react-native', reference: 'TouchableOpacity' },
15
- new: {
16
- module: '@dynatrace/react-native-plugin/lib/react-native/',
17
- reference: 'TouchableOpacity',
18
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
19
- },
20
- });
21
- exports.instrumentationInfo.push({
22
- old: { module: 'react-native', reference: 'TouchableNativeFeedback' },
23
- new: {
24
- module: '@dynatrace/react-native-plugin/lib/react-native/',
25
- reference: 'TouchableNativeFeedback',
26
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
27
- },
28
- });
29
- exports.instrumentationInfo.push({
30
- old: { module: 'react-native', reference: 'TouchableWithoutFeedback' },
31
- new: {
32
- module: '@dynatrace/react-native-plugin/lib/react-native/',
33
- reference: 'TouchableWithoutFeedback',
34
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
35
- },
36
- });
37
- exports.instrumentationInfo.push({
38
- old: { module: 'react-native', reference: 'Button' },
39
- new: {
40
- module: '@dynatrace/react-native-plugin/lib/react-native/',
41
- reference: 'Button',
42
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
43
- },
44
- });
45
- exports.instrumentationInfo.push({
46
- old: { module: 'react-native', reference: 'Text' },
47
- new: {
48
- module: '@dynatrace/react-native-plugin/lib/react-native/',
49
- reference: 'Text',
50
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
51
- },
52
- });
53
- exports.instrumentationInfo.push({
54
- old: { module: 'react-native', reference: 'Pressable' },
55
- new: {
56
- module: '@dynatrace/react-native-plugin/lib/react-native/',
57
- reference: 'Pressable',
58
- defaultImport: '@dynatrace/react-native-plugin/lib/react-native',
59
- },
60
- });
File without changes
File without changes
File without changes