@datadog/mobile-react-native 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +8 -2
  2. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +2 -1
  3. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +14 -0
  4. package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
  5. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +49 -0
  6. package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +7 -0
  7. package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +8 -1
  8. package/ios/Sources/DdSdkConfiguration.swift +9 -1
  9. package/ios/Sources/DdSdkNativeInitialization.swift +3 -1
  10. package/ios/Sources/RNDdSdkConfiguration.swift +24 -2
  11. package/ios/Sources/SdkVersion.swift +1 -1
  12. package/jest/mock.js +5 -2
  13. package/lib/commonjs/DdSdkReactNative.js +1 -1
  14. package/lib/commonjs/DdSdkReactNative.js.map +1 -1
  15. package/lib/commonjs/DdSdkReactNativeConfiguration.js +20 -2
  16. package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
  17. package/lib/commonjs/index.js +40 -1
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/logs/DdLogs.js +2 -2
  20. package/lib/commonjs/logs/DdLogs.js.map +1 -1
  21. package/lib/commonjs/rum/DdRum.js +14 -6
  22. package/lib/commonjs/rum/DdRum.js.map +1 -1
  23. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +77 -0
  24. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -0
  25. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js +44 -0
  26. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js.map +1 -0
  27. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -11
  28. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  29. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -4
  30. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  31. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +36 -3
  32. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  33. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +1 -1
  34. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  35. package/lib/commonjs/rum/types.js.map +1 -1
  36. package/lib/commonjs/types.js +3 -1
  37. package/lib/commonjs/types.js.map +1 -1
  38. package/lib/commonjs/version.js +1 -1
  39. package/lib/module/DdSdkReactNative.js +1 -1
  40. package/lib/module/DdSdkReactNative.js.map +1 -1
  41. package/lib/module/DdSdkReactNativeConfiguration.js +19 -1
  42. package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
  43. package/lib/module/index.js +7 -3
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/logs/DdLogs.js +2 -2
  46. package/lib/module/logs/DdLogs.js.map +1 -1
  47. package/lib/module/rum/DdRum.js +15 -7
  48. package/lib/module/rum/DdRum.js.map +1 -1
  49. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +70 -0
  50. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -0
  51. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js +37 -0
  52. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.js.map +1 -0
  53. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +12 -10
  54. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  55. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +7 -3
  56. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  57. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +32 -1
  58. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  59. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +2 -2
  60. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  61. package/lib/module/rum/types.js.map +1 -1
  62. package/lib/module/types.js +3 -1
  63. package/lib/module/types.js.map +1 -1
  64. package/lib/module/version.js +1 -1
  65. package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
  66. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +25 -0
  67. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +1 -1
  68. package/lib/typescript/index.d.ts +6 -3
  69. package/lib/typescript/index.d.ts.map +1 -1
  70. package/lib/typescript/rum/DdRum.d.ts +7 -3
  71. package/lib/typescript/rum/DdRum.d.ts.map +1 -1
  72. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +45 -0
  73. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -0
  74. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.d.ts +24 -0
  75. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.d.ts.map +1 -0
  76. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +4 -3
  77. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
  78. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +1 -0
  79. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
  80. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +6 -1
  81. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
  82. package/lib/typescript/rum/types.d.ts +31 -6
  83. package/lib/typescript/rum/types.d.ts.map +1 -1
  84. package/lib/typescript/types.d.ts +4 -1
  85. package/lib/typescript/types.d.ts.map +1 -1
  86. package/lib/typescript/version.d.ts +1 -1
  87. package/package.json +5 -2
  88. package/src/DdSdkReactNative.tsx +3 -1
  89. package/src/DdSdkReactNativeConfiguration.tsx +31 -1
  90. package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +6 -0
  91. package/src/index.tsx +16 -3
  92. package/src/logs/DdLogs.ts +2 -2
  93. package/src/rum/DdRum.ts +38 -15
  94. package/src/rum/__tests__/DdRum.test.ts +633 -10
  95. package/src/rum/__tests__/__utils__/TracingHeadersUtils.ts +166 -0
  96. package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +81 -0
  97. package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.ts +49 -0
  98. package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +19 -13
  99. package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/__utils__/TracingIdentifierUtils.ts +10 -6
  100. package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +2 -0
  101. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +9 -3
  102. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +71 -1
  103. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +2 -2
  104. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +2 -1
  105. package/src/rum/types.ts +42 -7
  106. package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +2 -0
  107. package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +4 -0
  108. package/src/types.tsx +5 -1
  109. package/src/version.ts +1 -1
  110. package/lib/commonjs/polyfills.js +0 -28
  111. package/lib/commonjs/polyfills.js.map +0 -1
  112. package/lib/module/polyfills.js +0 -26
  113. package/lib/module/polyfills.js.map +0 -1
  114. package/src/polyfills.js +0 -37
