@sentry/react-native 6.4.0 → 6.5.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 (301) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +31 -22
  4. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +8 -0
  5. package/dist/js/NativeRNSentry.d.ts +1 -1
  6. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  7. package/dist/js/NativeRNSentry.js.map +1 -1
  8. package/dist/js/breadcrumb.d.ts +1 -1
  9. package/dist/js/breadcrumb.d.ts.map +1 -1
  10. package/dist/js/breadcrumb.js +1 -1
  11. package/dist/js/breadcrumb.js.map +1 -1
  12. package/dist/js/client.d.ts +2 -1
  13. package/dist/js/client.d.ts.map +1 -1
  14. package/dist/js/client.js +2 -2
  15. package/dist/js/client.js.map +1 -1
  16. package/dist/js/index.d.ts +2 -2
  17. package/dist/js/index.d.ts.map +1 -1
  18. package/dist/js/index.js +1 -1
  19. package/dist/js/index.js.map +1 -1
  20. package/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  21. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  22. package/dist/js/integrations/debugsymbolicator.js +1 -1
  23. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  24. package/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
  25. package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
  26. package/dist/js/integrations/debugsymbolicatorutils.js +1 -1
  27. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  28. package/dist/js/integrations/default.d.ts +1 -1
  29. package/dist/js/integrations/default.d.ts.map +1 -1
  30. package/dist/js/integrations/default.js +13 -12
  31. package/dist/js/integrations/default.js.map +1 -1
  32. package/dist/js/integrations/devicecontext.d.ts +1 -1
  33. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  34. package/dist/js/integrations/devicecontext.js +1 -1
  35. package/dist/js/integrations/devicecontext.js.map +1 -1
  36. package/dist/js/integrations/eventorigin.d.ts +1 -1
  37. package/dist/js/integrations/eventorigin.d.ts.map +1 -1
  38. package/dist/js/integrations/eventorigin.js.map +1 -1
  39. package/dist/js/integrations/expocontext.d.ts +1 -1
  40. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  41. package/dist/js/integrations/expocontext.js.map +1 -1
  42. package/dist/js/integrations/factory.d.ts +1 -1
  43. package/dist/js/integrations/factory.d.ts.map +1 -1
  44. package/dist/js/integrations/factory.js.map +1 -1
  45. package/dist/js/integrations/modulesloader.d.ts +1 -1
  46. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  47. package/dist/js/integrations/modulesloader.js +1 -1
  48. package/dist/js/integrations/modulesloader.js.map +1 -1
  49. package/dist/js/integrations/nativelinkederrors.d.ts +1 -1
  50. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  51. package/dist/js/integrations/nativelinkederrors.js +1 -1
  52. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  53. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  54. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  55. package/dist/js/integrations/reactnativeerrorhandlers.js +1 -2
  56. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  57. package/dist/js/integrations/reactnativeerrorhandlersutils.js +1 -1
  58. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  59. package/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  60. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  61. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  62. package/dist/js/integrations/release.d.ts +1 -1
  63. package/dist/js/integrations/release.d.ts.map +1 -1
  64. package/dist/js/integrations/release.js.map +1 -1
  65. package/dist/js/integrations/rewriteframes.d.ts +1 -1
  66. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  67. package/dist/js/integrations/rewriteframes.js.map +1 -1
  68. package/dist/js/integrations/screenshot.d.ts +1 -1
  69. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  70. package/dist/js/integrations/screenshot.js.map +1 -1
  71. package/dist/js/integrations/sdkinfo.d.ts +1 -1
  72. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  73. package/dist/js/integrations/sdkinfo.js +1 -1
  74. package/dist/js/integrations/sdkinfo.js.map +1 -1
  75. package/dist/js/integrations/spotlight.d.ts +1 -1
  76. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  77. package/dist/js/integrations/spotlight.js +1 -1
  78. package/dist/js/integrations/spotlight.js.map +1 -1
  79. package/dist/js/integrations/viewhierarchy.d.ts +1 -1
  80. package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
  81. package/dist/js/integrations/viewhierarchy.js +1 -1
  82. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  83. package/dist/js/misc.d.ts +1 -1
  84. package/dist/js/misc.d.ts.map +1 -1
  85. package/dist/js/misc.js.map +1 -1
  86. package/dist/js/options.d.ts +18 -6
  87. package/dist/js/options.d.ts.map +1 -1
  88. package/dist/js/options.js.map +1 -1
  89. package/dist/js/profiling/cache.d.ts.map +1 -1
  90. package/dist/js/profiling/cache.js +53 -1
  91. package/dist/js/profiling/cache.js.map +1 -1
  92. package/dist/js/profiling/convertHermesProfile.d.ts +1 -1
  93. package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
  94. package/dist/js/profiling/convertHermesProfile.js +1 -1
  95. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  96. package/dist/js/profiling/debugid.d.ts +1 -1
  97. package/dist/js/profiling/debugid.d.ts.map +1 -1
  98. package/dist/js/profiling/debugid.js +1 -1
  99. package/dist/js/profiling/debugid.js.map +1 -1
  100. package/dist/js/profiling/integration.d.ts +1 -1
  101. package/dist/js/profiling/integration.d.ts.map +1 -1
  102. package/dist/js/profiling/integration.js +1 -3
  103. package/dist/js/profiling/integration.js.map +1 -1
  104. package/dist/js/profiling/types.d.ts +1 -1
  105. package/dist/js/profiling/types.d.ts.map +1 -1
  106. package/dist/js/profiling/types.js.map +1 -1
  107. package/dist/js/profiling/utils.d.ts +1 -1
  108. package/dist/js/profiling/utils.d.ts.map +1 -1
  109. package/dist/js/profiling/utils.js +1 -1
  110. package/dist/js/profiling/utils.js.map +1 -1
  111. package/dist/js/replay/CustomMask.js +1 -1
  112. package/dist/js/replay/CustomMask.js.map +1 -1
  113. package/dist/js/replay/mobilereplay.d.ts +3 -5
  114. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  115. package/dist/js/replay/mobilereplay.js +3 -5
  116. package/dist/js/replay/mobilereplay.js.map +1 -1
  117. package/dist/js/replay/networkUtils.d.ts +1 -0
  118. package/dist/js/replay/networkUtils.d.ts.map +1 -1
  119. package/dist/js/replay/xhrUtils.d.ts +1 -1
  120. package/dist/js/replay/xhrUtils.d.ts.map +1 -1
  121. package/dist/js/replay/xhrUtils.js +1 -1
  122. package/dist/js/replay/xhrUtils.js.map +1 -1
  123. package/dist/js/scopeSync.d.ts +1 -1
  124. package/dist/js/scopeSync.d.ts.map +1 -1
  125. package/dist/js/scopeSync.js.map +1 -1
  126. package/dist/js/sdk.d.ts +2 -1
  127. package/dist/js/sdk.d.ts.map +1 -1
  128. package/dist/js/sdk.js +9 -5
  129. package/dist/js/sdk.js.map +1 -1
  130. package/dist/js/tools/ModulesCollector.js +13 -13
  131. package/dist/js/tools/ModulesCollector.js.map +1 -1
  132. package/dist/js/tools/enableLogger.js +2 -2
  133. package/dist/js/tools/enableLogger.js.map +1 -1
  134. package/dist/js/tools/metroMiddleware.js +8 -8
  135. package/dist/js/tools/metroMiddleware.js.map +1 -1
  136. package/dist/js/tools/metroconfig.js +4 -4
  137. package/dist/js/tools/metroconfig.js.map +1 -1
  138. package/dist/js/tools/sentryBabelTransformerUtils.js +3 -3
  139. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  140. package/dist/js/touchevents.d.ts.map +1 -1
  141. package/dist/js/touchevents.js +1 -2
  142. package/dist/js/touchevents.js.map +1 -1
  143. package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
  144. package/dist/js/tracing/gesturetracing.js +1 -2
  145. package/dist/js/tracing/gesturetracing.js.map +1 -1
  146. package/dist/js/tracing/integrations/appStart.d.ts +1 -1
  147. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  148. package/dist/js/tracing/integrations/appStart.js +1 -3
  149. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  150. package/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
  151. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
  152. package/dist/js/tracing/integrations/nativeFrames.js +1 -1
  153. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  154. package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  155. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
  156. package/dist/js/tracing/integrations/stalltracking.js +1 -3
  157. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  158. package/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
  159. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
  160. package/dist/js/tracing/integrations/userInteraction.js +1 -2
  161. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  162. package/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
  163. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
  164. package/dist/js/tracing/onSpanEndUtils.js +1 -2
  165. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  166. package/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  167. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  168. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  169. package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
  170. package/dist/js/tracing/reactnativeprofiler.js +1 -1
  171. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  172. package/dist/js/tracing/reactnativetracing.d.ts +1 -1
  173. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  174. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  175. package/dist/js/tracing/reactnavigation.d.ts +1 -1
  176. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  177. package/dist/js/tracing/reactnavigation.js +1 -3
  178. package/dist/js/tracing/reactnavigation.js.map +1 -1
  179. package/dist/js/tracing/span.d.ts +3 -4
  180. package/dist/js/tracing/span.d.ts.map +1 -1
  181. package/dist/js/tracing/span.js +3 -3
  182. package/dist/js/tracing/span.js.map +1 -1
  183. package/dist/js/tracing/timetodisplay.d.ts +1 -1
  184. package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
  185. package/dist/js/tracing/timetodisplay.js +1 -2
  186. package/dist/js/tracing/timetodisplay.js.map +1 -1
  187. package/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
  188. package/dist/js/tracing/timetodisplaynative.types.d.ts.map +1 -1
  189. package/dist/js/tracing/types.d.ts +1 -1
  190. package/dist/js/tracing/types.d.ts.map +1 -1
  191. package/dist/js/tracing/types.js.map +1 -1
  192. package/dist/js/tracing/utils.d.ts +1 -1
  193. package/dist/js/tracing/utils.d.ts.map +1 -1
  194. package/dist/js/tracing/utils.js +1 -2
  195. package/dist/js/tracing/utils.js.map +1 -1
  196. package/dist/js/transports/native.d.ts +1 -2
  197. package/dist/js/transports/native.d.ts.map +1 -1
  198. package/dist/js/transports/native.js +1 -1
  199. package/dist/js/transports/native.js.map +1 -1
  200. package/dist/js/user.d.ts +1 -1
  201. package/dist/js/user.d.ts.map +1 -1
  202. package/dist/js/user.js.map +1 -1
  203. package/dist/js/utils/clientutils.d.ts +1 -1
  204. package/dist/js/utils/clientutils.d.ts.map +1 -1
  205. package/dist/js/utils/clientutils.js.map +1 -1
  206. package/dist/js/utils/envelope.d.ts +1 -1
  207. package/dist/js/utils/envelope.d.ts.map +1 -1
  208. package/dist/js/utils/envelope.js +1 -1
  209. package/dist/js/utils/envelope.js.map +1 -1
  210. package/dist/js/utils/fill.d.ts +1 -1
  211. package/dist/js/utils/fill.js +2 -2
  212. package/dist/js/utils/fill.js.map +1 -1
  213. package/dist/js/utils/normalize.js +1 -1
  214. package/dist/js/utils/normalize.js.map +1 -1
  215. package/dist/js/utils/outcome.d.ts +1 -1
  216. package/dist/js/utils/outcome.d.ts.map +1 -1
  217. package/dist/js/utils/outcome.js.map +1 -1
  218. package/dist/js/utils/safe.js +1 -1
  219. package/dist/js/utils/safe.js.map +1 -1
  220. package/dist/js/utils/sentryeventemitter.js +1 -1
  221. package/dist/js/utils/sentryeventemitter.js.map +1 -1
  222. package/dist/js/utils/sentryeventemitterfallback.js +1 -1
  223. package/dist/js/utils/sentryeventemitterfallback.js.map +1 -1
  224. package/dist/js/utils/span.d.ts +1 -1
  225. package/dist/js/utils/span.d.ts.map +1 -1
  226. package/dist/js/utils/span.js.map +1 -1
  227. package/dist/js/utils/worldwide.d.ts +1 -1
  228. package/dist/js/utils/worldwide.d.ts.map +1 -1
  229. package/dist/js/utils/worldwide.js +1 -1
  230. package/dist/js/utils/worldwide.js.map +1 -1
  231. package/dist/js/vendor/react-native/index.d.ts +1 -0
  232. package/dist/js/vendor/react-native/index.d.ts.map +1 -1
  233. package/dist/js/version.d.ts +1 -1
  234. package/dist/js/version.js +1 -1
  235. package/dist/js/version.js.map +1 -1
  236. package/dist/js/wrapper.d.ts +1 -1
  237. package/dist/js/wrapper.d.ts.map +1 -1
  238. package/dist/js/wrapper.js +1 -1
  239. package/dist/js/wrapper.js.map +1 -1
  240. package/ios/RNSentry.mm +1 -1
  241. package/ios/RNSentryReplay.mm +8 -17
  242. package/package.json +17 -17
  243. package/scripts/expo-upload-sourcemaps.js +6 -2
  244. package/src/js/NativeRNSentry.ts +1 -1
  245. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
  246. package/ts3.8/dist/js/breadcrumb.d.ts +1 -1
  247. package/ts3.8/dist/js/client.d.ts +2 -1
  248. package/ts3.8/dist/js/index.d.ts +2 -2
  249. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  250. package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
  251. package/ts3.8/dist/js/integrations/default.d.ts +1 -1
  252. package/ts3.8/dist/js/integrations/devicecontext.d.ts +1 -1
  253. package/ts3.8/dist/js/integrations/eventorigin.d.ts +1 -1
  254. package/ts3.8/dist/js/integrations/expocontext.d.ts +1 -1
  255. package/ts3.8/dist/js/integrations/factory.d.ts +1 -1
  256. package/ts3.8/dist/js/integrations/modulesloader.d.ts +1 -1
  257. package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +1 -1
  258. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  259. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  260. package/ts3.8/dist/js/integrations/release.d.ts +1 -1
  261. package/ts3.8/dist/js/integrations/rewriteframes.d.ts +1 -1
  262. package/ts3.8/dist/js/integrations/screenshot.d.ts +1 -1
  263. package/ts3.8/dist/js/integrations/sdkinfo.d.ts +1 -1
  264. package/ts3.8/dist/js/integrations/spotlight.d.ts +1 -1
  265. package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +1 -1
  266. package/ts3.8/dist/js/misc.d.ts +1 -1
  267. package/ts3.8/dist/js/options.d.ts +18 -6
  268. package/ts3.8/dist/js/profiling/convertHermesProfile.d.ts +1 -1
  269. package/ts3.8/dist/js/profiling/debugid.d.ts +1 -1
  270. package/ts3.8/dist/js/profiling/integration.d.ts +1 -1
  271. package/ts3.8/dist/js/profiling/types.d.ts +1 -1
  272. package/ts3.8/dist/js/profiling/utils.d.ts +1 -1
  273. package/ts3.8/dist/js/replay/mobilereplay.d.ts +3 -5
  274. package/ts3.8/dist/js/replay/networkUtils.d.ts +1 -0
  275. package/ts3.8/dist/js/replay/xhrUtils.d.ts +1 -1
  276. package/ts3.8/dist/js/scopeSync.d.ts +1 -1
  277. package/ts3.8/dist/js/sdk.d.ts +2 -1
  278. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
  279. package/ts3.8/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
  280. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  281. package/ts3.8/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
  282. package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
  283. package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  284. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +1 -1
  285. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +1 -1
  286. package/ts3.8/dist/js/tracing/span.d.ts +3 -4
  287. package/ts3.8/dist/js/tracing/timetodisplay.d.ts +1 -1
  288. package/ts3.8/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
  289. package/ts3.8/dist/js/tracing/types.d.ts +1 -1
  290. package/ts3.8/dist/js/tracing/utils.d.ts +1 -1
  291. package/ts3.8/dist/js/transports/native.d.ts +1 -2
  292. package/ts3.8/dist/js/user.d.ts +1 -1
  293. package/ts3.8/dist/js/utils/clientutils.d.ts +1 -1
  294. package/ts3.8/dist/js/utils/envelope.d.ts +1 -1
  295. package/ts3.8/dist/js/utils/fill.d.ts +1 -1
  296. package/ts3.8/dist/js/utils/outcome.d.ts +1 -1
  297. package/ts3.8/dist/js/utils/span.d.ts +1 -1
  298. package/ts3.8/dist/js/utils/worldwide.d.ts +1 -1
  299. package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -0
  300. package/ts3.8/dist/js/version.d.ts +1 -1
  301. package/ts3.8/dist/js/wrapper.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"reactnavigation.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnavigation.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EACL,aAAa,EACb,aAAa,EACb,SAAS,EACT,4BAA4B,EAC5B,gCA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GAAG,CAAC,CAAC;QAE1B,IAAI,eAAe,CAAC,MAAM,GAAG,2BAA2B,EAAE;YACxD,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,2BAA2B,CAAC,CAAC;SAC/F;IACH,CAAC,CAAC;IAEF,wEAAwE;IACxE,MAAM,yBAAyB,GAAG,GAAS,EAAE;QAC3C,IAAI,oBAAoB,EAAE;YACxB,IAAI,YAAY,CAAC,oBAAoB,CAAC,EAAE;gBACtC,oBAAoB,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;aAC1C;YACD,qCAAqC;YACrC,oBAAoB,CAAC,GAAG,EAAE,CAAC;YAC3B,oBAAoB,GAAG,SAAS,CAAC;SAClC;QACD,IAAI,wBAAwB,EAAE;YAC5B,wBAAwB,GAAG,SAAS,CAAC;SACtC;IACH,CAAC,CAAC;IAEF,MAAM,uBAAuB,GAAG,GAAS,EAAE;QACzC,IAAI,OAAO,kBAAkB,KAAK,WAAW,EAAE;YAC7C,YAAY,CAAC,kBAAkB,CAAC,CAAC;YACjC,kBAAkB,GAAG,SAAS,CAAC;SAChC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,aAAa;QACb,2BAA2B;KAC5B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport {\n addBreadcrumb,\n getActiveSpan,\n getClient,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_OK,\n spanToJSON,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { Client, Integration, Span } from '@sentry/types';\nimport { isPlainObject, logger, timestampInSeconds } from '@sentry/utils';\n\nimport type { NewFrameEvent } from '../utils/sentryeventemitter';\nimport type { SentryEventEmitterFallback } from '../utils/sentryeventemitterfallback';\nimport { createSentryFallbackEventEmitter } from '../utils/sentryeventemitterfallback';\nimport { isSentrySpan } from '../utils/span';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { NATIVE } from '../wrapper';\nimport { ignoreEmptyBackNavigation } from './onSpanEndUtils';\nimport { SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION } from './origin';\nimport type { ReactNativeTracingIntegration } from './reactnativetracing';\nimport { getReactNativeTracingIntegration } from './reactnativetracing';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from './semanticAttributes';\nimport {\n DEFAULT_NAVIGATION_SPAN_NAME,\n defaultIdleOptions,\n getDefaultIdleNavigationSpanOptions,\n startIdleNavigationSpan as startGenericIdleNavigationSpan,\n} from './span';\nimport { manualInitialDisplaySpans, startTimeToInitialDisplaySpan } from './timetodisplay';\nimport { setSpanDurationAsMeasurementOnSpan } from './utils';\nexport const INTEGRATION_NAME = 'ReactNavigation';\n\nconst NAVIGATION_HISTORY_MAX_SIZE = 200;\n\ninterface ReactNavigationIntegrationOptions {\n /**\n * How long the instrumentation will wait for the route to mount after a change has been initiated,\n * before the transaction is discarded.\n *\n * @default 1_000 (ms)\n */\n routeChangeTimeoutMs: number;\n\n /**\n * Time to initial display measures the time it takes from\n * navigation dispatch to the render of the first frame of the new screen.\n *\n * @default false\n */\n enableTimeToInitialDisplay: boolean;\n\n /**\n * Does not sample transactions that are from routes that have been seen any more and don't have any spans.\n * This removes a lot of the clutter as most back navigation transactions are now ignored.\n *\n * @default true\n */\n ignoreEmptyBackNavigationTransactions: boolean;\n}\n\n/**\n * Instrumentation for React-Navigation V5 and above. See docs or sample app for usage.\n *\n * How this works:\n * - `_onDispatch` is called every time a dispatch happens and sets an IdleTransaction on the scope without any route context.\n * - `_onStateChange` is then called AFTER the state change happens due to a dispatch and sets the route context onto the active transaction.\n * - If `_onStateChange` isn't called within `STATE_CHANGE_TIMEOUT_DURATION` of the dispatch, then the transaction is not sampled and finished.\n */\nexport const reactNavigationIntegration = ({\n routeChangeTimeoutMs = 1_000,\n enableTimeToInitialDisplay = false,\n ignoreEmptyBackNavigationTransactions = true,\n}: Partial<ReactNavigationIntegrationOptions> = {}): Integration & {\n /**\n * Pass the ref to the navigation container to register it to the instrumentation\n * @param navigationContainerRef Ref to a `NavigationContainer`\n */\n registerNavigationContainer: (navigationContainerRef: unknown) => void;\n} => {\n let navigationContainer: NavigationContainer | undefined;\n let newScreenFrameEventEmitter: SentryEventEmitterFallback | undefined;\n\n let tracing: ReactNativeTracingIntegration | undefined;\n let idleSpanOptions: Parameters<typeof startGenericIdleNavigationSpan>[1] = defaultIdleOptions;\n let latestRoute: NavigationRoute | undefined;\n\n let latestNavigationSpan: Span | undefined;\n let navigationProcessingSpan: Span | undefined;\n\n let initialStateHandled: boolean = false;\n let stateChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n let recentRouteKeys: string[] = [];\n\n if (enableTimeToInitialDisplay) {\n newScreenFrameEventEmitter = createSentryFallbackEventEmitter();\n newScreenFrameEventEmitter.initAsync();\n NATIVE.initNativeReactNavigationNewFrameTracking().catch((reason: unknown) => {\n logger.error(`${INTEGRATION_NAME} Failed to initialize native new frame tracking: ${reason}`);\n });\n }\n\n /**\n * Set the initial state and start initial navigation span for the current screen.\n */\n const afterAllSetup = (client: Client): void => {\n tracing = getReactNativeTracingIntegration(client);\n if (tracing) {\n idleSpanOptions = {\n finalTimeout: tracing.options.finalTimeoutMs,\n idleTimeout: tracing.options.idleTimeoutMs,\n };\n }\n\n if (initialStateHandled) {\n // We create an initial state here to ensure a transaction gets created before the first route mounts.\n return undefined;\n }\n\n startIdleNavigationSpan();\n\n if (!navigationContainer) {\n // This is expected as navigation container is registered after the root component is mounted.\n return undefined;\n }\n\n // Navigation container already registered, just populate with route state\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n const registerNavigationContainer = (navigationContainerRef: unknown): void => {\n /* We prevent duplicate routing instrumentation to be initialized on fast refreshes\n\n Explanation: If the user triggers a fast refresh on the file that the instrumentation is\n initialized in, it will initialize a new instance and will cause undefined behavior.\n */\n if (RN_GLOBAL_OBJ.__sentry_rn_v5_registered) {\n logger.log(\n `${INTEGRATION_NAME} Instrumentation already exists, but register has been called again, doing nothing.`,\n );\n return undefined;\n }\n\n if (isPlainObject(navigationContainerRef) && 'current' in navigationContainerRef) {\n navigationContainer = navigationContainerRef.current as NavigationContainer;\n } else {\n navigationContainer = navigationContainerRef as NavigationContainer;\n }\n if (!navigationContainer) {\n logger.warn(`${INTEGRATION_NAME} Received invalid navigation container ref!`);\n return undefined;\n }\n\n // This action is emitted on every dispatch\n navigationContainer.addListener('__unsafe_action__', startIdleNavigationSpan);\n navigationContainer.addListener('state', updateLatestNavigationSpanWithCurrentRoute);\n RN_GLOBAL_OBJ.__sentry_rn_v5_registered = true;\n\n if (initialStateHandled) {\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n logger.log(`${INTEGRATION_NAME} Navigation container registered, but integration has not been setup yet.`);\n return undefined;\n }\n\n // Navigation Container is registered after the first navigation\n // Initial navigation span was started, after integration setup,\n // so now we populate it with the current route.\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n /**\n * To be called on every React-Navigation action dispatch.\n * It does not name the transaction or populate it with route information. Instead, it waits for the state to fully change\n * and gets the route information from there, @see updateLatestNavigationSpanWithCurrentRoute\n */\n const startIdleNavigationSpan = (): void => {\n if (latestNavigationSpan) {\n logger.log(`${INTEGRATION_NAME} A transaction was detected that turned out to be a noop, discarding.`);\n _discardLatestTransaction();\n clearStateChangeTimeout();\n }\n\n latestNavigationSpan = startGenericIdleNavigationSpan(\n tracing && tracing.options.beforeStartSpan\n ? tracing.options.beforeStartSpan(getDefaultIdleNavigationSpanOptions())\n : getDefaultIdleNavigationSpanOptions(),\n idleSpanOptions,\n );\n latestNavigationSpan?.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION);\n if (ignoreEmptyBackNavigationTransactions) {\n ignoreEmptyBackNavigation(getClient(), latestNavigationSpan);\n }\n\n if (enableTimeToInitialDisplay) {\n navigationProcessingSpan = startInactiveSpan({\n op: 'navigation.processing',\n name: 'Navigation processing',\n startTime: latestNavigationSpan && spanToJSON(latestNavigationSpan).start_timestamp,\n });\n navigationProcessingSpan.setAttribute(\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION,\n );\n }\n\n stateChangeTimeout = setTimeout(_discardLatestTransaction, routeChangeTimeoutMs);\n };\n\n /**\n * To be called AFTER the state has been changed to populate the transaction with the current route.\n */\n const updateLatestNavigationSpanWithCurrentRoute = (): void => {\n const stateChangedTimestamp = timestampInSeconds();\n const previousRoute = latestRoute;\n\n if (!navigationContainer) {\n logger.warn(`${INTEGRATION_NAME} Missing navigation container ref. Route transactions will not be sent.`);\n return undefined;\n }\n\n const route = navigationContainer.getCurrentRoute();\n if (!route) {\n logger.debug(`[${INTEGRATION_NAME}] Navigation state changed, but no route is rendered.`);\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n logger.debug(\n `[${INTEGRATION_NAME}] Navigation state changed, but navigation transaction was not started on dispatch.`,\n );\n return undefined;\n }\n\n if (previousRoute && previousRoute.key === route.key) {\n logger.debug(`[${INTEGRATION_NAME}] Navigation state changed, but route is the same as previous.`);\n pushRecentRouteKey(route.key);\n latestRoute = route;\n\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n return undefined;\n }\n\n const routeHasBeenSeen = recentRouteKeys.includes(route.key);\n const latestTtidSpan =\n !routeHasBeenSeen &&\n enableTimeToInitialDisplay &&\n startTimeToInitialDisplaySpan({\n name: `${route.name} initial display`,\n isAutoInstrumented: true,\n });\n\n const navigationSpanWithTtid = latestNavigationSpan;\n if (!routeHasBeenSeen && latestTtidSpan) {\n newScreenFrameEventEmitter?.onceNewFrame(({ newFrameTimestampInSeconds }: NewFrameEvent) => {\n const activeSpan = getActiveSpan();\n if (activeSpan && manualInitialDisplaySpans.has(activeSpan)) {\n logger.warn('[ReactNavigationInstrumentation] Detected manual instrumentation for the current active span.');\n return;\n }\n\n latestTtidSpan.setStatus({ code: SPAN_STATUS_OK });\n latestTtidSpan.end(newFrameTimestampInSeconds);\n setSpanDurationAsMeasurementOnSpan('time_to_initial_display', latestTtidSpan, navigationSpanWithTtid);\n });\n }\n\n navigationProcessingSpan?.updateName(`Processing navigation to ${route.name}`);\n navigationProcessingSpan?.setStatus({ code: SPAN_STATUS_OK });\n navigationProcessingSpan?.end(stateChangedTimestamp);\n navigationProcessingSpan = undefined;\n\n if (spanToJSON(latestNavigationSpan).description === DEFAULT_NAVIGATION_SPAN_NAME) {\n latestNavigationSpan.updateName(route.name);\n }\n latestNavigationSpan.setAttributes({\n 'route.name': route.name,\n 'route.key': route.key,\n // TODO: filter PII params instead of dropping them all\n // 'route.params': {},\n 'route.has_been_seen': routeHasBeenSeen,\n 'previous_route.name': previousRoute?.name,\n 'previous_route.key': previousRoute?.key,\n // TODO: filter PII params instead of dropping them all\n // 'previous_route.params': {},\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n });\n\n // Clear the timeout so the transaction does not get cancelled.\n clearStateChangeTimeout();\n\n addBreadcrumb({\n category: 'navigation',\n type: 'navigation',\n message: `Navigation to ${route.name}`,\n data: {\n from: previousRoute?.name,\n to: route.name,\n },\n });\n\n tracing?.setCurrentRoute(route.key);\n\n pushRecentRouteKey(route.key);\n latestRoute = route;\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n };\n\n /** Pushes a recent route key, and removes earlier routes when there is greater than the max length */\n const pushRecentRouteKey = (key: string): void => {\n recentRouteKeys.push(key);\n\n if (recentRouteKeys.length > NAVIGATION_HISTORY_MAX_SIZE) {\n recentRouteKeys = recentRouteKeys.slice(recentRouteKeys.length - NAVIGATION_HISTORY_MAX_SIZE);\n }\n };\n\n /** Cancels the latest transaction so it does not get sent to Sentry. */\n const _discardLatestTransaction = (): void => {\n if (latestNavigationSpan) {\n if (isSentrySpan(latestNavigationSpan)) {\n latestNavigationSpan['_sampled'] = false;\n }\n // TODO: What if it's not SentrySpan?\n latestNavigationSpan.end();\n latestNavigationSpan = undefined;\n }\n if (navigationProcessingSpan) {\n navigationProcessingSpan = undefined;\n }\n };\n\n const clearStateChangeTimeout = (): void => {\n if (typeof stateChangeTimeout !== 'undefined') {\n clearTimeout(stateChangeTimeout);\n stateChangeTimeout = undefined;\n }\n };\n\n return {\n name: INTEGRATION_NAME,\n afterAllSetup,\n registerNavigationContainer,\n };\n};\n\nexport interface NavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params?: Record<string, any>;\n}\n\ninterface NavigationContainer {\n addListener: (type: string, listener: () => void) => void;\n getCurrentRoute: () => NavigationRoute;\n}\n"]}
