@sentry/react-native 5.28.0 → 6.0.0-alpha.0

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 (294) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/android/build.gradle +1 -1
  3. package/dist/js/client.d.ts +5 -9
  4. package/dist/js/client.d.ts.map +1 -1
  5. package/dist/js/client.js +11 -42
  6. package/dist/js/client.js.map +1 -1
  7. package/dist/js/index.d.ts +5 -10
  8. package/dist/js/index.d.ts.map +1 -1
  9. package/dist/js/index.js +4 -21
  10. package/dist/js/index.js.map +1 -1
  11. package/dist/js/integrations/debugsymbolicator.d.ts +2 -8
  12. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  13. package/dist/js/integrations/debugsymbolicator.js +1 -9
  14. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  15. package/dist/js/integrations/default.d.ts.map +1 -1
  16. package/dist/js/integrations/default.js +18 -7
  17. package/dist/js/integrations/default.js.map +1 -1
  18. package/dist/js/integrations/devicecontext.d.ts +2 -8
  19. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  20. package/dist/js/integrations/devicecontext.js +0 -9
  21. package/dist/js/integrations/devicecontext.js.map +1 -1
  22. package/dist/js/integrations/eventorigin.d.ts +2 -8
  23. package/dist/js/integrations/eventorigin.d.ts.map +1 -1
  24. package/dist/js/integrations/eventorigin.js +0 -8
  25. package/dist/js/integrations/eventorigin.js.map +1 -1
  26. package/dist/js/integrations/expocontext.d.ts +2 -8
  27. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  28. package/dist/js/integrations/expocontext.js +0 -8
  29. package/dist/js/integrations/expocontext.js.map +1 -1
  30. package/dist/js/integrations/exports.d.ts +4 -0
  31. package/dist/js/integrations/exports.d.ts.map +1 -1
  32. package/dist/js/integrations/exports.js +4 -0
  33. package/dist/js/integrations/exports.js.map +1 -1
  34. package/dist/js/integrations/modulesloader.d.ts +2 -8
  35. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  36. package/dist/js/integrations/modulesloader.js +0 -8
  37. package/dist/js/integrations/modulesloader.js.map +1 -1
  38. package/dist/js/integrations/nativelinkederrors.d.ts +2 -8
  39. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  40. package/dist/js/integrations/nativelinkederrors.js +0 -8
  41. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  42. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +2 -8
  43. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  44. package/dist/js/integrations/reactnativeerrorhandlers.js +1 -8
  45. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  46. package/dist/js/integrations/reactnativeinfo.d.ts +2 -8
  47. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  48. package/dist/js/integrations/reactnativeinfo.js +0 -8
  49. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  50. package/dist/js/integrations/release.d.ts +2 -8
  51. package/dist/js/integrations/release.d.ts.map +1 -1
  52. package/dist/js/integrations/release.js +0 -8
  53. package/dist/js/integrations/release.js.map +1 -1
  54. package/dist/js/integrations/rewriteframes.js +1 -1
  55. package/dist/js/integrations/rewriteframes.js.map +1 -1
  56. package/dist/js/integrations/screenshot.d.ts +2 -8
  57. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  58. package/dist/js/integrations/screenshot.js +2 -11
  59. package/dist/js/integrations/screenshot.js.map +1 -1
  60. package/dist/js/integrations/sdkinfo.d.ts +2 -8
  61. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  62. package/dist/js/integrations/sdkinfo.js +0 -8
  63. package/dist/js/integrations/sdkinfo.js.map +1 -1
  64. package/dist/js/integrations/spotlight.d.ts +2 -10
  65. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  66. package/dist/js/integrations/spotlight.js +1 -10
  67. package/dist/js/integrations/spotlight.js.map +1 -1
  68. package/dist/js/integrations/viewhierarchy.d.ts +2 -8
  69. package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
  70. package/dist/js/integrations/viewhierarchy.js +0 -8
  71. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  72. package/dist/js/options.d.ts +43 -0
  73. package/dist/js/options.d.ts.map +1 -1
  74. package/dist/js/options.js.map +1 -1
  75. package/dist/js/profiling/cache.d.ts +1 -1
  76. package/dist/js/profiling/hermes.d.ts +1 -1
  77. package/dist/js/profiling/hermes.d.ts.map +1 -1
  78. package/dist/js/profiling/integration.d.ts +1 -7
  79. package/dist/js/profiling/integration.d.ts.map +1 -1
  80. package/dist/js/profiling/integration.js +39 -25
  81. package/dist/js/profiling/integration.js.map +1 -1
  82. package/dist/js/profiling/utils.js +2 -1
  83. package/dist/js/profiling/utils.js.map +1 -1
  84. package/dist/js/replay/mobilereplay.d.ts +2 -2
  85. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  86. package/dist/js/replay/mobilereplay.js.map +1 -1
  87. package/dist/js/scopeSync.d.ts +6 -0
  88. package/dist/js/scopeSync.d.ts.map +1 -0
  89. package/dist/js/scopeSync.js +60 -0
  90. package/dist/js/scopeSync.js.map +1 -0
  91. package/dist/js/sdk.d.ts +1 -20
  92. package/dist/js/sdk.d.ts.map +1 -1
  93. package/dist/js/sdk.js +20 -53
  94. package/dist/js/sdk.js.map +1 -1
  95. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  96. package/dist/js/touchevents.d.ts +0 -1
  97. package/dist/js/touchevents.d.ts.map +1 -1
  98. package/dist/js/touchevents.js +5 -9
  99. package/dist/js/touchevents.js.map +1 -1
  100. package/dist/js/tracing/gesturetracing.d.ts +1 -6
  101. package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
  102. package/dist/js/tracing/gesturetracing.js +8 -12
  103. package/dist/js/tracing/gesturetracing.js.map +1 -1
  104. package/dist/js/tracing/index.d.ts +6 -7
  105. package/dist/js/tracing/index.d.ts.map +1 -1
  106. package/dist/js/tracing/index.js +4 -7
  107. package/dist/js/tracing/index.js.map +1 -1
  108. package/dist/js/tracing/integrations/appStart.d.ts +39 -0
  109. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -0
  110. package/dist/js/tracing/integrations/appStart.js +301 -0
  111. package/dist/js/tracing/integrations/appStart.js.map +1 -0
  112. package/dist/js/tracing/integrations/nativeFrames.d.ts +20 -0
  113. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -0
  114. package/dist/js/tracing/integrations/nativeFrames.js +256 -0
  115. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -0
  116. package/dist/js/tracing/integrations/stalltracking.d.ts +31 -0
  117. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -0
  118. package/dist/js/tracing/integrations/stalltracking.js +236 -0
  119. package/dist/js/tracing/integrations/stalltracking.js.map +1 -0
  120. package/dist/js/tracing/integrations/userInteraction.d.ts +11 -0
  121. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -0
  122. package/dist/js/tracing/integrations/userInteraction.js +70 -0
  123. package/dist/js/tracing/integrations/userInteraction.js.map +1 -0
  124. package/dist/js/tracing/onSpanEndUtils.d.ts +17 -0
  125. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -0
  126. package/dist/js/tracing/onSpanEndUtils.js +112 -0
  127. package/dist/js/tracing/onSpanEndUtils.js.map +1 -0
  128. package/dist/js/tracing/origin.d.ts +2 -0
  129. package/dist/js/tracing/origin.d.ts.map +1 -0
  130. package/dist/js/tracing/origin.js +2 -0
  131. package/dist/js/tracing/origin.js.map +1 -0
  132. package/dist/js/tracing/reactnativenavigation.d.ts +21 -39
  133. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  134. package/dist/js/tracing/reactnativenavigation.js +98 -87
  135. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  136. package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
  137. package/dist/js/tracing/reactnativeprofiler.js +6 -13
  138. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  139. package/dist/js/tracing/reactnativetracing.d.ts +44 -160
  140. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  141. package/dist/js/tracing/reactnativetracing.js +51 -481
  142. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  143. package/dist/js/tracing/reactnavigation.d.ts +18 -63
  144. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  145. package/dist/js/tracing/reactnavigation.js +197 -218
  146. package/dist/js/tracing/reactnavigation.js.map +1 -1
  147. package/dist/js/tracing/semanticAttributes.d.ts +12 -0
  148. package/dist/js/tracing/semanticAttributes.d.ts.map +1 -0
  149. package/dist/js/tracing/semanticAttributes.js +12 -0
  150. package/dist/js/tracing/semanticAttributes.js.map +1 -0
  151. package/dist/js/tracing/span.d.ts +52 -0
  152. package/dist/js/tracing/span.d.ts.map +1 -0
  153. package/dist/js/tracing/span.js +82 -0
  154. package/dist/js/tracing/span.js.map +1 -0
  155. package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
  156. package/dist/js/tracing/timetodisplay.js +16 -29
  157. package/dist/js/tracing/timetodisplay.js.map +1 -1
  158. package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
  159. package/dist/js/tracing/timetodisplaynative.js +5 -3
  160. package/dist/js/tracing/timetodisplaynative.js.map +1 -1
  161. package/dist/js/tracing/types.d.ts +2 -9
  162. package/dist/js/tracing/types.d.ts.map +1 -1
  163. package/dist/js/tracing/types.js.map +1 -1
  164. package/dist/js/tracing/utils.d.ts +23 -12
  165. package/dist/js/tracing/utils.d.ts.map +1 -1
  166. package/dist/js/tracing/utils.js +48 -52
  167. package/dist/js/tracing/utils.js.map +1 -1
  168. package/dist/js/transports/encodePolyfill.d.ts +3 -0
  169. package/dist/js/transports/encodePolyfill.d.ts.map +1 -0
  170. package/dist/js/transports/encodePolyfill.js +13 -0
  171. package/dist/js/transports/encodePolyfill.js.map +1 -0
  172. package/dist/js/transports/native.d.ts +2 -2
  173. package/dist/js/transports/native.d.ts.map +1 -1
  174. package/dist/js/transports/native.js +2 -1
  175. package/dist/js/transports/native.js.map +1 -1
  176. package/dist/js/utils/fill.d.ts +7 -0
  177. package/dist/js/utils/fill.d.ts.map +1 -0
  178. package/dist/js/utils/fill.js +9 -0
  179. package/dist/js/utils/fill.js.map +1 -0
  180. package/dist/js/utils/normalize.d.ts.map +1 -1
  181. package/dist/js/utils/normalize.js +8 -5
  182. package/dist/js/utils/normalize.js.map +1 -1
  183. package/dist/js/utils/rnlibraries.d.ts.map +1 -1
  184. package/dist/js/utils/rnlibraries.js +6 -0
  185. package/dist/js/utils/rnlibraries.js.map +1 -1
  186. package/dist/js/utils/rnlibrariesinterface.d.ts +3 -0
  187. package/dist/js/utils/rnlibrariesinterface.d.ts.map +1 -1
  188. package/dist/js/utils/rnlibrariesinterface.js.map +1 -1
  189. package/dist/js/utils/span.d.ts +19 -0
  190. package/dist/js/utils/span.d.ts.map +1 -0
  191. package/dist/js/utils/span.js +29 -0
  192. package/dist/js/utils/span.js.map +1 -0
  193. package/dist/js/vendor/react-native/index.d.ts +5 -1
  194. package/dist/js/vendor/react-native/index.d.ts.map +1 -1
  195. package/dist/js/vendor/react-native/index.js.map +1 -1
  196. package/dist/js/version.d.ts +1 -1
  197. package/dist/js/version.d.ts.map +1 -1
  198. package/dist/js/version.js +1 -1
  199. package/dist/js/version.js.map +1 -1
  200. package/dist/js/wrapper.d.ts.map +1 -1
  201. package/dist/js/wrapper.js +1 -0
  202. package/dist/js/wrapper.js.map +1 -1
  203. package/package.json +12 -13
  204. package/ts3.8/dist/js/client.d.ts +5 -9
  205. package/ts3.8/dist/js/index.d.ts +5 -10
  206. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +2 -8
  207. package/ts3.8/dist/js/integrations/devicecontext.d.ts +2 -8
  208. package/ts3.8/dist/js/integrations/eventorigin.d.ts +2 -8
  209. package/ts3.8/dist/js/integrations/expocontext.d.ts +2 -8
  210. package/ts3.8/dist/js/integrations/exports.d.ts +4 -0
  211. package/ts3.8/dist/js/integrations/modulesloader.d.ts +2 -8
  212. package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +2 -8
  213. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +2 -8
  214. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +2 -8
  215. package/ts3.8/dist/js/integrations/release.d.ts +2 -8
  216. package/ts3.8/dist/js/integrations/screenshot.d.ts +2 -8
  217. package/ts3.8/dist/js/integrations/sdkinfo.d.ts +2 -8
  218. package/ts3.8/dist/js/integrations/spotlight.d.ts +2 -10
  219. package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +2 -8
  220. package/ts3.8/dist/js/options.d.ts +43 -0
  221. package/ts3.8/dist/js/profiling/cache.d.ts +1 -1
  222. package/ts3.8/dist/js/profiling/hermes.d.ts +1 -1
  223. package/ts3.8/dist/js/profiling/integration.d.ts +1 -7
  224. package/ts3.8/dist/js/replay/mobilereplay.d.ts +2 -2
  225. package/ts3.8/dist/js/scopeSync.d.ts +6 -0
  226. package/ts3.8/dist/js/sdk.d.ts +1 -20
  227. package/ts3.8/dist/js/touchevents.d.ts +0 -1
  228. package/ts3.8/dist/js/tracing/gesturetracing.d.ts +1 -6
  229. package/ts3.8/dist/js/tracing/index.d.ts +6 -7
  230. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +39 -0
  231. package/ts3.8/dist/js/tracing/integrations/nativeFrames.d.ts +20 -0
  232. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +31 -0
  233. package/ts3.8/dist/js/tracing/integrations/userInteraction.d.ts +11 -0
  234. package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +17 -0
  235. package/ts3.8/dist/js/tracing/origin.d.ts +2 -0
  236. package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +21 -39
  237. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +44 -160
  238. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +18 -63
  239. package/ts3.8/dist/js/tracing/semanticAttributes.d.ts +12 -0
  240. package/ts3.8/dist/js/tracing/span.d.ts +52 -0
  241. package/ts3.8/dist/js/tracing/types.d.ts +2 -9
  242. package/ts3.8/dist/js/tracing/utils.d.ts +23 -12
  243. package/ts3.8/dist/js/transports/encodePolyfill.d.ts +3 -0
  244. package/ts3.8/dist/js/transports/native.d.ts +2 -2
  245. package/ts3.8/dist/js/utils/fill.d.ts +7 -0
  246. package/ts3.8/dist/js/utils/rnlibrariesinterface.d.ts +3 -0
  247. package/ts3.8/dist/js/utils/span.d.ts +19 -0
  248. package/ts3.8/dist/js/vendor/react-native/index.d.ts +5 -1
  249. package/ts3.8/dist/js/version.d.ts +1 -1
  250. package/dist/js/integrations/index.d.ts +0 -16
  251. package/dist/js/integrations/index.d.ts.map +0 -1
  252. package/dist/js/integrations/index.js +0 -17
  253. package/dist/js/integrations/index.js.map +0 -1
  254. package/dist/js/scope.d.ts +0 -54
  255. package/dist/js/scope.d.ts.map +0 -1
  256. package/dist/js/scope.js +0 -89
  257. package/dist/js/scope.js.map +0 -1
  258. package/dist/js/tracing/addTracingExtensions.d.ts +0 -8
  259. package/dist/js/tracing/addTracingExtensions.d.ts.map +0 -1
  260. package/dist/js/tracing/addTracingExtensions.js +0 -66
  261. package/dist/js/tracing/addTracingExtensions.js.map +0 -1
  262. package/dist/js/tracing/nativeframes.d.ts +0 -60
  263. package/dist/js/tracing/nativeframes.d.ts.map +0 -1
  264. package/dist/js/tracing/nativeframes.js +0 -210
  265. package/dist/js/tracing/nativeframes.js.map +0 -1
  266. package/dist/js/tracing/reactnavigationv4.d.ts +0 -92
  267. package/dist/js/tracing/reactnavigationv4.d.ts.map +0 -1
  268. package/dist/js/tracing/reactnavigationv4.js +0 -229
  269. package/dist/js/tracing/reactnavigationv4.js.map +0 -1
  270. package/dist/js/tracing/routingInstrumentation.d.ts +0 -52
  271. package/dist/js/tracing/routingInstrumentation.d.ts.map +0 -1
  272. package/dist/js/tracing/routingInstrumentation.js +0 -36
  273. package/dist/js/tracing/routingInstrumentation.js.map +0 -1
  274. package/dist/js/tracing/stalltracking.d.ts +0 -99
  275. package/dist/js/tracing/stalltracking.d.ts.map +0 -1
  276. package/dist/js/tracing/stalltracking.js +0 -286
  277. package/dist/js/tracing/stalltracking.js.map +0 -1
  278. package/dist/js/tracing/transaction.d.ts +0 -11
  279. package/dist/js/tracing/transaction.d.ts.map +0 -1
  280. package/dist/js/tracing/transaction.js +0 -37
  281. package/dist/js/tracing/transaction.js.map +0 -1
  282. package/dist/js/transports/TextEncoder.d.ts +0 -3
  283. package/dist/js/transports/TextEncoder.d.ts.map +0 -1
  284. package/dist/js/transports/TextEncoder.js +0 -12
  285. package/dist/js/transports/TextEncoder.js.map +0 -1
  286. package/ts3.8/dist/js/integrations/index.d.ts +0 -16
  287. package/ts3.8/dist/js/scope.d.ts +0 -54
  288. package/ts3.8/dist/js/tracing/addTracingExtensions.d.ts +0 -8
  289. package/ts3.8/dist/js/tracing/nativeframes.d.ts +0 -60
  290. package/ts3.8/dist/js/tracing/reactnavigationv4.d.ts +0 -92
  291. package/ts3.8/dist/js/tracing/routingInstrumentation.d.ts +0 -52
  292. package/ts3.8/dist/js/tracing/stalltracking.d.ts +0 -99
  293. package/ts3.8/dist/js/tracing/transaction.d.ts +0 -11
  294. package/ts3.8/dist/js/transports/TextEncoder.d.ts +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,118 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.0-alpha.0