@@ -70,6 +70,7 @@ describe('DatadogProvider', () => {
70
70
  },
71
71
  "appHangThreshold": undefined,
72
72
  "applicationId": "fakeApplicationId",
73
+ "batchProcessingLevel": "MEDIUM",
73
74
  "batchSize": "MEDIUM",
74
75
  "bundleLogsWithRum": true,
75
76
  "bundleLogsWithTraces": true,
@@ -99,6 +100,7 @@ describe('DatadogProvider', () => {
99
100
  "trackBackgroundEvents": false,
100
101
  "trackFrustrations": true,
101
102
  "trackNonFatalAnrs": undefined,
103
+ "trackWatchdogTerminations": false,
102
104
  "trackingConsent": "granted",
103
105
  "uploadFrequency": "AVERAGE",
104
106
  "verbosity": undefined,
@@ -52,6 +52,7 @@ describe('FileBasedConfiguration', () => {
52
52
  "actionNameAttribute": "action-name-attr",
53
53
  "additionalConfiguration": {},
54
54
  "applicationId": "fake-app-id",
55
+ "batchProcessingLevel": "MEDIUM",
55
56
  "batchSize": "MEDIUM",
56
57
  "bundleLogsWithRum": true,
57
58
  "bundleLogsWithTraces": true,
@@ -89,6 +90,7 @@ describe('FileBasedConfiguration', () => {
89
90
  "trackFrustrations": true,
90
91
  "trackInteractions": true,
91
92
  "trackResources": true,
93
+ "trackWatchdogTerminations": false,
92
94
  "trackingConsent": "not_granted",
93
95
  "uploadFrequency": "AVERAGE",
94
96
  "useAccessibilityLabel": true,
@@ -113,6 +115,7 @@ describe('FileBasedConfiguration', () => {
113
115
  "actionNameAttribute": undefined,
114
116
  "additionalConfiguration": {},
115
117
  "applicationId": "fake-app-id",
118
+ "batchProcessingLevel": "MEDIUM",
116
119
  "batchSize": "MEDIUM",
117
120
  "bundleLogsWithRum": true,
118
121
  "bundleLogsWithTraces": true,
@@ -140,6 +143,7 @@ describe('FileBasedConfiguration', () => {
140
143
  "trackFrustrations": true,
141
144
  "trackInteractions": false,
142
145
  "trackResources": false,
146
+ "trackWatchdogTerminations": false,
143
147
  "trackingConsent": "granted",
144
148
  "uploadFrequency": "AVERAGE",
145
149
  "useAccessibilityLabel": true,
package/src/types.tsx CHANGED
@@ -4,6 +4,8 @@
4
4
  * Copyright 2016-Present Datadog, Inc.
5
5
  */
6
6
 
7
+ import type { BatchProcessingLevel } from './DdSdkReactNativeConfiguration';
8
+
7
9
  /**
8
10
  * A configuration object to initialize Datadog's features.
9
11
  */
@@ -59,7 +61,9 @@ export class DdSdkConfiguration {
59
61
  readonly bundleLogsWithTraces: boolean,
60
62
  readonly trackNonFatalAnrs: boolean | undefined,
61
63
  readonly appHangThreshold: number | undefined,
62
- readonly resourceTracingSamplingRate: number | undefined
64
+ readonly resourceTracingSamplingRate: number | undefined,
65
+ readonly trackWatchdogTerminations: boolean | undefined,
66
+ readonly batchProcessingLevel: BatchProcessingLevel
63
67
  ) {}
64
68
  }
65
69
 
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '2.6.0';
2
+ export const version = '2.6.2';
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- var _package = require("react-native/package.json");
4
- /*
5
- * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
6
- * This product includes software developed at Datadog (https://www.datadoghq.com/).
7
- * Copyright 2016-Present Datadog, Inc.
8
- */
9
-
10
- function applyBigIntPolyfill() {
11
- const rnVersion = _package.version.split('.').map(Number);
12
- const isRn63 = rnVersion[0] === 0 && rnVersion[1] === 63;
13
- if (isRn63 && typeof BigInt === 'undefined') {
14
- try {
15
- // eslint-disable-next-line global-require, import/no-extraneous-dependencies
16
- global.BigInt = require('big-integer');
17
- console.warn('React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' + 'The missing type has been polyfilled using `big-integer` to grant back-compatibility. ' + 'We strongly suggest updating to a greater version of React Native (>= 0.64).');
18
- } catch (e) {
19
- if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
20
- throw new Error('React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' + 'We strongly suggest updating to a greater version of React Native (>= 0.64).\n\n' + 'You can install `big-integer` to enable our polyfill that grants back-compatibility with RN 63:\n\n' + '`yarn add big-integer`\n\nOR\n\n`npm install --save big-integer`');
21
- } else {
22
- throw e;
23
- }
24
- }
25
- }
26
- }
27
- applyBigIntPolyfill();
28
- //# sourceMappingURL=polyfills.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_package","require","applyBigIntPolyfill","rnVersion","reactNativeVersion","split","map","Number","isRn63","BigInt","global","console","warn","e","Error","code"],"sourceRoot":"../../src","sources":["polyfills.js"],"mappings":";;AAMA,IAAAA,QAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAIA,SAASC,mBAAmBA,CAAA,EAAG;EAC3B,MAAMC,SAAS,GAAGC,gBAAkB,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAC3D,MAAMC,MAAM,GAAGL,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAIA,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE;EAExD,IAAIK,MAAM,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACzC,IAAI;MACA;MACAC,MAAM,CAACD,MAAM,GAAGR,OAAO,CAAC,aAAa,CAAC;MACtCU,OAAO,CAACC,IAAI,CACR,iHAAiH,GAC7G,wFAAwF,GACxF,8EACR,CAAC;IACL,CAAC,CAAC,OAAOC,CAAC,EAAE;MACR,IAAIA,CAAC,YAAYC,KAAK,IAAID,CAAC,CAACE,IAAI,KAAK,kBAAkB,EAAE;QACrD,MAAM,IAAID,KAAK,CACX,iHAAiH,GAC7G,kFAAkF,GAClF,qGAAqG,GACrG,kEACR,CAAC;MACL,CAAC,MAAM;QACH,MAAMD,CAAC;MACX;IACJ;EACJ;AACJ;AAEAX,mBAAmB,CAAC,CAAC","ignoreList":[]}
@@ -1,26 +0,0 @@
1
- /*
2
- * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
- * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
- * Copyright 2016-Present Datadog, Inc.
5
- */
6
-
7
- import { version as reactNativeVersion } from 'react-native/package.json';
8
- function applyBigIntPolyfill() {
9
- const rnVersion = reactNativeVersion.split('.').map(Number);
10
- const isRn63 = rnVersion[0] === 0 && rnVersion[1] === 63;
11
- if (isRn63 && typeof BigInt === 'undefined') {
12
- try {
13
- // eslint-disable-next-line global-require, import/no-extraneous-dependencies
14
- global.BigInt = require('big-integer');
15
- console.warn('React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' + 'The missing type has been polyfilled using `big-integer` to grant back-compatibility. ' + 'We strongly suggest updating to a greater version of React Native (>= 0.64).');
16
- } catch (e) {
17
- if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
18
- throw new Error('React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' + 'We strongly suggest updating to a greater version of React Native (>= 0.64).\n\n' + 'You can install `big-integer` to enable our polyfill that grants back-compatibility with RN 63:\n\n' + '`yarn add big-integer`\n\nOR\n\n`npm install --save big-integer`');
19
- } else {
20
- throw e;
21
- }
22
- }
23
- }
24
- }
25
- applyBigIntPolyfill();
26
- //# sourceMappingURL=polyfills.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["version","reactNativeVersion","applyBigIntPolyfill","rnVersion","split","map","Number","isRn63","BigInt","global","require","console","warn","e","Error","code"],"sourceRoot":"../../src","sources":["polyfills.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,IAAIC,kBAAkB,QAAQ,2BAA2B;AAEzE,SAASC,mBAAmBA,CAAA,EAAG;EAC3B,MAAMC,SAAS,GAAGF,kBAAkB,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAC3D,MAAMC,MAAM,GAAGJ,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAIA,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE;EAExD,IAAII,MAAM,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACzC,IAAI;MACA;MACAC,MAAM,CAACD,MAAM,GAAGE,OAAO,CAAC,aAAa,CAAC;MACtCC,OAAO,CAACC,IAAI,CACR,iHAAiH,GAC7G,wFAAwF,GACxF,8EACR,CAAC;IACL,CAAC,CAAC,OAAOC,CAAC,EAAE;MACR,IAAIA,CAAC,YAAYC,KAAK,IAAID,CAAC,CAACE,IAAI,KAAK,kBAAkB,EAAE;QACrD,MAAM,IAAID,KAAK,CACX,iHAAiH,GAC7G,kFAAkF,GAClF,qGAAqG,GACrG,kEACR,CAAC;MACL,CAAC,MAAM;QACH,MAAMD,CAAC;MACX;IACJ;EACJ;AACJ;AAEAX,mBAAmB,CAAC,CAAC","ignoreList":[]}
package/src/polyfills.js DELETED
@@ -1,37 +0,0 @@
1
- /*
2
- * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
- * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
- * Copyright 2016-Present Datadog, Inc.
5
- */
6
-
7
- import { version as reactNativeVersion } from 'react-native/package.json';
8
-
9
- function applyBigIntPolyfill() {
10
- const rnVersion = reactNativeVersion.split('.').map(Number);
11
- const isRn63 = rnVersion[0] === 0 && rnVersion[1] === 63;
12
-
13
- if (isRn63 && typeof BigInt === 'undefined') {
14
- try {
15
- // eslint-disable-next-line global-require, import/no-extraneous-dependencies
16
- global.BigInt = require('big-integer');
17
- console.warn(
18
- 'React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' +
19
- 'The missing type has been polyfilled using `big-integer` to grant back-compatibility. ' +
20
- 'We strongly suggest updating to a greater version of React Native (>= 0.64).'
21
- );
22
- } catch (e) {
23
- if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
24
- throw new Error(
25
- 'React Native 0.63 does not support BigInt, which is required starting from v2.4.0 of Datadog React Native SDK. ' +
26
- 'We strongly suggest updating to a greater version of React Native (>= 0.64).\n\n' +
27
- 'You can install `big-integer` to enable our polyfill that grants back-compatibility with RN 63:\n\n' +
28
- '`yarn add big-integer`\n\nOR\n\n`npm install --save big-integer`'
29
- );
30
- } else {
31
- throw e;
32
- }
33
- }
34
- }
35
- }
36
-
37
- applyBigIntPolyfill();