1
+ {"version":3,"file":"reactnavigation.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnavigation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACN,4BAA4B,EAC5B,gCAAgC,EAChC,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,4CAA4C,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,4BAA4B,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zC,IAAI,OAAO,kBAAkB,KAAK,WAAW,EAAE;YAC7C,YAAY,CAAC,kBAAkB,CAAC,CAAC;YACjC,kBAAkB,GAAG,SAAS,CAAC;SAChC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,aAAa;QACb,2BAA2B;KAC5B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type { Client, Integration, Span } from '@sentry/core';\nimport {\n addBreadcrumb,\n getActiveSpan,\n getClient,\n isPlainObject,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_OK,\n spanToJSON,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\n\nimport type { NewFrameEvent } from '../utils/sentryeventemitter';\nimport type { SentryEventEmitterFallback } from '../utils/sentryeventemitterfallback';\nimport { createSentryFallbackEventEmitter } from '../utils/sentryeventemitterfallback';\nimport { isSentrySpan } from '../utils/span';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { NATIVE } from '../wrapper';\nimport { ignoreEmptyBackNavigation } from './onSpanEndUtils';\nimport { SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION } from './origin';\nimport type { ReactNativeTracingIntegration } from './reactnativetracing';\nimport { getReactNativeTracingIntegration } from './reactnativetracing';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from './semanticAttributes';\nimport {\n DEFAULT_NAVIGATION_SPAN_NAME,\n defaultIdleOptions,\n getDefaultIdleNavigationSpanOptions,\n startIdleNavigationSpan as startGenericIdleNavigationSpan,\n} from './span';\nimport { manualInitialDisplaySpans, startTimeToInitialDisplaySpan } from './timetodisplay';\nimport { setSpanDurationAsMeasurementOnSpan } from './utils';\nexport const INTEGRATION_NAME = 'ReactNavigation';\n\nconst NAVIGATION_HISTORY_MAX_SIZE = 200;\n\ninterface ReactNavigationIntegrationOptions {\n /**\n * How long the instrumentation will wait for the route to mount after a change has been initiated,\n * before the transaction is discarded.\n *\n * @default 1_000 (ms)\n */\n routeChangeTimeoutMs: number;\n\n /**\n * Time to initial display measures the time it takes from\n * navigation dispatch to the render of the first frame of the new screen.\n *\n * @default false\n */\n enableTimeToInitialDisplay: boolean;\n\n /**\n * Does not sample transactions that are from routes that have been seen any more and don't have any spans.\n * This removes a lot of the clutter as most back navigation transactions are now ignored.\n *\n * @default true\n */\n ignoreEmptyBackNavigationTransactions: boolean;\n}\n\n/**\n * Instrumentation for React-Navigation V5 and above. See docs or sample app for usage.\n *\n * How this works:\n * - `_onDispatch` is called every time a dispatch happens and sets an IdleTransaction on the scope without any route context.\n * - `_onStateChange` is then called AFTER the state change happens due to a dispatch and sets the route context onto the active transaction.\n * - If `_onStateChange` isn't called within `STATE_CHANGE_TIMEOUT_DURATION` of the dispatch, then the transaction is not sampled and finished.\n */\nexport const reactNavigationIntegration = ({\n routeChangeTimeoutMs = 1_000,\n enableTimeToInitialDisplay = false,\n ignoreEmptyBackNavigationTransactions = true,\n}: Partial<ReactNavigationIntegrationOptions> = {}): Integration & {\n /**\n * Pass the ref to the navigation container to register it to the instrumentation\n * @param navigationContainerRef Ref to a `NavigationContainer`\n */\n registerNavigationContainer: (navigationContainerRef: unknown) => void;\n} => {\n let navigationContainer: NavigationContainer | undefined;\n let newScreenFrameEventEmitter: SentryEventEmitterFallback | undefined;\n\n let tracing: ReactNativeTracingIntegration | undefined;\n let idleSpanOptions: Parameters<typeof startGenericIdleNavigationSpan>[1] = defaultIdleOptions;\n let latestRoute: NavigationRoute | undefined;\n\n let latestNavigationSpan: Span | undefined;\n let navigationProcessingSpan: Span | undefined;\n\n let initialStateHandled: boolean = false;\n let stateChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n let recentRouteKeys: string[] = [];\n\n if (enableTimeToInitialDisplay) {\n newScreenFrameEventEmitter = createSentryFallbackEventEmitter();\n newScreenFrameEventEmitter.initAsync();\n NATIVE.initNativeReactNavigationNewFrameTracking().catch((reason: unknown) => {\n logger.error(`${INTEGRATION_NAME} Failed to initialize native new frame tracking: ${reason}`);\n });\n }\n\n /**\n * Set the initial state and start initial navigation span for the current screen.\n */\n const afterAllSetup = (client: Client): void => {\n tracing = getReactNativeTracingIntegration(client);\n if (tracing) {\n idleSpanOptions = {\n finalTimeout: tracing.options.finalTimeoutMs,\n idleTimeout: tracing.options.idleTimeoutMs,\n };\n }\n\n if (initialStateHandled) {\n // We create an initial state here to ensure a transaction gets created before the first route mounts.\n return undefined;\n }\n\n startIdleNavigationSpan();\n\n if (!navigationContainer) {\n // This is expected as navigation container is registered after the root component is mounted.\n return undefined;\n }\n\n // Navigation container already registered, just populate with route state\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n const registerNavigationContainer = (navigationContainerRef: unknown): void => {\n /* We prevent duplicate routing instrumentation to be initialized on fast refreshes\n\n Explanation: If the user triggers a fast refresh on the file that the instrumentation is\n initialized in, it will initialize a new instance and will cause undefined behavior.\n */\n if (RN_GLOBAL_OBJ.__sentry_rn_v5_registered) {\n logger.log(\n `${INTEGRATION_NAME} Instrumentation already exists, but register has been called again, doing nothing.`,\n );\n return undefined;\n }\n\n if (isPlainObject(navigationContainerRef) && 'current' in navigationContainerRef) {\n navigationContainer = navigationContainerRef.current as NavigationContainer;\n } else {\n navigationContainer = navigationContainerRef as NavigationContainer;\n }\n if (!navigationContainer) {\n logger.warn(`${INTEGRATION_NAME} Received invalid navigation container ref!`);\n return undefined;\n }\n\n // This action is emitted on every dispatch\n navigationContainer.addListener('__unsafe_action__', startIdleNavigationSpan);\n navigationContainer.addListener('state', updateLatestNavigationSpanWithCurrentRoute);\n RN_GLOBAL_OBJ.__sentry_rn_v5_registered = true;\n\n if (initialStateHandled) {\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n logger.log(`${INTEGRATION_NAME} Navigation container registered, but integration has not been setup yet.`);\n return undefined;\n }\n\n // Navigation Container is registered after the first navigation\n // Initial navigation span was started, after integration setup,\n // so now we populate it with the current route.\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n /**\n * To be called on every React-Navigation action dispatch.\n * It does not name the transaction or populate it with route information. Instead, it waits for the state to fully change\n * and gets the route information from there, @see updateLatestNavigationSpanWithCurrentRoute\n */\n const startIdleNavigationSpan = (): void => {\n if (latestNavigationSpan) {\n logger.log(`${INTEGRATION_NAME} A transaction was detected that turned out to be a noop, discarding.`);\n _discardLatestTransaction();\n clearStateChangeTimeout();\n }\n\n latestNavigationSpan = startGenericIdleNavigationSpan(\n tracing && tracing.options.beforeStartSpan\n ? tracing.options.beforeStartSpan(getDefaultIdleNavigationSpanOptions())\n : getDefaultIdleNavigationSpanOptions(),\n idleSpanOptions,\n );\n latestNavigationSpan?.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION);\n if (ignoreEmptyBackNavigationTransactions) {\n ignoreEmptyBackNavigation(getClient(), latestNavigationSpan);\n }\n\n if (enableTimeToInitialDisplay) {\n navigationProcessingSpan = startInactiveSpan({\n op: 'navigation.processing',\n name: 'Navigation processing',\n startTime: latestNavigationSpan && spanToJSON(latestNavigationSpan).start_timestamp,\n });\n navigationProcessingSpan.setAttribute(\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION,\n );\n }\n\n stateChangeTimeout = setTimeout(_discardLatestTransaction, routeChangeTimeoutMs);\n };\n\n /**\n * To be called AFTER the state has been changed to populate the transaction with the current route.\n */\n const updateLatestNavigationSpanWithCurrentRoute = (): void => {\n const stateChangedTimestamp = timestampInSeconds();\n const previousRoute = latestRoute;\n\n if (!navigationContainer) {\n logger.warn(`${INTEGRATION_NAME} Missing navigation container ref. Route transactions will not be sent.`);\n return undefined;\n }\n\n const route = navigationContainer.getCurrentRoute();\n if (!route) {\n logger.debug(`[${INTEGRATION_NAME}] Navigation state changed, but no route is rendered.`);\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n logger.debug(\n `[${INTEGRATION_NAME}] Navigation state changed, but navigation transaction was not started on dispatch.`,\n );\n return undefined;\n }\n\n if (previousRoute && previousRoute.key === route.key) {\n logger.debug(`[${INTEGRATION_NAME}] Navigation state changed, but route is the same as previous.`);\n pushRecentRouteKey(route.key);\n latestRoute = route;\n\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n return undefined;\n }\n\n const routeHasBeenSeen = recentRouteKeys.includes(route.key);\n const latestTtidSpan =\n !routeHasBeenSeen &&\n enableTimeToInitialDisplay &&\n startTimeToInitialDisplaySpan({\n name: `${route.name} initial display`,\n isAutoInstrumented: true,\n });\n\n const navigationSpanWithTtid = latestNavigationSpan;\n if (!routeHasBeenSeen && latestTtidSpan) {\n newScreenFrameEventEmitter?.onceNewFrame(({ newFrameTimestampInSeconds }: NewFrameEvent) => {\n const activeSpan = getActiveSpan();\n if (activeSpan && manualInitialDisplaySpans.has(activeSpan)) {\n logger.warn('[ReactNavigationInstrumentation] Detected manual instrumentation for the current active span.');\n return;\n }\n\n latestTtidSpan.setStatus({ code: SPAN_STATUS_OK });\n latestTtidSpan.end(newFrameTimestampInSeconds);\n setSpanDurationAsMeasurementOnSpan('time_to_initial_display', latestTtidSpan, navigationSpanWithTtid);\n });\n }\n\n navigationProcessingSpan?.updateName(`Processing navigation to ${route.name}`);\n navigationProcessingSpan?.setStatus({ code: SPAN_STATUS_OK });\n navigationProcessingSpan?.end(stateChangedTimestamp);\n navigationProcessingSpan = undefined;\n\n if (spanToJSON(latestNavigationSpan).description === DEFAULT_NAVIGATION_SPAN_NAME) {\n latestNavigationSpan.updateName(route.name);\n }\n latestNavigationSpan.setAttributes({\n 'route.name': route.name,\n 'route.key': route.key,\n // TODO: filter PII params instead of dropping them all\n // 'route.params': {},\n 'route.has_been_seen': routeHasBeenSeen,\n 'previous_route.name': previousRoute?.name,\n 'previous_route.key': previousRoute?.key,\n // TODO: filter PII params instead of dropping them all\n // 'previous_route.params': {},\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n });\n\n // Clear the timeout so the transaction does not get cancelled.\n clearStateChangeTimeout();\n\n addBreadcrumb({\n category: 'navigation',\n type: 'navigation',\n message: `Navigation to ${route.name}`,\n data: {\n from: previousRoute?.name,\n to: route.name,\n },\n });\n\n tracing?.setCurrentRoute(route.key);\n\n pushRecentRouteKey(route.key);\n latestRoute = route;\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n };\n\n /** Pushes a recent route key, and removes earlier routes when there is greater than the max length */\n const pushRecentRouteKey = (key: string): void => {\n recentRouteKeys.push(key);\n\n if (recentRouteKeys.length > NAVIGATION_HISTORY_MAX_SIZE) {\n recentRouteKeys = recentRouteKeys.slice(recentRouteKeys.length - NAVIGATION_HISTORY_MAX_SIZE);\n }\n };\n\n /** Cancels the latest transaction so it does not get sent to Sentry. */\n const _discardLatestTransaction = (): void => {\n if (latestNavigationSpan) {\n if (isSentrySpan(latestNavigationSpan)) {\n latestNavigationSpan['_sampled'] = false;\n }\n // TODO: What if it's not SentrySpan?\n latestNavigationSpan.end();\n latestNavigationSpan = undefined;\n }\n if (navigationProcessingSpan) {\n navigationProcessingSpan = undefined;\n }\n };\n\n const clearStateChangeTimeout = (): void => {\n if (typeof stateChangeTimeout !== 'undefined') {\n clearTimeout(stateChangeTimeout);\n stateChangeTimeout = undefined;\n }\n };\n\n return {\n name: INTEGRATION_NAME,\n afterAllSetup,\n registerNavigationContainer,\n };\n};\n\nexport interface NavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params?: Record<string, any>;\n}\n\ninterface NavigationContainer {\n addListener: (type: string, listener: () => void) => void;\n getCurrentRoute: () => NavigationRoute;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Client, Scope, Span, StartSpanOptions } from '@sentry/types';
1
+ import type { Client, Scope, Span, StartSpanOptions } from '@sentry/core';
2
2
  export declare const DEFAULT_NAVIGATION_SPAN_NAME = "Route Change";
3
3
  export declare const defaultIdleOptions: {
4
4
  /**
@@ -36,8 +36,8 @@ export declare function getDefaultIdleNavigationSpanOptions(): StartSpanOptions;
36
36
  * Checks if the span is a Sentry User Interaction span.
37
37
  */
38
38
  export declare function isSentryInteractionSpan(span: Span): boolean;
39
- declare const SCOPE_SPAN_FIELD = "_sentrySpan";
40
- type ScopeWithMaybeSpan = Scope & {
39
+ export declare const SCOPE_SPAN_FIELD = "_sentrySpan";
40
+ export type ScopeWithMaybeSpan = Scope & {
41
41
  [SCOPE_SPAN_FIELD]?: Span;
42
42
  };
43
43
  /**
@@ -48,5 +48,4 @@ export declare function clearActiveSpanFromScope(scope: ScopeWithMaybeSpan): voi
48
48
  * Ensures that all created spans have an operation name.
49
49
  */
50
50
  export declare function addDefaultOpForSpanFrom(client: Client): void;
51
- export {};
52
51
  //# sourceMappingURL=span.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAW3E,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,EAAE;IAC/B;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;CAIrB,CAAC;AAEF,eAAO,MAAM,uBAAuB,oBACjB,gBAAgB,mCAI9B,QAAQ,yBAAyB,CAAC,KACpC,IAAI,GAAG,SAkCT,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,oBACP,gBAAgB;kBACc,MAAM,GAAG,SAAS;iBAAe,MAAM,GAAG,SAAS;MACjG,IAYF,CAAC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;IACvC,CAAC,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAGxE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAM5D"}
@@ -1,5 +1,4 @@
1
- import { getActiveSpan, getClient, getCurrentScope, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SentryNonRecordingSpan, SPAN_STATUS_ERROR, spanToJSON, startIdleSpan as coreStartIdleSpan, } from '@sentry/core';
2
- import { generatePropagationContext, logger } from '@sentry/utils';
1
+ import { generatePropagationContext, getActiveSpan, getClient, getCurrentScope, logger, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SentryNonRecordingSpan, SPAN_STATUS_ERROR, spanToJSON, startIdleSpan as coreStartIdleSpan, } from '@sentry/core';
3
2
  import { isRootSpan } from '../utils/span';
4
3
  import { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';
5
4
  import { SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM, SPAN_ORIGIN_MANUAL_INTERACTION, } from './origin';
@@ -15,6 +14,7 @@ export const startIdleNavigationSpan = (startSpanOption, { finalTimeout = defaul
15
14
  return undefined;
16
15
  }
17
16
  const activeSpan = getActiveSpan();
17
+ clearActiveSpanFromScope(getCurrentScope());
18
18
  if (activeSpan && isRootSpan(activeSpan) && isSentryInteractionSpan(activeSpan)) {
19
19
  logger.log(`[startIdleNavigationSpan] Canceling ${spanToJSON(activeSpan).op} transaction because of a new navigation root span.`);
20
20
  activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });
@@ -62,7 +62,7 @@ export function getDefaultIdleNavigationSpanOptions() {
62
62
  export function isSentryInteractionSpan(span) {
63
63
  return [SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_MANUAL_INTERACTION].includes(spanToJSON(span).origin);
64
64
  }
65
- const SCOPE_SPAN_FIELD = '_sentrySpan';
65
+ export const SCOPE_SPAN_FIELD = '_sentrySpan';
66
66
  /**
67
67
  * Removes the active span from the scope.
68
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,eAAe,EACf,4BAA4B,EAC5B,gCAAgC,EAChC,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,aAAa,IAAI,iBAAiB,GACnC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,4BAA4B,GAAG,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAgB3B;IACF,WAAW,EAAE,IAAK;IAClB,YAAY,EAAE,MAAO;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,eAAiC,EACjC,EACE,YAAY,GAAG,kBAAkB,CAAC,YAAY,EAC9C,WAAW,GAAG,kBAAkB,CAAC,WAAW,MACN,EAAE,EACxB,EAAE;IACpB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;QACzF,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC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,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,mCAAmC;IACjD,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,EAAE,EAAE,YAAY;QAChB,gBAAgB,EAAE,IAAI;QACtB,KAAK,EAAE,eAAe,EAAE;KACzB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAU;IAChD,OAAO,CAAC,4BAA4B,EAAE,8BAA8B,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1G,CAAC;AAED,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAMvC;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAyB;IAChE,gEAAgE;IAChE,OAAO,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,IAAU,EAAE,EAAE;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;YACxB,IAAI,CAAC,YAAY,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n getActiveSpan,\n getClient,\n getCurrentScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n SPAN_STATUS_ERROR,\n spanToJSON,\n startIdleSpan as coreStartIdleSpan,\n} from '@sentry/core';\nimport type { Client, Scope, Span, StartSpanOptions } from '@sentry/types';\nimport { generatePropagationContext, logger } from '@sentry/utils';\n\nimport { isRootSpan } from '../utils/span';\nimport { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';\nimport {\n SPAN_ORIGIN_AUTO_INTERACTION,\n SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM,\n SPAN_ORIGIN_MANUAL_INTERACTION,\n} from './origin';\n\nexport const DEFAULT_NAVIGATION_SPAN_NAME = 'Route Change';\n\nexport const defaultIdleOptions: {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n *\n * @default 1_000 (ms)\n */\n finalTimeout: number;\n\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * @default 60_0000 (ms)\n */\n idleTimeout: number;\n} = {\n idleTimeout: 1_000,\n finalTimeout: 60_0000,\n};\n\nexport const startIdleNavigationSpan = (\n startSpanOption: StartSpanOptions,\n {\n finalTimeout = defaultIdleOptions.finalTimeout,\n idleTimeout = defaultIdleOptions.idleTimeout,\n }: Partial<typeof defaultIdleOptions> = {},\n): Span | undefined => {\n const client = getClient();\n if (!client) {\n logger.warn(`[startIdleNavigationSpan] Can't create route change span, missing client.`);\n return undefined;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan && isRootSpan(activeSpan) && isSentryInteractionSpan(activeSpan)) {\n logger.log(\n `[startIdleNavigationSpan] Canceling ${\n spanToJSON(activeSpan).op\n } transaction because of a new navigation root span.`,\n );\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n activeSpan.end();\n }\n\n const finalStartStapOptions = {\n ...getDefaultIdleNavigationSpanOptions(),\n ...startSpanOption,\n };\n\n const idleSpan = startIdleSpan(finalStartStapOptions, { finalTimeout, idleTimeout });\n logger.log(\n `[startIdleNavigationSpan] Starting ${finalStartStapOptions.op || 'unknown op'} transaction \"${\n finalStartStapOptions.name\n }\" on scope`,\n );\n\n adjustTransactionDuration(client, idleSpan, finalTimeout);\n\n idleSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM);\n return idleSpan;\n};\n\n/**\n * Starts an idle span from `@sentry/core` with React Native application\n * context awareness.\n *\n * - Span will be started with new propagation context.\n * - Span will be canceled if the app goes to background.\n */\nexport const startIdleSpan = (\n startSpanOption: StartSpanOptions,\n { finalTimeout, idleTimeout }: { finalTimeout: number | undefined; idleTimeout: number | undefined },\n): Span => {\n const client = getClient();\n if (!client) {\n logger.warn(`[startIdleSpan] Can't create idle span, missing client.`);\n return new SentryNonRecordingSpan();\n }\n\n getCurrentScope().setPropagationContext(generatePropagationContext());\n\n const span = coreStartIdleSpan(startSpanOption, { finalTimeout, idleTimeout });\n cancelInBackground(client, span);\n return span;\n};\n\n/**\n * Returns the default options for the idle navigation span.\n */\nexport function getDefaultIdleNavigationSpanOptions(): StartSpanOptions {\n return {\n name: DEFAULT_NAVIGATION_SPAN_NAME,\n op: 'navigation',\n forceTransaction: true,\n scope: getCurrentScope(),\n };\n}\n\n/**\n * Checks if the span is a Sentry User Interaction span.\n */\nexport function isSentryInteractionSpan(span: Span): boolean {\n return [SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_MANUAL_INTERACTION].includes(spanToJSON(span).origin);\n}\n\nconst SCOPE_SPAN_FIELD = '_sentrySpan';\n\ntype ScopeWithMaybeSpan = Scope & {\n [SCOPE_SPAN_FIELD]?: Span;\n};\n\n/**\n * Removes the active span from the scope.\n */\nexport function clearActiveSpanFromScope(scope: ScopeWithMaybeSpan): void {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete scope[SCOPE_SPAN_FIELD];\n}\n\n/**\n * Ensures that all created spans have an operation name.\n */\nexport function addDefaultOpForSpanFrom(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).op) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'default');\n }\n });\n}\n"]}
1
+ {"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,SAAS,EACT,eAAe,EACf,MAAM,EAC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AAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1G,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAM9C;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAyB;IAChE,gEAAgE;IAChE,OAAO,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,IAAU,EAAE,EAAE;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;YACxB,IAAI,CAAC,YAAY,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Client, Scope, Span, StartSpanOptions } from '@sentry/core';\nimport {\n generatePropagationContext,\n getActiveSpan,\n getClient,\n getCurrentScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n SPAN_STATUS_ERROR,\n spanToJSON,\n startIdleSpan as coreStartIdleSpan,\n} from '@sentry/core';\n\nimport { isRootSpan } from '../utils/span';\nimport { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';\nimport {\n SPAN_ORIGIN_AUTO_INTERACTION,\n SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM,\n SPAN_ORIGIN_MANUAL_INTERACTION,\n} from './origin';\n\nexport const DEFAULT_NAVIGATION_SPAN_NAME = 'Route Change';\n\nexport const defaultIdleOptions: {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n *\n * @default 1_000 (ms)\n */\n finalTimeout: number;\n\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * @default 60_0000 (ms)\n */\n idleTimeout: number;\n} = {\n idleTimeout: 1_000,\n finalTimeout: 60_0000,\n};\n\nexport const startIdleNavigationSpan = (\n startSpanOption: StartSpanOptions,\n {\n finalTimeout = defaultIdleOptions.finalTimeout,\n idleTimeout = defaultIdleOptions.idleTimeout,\n }: Partial<typeof defaultIdleOptions> = {},\n): Span | undefined => {\n const client = getClient();\n if (!client) {\n logger.warn(`[startIdleNavigationSpan] Can't create route change span, missing client.`);\n return undefined;\n }\n\n const activeSpan = getActiveSpan();\n clearActiveSpanFromScope(getCurrentScope());\n if (activeSpan && isRootSpan(activeSpan) && isSentryInteractionSpan(activeSpan)) {\n logger.log(\n `[startIdleNavigationSpan] Canceling ${\n spanToJSON(activeSpan).op\n } transaction because of a new navigation root span.`,\n );\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n activeSpan.end();\n }\n\n const finalStartStapOptions = {\n ...getDefaultIdleNavigationSpanOptions(),\n ...startSpanOption,\n };\n\n const idleSpan = startIdleSpan(finalStartStapOptions, { finalTimeout, idleTimeout });\n logger.log(\n `[startIdleNavigationSpan] Starting ${finalStartStapOptions.op || 'unknown op'} transaction \"${\n finalStartStapOptions.name\n }\" on scope`,\n );\n\n adjustTransactionDuration(client, idleSpan, finalTimeout);\n\n idleSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM);\n return idleSpan;\n};\n\n/**\n * Starts an idle span from `@sentry/core` with React Native application\n * context awareness.\n *\n * - Span will be started with new propagation context.\n * - Span will be canceled if the app goes to background.\n */\nexport const startIdleSpan = (\n startSpanOption: StartSpanOptions,\n { finalTimeout, idleTimeout }: { finalTimeout: number | undefined; idleTimeout: number | undefined },\n): Span => {\n const client = getClient();\n if (!client) {\n logger.warn(`[startIdleSpan] Can't create idle span, missing client.`);\n return new SentryNonRecordingSpan();\n }\n\n getCurrentScope().setPropagationContext(generatePropagationContext());\n\n const span = coreStartIdleSpan(startSpanOption, { finalTimeout, idleTimeout });\n cancelInBackground(client, span);\n return span;\n};\n\n/**\n * Returns the default options for the idle navigation span.\n */\nexport function getDefaultIdleNavigationSpanOptions(): StartSpanOptions {\n return {\n name: DEFAULT_NAVIGATION_SPAN_NAME,\n op: 'navigation',\n forceTransaction: true,\n scope: getCurrentScope(),\n };\n}\n\n/**\n * Checks if the span is a Sentry User Interaction span.\n */\nexport function isSentryInteractionSpan(span: Span): boolean {\n return [SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_MANUAL_INTERACTION].includes(spanToJSON(span).origin);\n}\n\nexport const SCOPE_SPAN_FIELD = '_sentrySpan';\n\nexport type ScopeWithMaybeSpan = Scope & {\n [SCOPE_SPAN_FIELD]?: Span;\n};\n\n/**\n * Removes the active span from the scope.\n */\nexport function clearActiveSpanFromScope(scope: ScopeWithMaybeSpan): void {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete scope[SCOPE_SPAN_FIELD];\n}\n\n/**\n * Ensures that all created spans have an operation name.\n */\nexport function addDefaultOpForSpanFrom(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).op) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'default');\n }\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Span, StartSpanOptions } from '@sentry/types';
1
+ import type { Span, StartSpanOptions } from '@sentry/core';
2
2
  import * as React from 'react';
3
3
  /**
4
4
  * Flags of active spans with manual initial display.
@@ -1 +1 @@
1
- {"version":3,"file":"timetodisplay.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAC,gBAAgB,EAAG,MAAM,eAAe,CAAC;AAE5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;GAEG;AACH,eAAO,MAAM,yBAAyB,qBAA4B,CAAC;AAOnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC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F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAG/E;AAgCD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,GACA,IAAI,GAAG,SAAS,CAgClB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAG7B,GACA,IAAI,GAAG,SAAS,CAqDlB"}
@@ -1,5 +1,4 @@
1
- import { getActiveSpan, getSpanDescendants, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';
2
- import { fill, logger } from '@sentry/utils';
1
+ import { fill, getActiveSpan, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';
3
2
  import * as React from 'react';
4
3
  import { isTurboModuleEnabled } from '../utils/environment';
5
4
  import { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin';
@@ -1 +1 @@
1
- {"version":3,"file":"timetodisplay.js","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,cAAc,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ED,IAAI,0BAA0B,GAAG,qBAAqB,EAAE;QACtD,MAAM,CAAC,IAAI,CAAC,4GAA4G,CAAC,CAAC;QAC1H,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;KACtC;SAAM;QACL,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;KACjC;IAED,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,CAAC,mBAAmB,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,OAAO,oCAAoC,CAAC,CAAC;IAE/G,4BAA4B,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { getActiveSpan, getSpanDescendants, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';\nimport type { Span,StartSpanOptions } from '@sentry/types';\nimport { fill, logger } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { isTurboModuleEnabled } from '../utils/environment';\nimport { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin';\nimport { getRNSentryOnDrawReporter, nativeComponentExists } from './timetodisplaynative';\nimport type {RNSentryOnDrawNextFrameEvent } from './timetodisplaynative.types';\nimport { setSpanDurationAsMeasurement } from './utils';\n\nlet nativeComponentMissingLogged = false;\n\n/**\n * Flags of active spans with manual initial display.\n */\nexport const manualInitialDisplaySpans = new WeakMap<Span, true>();\n\n/**\n * Flag full display called before initial display for an active span.\n */\nconst fullDisplayBeforeInitialDisplay = new WeakMap<Span, true>();\n\nexport type TimeToDisplayProps = {\n children?: React.ReactNode;\n record?: boolean;\n};\n\n/**\n * Component to measure time to initial display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToInitialDisplay(props: TimeToDisplayProps): React.ReactElement {\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n manualInitialDisplaySpans.set(activeSpan, true);\n startTimeToInitialDisplaySpan();\n }\n\n return <TimeToDisplay initialDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\n/**\n * Component to measure time to full display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToFullDisplay(props: TimeToDisplayProps): React.ReactElement {\n startTimeToFullDisplaySpan();\n return <TimeToDisplay fullDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\nfunction TimeToDisplay(props: {\n children?: React.ReactNode;\n initialDisplay?: boolean;\n fullDisplay?: boolean;\n}): React.ReactElement {\n const RNSentryOnDrawReporter = getRNSentryOnDrawReporter();\n const isNewArchitecture = isTurboModuleEnabled();\n\n if (__DEV__ && (isNewArchitecture || (!nativeComponentExists && !nativeComponentMissingLogged))){\n nativeComponentMissingLogged = true;\n // Using setTimeout with a delay of 0 milliseconds to defer execution and avoid printing the React stack trace.\n setTimeout(() => {\n logger.warn(\n 'TimeToInitialDisplay and TimeToFullDisplay are not supported on the web, Expo Go and New Architecture. Run native build or report an issue at https://github.com/getsentry/sentry-react-native');\n }, 0);\n }\n\n const onDraw = (event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void => onDrawNextFrame(event);\n\n return (\n <>\n <RNSentryOnDrawReporter\n onDrawNextFrame={onDraw}\n initialDisplay={props.initialDisplay}\n fullDisplay={props.fullDisplay} />\n {props.children}\n </>\n );\n}\n\n/**\n * Starts a new span for the initial display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToInitialDisplaySpan(\n options?: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string;\n isAutoInstrumented?: boolean\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return undefined;\n }\n\n const existingSpan = getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.initial_display span.`);\n return existingSpan\n }\n\n const initialDisplaySpan = startInactiveSpan({\n op: 'ui.load.initial_display',\n name: 'Time To Initial Display',\n startTime: spanToJSON(activeSpan).start_timestamp,\n ...options,\n });\n\n if (!initialDisplaySpan) {\n return undefined;\n }\n\n if (options?.isAutoInstrumented) {\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n manualInitialDisplaySpans.set(activeSpan, true);\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return initialDisplaySpan;\n}\n\n/**\n * Starts a new span for the full display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToFullDisplaySpan(\n options: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string,\n timeoutMs?: number,\n isAutoInstrumented?: boolean\n } = {\n timeoutMs: 30_000,\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const descendantSpans = getSpanDescendants(activeSpan);\n\n const initialDisplaySpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (!initialDisplaySpan) {\n logger.warn(`[TimeToDisplay] No initial display span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const existingSpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.full_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.full_display span.`);\n return existingSpan;\n }\n\n const fullDisplaySpan = startInactiveSpan({\n op: 'ui.load.full_display',\n name: 'Time To Full Display',\n startTime: spanToJSON(initialDisplaySpan).start_timestamp,\n ...options,\n });\n if (!fullDisplaySpan) {\n return undefined;\n }\n\n const timeout = setTimeout(() => {\n if (spanToJSON(fullDisplaySpan).timestamp) {\n return;\n }\n fullDisplaySpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n fullDisplaySpan.end(spanToJSON(initialDisplaySpan).timestamp);\n setSpanDurationAsMeasurement('time_to_full_display', fullDisplaySpan);\n logger.warn(`[TimeToDisplay] Full display span deadline_exceeded.`);\n }, options.timeoutMs);\n\n fill(fullDisplaySpan, 'end', (originalEnd: Span['end']) => (endTimestamp?: Parameters<Span['end']>[0]) => {\n clearTimeout(timeout);\n originalEnd.call(fullDisplaySpan, endTimestamp);\n });\n\n if (options?.isAutoInstrumented) {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return fullDisplaySpan;\n}\n\nfunction onDrawNextFrame(event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void {\n logger.debug(`[TimeToDisplay] onDrawNextFrame: ${JSON.stringify(event.nativeEvent)}`);\n if (event.nativeEvent.type === 'fullDisplay') {\n return updateFullDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n if (event.nativeEvent.type === 'initialDisplay') {\n return updateInitialDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n}\n\nfunction updateInitialDisplaySpan(frameTimestampSeconds: number): void {\n const span = startTimeToInitialDisplaySpan();\n if (!span) {\n logger.warn(`[TimeToDisplay] No span found or created, possibly performance is disabled.`);\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return;\n }\n\n if (spanToJSON(span).parent_span_id !== spanToJSON(activeSpan).span_id) {\n logger.warn(`[TimeToDisplay] Initial display span is not a child of current active span.`);\n return;\n }\n\n if (spanToJSON(span).timestamp) {\n logger.warn(`[TimeToDisplay] ${spanToJSON(span).description} span already ended.`);\n return;\n }\n\n span.end(frameTimestampSeconds);\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanToJSON(span).description} span updated with end timestamp.`);\n\n if (fullDisplayBeforeInitialDisplay.has(activeSpan)) {\n fullDisplayBeforeInitialDisplay.delete(activeSpan);\n logger.debug(`[TimeToDisplay] Updating full display with initial display (${span.spanContext().spanId}) end.`);\n updateFullDisplaySpan(frameTimestampSeconds, span);\n }\n\n setSpanDurationAsMeasurement('time_to_initial_display', span);\n}\n\nfunction updateFullDisplaySpan(frameTimestampSeconds: number, passedInitialDisplaySpan?: Span): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to update ui.load.full_display in.`);\n return;\n }\n\n const existingInitialDisplaySpan = passedInitialDisplaySpan\n || getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n const initialDisplayEndTimestamp = existingInitialDisplaySpan && spanToJSON(existingInitialDisplaySpan).timestamp;\n if (!initialDisplayEndTimestamp) {\n fullDisplayBeforeInitialDisplay.set(activeSpan, true);\n logger.warn(`[TimeToDisplay] Full display called before initial display for active span (${activeSpan.spanContext().spanId}).`);\n return;\n }\n\n const span = startTimeToFullDisplaySpan({\n isAutoInstrumented: true,\n });\n if (!span) {\n logger.warn(`[TimeToDisplay] No TimeToFullDisplay span found or created, possibly performance is disabled.`);\n return;\n }\n\n const spanJSON = spanToJSON(span);\n if (spanJSON.timestamp) {\n logger.warn(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span already ended.`);\n return;\n }\n\n if (initialDisplayEndTimestamp > frameTimestampSeconds) {\n logger.warn(`[TimeToDisplay] Using initial display end. Full display end frame timestamp is before initial display end.`);\n span.end(initialDisplayEndTimestamp);\n } else {\n span.end(frameTimestampSeconds);\n }\n\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span updated with end timestamp.`);\n\n setSpanDurationAsMeasurement('time_to_full_display', span);\n}\n"]}
1
+ {"version":3,"file":"timetodisplay.js","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnL,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,mCAAmC,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,OAAO,EAAc,CAAC;AAEnE;;GAEG;AACH,MAAM,+BAA+B,GAAG,IAAI,OAAO,EAAc,CAAC;AAOlE;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAyB;IAC5D,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,IAAI,UAAU,EAAE;QACd,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAChD,6BAA6B,EAAE,CAAC;KACjC;IAED,OAAO,oBAAC,aAAa,IAAC,cAAc,EAAE,KAAK,CAAC,MAAM,IAAG,KAAK,CAAC,QAAQ,CAAiB,CAAC;AACvF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,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C,IAAI,EAAE;QACT,MAAM,CAAC,IAAI,CAAC,+FAA+F,CAAC,CAAC;QAC7G,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,SAAS,EAAE;QACtB,MAAM,CAAC,IAAI,CAAC,mBAAmB,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,OAAO,uBAAuB,CAAC,CAAC;QACjG,OAAO;KACR;IAED,IAAI,0BAA0B,GAAG,qBAAqB,EAAE;QACtD,MAAM,CAAC,IAAI,CAAC,4GAA4G,CAAC,CAAC;QAC1H,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;KACtC;SAAM;QACL,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;KACjC;IAED,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,CAAC,mBAAmB,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,OAAO,oCAAoC,CAAC,CAAC;IAE/G,4BAA4B,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import type { Span,StartSpanOptions } from '@sentry/core';\nimport { fill, getActiveSpan, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';\nimport * as React from 'react';\n\nimport { isTurboModuleEnabled } from '../utils/environment';\nimport { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin';\nimport { getRNSentryOnDrawReporter, nativeComponentExists } from './timetodisplaynative';\nimport type {RNSentryOnDrawNextFrameEvent } from './timetodisplaynative.types';\nimport { setSpanDurationAsMeasurement } from './utils';\n\nlet nativeComponentMissingLogged = false;\n\n/**\n * Flags of active spans with manual initial display.\n */\nexport const manualInitialDisplaySpans = new WeakMap<Span, true>();\n\n/**\n * Flag full display called before initial display for an active span.\n */\nconst fullDisplayBeforeInitialDisplay = new WeakMap<Span, true>();\n\nexport type TimeToDisplayProps = {\n children?: React.ReactNode;\n record?: boolean;\n};\n\n/**\n * Component to measure time to initial display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToInitialDisplay(props: TimeToDisplayProps): React.ReactElement {\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n manualInitialDisplaySpans.set(activeSpan, true);\n startTimeToInitialDisplaySpan();\n }\n\n return <TimeToDisplay initialDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\n/**\n * Component to measure time to full display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToFullDisplay(props: TimeToDisplayProps): React.ReactElement {\n startTimeToFullDisplaySpan();\n return <TimeToDisplay fullDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\nfunction TimeToDisplay(props: {\n children?: React.ReactNode;\n initialDisplay?: boolean;\n fullDisplay?: boolean;\n}): React.ReactElement {\n const RNSentryOnDrawReporter = getRNSentryOnDrawReporter();\n const isNewArchitecture = isTurboModuleEnabled();\n\n if (__DEV__ && (isNewArchitecture || (!nativeComponentExists && !nativeComponentMissingLogged))){\n nativeComponentMissingLogged = true;\n // Using setTimeout with a delay of 0 milliseconds to defer execution and avoid printing the React stack trace.\n setTimeout(() => {\n logger.warn(\n 'TimeToInitialDisplay and TimeToFullDisplay are not supported on the web, Expo Go and New Architecture. Run native build or report an issue at https://github.com/getsentry/sentry-react-native');\n }, 0);\n }\n\n const onDraw = (event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void => onDrawNextFrame(event);\n\n return (\n <>\n <RNSentryOnDrawReporter\n onDrawNextFrame={onDraw}\n initialDisplay={props.initialDisplay}\n fullDisplay={props.fullDisplay} />\n {props.children}\n </>\n );\n}\n\n/**\n * Starts a new span for the initial display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToInitialDisplaySpan(\n options?: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string;\n isAutoInstrumented?: boolean\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return undefined;\n }\n\n const existingSpan = getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.initial_display span.`);\n return existingSpan\n }\n\n const initialDisplaySpan = startInactiveSpan({\n op: 'ui.load.initial_display',\n name: 'Time To Initial Display',\n startTime: spanToJSON(activeSpan).start_timestamp,\n ...options,\n });\n\n if (!initialDisplaySpan) {\n return undefined;\n }\n\n if (options?.isAutoInstrumented) {\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n manualInitialDisplaySpans.set(activeSpan, true);\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return initialDisplaySpan;\n}\n\n/**\n * Starts a new span for the full display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToFullDisplaySpan(\n options: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string,\n timeoutMs?: number,\n isAutoInstrumented?: boolean\n } = {\n timeoutMs: 30_000,\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const descendantSpans = getSpanDescendants(activeSpan);\n\n const initialDisplaySpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (!initialDisplaySpan) {\n logger.warn(`[TimeToDisplay] No initial display span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const existingSpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.full_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.full_display span.`);\n return existingSpan;\n }\n\n const fullDisplaySpan = startInactiveSpan({\n op: 'ui.load.full_display',\n name: 'Time To Full Display',\n startTime: spanToJSON(initialDisplaySpan).start_timestamp,\n ...options,\n });\n if (!fullDisplaySpan) {\n return undefined;\n }\n\n const timeout = setTimeout(() => {\n if (spanToJSON(fullDisplaySpan).timestamp) {\n return;\n }\n fullDisplaySpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n fullDisplaySpan.end(spanToJSON(initialDisplaySpan).timestamp);\n setSpanDurationAsMeasurement('time_to_full_display', fullDisplaySpan);\n logger.warn(`[TimeToDisplay] Full display span deadline_exceeded.`);\n }, options.timeoutMs);\n\n fill(fullDisplaySpan, 'end', (originalEnd: Span['end']) => (endTimestamp?: Parameters<Span['end']>[0]) => {\n clearTimeout(timeout);\n originalEnd.call(fullDisplaySpan, endTimestamp);\n });\n\n if (options?.isAutoInstrumented) {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return fullDisplaySpan;\n}\n\nfunction onDrawNextFrame(event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void {\n logger.debug(`[TimeToDisplay] onDrawNextFrame: ${JSON.stringify(event.nativeEvent)}`);\n if (event.nativeEvent.type === 'fullDisplay') {\n return updateFullDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n if (event.nativeEvent.type === 'initialDisplay') {\n return updateInitialDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n}\n\nfunction updateInitialDisplaySpan(frameTimestampSeconds: number): void {\n const span = startTimeToInitialDisplaySpan();\n if (!span) {\n logger.warn(`[TimeToDisplay] No span found or created, possibly performance is disabled.`);\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return;\n }\n\n if (spanToJSON(span).parent_span_id !== spanToJSON(activeSpan).span_id) {\n logger.warn(`[TimeToDisplay] Initial display span is not a child of current active span.`);\n return;\n }\n\n if (spanToJSON(span).timestamp) {\n logger.warn(`[TimeToDisplay] ${spanToJSON(span).description} span already ended.`);\n return;\n }\n\n span.end(frameTimestampSeconds);\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanToJSON(span).description} span updated with end timestamp.`);\n\n if (fullDisplayBeforeInitialDisplay.has(activeSpan)) {\n fullDisplayBeforeInitialDisplay.delete(activeSpan);\n logger.debug(`[TimeToDisplay] Updating full display with initial display (${span.spanContext().spanId}) end.`);\n updateFullDisplaySpan(frameTimestampSeconds, span);\n }\n\n setSpanDurationAsMeasurement('time_to_initial_display', span);\n}\n\nfunction updateFullDisplaySpan(frameTimestampSeconds: number, passedInitialDisplaySpan?: Span): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to update ui.load.full_display in.`);\n return;\n }\n\n const existingInitialDisplaySpan = passedInitialDisplaySpan\n || getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n const initialDisplayEndTimestamp = existingInitialDisplaySpan && spanToJSON(existingInitialDisplaySpan).timestamp;\n if (!initialDisplayEndTimestamp) {\n fullDisplayBeforeInitialDisplay.set(activeSpan, true);\n logger.warn(`[TimeToDisplay] Full display called before initial display for active span (${activeSpan.spanContext().spanId}).`);\n return;\n }\n\n const span = startTimeToFullDisplaySpan({\n isAutoInstrumented: true,\n });\n if (!span) {\n logger.warn(`[TimeToDisplay] No TimeToFullDisplay span found or created, possibly performance is disabled.`);\n return;\n }\n\n const spanJSON = spanToJSON(span);\n if (spanJSON.timestamp) {\n logger.warn(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span already ended.`);\n return;\n }\n\n if (initialDisplayEndTimestamp > frameTimestampSeconds) {\n logger.warn(`[TimeToDisplay] Using initial display end. Full display end frame timestamp is before initial display end.`);\n span.end(initialDisplayEndTimestamp);\n } else {\n span.end(frameTimestampSeconds);\n }\n\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span updated with end timestamp.`);\n\n setSpanDurationAsMeasurement('time_to_full_display', span);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface RNSentryOnDrawNextFrameEvent {
2
3
  newFrameTimestampInSeconds: number;
3
4
  type: 'initialDisplay' | 'fullDisplay';
@@ -1 +1 @@
1
- {"version":3,"file":"timetodisplaynative.types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplaynative.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,gBAAgB,GAAG,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,4BAA4B,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
1
+ {"version":3,"file":"timetodisplaynative.types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplaynative.types.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,4BAA4B;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,gBAAgB,GAAG,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,4BAA4B,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -1,4 +1,4 @@
1
- import type { Span } from '@sentry/types';
1
+ import type { Span } from '@sentry/core';
2
2
  export interface ReactNavigationRoute {
3
3
  name: string;
4
4
  key: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,CAAC,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,CAAC,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Span } from '@sentry/types';\n\nexport interface ReactNavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params: Record<string, any>;\n}\n\nexport interface ReactNavigationCurrentRoute extends ReactNavigationRoute {\n hasBeenSeen: boolean;\n}\n\nexport type RouteChangeContextData = {\n previousRoute?: {\n [key: string]: unknown;\n name: string;\n } | null;\n route: {\n [key: string]: unknown;\n name: string;\n hasBeenSeen: boolean;\n };\n};\n\nexport type BeforeNavigate = (context: Span) => void;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Span } from '@sentry/core';\n\nexport interface ReactNavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params: Record<string, any>;\n}\n\nexport interface ReactNavigationCurrentRoute extends ReactNavigationRoute {\n hasBeenSeen: boolean;\n}\n\nexport type RouteChangeContextData = {\n previousRoute?: {\n [key: string]: unknown;\n name: string;\n } | null;\n route: {\n [key: string]: unknown;\n name: string;\n hasBeenSeen: boolean;\n };\n};\n\nexport type BeforeNavigate = (context: Span) => void;\n"]}
@@ -1,4 +1,4 @@
1
- import type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/types';
1
+ import type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/core';
2
2
  export declare const defaultTransactionSource: TransactionSource;
3
3
  export declare const customTransactionSource: TransactionSource;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/utils.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKxF,eAAO,MAAM,wBAAwB,EAAE,iBAA+B,CAAC;AACvE,eAAO,MAAM,uBAAuB,EAAE,iBAA4B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAI5C;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAKlE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAO3E;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,CAO3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,M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MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,CAO3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,IAAI,CAKtG;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAM7E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,GAAG,SAAS,CAe9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,GAAG,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC,GAC7G,QAAQ,CAYV;AAID;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,GAAG,iBAAiB,GAAG,WAAW,CAAC,GAClG,QAAQ,CAQV"}
@@ -1,5 +1,4 @@
1
- import { getSpanDescendants, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, setMeasurement, spanToJSON, } from '@sentry/core';
2
- import { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';
1
+ import { dropUndefinedKeys, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, setMeasurement, spanToJSON, timestampInSeconds, uuid4, } from '@sentry/core';
3
2
  import { RN_GLOBAL_OBJ } from '../utils/worldwide';
4
3
  export const defaultTransactionSource = 'component';
5
4
  export const customTransactionSource = 'custom';
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tracing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,0CAA0C,EAC1C,2CAA2C,EAC3C,4BAA4B,EAC5B,gCAAgC,EAChC,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,wBAAwB,GAAsB,WAAW,CAAC;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAsB,QAAQ,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,MAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAA6B;IACvD,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,SAAS,CAAC,IAAI,uBAAuB,CAAC;AAC/E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAY,EAAE,IAAU;IACnE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5E,IAAI,CAAC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AAC,MAAM,IAAI,qBAAqB,IAC3C,IAAI,EACP,CAAC;AACL,CAAC","sourcesContent":["import {\n getSpanDescendants,\n SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,\n SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n setMeasurement,\n spanToJSON,\n} from '@sentry/core';\nimport type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/types';\nimport { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\nexport const defaultTransactionSource: TransactionSource = 'component';\nexport const customTransactionSource: TransactionSource = 'custom';\n\n/**\n * A margin of error of 50ms is allowed for the async native bridge call.\n * Anything larger would reduce the accuracy of our frames measurements.\n */\nexport const MARGIN_OF_ERROR_SECONDS = 0.05;\n\nconst timeOriginMilliseconds = Date.now();\n\n/**\n * Returns the timestamp where the JS global scope was initialized.\n */\nexport function getTimeOriginMilliseconds(): number {\n return timeOriginMilliseconds;\n}\n\n/**\n * Determines if the timestamp is now or within the specified margin of error from now.\n */\nexport function isNearToNow(timestamp: number | undefined): boolean {\n if (!timestamp) {\n return false;\n }\n return Math.abs(timestampInSeconds() - timestamp) <= MARGIN_OF_ERROR_SECONDS;\n}\n\n/**\n * Sets the duration of the span as a measurement.\n * Uses `setMeasurement` function from @sentry/core.\n */\nexport function setSpanDurationAsMeasurement(name: string, span: Span): void {\n const { timestamp: spanEnd, start_timestamp: spanStart } = spanToJSON(span);\n if (!spanEnd || !spanStart) {\n return;\n }\n\n setMeasurement(name, (spanEnd - spanStart) * 1000, 'millisecond');\n}\n\n/**\n * Sets the duration of the span as a measurement.\n * Uses `setMeasurement` function from @sentry/core.\n */\nexport function setSpanDurationAsMeasurementOnSpan(name: string, span: Span, on: Span): void {\n const { timestamp: spanEnd, start_timestamp: spanStart } = spanToJSON(span);\n if (!spanEnd || !spanStart) {\n return;\n }\n\n setSpanMeasurement(on, name, (spanEnd - spanStart) * 1000, 'millisecond');\n}\n\n/**\n * Sets measurement on the give span.\n */\nexport function setSpanMeasurement(span: Span, key: string, value: number, unit: MeasurementUnit): void {\n span.addEvent(key, {\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value,\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit as string,\n });\n}\n\n/**\n * Returns the latest end timestamp of the child spans of the given span.\n */\nexport function getLatestChildSpanEndTimestamp(span: Span): number | undefined {\n const childEndTimestamps = getSpanDescendants(span)\n .map(span => spanToJSON(span).timestamp)\n .filter(timestamp => !!timestamp) as number[];\n\n return childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined;\n}\n\n/**\n * Returns unix timestamp in ms of the bundle start time.\n *\n * If not available, returns undefined.\n */\nexport function getBundleStartTimestampMs(): number | undefined {\n const bundleStartTime = RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;\n if (!bundleStartTime) {\n logger.warn('Missing the bundle start time on the global object.');\n return undefined;\n }\n\n if (!RN_GLOBAL_OBJ.nativePerformanceNow) {\n // bundleStartTime is Date.now() in milliseconds\n return bundleStartTime;\n }\n\n // nativePerformanceNow() is monotonic clock like performance.now()\n const approxStartingTimeOrigin = Date.now() - RN_GLOBAL_OBJ.nativePerformanceNow();\n return approxStartingTimeOrigin + bundleStartTime;\n}\n\n/**\n * Creates valid span JSON object from the given data.\n */\nexport function createSpanJSON(\n from: Partial<SpanJSON> & Pick<Required<SpanJSON>, 'description' | 'start_timestamp' | 'timestamp' | 'origin'>,\n): SpanJSON {\n return dropUndefinedKeys({\n status: 'ok',\n ...from,\n span_id: from.span_id ? from.span_id : uuid4().substring(16),\n trace_id: from.trace_id ? from.trace_id : uuid4(),\n data: dropUndefinedKeys({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: from.op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: from.origin,\n ...(from.data ? from.data : {}),\n }),\n });\n}\n\nconst SENTRY_DEFAULT_ORIGIN = 'manual';\n\n/**\n *\n */\nexport function createChildSpanJSON(\n parent: SpanJSON,\n from: Partial<SpanJSON> & Pick<Required<SpanJSON>, 'description' | 'start_timestamp' | 'timestamp'>,\n): SpanJSON {\n return createSpanJSON({\n op: parent.op,\n trace_id: parent.trace_id,\n parent_span_id: parent.span_id,\n origin: parent.origin || SENTRY_DEFAULT_ORIGIN,\n ...from,\n });\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tracing/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,0CAA0C,EAC1C,2CAA2C,EAC3C,4BAA4B,EAC5B,gCAAgC,EAChC,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,wBAAwB,GAAsB,WAAW,CAAC;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAsB,QAAQ,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,MAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAA6B;IACvD,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,SAAS,CAAC,IAAI,uBAAuB,CAAC;AAC/E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAY,EAAE,IAAU;I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,MAAM,CAAC,EAAE,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,cAAc,EAAE,MAAM,CAAC,OAAO,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,qBAAqB,IAC3C,IAAI,EACP,CAAC;AACL,CAAC","sourcesContent":["import type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/core';\nimport {\n dropUndefinedKeys,\n getSpanDescendants,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,\n SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n setMeasurement,\n spanToJSON,\n timestampInSeconds,\n uuid4,\n} from '@sentry/core';\n\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\nexport const defaultTransactionSource: TransactionSource = 'component';\nexport const customTransactionSource: TransactionSource = 'custom';\n\n/**\n * A margin of error of 50ms is allowed for the async native bridge call.\n * Anything larger would reduce the accuracy of our frames measurements.\n */\nexport const MARGIN_OF_ERROR_SECONDS = 0.05;\n\nconst timeOriginMilliseconds = Date.now();\n\n/**\n * Returns the timestamp where the JS global scope was initialized.\n */\nexport function getTimeOriginMilliseconds(): number {\n return timeOriginMilliseconds;\n}\n\n/**\n * Determines if the timestamp is now or within the specified margin of error from now.\n */\nexport function isNearToNow(timestamp: number | undefined): boolean {\n if (!timestamp) {\n return false;\n }\n return Math.abs(timestampInSeconds() - timestamp) <= MARGIN_OF_ERROR_SECONDS;\n}\n\n/**\n * Sets the duration of the span as a measurement.\n * Uses `setMeasurement` function from @sentry/core.\n */\nexport function setSpanDurationAsMeasurement(name: string, span: Span): void {\n const { timestamp: spanEnd, start_timestamp: spanStart } = spanToJSON(span);\n if (!spanEnd || !spanStart) {\n return;\n }\n\n setMeasurement(name, (spanEnd - spanStart) * 1000, 'millisecond');\n}\n\n/**\n * Sets the duration of the span as a measurement.\n * Uses `setMeasurement` function from @sentry/core.\n */\nexport function setSpanDurationAsMeasurementOnSpan(name: string, span: Span, on: Span): void {\n const { timestamp: spanEnd, start_timestamp: spanStart } = spanToJSON(span);\n if (!spanEnd || !spanStart) {\n return;\n }\n\n setSpanMeasurement(on, name, (spanEnd - spanStart) * 1000, 'millisecond');\n}\n\n/**\n * Sets measurement on the give span.\n */\nexport function setSpanMeasurement(span: Span, key: string, value: number, unit: MeasurementUnit): void {\n span.addEvent(key, {\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value,\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit as string,\n });\n}\n\n/**\n * Returns the latest end timestamp of the child spans of the given span.\n */\nexport function getLatestChildSpanEndTimestamp(span: Span): number | undefined {\n const childEndTimestamps = getSpanDescendants(span)\n .map(span => spanToJSON(span).timestamp)\n .filter(timestamp => !!timestamp) as number[];\n\n return childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined;\n}\n\n/**\n * Returns unix timestamp in ms of the bundle start time.\n *\n * If not available, returns undefined.\n */\nexport function getBundleStartTimestampMs(): number | undefined {\n const bundleStartTime = RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;\n if (!bundleStartTime) {\n logger.warn('Missing the bundle start time on the global object.');\n return undefined;\n }\n\n if (!RN_GLOBAL_OBJ.nativePerformanceNow) {\n // bundleStartTime is Date.now() in milliseconds\n return bundleStartTime;\n }\n\n // nativePerformanceNow() is monotonic clock like performance.now()\n const approxStartingTimeOrigin = Date.now() - RN_GLOBAL_OBJ.nativePerformanceNow();\n return approxStartingTimeOrigin + bundleStartTime;\n}\n\n/**\n * Creates valid span JSON object from the given data.\n */\nexport function createSpanJSON(\n from: Partial<SpanJSON> & Pick<Required<SpanJSON>, 'description' | 'start_timestamp' | 'timestamp' | 'origin'>,\n): SpanJSON {\n return dropUndefinedKeys({\n status: 'ok',\n ...from,\n span_id: from.span_id ? from.span_id : uuid4().substring(16),\n trace_id: from.trace_id ? from.trace_id : uuid4(),\n data: dropUndefinedKeys({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: from.op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: from.origin,\n ...(from.data ? from.data : {}),\n }),\n });\n}\n\nconst SENTRY_DEFAULT_ORIGIN = 'manual';\n\n/**\n *\n */\nexport function createChildSpanJSON(\n parent: SpanJSON,\n from: Partial<SpanJSON> & Pick<Required<SpanJSON>, 'description' | 'start_timestamp' | 'timestamp'>,\n): SpanJSON {\n return createSpanJSON({\n op: parent.op,\n trace_id: parent.trace_id,\n parent_span_id: parent.span_id,\n origin: parent.origin || SENTRY_DEFAULT_ORIGIN,\n ...from,\n });\n}\n"]}
@@ -1,5 +1,4 @@
1
- import type { BaseTransportOptions, Envelope, Transport, TransportMakeRequestResponse } from '@sentry/types';
2
- import type { PromiseBuffer } from '@sentry/utils';
1
+ import type { BaseTransportOptions, Envelope, PromiseBuffer, Transport, TransportMakeRequestResponse } from '@sentry/core';
3
2
  export declare const DEFAULT_BUFFER_SIZE = 30;
4
3
  export type BaseNativeTransport = BaseTransportOptions;
5
4
  export interface BaseNativeTransportOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAKnD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD,MAAM,WAAW,0BAA0B;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,SAAS;IAC/C,4CAA4C;IAC5C,SAAS,CAAC,QAAQ,CAAC,OAAO,EA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CAE7F;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,YAAY,GACb,EAAE;IACD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,mBAAmB,GAAG,IAAI,CAKpC"}
@@ -1,4 +1,4 @@
1
- import { makePromiseBuffer } from '@sentry/utils';
1
+ import { makePromiseBuffer } from '@sentry/core';
2
2
  import { NATIVE } from '../wrapper';
3
3
  export const DEFAULT_BUFFER_SIZE = 30;
4
4
  /** Native Transport class implementation */
@@ -1 +1 @@
1
- {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAQtC,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAI1B,YAAmB,UAAsC,EAAE;QACzD,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,QAAkB;QAC5B,yEAAyE;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAsC,EAAE;IAC1E,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,YAAY,GAGb;IACC,IAAI,YAAY,IAAI,MAAM,CAAC,iBAAiB,EAAE,EAAE;QAC9C,OAAO,mBAAmB,CAAC;KAC5B;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BaseTransportOptions, Envelope, Transport, TransportMakeRequestResponse } from '@sentry/types';\nimport type { PromiseBuffer } from '@sentry/utils';\nimport { makePromiseBuffer } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\nexport const DEFAULT_BUFFER_SIZE = 30;\n\nexport type BaseNativeTransport = BaseTransportOptions;\n\nexport interface BaseNativeTransportOptions {\n bufferSize?: number;\n}\n\n/** Native Transport class implementation */\nexport class NativeTransport implements Transport {\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<void>;\n\n public constructor(options: BaseNativeTransportOptions = {}) {\n this._buffer = makePromiseBuffer(options.bufferSize || DEFAULT_BUFFER_SIZE);\n }\n\n /**\n * Sends the envelope to the Store endpoint in Sentry.\n *\n * @param envelope Envelope that should be sent to Sentry.\n */\n public send(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n // TODO: We currently can't retrieve the response information from native\n return this._buffer.add(() => NATIVE.sendEnvelope(envelope)).then(() => ({}));\n }\n\n /**\n * Wait for all envelopes to be sent or the timeout to expire, whichever comes first.\n *\n * @param timeout Maximum time in ms the transport should wait for envelopes to be flushed. Omitting this parameter will\n * cause the transport to wait until all events are sent before resolving the promise.\n * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n * still events in the queue when the timeout is reached.\n */\n public flush(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n}\n\n/**\n * Creates a Native Transport.\n */\nexport function makeNativeTransport(options: BaseNativeTransportOptions = {}): NativeTransport {\n return new NativeTransport(options);\n}\n\n/**\n * Creates a Native Transport factory if the native transport is available.\n */\nexport function makeNativeTransportFactory({\n enableNative,\n}: {\n enableNative?: boolean;\n}): typeof makeNativeTransport | null {\n if (enableNative && NATIVE.isNativeAvailable()) {\n return makeNativeTransport;\n }\n return null;\n}\n"]}
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAQtC,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAI1B,YAAmB,UAAsC,EAAE;QACzD,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,QAAkB;QAC5B,yEAAyE;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAsC,EAAE;IAC1E,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,YAAY,GAGb;IACC,IAAI,YAAY,IAAI,MAAM,CAAC,iBAAiB,EAAE,EAAE;QAC9C,OAAO,mBAAmB,CAAC;KAC5B;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type {\n BaseTransportOptions,\n Envelope,\n PromiseBuffer,\n Transport,\n TransportMakeRequestResponse,\n} from '@sentry/core';\nimport { makePromiseBuffer } from '@sentry/core';\n\nimport { NATIVE } from '../wrapper';\n\nexport const DEFAULT_BUFFER_SIZE = 30;\n\nexport type BaseNativeTransport = BaseTransportOptions;\n\nexport interface BaseNativeTransportOptions {\n bufferSize?: number;\n}\n\n/** Native Transport class implementation */\nexport class NativeTransport implements Transport {\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<void>;\n\n public constructor(options: BaseNativeTransportOptions = {}) {\n this._buffer = makePromiseBuffer(options.bufferSize || DEFAULT_BUFFER_SIZE);\n }\n\n /**\n * Sends the envelope to the Store endpoint in Sentry.\n *\n * @param envelope Envelope that should be sent to Sentry.\n */\n public send(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n // TODO: We currently can't retrieve the response information from native\n return this._buffer.add(() => NATIVE.sendEnvelope(envelope)).then(() => ({}));\n }\n\n /**\n * Wait for all envelopes to be sent or the timeout to expire, whichever comes first.\n *\n * @param timeout Maximum time in ms the transport should wait for envelopes to be flushed. Omitting this parameter will\n * cause the transport to wait until all events are sent before resolving the promise.\n * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n * still events in the queue when the timeout is reached.\n */\n public flush(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n}\n\n/**\n * Creates a Native Transport.\n */\nexport function makeNativeTransport(options: BaseNativeTransportOptions = {}): NativeTransport {\n return new NativeTransport(options);\n}\n\n/**\n * Creates a Native Transport factory if the native transport is available.\n */\nexport function makeNativeTransportFactory({\n enableNative,\n}: {\n enableNative?: boolean;\n}): typeof makeNativeTransport | null {\n if (enableNative && NATIVE.isNativeAvailable()) {\n return makeNativeTransport;\n }\n return null;\n}\n"]}
package/dist/js/user.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { User } from '@sentry/types';
1
+ import type { User } from '@sentry/core';
2
2
  /** Requires all the keys defined on User interface to be present on an object */
3
3
  export type RequiredKeysUser = {
4
4
  [P in keyof Required<User>]: User[P] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG;KAAG,CAAC,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,CAAC"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG;KAAG,CAAC,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"","sourcesContent":["import type { User } from '@sentry/types';\n\n/** Requires all the keys defined on User interface to be present on an object */\nexport type RequiredKeysUser = { [P in keyof Required<User>]: User[P] | undefined };\n"]}
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"","sourcesContent":["import type { User } from '@sentry/core';\n\n/** Requires all the keys defined on User interface to be present on an object */\nexport type RequiredKeysUser = { [P in keyof Required<User>]: User[P] | undefined };\n"]}
@@ -1,4 +1,4 @@
1
- import type { Client } from '@sentry/types';
1
+ import type { Client } from '@sentry/core';
2
2
  /**
3
3
  * Checks if the provided Sentry client has hooks implemented.
4
4
  * @param client The Sentry client object to check.
@@ -1 +1 @@
1
- {"version":3,"file":"clientutils.d.ts","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;CAAE,CAE1F"}
1
+ {"version":3,"file":"clientutils.d.ts","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;CAAE,CAE1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"clientutils.js","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import type { Client } from '@sentry/types';\n\n/**\n * Checks if the provided Sentry client has hooks implemented.\n * @param client The Sentry client object to check.\n * @returns True if the client has hooks, false otherwise.\n */\nexport function hasHooks(client: Client): client is Client & { on: Required<Client>['on'] } {\n return client.on !== undefined;\n}\n"]}
1
+ {"version":3,"file":"clientutils.js","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import type { Client } from '@sentry/core';\n\n/**\n * Checks if the provided Sentry client has hooks implemented.\n * @param client The Sentry client object to check.\n * @returns True if the client has hooks, false otherwise.\n */\nexport function hasHooks(client: Client): client is Client & { on: Required<Client>['on'] } {\n return client.on !== undefined;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback } from '@sentry/types';
1
+ import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback } from '@sentry/core';
2
2
  export declare const header = 0;
3
3
  export declare const items = 1;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,eAAe,CAAC;AAG/G,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,KAAK,IAAI,CAAC;AAEvB;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;CAChC,GACA,aAAa,CAgBf"}
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,cAAc,CAAC;AAG9G,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,KAAK,IAAI,CAAC;AAEvB;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;CAChC,GACA,aAAa,CAgBf"}
@@ -1,4 +1,4 @@
1
- import { createEnvelope, dsnToString } from '@sentry/utils';
1
+ import { createEnvelope, dsnToString } from '@sentry/core';
2
2
  export const header = 0;
3
3
  export const items = 1;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC;AACxB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC;AAEvB;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAAsB,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GAKJ;IAED,MAAM,OAAO,iCACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAC9B,CAAC,QAAQ;QACV,QAAQ,CAAC,GAAG,IAAI;QACd,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;YACvB,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;SAC9B;KACF,CAAC,GACD,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CACpD,CAAC;IACF,MAAM,IAAI,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAEtD,OAAO,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,8BAA8B,CAAC,QAAsB;IAC5D,MAAM,eAAe,GAAwB;QAC3C,IAAI,EAAE,aAAa;KACpB,CAAC;IACF,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\nexport const header = 0;\nexport const items = 1;\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"]}
1
+ {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC;AACxB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC;AAEvB;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAAsB,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GAKJ;IAED,MAAM,OAAO,iCACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAC9B,CAAC,QAAQ;QACV,QAAQ,CAAC,GAAG,IAAI;QACd,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;YACvB,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;SAC9B;KACF,CAAC,GACD,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CACpD,CAAC;IACF,MAAM,IAAI,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAEtD,OAAO,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,8BAA8B,CAAC,QAAsB;IAC5D,MAAM,eAAe,GAAwB;QAC3C,IAAI,EAAE,aAAa;KACpB,CAAC;IACF,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core';\nimport { createEnvelope, dsnToString } from '@sentry/core';\n\nexport const header = 0;\nexport const items = 1;\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The same as `import { fill } from '@sentry/utils';` but with explicit types.
2
+ * The same as `import { fill } from '@sentry/core';` but with explicit types.
3
3
  */
4
4
  export declare function fillTyped<Source extends {
5
5
  [key: string]: any;
@@ -1,6 +1,6 @@
1
- import { fill } from '@sentry/utils';
1
+ import { fill } from '@sentry/core';
2
2
  /**
3
- * The same as `import { fill } from '@sentry/utils';` but with explicit types.
3
+ * The same as `import { fill } from '@sentry/core';` but with explicit types.
4
4
  */
5
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
6
  export function fillTyped(source, name, replacement) {
@@ -1 +1 @@
1
- {"version":3,"file":"fill.js","sourceRoot":"","sources":["../../../src/js/utils/fill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CACvB,MAAc,EACd,IAAU,EACV,WAAqD;IAErD,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { fill } from '@sentry/utils';\n\n/**\n * The same as `import { fill } from '@sentry/utils';` but with explicit types.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function fillTyped<Source extends { [key: string]: any }, Name extends keyof Source & string>(\n source: Source,\n name: Name,\n replacement: (original: Source[Name]) => Source[Name],\n): void {\n fill(source, name, replacement);\n}\n"]}
1
+ {"version":3,"file":"fill.js","sourceRoot":"","sources":["../../../src/js/utils/fill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CACvB,MAAc,EACd,IAAU,EACV,WAAqD;IAErD,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { fill } from '@sentry/core';\n\n/**\n * The same as `import { fill } from '@sentry/core';` but with explicit types.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function fillTyped<Source extends { [key: string]: any }, Name extends keyof Source & string>(\n source: Source,\n name: Name,\n replacement: (original: Source[Name]) => Source[Name],\n): void {\n fill(source, name, replacement);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { normalize } from '@sentry/utils';
1
+ import { normalize } from '@sentry/core';
2
2
  const KEY = 'value';
3
3
  /**
4
4
  * Converts any input into a valid record with string keys.
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/js/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,GAAG,GAAG,OAAO,CAAC;AAEpB;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,yBAAyB,CAAC,IAAa;IACrD,MAAM,UAAU,GAAY,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5C,IACE,UAAU,KAAK,IAAI;QACnB,OAAO,UAAU,KAAK,QAAQ;QAC9B,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QAC1B,UAAU,CAAC,WAAW,KAAK,MAAM,EACjC;QACA,8DAA8D;QAC9D,OAAO,UAAiC,CAAC;KAC1C;SAAM;QACL,OAAO;YACL,CAAC,GAAG,CAAC,EAAE,UAAU;SAClB,CAAC;KACH;AACH,CAAC","sourcesContent":["import { normalize } from '@sentry/utils';\n\nconst KEY = 'value';\n\n/**\n * Converts any input into a valid record with string keys.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function convertToNormalizedObject(data: unknown): Record<string, any> {\n const normalized: unknown = normalize(data);\n if (\n normalized !== null &&\n typeof normalized === 'object' &&\n !Array.isArray(normalized) &&\n normalized.constructor === Object\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return normalized as Record<string, any>;\n } else {\n return {\n [KEY]: normalized,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/js/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,GAAG,GAAG,OAAO,CAAC;AAEpB;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,yBAAyB,CAAC,IAAa;IACrD,MAAM,UAAU,GAAY,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5C,IACE,UAAU,KAAK,IAAI;QACnB,OAAO,UAAU,KAAK,QAAQ;QAC9B,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QAC1B,UAAU,CAAC,WAAW,KAAK,MAAM,EACjC;QACA,8DAA8D;QAC9D,OAAO,UAAiC,CAAC;KAC1C;SAAM;QACL,OAAO;YACL,CAAC,GAAG,CAAC,EAAE,UAAU;SAClB,CAAC;KACH;AACH,CAAC","sourcesContent":["import { normalize } from '@sentry/core';\n\nconst KEY = 'value';\n\n/**\n * Converts any input into a valid record with string keys.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function convertToNormalizedObject(data: unknown): Record<string, any> {\n const normalized: unknown = normalize(data);\n if (\n normalized !== null &&\n typeof normalized === 'object' &&\n !Array.isArray(normalized) &&\n normalized.constructor === Object\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return normalized as Record<string, any>;\n } else {\n return {\n [KEY]: normalized,\n };\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Outcome } from '@sentry/types';
1
+ import type { Outcome } from '@sentry/core';
2
2
  /**
3
3
  * Merges buffer with new outcomes.
4
4
  */