4
+
5
+ This is an alpha version of the next major version of the Sentry React Native SDK 6.0.0.
6
+ Please read the changes listed below as well as the changes made in the underlying
7
+ Sentry Javascript SDK 8.0.0 ([JS Docs](https://docs.sentry.io/platforms/javascript/guides/react/migration/v7-to-v8/)).
8
+
9
+ ### Changes
10
+
11
+ - Removed deprecated ReactNativeTracing option `idleTimeout` use `idleTimeoutMs` instead ([#3998](https://github.com/getsentry/sentry-react-native/pull/3998))
12
+ - Removed deprecated ReactNativeTracing option `maxTransactionDuration` use `finalTimeoutMs` instead ([#3998](https://github.com/getsentry/sentry-react-native/pull/3998))
13
+ - Removed `beforeNavigate` use `beforeStartSpan` instead ([#3998](https://github.com/getsentry/sentry-react-native/pull/3998))
14
+ - `beforeStartSpan` is executed before the span start, compared to `beforeNavigate` which was executed before the navigation ended (after the span was created)
15
+ - New Native Frames Integration ([#3996](https://github.com/getsentry/sentry-react-native/pull/3996))
16
+ - New Stall Tracking Integration ([#3997](https://github.com/getsentry/sentry-react-native/pull/3997))
17
+ - New User Interaction Tracing Integration ([#3999](https://github.com/getsentry/sentry-react-native/pull/3999))
18
+ - New App Start Integration ([#3852](https://github.com/getsentry/sentry-react-native/pull/3852))
19
+
20
+ By default app start spans are attached to the first created transaction.
21
+ Standalone mode creates single root span (transaction) including only app start data.
22
+
23
+ ```js
24
+ import Sentry from '@sentry/react-native';
25
+
26
+ Sentry.init({
27
+ tracesSampleRate: 1.0,
28
+ enableAppStartTracking: true, // default true
29
+ enableNativeFramesTracking: true, // default true
30
+ enableStallTracking: true, // default true
31
+ enableUserInteractionTracing: true, // default false
32
+ integrations: [
33
+ Sentry.reactNativeTracingIntegration({
34
+ beforeStartSpan: (startSpanOptions) => {
35
+ startSpanOptions.name = 'New Name';
36
+ return startSpanOptions;
37
+ },
38
+ }),
39
+ Sentry.appStartIntegration({
40
+ standalone: false, // default false
41
+ }),
42
+ ],
43
+ });
44
+ ```
45
+
46
+ - New React Navigation Integration interface ([#4003](https://github.com/getsentry/sentry-react-native/pull/4003))
47
+
48
+ ```js
49
+ import Sentry from '@sentry/react-native';
50
+ import { NavigationContainer } from '@react-navigation/native';
51
+
52
+ const reactNavigationIntegration = Sentry.reactNavigationIntegration();
53
+
54
+ Sentry.init({
55
+ tracesSampleRate: 1.0,
56
+ integrations: [reactNavigationIntegration],
57
+ });
58
+
59
+ function RootComponent() {
60
+ const navigation = React.useRef(null);
61
+
62
+ return <NavigationContainer ref={navigation}
63
+ onReady={() => {
64
+ reactNavigationIntegration.registerNavigationContainer(navigation);
65
+ }}>
66
+ </NavigationContainer>;
67
+ }
68
+ ```
69
+
70
+ - New React Native Navigation Integration interface ([#4003](https://github.com/getsentry/sentry-react-native/pull/4003))
71
+
72
+ ```js
73
+ import Sentry from '@sentry/react-native';
74
+ import { Navigation } from 'react-native-navigation';
75
+
76
+ Sentry.init({
77
+ tracesSampleRate: 1.0,
78
+ integrations: [
79
+ Sentry.reactNativeNavigationIntegration({ navigation: Navigation })
80
+ ],
81
+ });
82
+ ```
83
+
84
+ - Add `spotlight` option ([#4023](https://github.com/getsentry/sentry-react-native/pull/4023))
85
+ - Deprecating `enableSpotlight` and `spotlightSidecarUrl`
86
+
87
+ ### Dependencies
88
+
89
+ - Bump JavaScript SDK from v7.118.0 to v8.11.0 ([#3910](https://github.com/getsentry/sentry-react-native/pull/3910))
90
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#8110)
91
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.118.0...8.11.0)
92
+
93
+ ## 5.29.0
94
+
95
+ ### Features
96
+
97
+ - `TimeToInitialDisplay` and `TimeToFullDisplay` start the time to display spans on mount ([#4020](https://github.com/getsentry/sentry-react-native/pull/4020))
98
+
99
+ ### Fixed
100
+
101
+ - fix(ttid): End and measure TTID regardless current active span ([#4019](https://github.com/getsentry/sentry-react-native/pull/4019))
102
+ - Fixes possible missing TTID measurements and spans
103
+ - Fix crash when passing array as data to `Sentry.addBreadcrumb({ data: [] })` ([#4021](https://github.com/getsentry/sentry-react-native/pull/4021))
104
+ - The expected `data` type is plain JS object, otherwise the data might be lost.
105
+ - Fix `requireNativeComponent` missing in `react-native-web` ([#3958](https://github.com/getsentry/sentry-react-native/pull/3958))
106
+
107
+ ### Dependencies
108
+
109
+ - Bump JavaScript SDK from v7.117.0 to v7.118.0 ([#4018](https://github.com/getsentry/sentry-react-native/pull/4018))
110
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/v7/CHANGELOG.md#71180)
111
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.117.0...7.118.0)
112
+ - Bump Android SDK from v7.13.0 to v7.14.0 ([#4022](https://github.com/getsentry/sentry-react-native/pull/4022))
113
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7140)
114
+ - [diff](https://github.com/getsentry/sentry-java/compare/7.13.0...7.14.0)
115
+
3
116
  ## 5.28.0
4
117
 
5
118
  ### Fixes
@@ -54,5 +54,5 @@ android {
54
54
 
55
55
  dependencies {
56
56
  implementation 'com.facebook.react:react-native:+'
57
- api 'io.sentry:sentry-android:7.13.0'
57
+ api 'io.sentry:sentry-android:7.14.0'
58
58
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseClient } from '@sentry/core';
2
- import type { Envelope, Event, EventHint, SeverityLevel, UserFeedback } from '@sentry/types';
2
+ import type { Envelope, Event, EventHint, SeverityLevel, TransportMakeRequestResponse, UserFeedback } from '@sentry/types';
3
3
  import type { ReactNativeClientOptions } from './options';
4
4
  /**
5
5
  * The Sentry React Native SDK Client.
@@ -36,17 +36,13 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
36
36
  */
37
37
  captureUserFeedback(feedback: UserFeedback): void;
38
38
  /**
39
- * @inheritDoc
40
- */
41
- init(): void;
42
- /**
43
- * Sets up the integrations
39
+ * @inheritdoc
44
40
  */
45
- protected _setupIntegrations(): void;
41
+ sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse>;
46
42
  /**
47
- * @inheritdoc
43
+ * @inheritDoc
48
44
  */
49
- protected _sendEnvelope(envelope: Envelope): void;
45
+ init(): void;
50
46
  /**
51
47
  * Starts native client with dsn and options
52
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAGV,QAAQ,EACR,KAAK,EACL,SAAS,EAGT,aAAa,EAEb,YAAY,EACb,MAAM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iBAAkB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IACzE,OAAO,CAAC,eAAe,CAAY;IAEnC;;;OAGG;gBACgB,OAAO,EAAE,wBAAwB;IASpD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,GAAE,SAAc,GAAG,WAAW,CAAC,KAAK,CAAC;IAIvF;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAIrG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAUxD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,4BAA4B,CAAC;IAiClF;;OAEG;IACI,IAAI,IAAI,IAAI;IAKnB;;OAEG;IACH,OAAO,CAAC,cAAc;IA0BtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAa9B"}
package/dist/js/client.js CHANGED
@@ -2,10 +2,8 @@ import { eventFromException, eventFromMessage } from '@sentry/browser';
2
2
  import { BaseClient } from '@sentry/core';
3
3
  import { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';
4
4
  import { Alert } from 'react-native';
5
- import { createIntegration } from './integrations/factory';
6
5
  import { defaultSdkInfo } from './integrations/sdkinfo';
7
6
  import { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';
8
- import { ReactNativeTracing } from './tracing';
9
7
  import { createUserFeedbackEnvelope, items } from './utils/envelope';
10
8
  import { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';
11
9
  import { mergeOutcomes } from './utils/outcome';
@@ -38,21 +36,6 @@ export class ReactNativeClient extends BaseClient {
38
36
  * @inheritDoc
39
37
  */
40
38
  eventFromMessage(message, level, hint) {
41
- if (this._options.useThreadsForMessageStack) {
42
- return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then((event) => {
43
- var _a;
44
- // TMP! Remove this function once JS SDK uses threads for messages
45
- if (!((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || event.exception.values.length <= 0) {
46
- return event;
47
- }
48
- const values = event.exception.values.map((exception) => ({
49
- stacktrace: exception.stacktrace,
50
- }));
51
- event.threads = { values };
52
- delete event.exception;
53
- return event;
54
- });
55
- }
56
39
  return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
57
40
  }
58
41
  /**
@@ -80,35 +63,13 @@ export class ReactNativeClient extends BaseClient {
80
63
  dsn: this.getDsn(),
81
64
  tunnel: undefined,
82
65
  });
83
- this._sendEnvelope(envelope);
84
- }
85
- /**
86
- * @inheritDoc
87
- */
88
- init() {
89
- super.init();
90
- this._initNativeSdk();
91
- }
92
- /**
93
- * Sets up the integrations
94
- */
95
- _setupIntegrations() {
96
- var _a;
97
- super._setupIntegrations();
98
- const tracing = this.getIntegration(ReactNativeTracing);
99
- const routingName = (_a = tracing === null || tracing === void 0 ? void 0 : tracing.options.routingInstrumentation) === null || _a === void 0 ? void 0 : _a.name;
100
- if (routingName) {
101
- this.addIntegration(createIntegration(routingName));
102
- }
103
- const enableUserInteractionTracing = tracing === null || tracing === void 0 ? void 0 : tracing.options.enableUserInteractionTracing;
104
- if (enableUserInteractionTracing) {
105
- this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));
106
- }
66
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
67
+ this.sendEnvelope(envelope);
107
68
  }
108
69
  /**
109
70
  * @inheritdoc
110
71
  */
111
- _sendEnvelope(envelope) {
72
+ sendEnvelope(envelope) {
112
73
  const outcomes = this._clearOutcomes();
113
74
  this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);
114
75
  if (this._options.sendClientReports) {
@@ -135,6 +96,14 @@ export class ReactNativeClient extends BaseClient {
135
96
  if (shouldClearOutcomesBuffer) {
136
97
  this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact
137
98
  }
99
+ return Promise.resolve({});
100
+ }
101
+ /**
102
+ * @inheritDoc
103
+ */
104
+ init() {
105
+ super.init();
106
+ this._initNativeSdk();
138
107
  }
139
108
  /**
140
109
  * Starts native client with dsn and options
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAoC;IAGzE;;;OAGG;IACH,YAAmB,OAAiC;QAClD,sBAAsB,EAAE,CAAC;QACzB,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QAC5C,OAAO,CAAC,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} from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n if (this._options.useThreadsForMessageStack) {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Sets up the integrations\n */\n protected _setupIntegrations(): void {\n super._setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing = tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAA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C,QAAQ,EAAC,OAAO,mDAAG,EAAE,iBAAiB,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC;aACD,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
@@ -1,17 +1,12 @@
1
1
  export type { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
2
- export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metrics, } from '@sentry/core';
3
- export { Integrations as BrowserIntegrations, ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
4
- export { lastEventId } from '@sentry/browser';
5
- import * as Integrations from './integrations';
2
+ export { addBreadcrumb, captureException, captureEvent, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, } from '@sentry/core';
3
+ export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
6
4
  export * from './integrations/exports';
7
5
  export { SDK_NAME, SDK_VERSION } from './version';
8
6
  export type { ReactNativeOptions } from './options';
9
7
  export { ReactNativeClient } from './client';
10
- export { init, wrap, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback, withScope, configureScope, } from './sdk';
8
+ export { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope } from './sdk';
11
9
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
12
- export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
13
- export type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';
14
- export {
15
- /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */
16
- Integrations, };
10
+ export { reactNativeTracingIntegration, getCurrentReactNativeTracingIntegration, getReactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, startIdleNavigationSpan, startIdleSpan, getDefaultIdleNavigationSpanOptions, } from './tracing';
11
+ export type { TimeToDisplayProps } from './tracing';
17
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAGhB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EAGd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,YAAY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EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,IAAI,OAAO,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,GACpC,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC"}
package/dist/js/index.js CHANGED
@@ -1,26 +1,9 @@
1
- export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction,
2
- // v8 spans
3
- startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement,
4
- // v8 scopes
5
- getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metrics, } from '@sentry/core';
6
- import { _addTracingExtensions } from './tracing/addTracingExtensions';
7
- _addTracingExtensions();
8
- export { Integrations as BrowserIntegrations, ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
9
- export { lastEventId } from '@sentry/browser';
10
- import * as Integrations from './integrations';
1
+ export { addBreadcrumb, captureException, captureEvent, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, } from '@sentry/core';
2
+ export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
11
3
  export * from './integrations/exports';
12
4
  export { SDK_NAME, SDK_VERSION } from './version';
13
5
  export { ReactNativeClient } from './client';
14
- export { init, wrap,
15
- // eslint-disable-next-line deprecation/deprecation
16
- setDist,
17
- // eslint-disable-next-line deprecation/deprecation
18
- setRelease, nativeCrash, flush, close, captureUserFeedback, withScope, configureScope, } from './sdk';
6
+ export { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope } from './sdk';
19
7
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
20
- export { ReactNativeTracing, ReactNavigationV4Instrumentation,
21
- // eslint-disable-next-line deprecation/deprecation
22
- ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
23
- export {
24
- /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */
25
- Integrations, };
8
+ export { reactNativeTracingIntegration, getCurrentReactNativeTracingIntegration, getReactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, startIdleNavigationSpan, startIdleSpan, getDefaultIdleNavigationSpanOptions, } from './tracing';
26
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB;AAEhB,WAAW;AACX,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc;AAEd,YAAY;AACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,qBAAqB,EAAE,CAAC;AAExB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,IAAI;AACJ,mDAAmD;AACnD,OAAO;AACP,mDAAmD;AACnD,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL,mBAAmB,EACnB,SAAS,EACT,cAAc,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,gCAAgC;AAChC,mDAAmD;AACnD,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAInB,OAAO;AACL,sIAAsI;AACtI,YAAY,GACb,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startTransaction,\n\n // v8 spans\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n\n // v8 scopes\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metrics,\n} from '@sentry/core';\n\nimport { _addTracingExtensions } from './tracing/addTracingExtensions';\n_addTracingExtensions();\n\nexport {\n Integrations as BrowserIntegrations,\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport { lastEventId } from '@sentry/browser';\n\nimport * as Integrations from './integrations';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport {\n init,\n wrap,\n // eslint-disable-next-line deprecation/deprecation\n setDist,\n // eslint-disable-next-line deprecation/deprecation\n setRelease,\n nativeCrash,\n flush,\n close,\n captureUserFeedback,\n withScope,\n configureScope,\n} from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n ReactNativeTracing,\n ReactNavigationV4Instrumentation,\n // eslint-disable-next-line deprecation/deprecation\n ReactNavigationV5Instrumentation,\n ReactNavigationInstrumentation,\n ReactNativeNavigationInstrumentation,\n RoutingInstrumentation,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n} from './tracing';\n\nexport type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';\n\nexport {\n /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */\n Integrations,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,IAAI,OAAO,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,GACpC,MAAM,WAAW,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/types';\n\nexport {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metricsDefault as metrics,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n"]}
@@ -1,4 +1,4 @@
1
- import type { Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';
1
+ import type { Integration } from '@sentry/types';
2
2
  /**
3
3
  * React Native Error
4
4
  */
@@ -9,11 +9,5 @@ export type ReactNativeError = Error & {
9
9
  componentStack?: string;
10
10
  };
11
11
  /** Tries to symbolicate the JS stack trace on the device. */
12
- export declare const debugSymbolicatorIntegration: () => IntegrationFnResult;
13
- /**
14
- * Tries to symbolicate the JS stack trace on the device.
15
- *
16
- * @deprecated Use `debugSymbolicatorIntegration()` instead.
17
- */
18
- export declare const DebugSymbolicator: IntegrationClass<Integration>;
12
+ export declare const debugSymbolicatorIntegration: () => Integration;
19
13
  //# sourceMappingURL=debugsymbolicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicator.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,eAAe,CAAC;AAavB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,QAAO,mBAQ/C,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,iBAAiB,+BAGI,CAAC"}
1
+ {"version":3,"file":"debugsymbolicator.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,WAAW,EAAkC,MAAM,eAAe,CAAC;AAa9G;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,QAAO,WAQ/C,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { __awaiter } from "tslib";
2
- import { convertIntegrationFnToClass } from '@sentry/core';
3
2
  import { addContextToFrame, logger } from '@sentry/utils';
4
3
  import { getFramesToPop, isErrorLike } from '../utils/error';
5
4
  import { fetchSourceContext, getDevServer, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';
@@ -16,13 +15,6 @@ export const debugSymbolicatorIntegration = () => {
16
15
  processEvent,
17
16
  };
18
17
  };
19
- /**
20
- * Tries to symbolicate the JS stack trace on the device.
21
- *
22
- * @deprecated Use `debugSymbolicatorIntegration()` instead.
23
- */
24
- // eslint-disable-next-line deprecation/deprecation
25
- export const DebugSymbolicator = convertIntegrationFnToClass(INTEGRATION_NAME, debugSymbolicatorIntegration);
26
18
  function processEvent(event, hint) {
27
19
  var _a;
28
20
  return __awaiter(this, void 0, void 0, function* () {
@@ -64,7 +56,7 @@ function symbolicate(rawStack, skipFirstFrames = 0) {
64
56
  return null;
65
57
  }
66
58
  // This has been changed in an react-native version so stack is contained in here
67
- const newStack = prettyStack.stack || prettyStack;
59
+ const newStack = 'stack' in prettyStack ? prettyStack.stack : prettyStack;
68
60
  // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23
69
61
  // Match SentryParser which counts lines of stack (-1 for first line with the Error message)
70
62
  const skipFirstAdjustedToSentryStackParser = Math.max(sk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AAS;aACV;YAED,aAAa,GAAG,MAAM,kBAAkB,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;YACpE,IAAI,aAAa,EAAE;gBACjB,MAAM;aACP;SACF;QAED,IAAI,CAAC,aAAa,EAAE;YAClB,OAAO;SACR;QAED,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;;CACjC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,iBAA0B;IACnD,MAAM,GAAG,GAAG,iBAAkC,CAAC;IAC/C,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,IAAI,KAAK,GAA8B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE;QACxF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { convertIntegrationFnToClass } from '@sentry/core';\nimport type {\n Event,\n EventHint,\n Exception,\n Integration,\n IntegrationClass,\n IntegrationFnResult,\n StackFrame as SentryStackFrame,\n} from '@sentry/types';\nimport { addContextToFrame, logger } from '@sentry/utils';\n\nimport type { ExtendedError } from '../utils/error';\nimport { getFramesToPop, isErrorLike } from '../utils/error';\nimport type * as ReactNative from '../vendor/react-native';\nimport { fetchSourceContext, getDevServer, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';\n\nconst INTEGRATION_NAME = 'DebugSymbolicator';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\nconst INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\\\.js$', 'MessageQueue\\\\.js$'].join('|'));\n\n/**\n * React Native Error\n */\nexport type ReactNativeError = Error & {\n framesToPop?: number;\n jsEngine?: string;\n preventSymbolication?: boolean;\n componentStack?: string;\n};\n\n/** Tries to symbolicate the JS stack trace on the device. */\nexport const debugSymbolicatorIntegration = (): IntegrationFnResult => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\n/**\n * Tries to symbolicate the JS stack trace on the device.\n *\n * @deprecated Use `debugSymbolicatorIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const DebugSymbolicator = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n debugSymbolicatorIntegration,\n) as IntegrationClass<Integration>;\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n if (event.exception?.values && isErrorLike(hint.originalException)) {\n // originalException is ErrorLike object\n const errorGroup = getExceptionGroup(hint.originalException);\n for (const [index, error] of errorGroup.entries()) {\n const symbolicatedFrames = await symbolicate(error.stack, getFramesToPop(error));\n\n symbolicatedFrames && replaceExceptionFramesInException(event.exception.values[index], symbolicatedFrames);\n }\n } else if (hint.syntheticException && isErrorLike(hint.syntheticException)) {\n // syntheticException is Error object\n const symbolicatedFrames = await symbolicate(\n hint.syntheticException.stack,\n getFramesToPop(hint.syntheticException),\n );\n\n if (event.exception) {\n symbolicatedFrames &&\n event.exception.values &&\n replaceExceptionFramesInException(event.exception.values[0], symbolicatedFrames);\n } else if (event.threads) {\n // RN JS doesn't have threads\n symbolicatedFrames && replaceThreadFramesInEvent(event, symbolicatedFrames);\n }\n }\n\n return event;\n}\n\n/**\n * Symbolicates the stack on the device talking to local dev server.\n * Mutates the passed event.\n */\nasync function symbolicate(rawStack: string, skipFirstFrames: number = 0): Promise<SentryStackFrame[] | null> {\n try {\n const parsedStack = parseErrorStack(rawStack);\n\n const prettyStack = await symbolicateStackTrace(parsedStack);\n if (!prettyStack) {\n logger.error('React Native DevServer could not symbolicate the stack trace.');\n return null;\n }\n\n // This has been changed in an react-native version so stack is contained in here\n const newStack = prettyStack.stack || prettyStack;\n\n // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n // Match SentryParser which counts lines of stack (-1 for first line with the Error message)\n const skipFirstAdjustedToSentryStackParser = Math.max(skipFirstFrames - 1, 0);\n const stackWithoutPoppedFrames = skipFirstAdjustedToSentryStackParser\n ? newStack.slice(skipFirstAdjustedToSentryStackParser)\n : newStack;\n\n const stackWithoutInternalCallsites = stackWithoutPoppedFrames.filter(\n (frame: { file?: string }) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n );\n\n return await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);\n } catch (error) {\n if (error instanceof Error) {\n logger.warn(`Unable to symbolicate stack trace: ${error.message}`);\n }\n return null;\n }\n}\n\n/**\n * Converts ReactNativeFrames to frames in the Sentry format\n * @param frames ReactNativeFrame[]\n */\nasync function convertReactNativeFramesToSentryFrames(frames: ReactNative.StackFrame[]): Promise<SentryStackFrame[]> {\n return Promise.all(\n frames.map(async (frame: ReactNative.StackFrame): Promise<SentryStackFrame> => {\n let inApp = !!frame.column && !!frame.lineNumber;\n inApp =\n inApp &&\n frame.file !== undefined &&\n !frame.file.includes('node_modules') &&\n !frame.file.includes('native code');\n\n const newFrame: SentryStackFrame = {\n lineno: frame.lineNumber,\n colno: frame.column,\n filename: frame.file,\n function: frame.methodName,\n in_app: inApp,\n };\n\n if (inApp) {\n await addSourceContext(newFrame);\n }\n\n return newFrame;\n }),\n );\n}\n\n/**\n * Replaces the frames in the exception of a error.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceExceptionFramesInException(exception: Exception, frames: SentryStackFrame[]): void {\n if (exception?.stacktrace) {\n exception.stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Replaces the frames in the thread of a message.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {\n if (event.threads && event.threads.values && event.threads.values[0] && event.threads.values[0].stacktrace) {\n event.threads.values[0].stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * This tries to add source context for in_app Frames\n *\n * @param frame StackFrame\n * @param getDevServer function from RN to get DevServer URL\n */\nasync function addSourceContext(frame: SentryStackFrame): Promise<void> {\n let sourceContext: string | null = null;\n\n const segments = frame.filename?.split('/') ?? [];\n\n const serverUrl = getDevServer()?.url;\n if (!serverUrl) {\n return;\n }\n\n for (const idx in segments) {\n if (!Object.prototype.hasOwnProperty.call(segments, idx)) {\n continue;\n }\n\n sourceContext = await fetchSourceContext(serverUrl, segments, -idx);\n if (sourceContext) {\n break;\n }\n }\n\n if (!sourceContext) {\n return;\n }\n\n const lines = sourceContext.split('\\n');\n addContextToFrame(lines, frame);\n}\n\n/**\n * Return a list containing the original exception and also the cause if found.\n *\n * @param originalException The original exception.\n */\nfunction getExceptionGroup(originalException: unknown): (Error & { stack: string })[] {\n const err = originalException as ExtendedError;\n const errorGroup: (Error & { stack: string })[] = [];\n for (let cause: ExtendedError | undefined = err; isErrorLike(cause); cause = cause.cause) {\n errorGroup.push(cause);\n }\n return errorGroup;\n}\n"]}
1
+ {"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEpH,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,sEAAsE;AACtE,MAAM,wBAAwB,GAAG,IAAI,MAAM,CAAC,CAAC,+BAA+B,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAY/G,6DAA6D;AAC7D,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAgB,EAAE;IAC5D,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SA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AAE,CAAC;KAC9D;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAe,gBAAgB,CAAC,KAAuB;;;QACrD,IAAI,aAAa,GAAkB,IAAI,CAAC;QAExC,MAAM,QAAQ,GAAG,MAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,KAAK,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;QAElD,MAAM,SAAS,GAAG,MAAA,YAAY,EAAE,0CAAE,GAAG,CAAC;QACtC,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QAED,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE;gBACxD,SAAS;aACV;YAED,aAAa,GAAG,MAAM,kBAAkB,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;YACpE,IAAI,aAAa,EAAE;gBACjB,MAAM;aACP;SACF;QAED,IAAI,CAAC,aAAa,EAAE;YAClB,OAAO;SACR;QAED,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;;CACjC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,iBAA0B;IACnD,MAAM,GAAG,GAAG,iBAAkC,CAAC;IAC/C,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,IAAI,KAAK,GAA8B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE;QACxF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Event, EventHint, Exception, Integration, StackFrame as SentryStackFrame } from '@sentry/types';\nimport { addContextToFrame, logger } from '@sentry/utils';\n\nimport type { ExtendedError } from '../utils/error';\nimport { getFramesToPop, isErrorLike } from '../utils/error';\nimport type * as ReactNative from '../vendor/react-native';\nimport { fetchSourceContext, getDevServer, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';\n\nconst INTEGRATION_NAME = 'DebugSymbolicator';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\nconst INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\\\.js$', 'MessageQueue\\\\.js$'].join('|'));\n\n/**\n * React Native Error\n */\nexport type ReactNativeError = Error & {\n framesToPop?: number;\n jsEngine?: string;\n preventSymbolication?: boolean;\n componentStack?: string;\n};\n\n/** Tries to symbolicate the JS stack trace on the device. */\nexport const debugSymbolicatorIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n if (event.exception?.values && isErrorLike(hint.originalException)) {\n // originalException is ErrorLike object\n const errorGroup = getExceptionGroup(hint.originalException);\n for (const [index, error] of errorGroup.entries()) {\n const symbolicatedFrames = await symbolicate(error.stack, getFramesToPop(error));\n\n symbolicatedFrames && replaceExceptionFramesInException(event.exception.values[index], symbolicatedFrames);\n }\n } else if (hint.syntheticException && isErrorLike(hint.syntheticException)) {\n // syntheticException is Error object\n const symbolicatedFrames = await symbolicate(\n hint.syntheticException.stack,\n getFramesToPop(hint.syntheticException),\n );\n\n if (event.exception) {\n symbolicatedFrames &&\n event.exception.values &&\n replaceExceptionFramesInException(event.exception.values[0], symbolicatedFrames);\n } else if (event.threads) {\n // RN JS doesn't have threads\n symbolicatedFrames && replaceThreadFramesInEvent(event, symbolicatedFrames);\n }\n }\n\n return event;\n}\n\n/**\n * Symbolicates the stack on the device talking to local dev server.\n * Mutates the passed event.\n */\nasync function symbolicate(rawStack: string, skipFirstFrames: number = 0): Promise<SentryStackFrame[] | null> {\n try {\n const parsedStack = parseErrorStack(rawStack);\n\n const prettyStack = await symbolicateStackTrace(parsedStack);\n if (!prettyStack) {\n logger.error('React Native DevServer could not symbolicate the stack trace.');\n return null;\n }\n\n // This has been changed in an react-native version so stack is contained in here\n const newStack = 'stack' in prettyStack ? prettyStack.stack : prettyStack;\n\n // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n // Match SentryParser which counts lines of stack (-1 for first line with the Error message)\n const skipFirstAdjustedToSentryStackParser = Math.max(skipFirstFrames - 1, 0);\n const stackWithoutPoppedFrames = skipFirstAdjustedToSentryStackParser\n ? newStack.slice(skipFirstAdjustedToSentryStackParser)\n : newStack;\n\n const stackWithoutInternalCallsites = stackWithoutPoppedFrames.filter(\n (frame: { file?: string }) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n );\n\n return await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);\n } catch (error) {\n if (error instanceof Error) {\n logger.warn(`Unable to symbolicate stack trace: ${error.message}`);\n }\n return null;\n }\n}\n\n/**\n * Converts ReactNativeFrames to frames in the Sentry format\n * @param frames ReactNativeFrame[]\n */\nasync function convertReactNativeFramesToSentryFrames(frames: ReactNative.StackFrame[]): Promise<SentryStackFrame[]> {\n return Promise.all(\n frames.map(async (frame: ReactNative.StackFrame): Promise<SentryStackFrame> => {\n let inApp = !!frame.column && !!frame.lineNumber;\n inApp =\n inApp &&\n frame.file !== undefined &&\n !frame.file.includes('node_modules') &&\n !frame.file.includes('native code');\n\n const newFrame: SentryStackFrame = {\n lineno: frame.lineNumber,\n colno: frame.column,\n filename: frame.file,\n function: frame.methodName,\n in_app: inApp,\n };\n\n if (inApp) {\n await addSourceContext(newFrame);\n }\n\n return newFrame;\n }),\n );\n}\n\n/**\n * Replaces the frames in the exception of a error.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceExceptionFramesInException(exception: Exception, frames: SentryStackFrame[]): void {\n if (exception?.stacktrace) {\n exception.stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Replaces the frames in the thread of a message.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {\n if (event.threads && event.threads.values && event.threads.values[0] && event.threads.values[0].stacktrace) {\n event.threads.values[0].stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * This tries to add source context for in_app Frames\n *\n * @param frame StackFrame\n * @param getDevServer function from RN to get DevServer URL\n */\nasync function addSourceContext(frame: SentryStackFrame): Promise<void> {\n let sourceContext: string | null = null;\n\n const segments = frame.filename?.split('/') ?? [];\n\n const serverUrl = getDevServer()?.url;\n if (!serverUrl) {\n return;\n }\n\n for (const idx in segments) {\n if (!Object.prototype.hasOwnProperty.call(segments, idx)) {\n continue;\n }\n\n sourceContext = await fetchSourceContext(serverUrl, segments, -idx);\n if (sourceContext) {\n break;\n }\n }\n\n if (!sourceContext) {\n return;\n }\n\n const lines = sourceContext.split('\\n');\n addContextToFrame(lines, frame);\n}\n\n/**\n * Return a list containing the original exception and also the cause if found.\n *\n * @param originalException The original exception.\n */\nfunction getExceptionGroup(originalException: unknown): (Error & { stack: string })[] {\n const err = originalException as ExtendedError;\n const errorGroup: (Error & { stack: string })[] = [];\n for (let cause: ExtendedError | undefined = err; isErrorLike(cause); cause = cause.cause) {\n errorGroup.push(cause);\n }\n return errorGroup;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAgC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAuFvF"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAoC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAgGvF"}
@@ -1,6 +1,6 @@
1
- import { ReactNativeTracing } from '../tracing';
1
+ import { reactNativeTracingIntegration } from '../tracing';
2
2
  import { isExpoGo, notWeb } from '../utils/environment';
3
- import { breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, browserReplayIntegration, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, viewHierarchyIntegration, } from './exports';
3
+ import { appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, browserReplayIntegration, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeFramesIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
4
4
  import { createReactNativeRewriteFrames } from './rewriteframes';
5
5
  /**
6
6
  * Returns the default ReactNative integrations based on the current environment.
@@ -56,8 +56,20 @@ export function getDefaultIntegrations(options) {
56
56
  const hasTracingEnabled = options.enableTracing ||
57
57
  typeof options.tracesSampleRate === 'number' ||
58
58
  typeof options.tracesSampler === 'function';
59
+ if (hasTracingEnabled && options.enableAppStartTracking) {
60
+ integrations.push(appStartIntegration());
61
+ }
62
+ if (hasTracingEnabled && options.enableNativeFramesTracking) {
63
+ integrations.push(nativeFramesIntegration());
64
+ }
65
+ if (hasTracingEnabled && options.enableStallTracking) {
66
+ integrations.push(stallTrackingIntegration());
67
+ }
68
+ if (hasTracingEnabled && options.enableUserInteractionTracing) {
69
+ integrations.push(userInteractionIntegration());
70
+ }
59
71
  if (hasTracingEnabled && options.enableAutoPerformanceTracing) {
60
- integrations.push(new ReactNativeTracing());
72
+ integrations.push(reactNativeTracingIntegration());
61
73
  }
62
74
  if (options.enableCaptureFailedRequests) {
63
75
  integrations.push(httpClientIntegration());
@@ -65,10 +77,9 @@ export function getDefaultIntegrations(options) {
65
77
  if (isExpoGo()) {
66
78
  integrations.push(expoContextIntegration());
67
79
  }
68
- if (options.enableSpotlight) {
69
- integrations.push(spotlightIntegration({
70
- sidecarUrl: options.spotlightSidecarUrl,
71
- }));
80
+ if (options.spotlight || options.enableSpotlight) {
81
+ const sidecarUrl = (typeof options.spotlight === 'string' && options.spotlight) || options.spotlightSidecarUrl;
82
+ integrations.push(spotlightIntegration({ sidecarUrl }));
72
83
  }
73
84
  if ((options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
74
85
  (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')) {
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB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AAQ,EAAE,EAAE;QACd,YAAY,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;KAC7C;IAED,IAAI,OAAO,CAAC,eAAe,EAAE;QAC3B,YAAY,CAAC,IAAI,CACf,oBAAoB,CAAC;YACnB,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC,CAAC,CACH,CAAC;KACH;IAED,IACE,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,EAC3F;QACA,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,MAAM,EAAE,EAAE;YACZ,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;YACpG,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;SACtG;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { BrowserOptions } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n browserReplayIntegration,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n viewHierarchyIntegration,\n} from './exports';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.enableSpotlight) {\n integrations.push(\n spotlightIntegration({\n sidecarUrl: options.spotlightSidecarUrl,\n }),\n );\n }\n\n if (\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')\n ) {\n integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());\n if (!notWeb()) {\n (options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n (options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n }\n\n return integrations;\n}\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,8BAA8B,E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,EAAE,CAAC,CAAC;KACpD;IACD,IAAI,OAAO,CAAC,2BAA2B,EAAE;QACvC,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;KAC5C;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,YAAY,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;KAC7C;IAED,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,eAAe,EAAE;QAChD,MAAM,UAAU,GAAG,CAAC,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,mBAAmB,CAAC;QAC/G,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;KACzD;IAED,IACE,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,EAC3F;QACA,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,MAAM,EAAE,EAAE;YACZ,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;YACpG,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;SACtG;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { BrowserOptions } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n browserReplayIntegration,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeFramesIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking) {\n integrations.push(appStartIntegration());\n }\n if (hasTracingEnabled && options.enableNativeFramesTracking) {\n integrations.push(nativeFramesIntegration());\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(reactNativeTracingIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.spotlight || options.enableSpotlight) {\n const sidecarUrl = (typeof options.spotlight === 'string' && options.spotlight) || options.spotlightSidecarUrl;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n if (\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')\n ) {\n integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());\n if (!notWeb()) {\n (options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n (options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n }\n\n return integrations;\n}\n"]}