@sentry/react-native 8.4.0 → 8.6.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 (266) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +2 -2
  3. package/android/expo-handler/build.gradle +20 -0
  4. package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryExpoPackage.java +22 -0
  5. package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryReactNativeHostHandler.java +48 -0
  6. package/android/expo-stubs/README.md +7 -0
  7. package/android/expo-stubs/build.gradle +23 -0
  8. package/android/expo-stubs/gradle/wrapper/gradle-wrapper.jar +0 -0
  9. package/android/expo-stubs/gradle/wrapper/gradle-wrapper.properties +7 -0
  10. package/android/expo-stubs/gradlew +251 -0
  11. package/android/expo-stubs/gradlew.bat +94 -0
  12. package/android/expo-stubs/settings.gradle +1 -0
  13. package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/Package.java +11 -0
  14. package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +7 -0
  15. package/android/libs/expo-stubs.jar +0 -0
  16. package/android/libs/replay-stubs.jar +0 -0
  17. package/android/replay-stubs/build.gradle +1 -1
  18. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +71 -15
  19. package/android/src/main/java/io/sentry/react/RNSentryStart.java +3 -0
  20. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  21. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  22. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +10 -0
  23. package/dist/js/NativeLogListener.js.map +1 -1
  24. package/dist/js/NativeRNSentry.d.ts +2 -0
  25. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  26. package/dist/js/NativeRNSentry.js.map +1 -1
  27. package/dist/js/RNSentryReplayMaskNativeComponent.d.ts.map +1 -1
  28. package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts.map +1 -1
  29. package/dist/js/breadcrumb.js.map +1 -1
  30. package/dist/js/client.js.map +1 -1
  31. package/dist/js/feedback/FeedbackButton.js.map +1 -1
  32. package/dist/js/feedback/FeedbackWidget.js +6 -6
  33. package/dist/js/feedback/FeedbackWidget.js.map +1 -1
  34. package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +1 -1
  35. package/dist/js/feedback/FeedbackWidgetManager.d.ts +3 -1
  36. package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +1 -1
  37. package/dist/js/feedback/FeedbackWidgetManager.js +15 -1
  38. package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
  39. package/dist/js/feedback/FeedbackWidgetProvider.d.ts +3 -2
  40. package/dist/js/feedback/FeedbackWidgetProvider.d.ts.map +1 -1
  41. package/dist/js/feedback/FeedbackWidgetProvider.js +12 -4
  42. package/dist/js/feedback/FeedbackWidgetProvider.js.map +1 -1
  43. package/dist/js/feedback/ScreenshotButton.d.ts +1 -1
  44. package/dist/js/feedback/ScreenshotButton.js.map +1 -1
  45. package/dist/js/feedback/ShakeToReportBug.d.ts +27 -0
  46. package/dist/js/feedback/ShakeToReportBug.d.ts.map +1 -0
  47. package/dist/js/feedback/ShakeToReportBug.js +83 -0
  48. package/dist/js/feedback/ShakeToReportBug.js.map +1 -0
  49. package/dist/js/feedback/defaults.js.map +1 -1
  50. package/dist/js/feedback/integration.d.ts +13 -2
  51. package/dist/js/feedback/integration.d.ts.map +1 -1
  52. package/dist/js/feedback/integration.js +7 -1
  53. package/dist/js/feedback/integration.js.map +1 -1
  54. package/dist/js/feedback/lazy.js.map +1 -1
  55. package/dist/js/feedback/utils.d.ts.map +1 -1
  56. package/dist/js/feedback/utils.js.map +1 -1
  57. package/dist/js/index.d.ts +1 -1
  58. package/dist/js/index.d.ts.map +1 -1
  59. package/dist/js/index.js +1 -1
  60. package/dist/js/index.js.map +1 -1
  61. package/dist/js/integrations/appRegistry.d.ts.map +1 -1
  62. package/dist/js/integrations/appRegistry.js.map +1 -1
  63. package/dist/js/integrations/breadcrumbs.d.ts.map +1 -1
  64. package/dist/js/integrations/debugsymbolicator.js +6 -4
  65. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  66. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  67. package/dist/js/integrations/default.d.ts.map +1 -1
  68. package/dist/js/integrations/default.js +3 -2
  69. package/dist/js/integrations/default.js.map +1 -1
  70. package/dist/js/integrations/devicecontext.js +1 -1
  71. package/dist/js/integrations/devicecontext.js.map +1 -1
  72. package/dist/js/integrations/expoconstants.js.map +1 -1
  73. package/dist/js/integrations/expocontext.js.map +1 -1
  74. package/dist/js/integrations/exports.d.ts +1 -0
  75. package/dist/js/integrations/exports.d.ts.map +1 -1
  76. package/dist/js/integrations/exports.js +1 -0
  77. package/dist/js/integrations/exports.js.map +1 -1
  78. package/dist/js/integrations/expoupdateslistener.d.ts +38 -0
  79. package/dist/js/integrations/expoupdateslistener.d.ts.map +1 -0
  80. package/dist/js/integrations/expoupdateslistener.js +130 -0
  81. package/dist/js/integrations/expoupdateslistener.js.map +1 -0
  82. package/dist/js/integrations/logEnricherIntegration.js +1 -1
  83. package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
  84. package/dist/js/integrations/modulesloader.js.map +1 -1
  85. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  86. package/dist/js/integrations/nativelinkederrors.js +1 -0
  87. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  88. package/dist/js/integrations/primitiveTagIntegration.js.map +1 -1
  89. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  90. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  91. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  92. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  93. package/dist/js/integrations/release.js +1 -1
  94. package/dist/js/integrations/release.js.map +1 -1
  95. package/dist/js/integrations/rewriteframes.js.map +1 -1
  96. package/dist/js/integrations/screenshot.js +1 -1
  97. package/dist/js/integrations/screenshot.js.map +1 -1
  98. package/dist/js/integrations/sdkinfo.js.map +1 -1
  99. package/dist/js/integrations/spotlight.js.map +1 -1
  100. package/dist/js/integrations/viewhierarchy.js +1 -1
  101. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  102. package/dist/js/misc.js +2 -2
  103. package/dist/js/misc.js.map +1 -1
  104. package/dist/js/options.d.ts +13 -1
  105. package/dist/js/options.d.ts.map +1 -1
  106. package/dist/js/options.js.map +1 -1
  107. package/dist/js/playground/examples.js.map +1 -1
  108. package/dist/js/playground/modal.d.ts +2 -2
  109. package/dist/js/playground/modal.d.ts.map +1 -1
  110. package/dist/js/playground/modal.js +6 -6
  111. package/dist/js/playground/modal.js.map +1 -1
  112. package/dist/js/profiling/cache.js.map +1 -1
  113. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  114. package/dist/js/profiling/debugid.js.map +1 -1
  115. package/dist/js/profiling/integration.d.ts.map +1 -1
  116. package/dist/js/profiling/integration.js.map +1 -1
  117. package/dist/js/profiling/utils.js.map +1 -1
  118. package/dist/js/replay/CustomMask.d.ts.map +1 -1
  119. package/dist/js/replay/CustomMask.js.map +1 -1
  120. package/dist/js/replay/CustomMask.web.d.ts.map +1 -1
  121. package/dist/js/replay/browserReplay.d.ts.map +1 -1
  122. package/dist/js/replay/browserReplay.js.map +1 -1
  123. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  124. package/dist/js/replay/mobilereplay.js +21 -2
  125. package/dist/js/replay/mobilereplay.js.map +1 -1
  126. package/dist/js/replay/networkUtils.d.ts +0 -1
  127. package/dist/js/replay/networkUtils.d.ts.map +1 -1
  128. package/dist/js/replay/networkUtils.js.map +1 -1
  129. package/dist/js/replay/xhrUtils.js.map +1 -1
  130. package/dist/js/scopeSync.js.map +1 -1
  131. package/dist/js/sdk.d.ts.map +1 -1
  132. package/dist/js/sdk.js +4 -2
  133. package/dist/js/sdk.js.map +1 -1
  134. package/dist/js/tools/ModulesCollector.js.map +1 -1
  135. package/dist/js/tools/easBuildHooks.js +13 -14
  136. package/dist/js/tools/easBuildHooks.js.map +1 -1
  137. package/dist/js/tools/enableLogger.js +1 -2
  138. package/dist/js/tools/enableLogger.js.map +1 -1
  139. package/dist/js/tools/metroMiddleware.d.ts.map +1 -1
  140. package/dist/js/tools/metroMiddleware.js.map +1 -1
  141. package/dist/js/tools/metroconfig.js +6 -7
  142. package/dist/js/tools/metroconfig.js.map +1 -1
  143. package/dist/js/tools/sentryBabelTransformerUtils.js +7 -7
  144. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  145. package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
  146. package/dist/js/tools/sentryMetroSerializer.js +2 -2
  147. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  148. package/dist/js/tools/sentryOptionsSerializer.js +1 -2
  149. package/dist/js/tools/sentryOptionsSerializer.js.map +1 -1
  150. package/dist/js/tools/sentryReleaseInjector.d.ts +1 -1
  151. package/dist/js/tools/sentryReleaseInjector.d.ts.map +1 -1
  152. package/dist/js/tools/sentryReleaseInjector.js.map +1 -1
  153. package/dist/js/tools/utils.d.ts.map +1 -1
  154. package/dist/js/tools/utils.js +9 -10
  155. package/dist/js/tools/utils.js.map +1 -1
  156. package/dist/js/tools/vendor/metro/countLines.d.ts.map +1 -1
  157. package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
  158. package/dist/js/tools/vendor/metro/utils.js.map +1 -1
  159. package/dist/js/touchevents.d.ts.map +1 -1
  160. package/dist/js/touchevents.js +2 -0
  161. package/dist/js/touchevents.js.map +1 -1
  162. package/dist/js/tracing/expoAsset.js.map +1 -1
  163. package/dist/js/tracing/expoImage.js.map +1 -1
  164. package/dist/js/tracing/expoRouter.js.map +1 -1
  165. package/dist/js/tracing/gesturetracing.js.map +1 -1
  166. package/dist/js/tracing/integrations/appStart.d.ts +9 -1
  167. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  168. package/dist/js/tracing/integrations/appStart.js +61 -12
  169. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  170. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
  171. package/dist/js/tracing/integrations/nativeFrames.js +35 -22
  172. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  173. package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  174. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
  175. package/dist/js/tracing/integrations/stalltracking.js +4 -1
  176. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  177. package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -1
  178. package/dist/js/tracing/integrations/timeToDisplayIntegration.js +15 -14
  179. package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
  180. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
  181. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  182. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
  183. package/dist/js/tracing/onSpanEndUtils.js +20 -13
  184. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  185. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  186. package/dist/js/tracing/reactnativenavigation.js +1 -1
  187. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  188. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  189. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  190. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  191. package/dist/js/tracing/reactnavigation.d.ts +3 -0
  192. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  193. package/dist/js/tracing/reactnavigation.js +7 -3
  194. package/dist/js/tracing/reactnavigation.js.map +1 -1
  195. package/dist/js/tracing/span.d.ts +2 -17
  196. package/dist/js/tracing/span.d.ts.map +1 -1
  197. package/dist/js/tracing/span.js.map +1 -1
  198. package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
  199. package/dist/js/tracing/timetodisplay.js.map +1 -1
  200. package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
  201. package/dist/js/tracing/timetodisplaynative.js.map +1 -1
  202. package/dist/js/tracing/utils.js.map +1 -1
  203. package/dist/js/transports/encodePolyfill.d.ts +1 -1
  204. package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
  205. package/dist/js/transports/encodePolyfill.js.map +1 -1
  206. package/dist/js/transports/native.js.map +1 -1
  207. package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
  208. package/dist/js/utils/encode.js.map +1 -1
  209. package/dist/js/utils/environment.js.map +1 -1
  210. package/dist/js/utils/ignorerequirecyclelogs.js +1 -1
  211. package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
  212. package/dist/js/utils/normalize.js.map +1 -1
  213. package/dist/js/utils/outcome.js.map +1 -1
  214. package/dist/js/utils/primitiveConverter.js.map +1 -1
  215. package/dist/js/utils/release.js.map +1 -1
  216. package/dist/js/utils/rnlibraries.js.map +1 -1
  217. package/dist/js/utils/safe.d.ts +1 -1
  218. package/dist/js/utils/safe.d.ts.map +1 -1
  219. package/dist/js/utils/safe.js.map +1 -1
  220. package/dist/js/utils/worldwide.d.ts +0 -1
  221. package/dist/js/utils/worldwide.d.ts.map +1 -1
  222. package/dist/js/utils/xhr.d.ts +0 -1
  223. package/dist/js/utils/xhr.d.ts.map +1 -1
  224. package/dist/js/utils/xhr.js.map +1 -1
  225. package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
  226. package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
  227. package/dist/js/version.d.ts +1 -1
  228. package/dist/js/version.js +1 -1
  229. package/dist/js/version.js.map +1 -1
  230. package/dist/js/wrapper.d.ts.map +1 -1
  231. package/dist/js/wrapper.js +5 -6
  232. package/dist/js/wrapper.js.map +1 -1
  233. package/expo-module.config.json +7 -0
  234. package/ios/RNSentry.mm +47 -1
  235. package/ios/RNSentryEvents.h +1 -0
  236. package/ios/RNSentryEvents.m +1 -0
  237. package/ios/RNSentryStart.m +4 -1
  238. package/ios/RNSentryVersion.m +1 -1
  239. package/package.json +15 -15
  240. package/plugin/build/withSentry.js +1 -1
  241. package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
  242. package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
  243. package/scripts/sentry-xcode.sh +14 -0
  244. package/sentry.gradle +13 -0
  245. package/src/js/NativeRNSentry.ts +2 -0
  246. package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
  247. package/ts3.8/dist/js/feedback/FeedbackWidgetManager.d.ts +3 -1
  248. package/ts3.8/dist/js/feedback/FeedbackWidgetProvider.d.ts +3 -2
  249. package/ts3.8/dist/js/feedback/ScreenshotButton.d.ts +1 -1
  250. package/ts3.8/dist/js/feedback/ShakeToReportBug.d.ts +27 -0
  251. package/ts3.8/dist/js/feedback/integration.d.ts +13 -2
  252. package/ts3.8/dist/js/index.d.ts +1 -1
  253. package/ts3.8/dist/js/integrations/exports.d.ts +1 -0
  254. package/ts3.8/dist/js/integrations/expoupdateslistener.d.ts +38 -0
  255. package/ts3.8/dist/js/options.d.ts +13 -1
  256. package/ts3.8/dist/js/playground/modal.d.ts +2 -2
  257. package/ts3.8/dist/js/replay/networkUtils.d.ts +0 -1
  258. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +9 -1
  259. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  260. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +3 -0
  261. package/ts3.8/dist/js/tracing/span.d.ts +2 -17
  262. package/ts3.8/dist/js/transports/encodePolyfill.d.ts +1 -1
  263. package/ts3.8/dist/js/utils/safe.d.ts +1 -1
  264. package/ts3.8/dist/js/utils/worldwide.d.ts +0 -1
  265. package/ts3.8/dist/js/utils/xhr.d.ts +0 -1
  266. package/ts3.8/dist/js/version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"countLines.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/countLines.ts"],"names":[],"mappings":"iCAgCwB,MAAM,KAAG,MAAM;AAAvC,wBAAoF"}
1
+ {"version":3,"file":"countLines.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/countLines.ts"],"names":[],"mappings":"yBAgCgB,QAAQ,MAAM,KAAG,MAAM;AAAvC,wBAAoF"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA+CnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UACpB,aAAa;2BAIK,MAAM,KAAK,MAAM;MAEzC,SAAS,MAAM,EAMjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,QAAO,eAqC/C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA+CnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,aAAa,EACpB,qBAEG;IACD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1C,KACA,SAAS,MAAM,EAMjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,QAAO,eAqC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;;AAiC3C,IAAI,kBAAuB,CAAC;AAC5B,IAAI;I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GAAG,uBAAuB,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,IAAA,wBAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;YACxF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SACtE,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,4BAA4B,gCAqCvC","sourcesContent":["// Vendored / modified from @facebook/metro\n\n// https://github.com/facebook/metro/commit/9b85f83c9cc837d8cd897aa7723be7da5b296067\n\n// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type * as baseJSBundleType from 'metro/private/DeltaBundler/Serializers/baseJSBundle';\nimport type * as sourceMapStringType from 'metro/private/DeltaBundler/Serializers/sourceMapString';\nimport type * as bundleToStringType from 'metro/private/lib/bundleToString';\nimport type { MetroSerializer } from '../../utils';\n\nlet baseJSBundleModule: any;\ntry {\n baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');\n} catch {\n baseJSBundleModule = require('metro/src/DeltaBundler/Serializers/baseJSBundle');\n}\n\nconst baseJSBundle: typeof baseJSBundleType =\n typeof baseJSBundleModule === 'function'\n ? baseJSBundleModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n baseJSBundleModule?.baseJSBundle ?? baseJSBundleModule?.default;\n\nlet sourceMapString: typeof sourceMapStringType;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const sourceMapStringModule = require('metro/private/DeltaBundler/Serializers/sourceMapString');\n sourceMapString = (sourceMapStringModule as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n} catch (e) {\n sourceMapString = require('metro/src/DeltaBundler/Serializers/sourceMapString');\n if ('sourceMapString' in sourceMapString) {\n // Changed to named export in https://github.com/facebook/metro/commit/34148e61200a508923315fbe387b26d1da27bf4b\n // Metro 0.81.0 and 0.80.10 patch\n sourceMapString = (sourceMapString as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n }\n}\n\nlet bundleToStringModule: any;\ntry {\n bundleToStringModule = require('metro/private/lib/bundleToString');\n} catch {\n bundleToStringModule = require('metro/src/lib/bundleToString');\n}\n\nconst bundleToString: typeof bundleToStringType =\n typeof bundleToStringModule === 'function'\n ? bundleToStringModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n bundleToStringModule?.bundleToString ?? bundleToStringModule?.default;\n\ntype NewSourceMapStringExport = {\n // Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28\n sourceMapString: typeof sourceMapString;\n};\n\n/**\n * This function ensures that modules in source maps are sorted in the same\n * order as in a plain JS bundle.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984\n */\nexport const getSortedModules = (\n graph: ReadOnlyGraph,\n {\n createModuleId,\n }: {\n createModuleId: (file: string) => number;\n },\n): readonly Module[] => {\n const modules = [...graph.dependencies.values()];\n // Sort by IDs\n return modules.sort(\n (a: Module<MixedOutput>, b: Module<MixedOutput>) => createModuleId(a.path) - createModuleId(b.path),\n );\n};\n\n/**\n * Creates the default Metro plain bundle serializer.\n * Because Metro exports only the intermediate serializer functions, we need to\n * assemble the final serializer ourselves. We have to work with the modules the same as Metro does\n * to avoid unexpected changes in the final bundle.\n *\n * This is used when the user does not provide a custom serializer.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277\n */\nexport const createDefaultMetroSerializer = (): MetroSerializer => {\n return (entryPoint, preModules, graph, options) => {\n // baseJSBundle assigns IDs to modules in a consistent order\n let bundle = baseJSBundle(entryPoint, preModules, graph, options);\n if (options.sentryBundleCallback && !graph.transformOptions.hot) {\n bundle = options.sentryBundleCallback(bundle);\n }\n const { code } = bundleToString(bundle);\n if (graph.transformOptions.hot) {\n // Hot means running in dev server, sourcemaps are generated on demand\n return code;\n }\n\n let sourceMapStringFunction: typeof sourceMapString | undefined;\n if (typeof sourceMapString === 'function') {\n sourceMapStringFunction = sourceMapString;\n } else if (\n typeof sourceMapString === 'object' &&\n sourceMapString != null &&\n 'sourceMapString' in sourceMapString &&\n typeof sourceMapString['sourceMapString'] === 'function'\n ) {\n sourceMapStringFunction = (sourceMapString as NewSourceMapStringExport).sourceMapString;\n } else {\n throw new Error(`\n[@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.\nPlease check the version of Metro you are using and report the issue at http://www.github.com/getsentry/sentry-react-native/issues\n`);\n }\n\n // Always generate source maps, can't use Sentry without source maps\n const map = sourceMapStringFunction([...preModules, ...getSortedModules(graph, options)], {\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList || (() => false),\n });\n return { code, map };\n };\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;;AAiC3C,IAAI,kBAAuB,CAAC;AAC5B,IAAI,CAAC;IACH,kBAAkB,GAAG,OAAO,CAAC,qDAAqD,CAAC,CAAC;AACtF,CAAC;AAAC,WAAM,CAAC;IACP,kBAAkB,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,YAAY,GAChB,OAAO,kBAAkB,KAAK,UAAU;IACtC,CAAC,CAAC,kBAAkB;IACpB,CAAC,CAAC,sEAAsE;QACtE,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,YAAY,mCAAI,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAC;AAEtE,IAAI,eAA2C,CAAC;AAChD,IAAI,CAAC;IACH,8DAA8D;IAC9D,MAAM,qBAAqB,GAAG,OAAO,CAAC,wDAAwD,CAAC,CAAC;IAChG,eAAe,GAAI,qBAAyE,CAAC,eAAe,CAAC;AAC/G,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,eAAe,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;IAChF,IAAI,iBAAiB,IAAI,eAAe,EAAE,CAAC;QACzC,+GAA+G;QAC/G,iCAAiC;QACjC,eAAe,GAAI,eAAmE,CAAC,eAAe,CAAC;IACzG,CAAC;AACH,CAAC;AAED,IAAI,oBAAyB,CAAC;AAC9B,IAAI,CAAC;IACH,oBAAoB,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACrE,CAAC;AAAC,WAAM,CAAC;IACP,oBAAoB,GAAG,OAAO,CA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QACd,CAAC;QAED,IAAI,uBAA2D,CAAC;QAChE,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE,CAAC;YAC1C,uBAAuB,GAAG,eAAe,CAAC;QAC5C,CAAC;aAAM,IACL,OAAO,eAAe,KAAK,QAAQ;YACnC,eAAe,IAAI,IAAI;YACvB,iBAAiB,IAAI,eAAe;YACpC,OAAO,eAAe,CAAC,iBAAiB,CAAC,KAAK,UAAU,EACxD,CAAC;YACD,uBAAuB,GAAI,eAA4C,CAAC,eAAe,CAAC;QAC1F,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC;;;CAGrB,CAAC,CAAC;QACC,CAAC;QAED,oEAAoE;QACpE,MAAM,GAAG,GAAG,uBAAuB,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,IAAA,wBAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;YACxF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SACtE,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,4BAA4B,gCAqCvC","sourcesContent":["// Vendored / modified from @facebook/metro\n\n// https://github.com/facebook/metro/commit/9b85f83c9cc837d8cd897aa7723be7da5b296067\n\n// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type * as baseJSBundleType from 'metro/private/DeltaBundler/Serializers/baseJSBundle';\nimport type * as sourceMapStringType from 'metro/private/DeltaBundler/Serializers/sourceMapString';\nimport type * as bundleToStringType from 'metro/private/lib/bundleToString';\nimport type { MetroSerializer } from '../../utils';\n\nlet baseJSBundleModule: any;\ntry {\n baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');\n} catch {\n baseJSBundleModule = require('metro/src/DeltaBundler/Serializers/baseJSBundle');\n}\n\nconst baseJSBundle: typeof baseJSBundleType =\n typeof baseJSBundleModule === 'function'\n ? baseJSBundleModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n baseJSBundleModule?.baseJSBundle ?? baseJSBundleModule?.default;\n\nlet sourceMapString: typeof sourceMapStringType;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const sourceMapStringModule = require('metro/private/DeltaBundler/Serializers/sourceMapString');\n sourceMapString = (sourceMapStringModule as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n} catch (e) {\n sourceMapString = require('metro/src/DeltaBundler/Serializers/sourceMapString');\n if ('sourceMapString' in sourceMapString) {\n // Changed to named export in https://github.com/facebook/metro/commit/34148e61200a508923315fbe387b26d1da27bf4b\n // Metro 0.81.0 and 0.80.10 patch\n sourceMapString = (sourceMapString as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n }\n}\n\nlet bundleToStringModule: any;\ntry {\n bundleToStringModule = require('metro/private/lib/bundleToString');\n} catch {\n bundleToStringModule = require('metro/src/lib/bundleToString');\n}\n\nconst bundleToString: typeof bundleToStringType =\n typeof bundleToStringModule === 'function'\n ? bundleToStringModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n bundleToStringModule?.bundleToString ?? bundleToStringModule?.default;\n\ntype NewSourceMapStringExport = {\n // Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28\n sourceMapString: typeof sourceMapString;\n};\n\n/**\n * This function ensures that modules in source maps are sorted in the same\n * order as in a plain JS bundle.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984\n */\nexport const getSortedModules = (\n graph: ReadOnlyGraph,\n {\n createModuleId,\n }: {\n createModuleId: (file: string) => number;\n },\n): readonly Module[] => {\n const modules = [...graph.dependencies.values()];\n // Sort by IDs\n return modules.sort(\n (a: Module<MixedOutput>, b: Module<MixedOutput>) => createModuleId(a.path) - createModuleId(b.path),\n );\n};\n\n/**\n * Creates the default Metro plain bundle serializer.\n * Because Metro exports only the intermediate serializer functions, we need to\n * assemble the final serializer ourselves. We have to work with the modules the same as Metro does\n * to avoid unexpected changes in the final bundle.\n *\n * This is used when the user does not provide a custom serializer.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277\n */\nexport const createDefaultMetroSerializer = (): MetroSerializer => {\n return (entryPoint, preModules, graph, options) => {\n // baseJSBundle assigns IDs to modules in a consistent order\n let bundle = baseJSBundle(entryPoint, preModules, graph, options);\n if (options.sentryBundleCallback && !graph.transformOptions.hot) {\n bundle = options.sentryBundleCallback(bundle);\n }\n const { code } = bundleToString(bundle);\n if (graph.transformOptions.hot) {\n // Hot means running in dev server, sourcemaps are generated on demand\n return code;\n }\n\n let sourceMapStringFunction: typeof sourceMapString | undefined;\n if (typeof sourceMapString === 'function') {\n sourceMapStringFunction = sourceMapString;\n } else if (\n typeof sourceMapString === 'object' &&\n sourceMapString != null &&\n 'sourceMapString' in sourceMapString &&\n typeof sourceMapString['sourceMapString'] === 'function'\n ) {\n sourceMapStringFunction = (sourceMapString as NewSourceMapStringExport).sourceMapString;\n } else {\n throw new Error(`\n[@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.\nPlease check the version of Metro you are using and report the issue at http://www.github.com/getsentry/sentry-react-native/issues\n`);\n }\n\n // Always generate source maps, can't use Sentry without source maps\n const map = sourceMapStringFunction([...preModules, ...getSortedModules(graph, options)], {\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList || (() => false),\n });\n return { code, map };\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"touchevents.d.ts","sourceRoot":"","sources":["../../src/js/touchevents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EA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,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACrD,CAAC;AAsCF;;GAEG;AACH,cAAM,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,CAAC;IACvE,OAAc,WAAW,EAAE,MAAM,CAAiC;IAClE,OAAc,YAAY,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAK1D;IAEF,SAAgB,IAAI,EAAE,MAAM,CAAwB;IAEpD;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAKhC;;OAEG;IACI,MAAM,IAAI,KAAK,CAAC,SAAS;IAYhC;;OAEG;IACH,OAAO,CAAC,cAAc;IAsBtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB;;;OAGG;IAEH,OAAO,CAAC,aAAa;IA+DrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAuB1B;AAgFD;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAE1B,gBAAgB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EACxC,gBAAgB,uBAAuB,KACtC,KAAK,CAAC,iBAUR,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC"}
@@ -210,7 +210,9 @@ function getLabelValue(props, labelKey) {
210
210
  ? props[SENTRY_LABEL_PROP_KEY]
211
211
  // For some reason type narrowing doesn't work as expected with indexing when checking it all in one go in
212
212
  // the "check-label" if sentence, so we have to assign it to a variable here first
213
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
213
214
  : typeof labelKey === 'string' && typeof props[labelKey] == 'string' && props[labelKey].length > 0
215
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
214
216
  ? props[labelKey]
215
217
  : undefined;
216
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"touchevents.js","sourceRoot":"","sources":["../../src/js/touchevents.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AA0ChE,MAAM,gBAAgB,GAAG,UAAU,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE;QACX,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,OAAO,CAAC;AAC5C,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAC7C,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AACjE,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AACtD,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAsBvD;;GAEG;AACH,MAAM,kBAAmB,SAAQ,KAAK,CAAC,SAAkC;IAAzE;;QASkB,SAAI,GAAW,oBAAoB,CAAC;IAuKtD,CAAC;IArKC;;OAEG;IACI,iBAAiB;;QACtB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,uDAAG,iBAA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AAC;AAED,SAAS,iBAAiB,CAAC,WAA4B;IACrD,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;QAC9B,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE1D,qDAAqD;IACrD,IACE,OAAO,UAAU,KAAK,QAAQ;QAC9B,UAAU,KAAK,IAAI;QACnB,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAC1B;QACA,OAAO,UAAgD,CAAC;KACzD;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,sBAAsB,GAAG;AAC7B,8DAA8D;AAC9D,cAAwC,EACxC,aAAuC,EACd,EAAE;IAC3B,MAAM,gBAAgB,GAA4B,KAAK,CAAC,EAAE,CAAC,CACzD,oBAAC,kBAAkB,oBAAK,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC;QAC3C,oBAAC,cAAc,oBAAK,KAAK,EAAI,CACV,CACtB,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,wBAAwB,CAAC;IAExD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import type { SeverityLevel, SpanAttributeValue } from '@sentry/core';\nimport { addBreadcrumb, debug, dropUndefinedKeys, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport * as React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\nimport { createIntegration } from './integrations/factory';\nimport { startUserInteractionSpan } from './tracing/integrations/userInteraction';\nimport { UI_ACTION_TOUCH } from './tracing/ops';\nimport { SPAN_ORIGIN_AUTO_INTERACTION } from './tracing/origin';\n\nexport type TouchEventBoundaryProps = {\n /**\n * The category assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbCategory?: string;\n /**\n * The type assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbType?: string;\n /**\n * The max number of components to display when logging a touch's component tree.\n */\n maxComponentTreeSize?: number;\n /**\n * Component name(s) to ignore when logging the touch event. This prevents unhelpful logs such as\n * \"Touch event within element: View\" where you still can't tell which View it occurred in.\n */\n ignoreNames?: Array<string | RegExp>;\n /**\n * Deprecated, use ignoreNames instead\n * @deprecated\n */\n ignoredDisplayNames?: Array<string | RegExp>;\n /**\n * React Node wrapped by TouchEventBoundary.\n */\n children?: React.ReactNode;\n /**\n * Label Name used to identify the touched element.\n */\n labelName?: string;\n /**\n * Custom attributes to add to user interaction spans.\n * Accepts an object with string keys and values that are strings, numbers, booleans, or arrays.\n *\n * @experimental This API is experimental and may change in future releases.\n */\n spanAttributes?: Record<string, SpanAttributeValue>;\n};\n\nconst touchEventStyles = StyleSheet.create({\n wrapperView: {\n flex: 1,\n },\n});\n\nconst DEFAULT_BREADCRUMB_CATEGORY = 'touch';\nconst DEFAULT_BREADCRUMB_TYPE = 'user';\nconst DEFAULT_MAX_COMPONENT_TREE_SIZE = 20;\n\nconst SENTRY_LABEL_PROP_KEY = 'sentry-label';\nconst SENTRY_SPAN_ATTRIBUTES_PROP_KEY = 'sentry-span-attributes';\nconst SENTRY_COMPONENT_PROP_KEY = 'data-sentry-component';\nconst SENTRY_ELEMENT_PROP_KEY = 'data-sentry-element';\nconst SENTRY_FILE_PROP_KEY = 'data-sentry-source-file';\n\ninterface ElementInstance {\n elementType?: {\n displayName?: string;\n name?: string;\n };\n memoizedProps?: Record<string, unknown>;\n return?: ElementInstance;\n}\n\ninterface TouchedComponentInfo {\n name?: string;\n label?: string;\n element?: string;\n file?: string;\n}\n\ninterface PrivateGestureResponderEvent extends GestureResponderEvent {\n _targetInst?: ElementInstance;\n}\n\n/**\n * Boundary to log breadcrumbs for interaction events.\n */\nclass TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {\n public static displayName: string = '__Sentry.TouchEventBoundary';\n public static defaultProps: Partial<TouchEventBoundaryProps> = {\n breadcrumbCategory: DEFAULT_BREADCRUMB_CATEGORY,\n breadcrumbType: DEFAULT_BREADCRUMB_TYPE,\n ignoreNames: [],\n maxComponentTreeSize: DEFAULT_MAX_COMPONENT_TREE_SIZE,\n };\n\n public readonly name: string = 'TouchEventBoundary';\n\n /**\n * Registers the TouchEventBoundary as a Sentry Integration.\n */\n public componentDidMount(): void {\n const client = getClient();\n client?.addIntegration?.(createIntegration(this.name));\n }\n\n /**\n *\n */\n public render(): React.ReactNode {\n return (\n <View\n style={touchEventStyles.wrapperView}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onTouchStart={this._onTouchStart.bind(this) as any}\n >\n {this.props.children}\n </View>\n );\n }\n\n /**\n * Logs the touch event given the component tree names and a label.\n */\n private _logTouchEvent(touchPath: TouchedComponentInfo[], label?: string): void {\n const level = 'info' as SeverityLevel;\n\n const root = touchPath[0];\n if (!root) {\n debug.warn('[TouchEvents] No root component found in touch path.');\n return;\n }\n\n const detail = label ? label : `${root.name}${root.file ? ` (${root.file})` : ''}`;\n const crumb = {\n category: this.props.breadcrumbCategory,\n data: { path: touchPath },\n level: level,\n message: `Touch event within element: ${detail}`,\n type: this.props.breadcrumbType,\n };\n addBreadcrumb(crumb);\n\n debug.log(`[TouchEvents] ${crumb.message}`);\n }\n\n /**\n * Checks if the name is supposed to be ignored.\n */\n private _isNameIgnored(name: string): boolean {\n let ignoreNames = this.props.ignoreNames || [];\n // eslint-disable-next-line deprecation/deprecation\n if (this.props.ignoredDisplayNames) {\n // This is to make it compatible with prior version.\n // eslint-disable-next-line deprecation/deprecation\n ignoreNames = [...ignoreNames, ...this.props.ignoredDisplayNames];\n }\n\n return ignoreNames.some(\n (ignoreName: string | RegExp) =>\n (typeof ignoreName === 'string' && name === ignoreName) ||\n (ignoreName instanceof RegExp && name.match(ignoreName)),\n );\n }\n\n // Originally was going to clean the names of any HOCs as well but decided that it might hinder debugging effectively. Will leave here in case\n // private readonly _cleanName = (name: string): string =>\n // name.replace(/.*\\(/g, \"\").replace(/\\)/g, \"\");\n\n /**\n * Traverses through the component tree when a touch happens and logs it.\n * @param e\n */\n // eslint-disable-next-line complexity\n private _onTouchStart(e: PrivateGestureResponderEvent): void {\n if (!e._targetInst) {\n return;\n }\n\n let currentInst: ElementInstance | undefined = e._targetInst;\n const touchPath: TouchedComponentInfo[] = [];\n\n while (\n currentInst &&\n // maxComponentTreeSize will always be defined as we have a defaultProps. But ts needs a check so this is here.\n this.props.maxComponentTreeSize &&\n touchPath.length < this.props.maxComponentTreeSize\n ) {\n if (\n // If the loop gets to the boundary itself, break.\n currentInst.elementType?.displayName === TouchEventBoundary.displayName\n ) {\n break;\n }\n\n const info = getTouchedComponentInfo(currentInst, this.props.labelName);\n this._pushIfNotIgnored(touchPath, info);\n\n currentInst = currentInst.return;\n }\n\n const label = touchPath.find(info => info.label)?.label;\n if (touchPath.length > 0) {\n this._logTouchEvent(touchPath, label);\n }\n\n const span = startUserInteractionSpan({\n elementId: label,\n op: UI_ACTION_TOUCH,\n });\n if (span) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);\n\n // Apply custom attributes from sentry-span-attributes prop\n // Traverse the component tree to find custom attributes\n let instForAttributes: ElementInstance | undefined = e._targetInst;\n let customAttributes: Record<string, SpanAttributeValue> | undefined;\n\n while (instForAttributes) {\n if (instForAttributes.elementType?.displayName === TouchEventBoundary.displayName) {\n break;\n }\n\n customAttributes = getSpanAttributes(instForAttributes);\n if (customAttributes && Object.keys(customAttributes).length > 0) {\n break;\n }\n\n instForAttributes = instForAttributes.return;\n }\n\n if (customAttributes && Object.keys(customAttributes).length > 0) {\n span.setAttributes(customAttributes);\n }\n }\n }\n\n /**\n * Pushes the name to the componentTreeNames array if it is not ignored.\n */\n private _pushIfNotIgnored(touchPath: TouchedComponentInfo[], value: TouchedComponentInfo | undefined): boolean {\n if (!value) {\n return false;\n }\n\n if (!value.name && !value.label) {\n return false;\n }\n if (value.name && this._isNameIgnored(value.name)) {\n return false;\n }\n if (value.label && this._isNameIgnored(value.label)) {\n return false;\n }\n\n // Deduplicate same subsequent items.\n if (touchPath.length > 0 && JSON.stringify(touchPath[touchPath.length - 1]) === JSON.stringify(value)) {\n return false;\n }\n\n touchPath.push(value);\n return true;\n }\n}\n\nfunction getTouchedComponentInfo(currentInst: ElementInstance, labelKey: string | undefined): TouchedComponentInfo | undefined {\n const displayName = currentInst.elementType?.displayName;\n\n const props = currentInst.memoizedProps;\n if (!props) {\n // Early return if no props are available, as we can't extract any useful information\n if (displayName) {\n return {\n name: displayName,\n };\n }\n return undefined;\n }\n\n return dropUndefinedKeys<TouchedComponentInfo>({\n // provided by @sentry/babel-plugin-component-annotate\n name: getComponentName(props) || displayName,\n element: getElementName(props),\n file: getFileName(props),\n\n // `sentry-label` or user defined label key\n label: getLabelValue(props, labelKey),\n });\n}\n\nfunction getComponentName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_COMPONENT_PROP_KEY] === 'string' &&\n props[SENTRY_COMPONENT_PROP_KEY].length > 0 &&\n props[SENTRY_COMPONENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_COMPONENT_PROP_KEY] || undefined;\n}\n\nfunction getElementName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_ELEMENT_PROP_KEY] === 'string' &&\n props[SENTRY_ELEMENT_PROP_KEY].length > 0 &&\n props[SENTRY_ELEMENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_ELEMENT_PROP_KEY] || undefined;\n}\n\nfunction getFileName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_FILE_PROP_KEY] === 'string' &&\n props[SENTRY_FILE_PROP_KEY].length > 0 &&\n props[SENTRY_FILE_PROP_KEY] !== 'unknown' &&\n props[SENTRY_FILE_PROP_KEY] || undefined;\n}\n\nfunction getLabelValue(props: Record<string, unknown>, labelKey: string | undefined): string | undefined {\n return typeof props[SENTRY_LABEL_PROP_KEY] === 'string' && props[SENTRY_LABEL_PROP_KEY].length > 0\n ? props[SENTRY_LABEL_PROP_KEY]\n // For some reason type narrowing doesn't work as expected with indexing when checking it all in one go in\n // the \"check-label\" if sentence, so we have to assign it to a variable here first\n : typeof labelKey === 'string' && typeof props[labelKey] == 'string' && (props[labelKey] as string).length > 0\n ? props[labelKey] as string\n : undefined;\n}\n\nfunction getSpanAttributes(currentInst: ElementInstance): Record<string, SpanAttributeValue> | undefined {\n if (!currentInst.memoizedProps) {\n return undefined;\n }\n\n const props = currentInst.memoizedProps;\n const attributes = props[SENTRY_SPAN_ATTRIBUTES_PROP_KEY];\n\n // Validate that it's an object (not null, not array)\n if (\n typeof attributes === 'object' &&\n attributes !== null &&\n !Array.isArray(attributes)\n ) {\n return attributes as Record<string, SpanAttributeValue>;\n }\n\n return undefined;\n}\n\n/**\n * Convenience Higher-Order-Component for TouchEventBoundary\n * @param WrappedComponent any React Component\n * @param boundaryProps TouchEventBoundaryProps\n */\nconst withTouchEventBoundary = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InnerComponent: React.ComponentType<any>,\n boundaryProps?: TouchEventBoundaryProps,\n): React.FunctionComponent => {\n const WrappedComponent: React.FunctionComponent = props => (\n <TouchEventBoundary {...(boundaryProps ?? {})}>\n <InnerComponent {...props} />\n </TouchEventBoundary>\n );\n\n WrappedComponent.displayName = 'WithTouchEventBoundary';\n\n return WrappedComponent;\n};\n\nexport { TouchEventBoundary, withTouchEventBoundary };\n"]}
1
+ {"version":3,"file":"touchevents.js","sourceRoot":"","sources":["../../src/js/touchevents.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,M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CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE1D,qDAAqD;IACrD,IACE,OAAO,UAAU,KAAK,QAAQ;QAC9B,UAAU,KAAK,IAAI;QACnB,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAC1B,CAAC;QACD,OAAO,UAAgD,CAAC;IAC1D,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,sBAAsB,GAAG;AAC7B,8DAA8D;AAC9D,cAAwC,EACxC,aAAuC,EACd,EAAE;IAC3B,MAAM,gBAAgB,GAA4B,KAAK,CAAC,EAAE,CAAC,CACzD,oBAAC,kBAAkB,oBAAK,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC;QAC3C,oBAAC,cAAc,oBAAK,KAAK,EAAI,CACV,CACtB,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,wBAAwB,CAAC;IAExD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import type { SeverityLevel, SpanAttributeValue } from '@sentry/core';\nimport { addBreadcrumb, debug, dropUndefinedKeys, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport * as React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\nimport { createIntegration } from './integrations/factory';\nimport { startUserInteractionSpan } from './tracing/integrations/userInteraction';\nimport { UI_ACTION_TOUCH } from './tracing/ops';\nimport { SPAN_ORIGIN_AUTO_INTERACTION } from './tracing/origin';\n\nexport type TouchEventBoundaryProps = {\n /**\n * The category assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbCategory?: string;\n /**\n * The type assigned to the breadcrumb that is logged by the touch event.\n */\n breadcrumbType?: string;\n /**\n * The max number of components to display when logging a touch's component tree.\n */\n maxComponentTreeSize?: number;\n /**\n * Component name(s) to ignore when logging the touch event. This prevents unhelpful logs such as\n * \"Touch event within element: View\" where you still can't tell which View it occurred in.\n */\n ignoreNames?: Array<string | RegExp>;\n /**\n * Deprecated, use ignoreNames instead\n * @deprecated\n */\n ignoredDisplayNames?: Array<string | RegExp>;\n /**\n * React Node wrapped by TouchEventBoundary.\n */\n children?: React.ReactNode;\n /**\n * Label Name used to identify the touched element.\n */\n labelName?: string;\n /**\n * Custom attributes to add to user interaction spans.\n * Accepts an object with string keys and values that are strings, numbers, booleans, or arrays.\n *\n * @experimental This API is experimental and may change in future releases.\n */\n spanAttributes?: Record<string, SpanAttributeValue>;\n};\n\nconst touchEventStyles = StyleSheet.create({\n wrapperView: {\n flex: 1,\n },\n});\n\nconst DEFAULT_BREADCRUMB_CATEGORY = 'touch';\nconst DEFAULT_BREADCRUMB_TYPE = 'user';\nconst DEFAULT_MAX_COMPONENT_TREE_SIZE = 20;\n\nconst SENTRY_LABEL_PROP_KEY = 'sentry-label';\nconst SENTRY_SPAN_ATTRIBUTES_PROP_KEY = 'sentry-span-attributes';\nconst SENTRY_COMPONENT_PROP_KEY = 'data-sentry-component';\nconst SENTRY_ELEMENT_PROP_KEY = 'data-sentry-element';\nconst SENTRY_FILE_PROP_KEY = 'data-sentry-source-file';\n\ninterface ElementInstance {\n elementType?: {\n displayName?: string;\n name?: string;\n };\n memoizedProps?: Record<string, unknown>;\n return?: ElementInstance;\n}\n\ninterface TouchedComponentInfo {\n name?: string;\n label?: string;\n element?: string;\n file?: string;\n}\n\ninterface PrivateGestureResponderEvent extends GestureResponderEvent {\n _targetInst?: ElementInstance;\n}\n\n/**\n * Boundary to log breadcrumbs for interaction events.\n */\nclass TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {\n public static displayName: string = '__Sentry.TouchEventBoundary';\n public static defaultProps: Partial<TouchEventBoundaryProps> = {\n breadcrumbCategory: DEFAULT_BREADCRUMB_CATEGORY,\n breadcrumbType: DEFAULT_BREADCRUMB_TYPE,\n ignoreNames: [],\n maxComponentTreeSize: DEFAULT_MAX_COMPONENT_TREE_SIZE,\n };\n\n public readonly name: string = 'TouchEventBoundary';\n\n /**\n * Registers the TouchEventBoundary as a Sentry Integration.\n */\n public componentDidMount(): void {\n const client = getClient();\n client?.addIntegration?.(createIntegration(this.name));\n }\n\n /**\n *\n */\n public render(): React.ReactNode {\n return (\n <View\n style={touchEventStyles.wrapperView}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onTouchStart={this._onTouchStart.bind(this) as any}\n >\n {this.props.children}\n </View>\n );\n }\n\n /**\n * Logs the touch event given the component tree names and a label.\n */\n private _logTouchEvent(touchPath: TouchedComponentInfo[], label?: string): void {\n const level = 'info' as SeverityLevel;\n\n const root = touchPath[0];\n if (!root) {\n debug.warn('[TouchEvents] No root component found in touch path.');\n return;\n }\n\n const detail = label ? label : `${root.name}${root.file ? ` (${root.file})` : ''}`;\n const crumb = {\n category: this.props.breadcrumbCategory,\n data: { path: touchPath },\n level: level,\n message: `Touch event within element: ${detail}`,\n type: this.props.breadcrumbType,\n };\n addBreadcrumb(crumb);\n\n debug.log(`[TouchEvents] ${crumb.message}`);\n }\n\n /**\n * Checks if the name is supposed to be ignored.\n */\n private _isNameIgnored(name: string): boolean {\n let ignoreNames = this.props.ignoreNames || [];\n // eslint-disable-next-line deprecation/deprecation\n if (this.props.ignoredDisplayNames) {\n // This is to make it compatible with prior version.\n // eslint-disable-next-line deprecation/deprecation\n ignoreNames = [...ignoreNames, ...this.props.ignoredDisplayNames];\n }\n\n return ignoreNames.some(\n (ignoreName: string | RegExp) =>\n (typeof ignoreName === 'string' && name === ignoreName) ||\n (ignoreName instanceof RegExp && name.match(ignoreName)),\n );\n }\n\n // Originally was going to clean the names of any HOCs as well but decided that it might hinder debugging effectively. Will leave here in case\n // private readonly _cleanName = (name: string): string =>\n // name.replace(/.*\\(/g, \"\").replace(/\\)/g, \"\");\n\n /**\n * Traverses through the component tree when a touch happens and logs it.\n * @param e\n */\n // eslint-disable-next-line complexity\n private _onTouchStart(e: PrivateGestureResponderEvent): void {\n if (!e._targetInst) {\n return;\n }\n\n let currentInst: ElementInstance | undefined = e._targetInst;\n const touchPath: TouchedComponentInfo[] = [];\n\n while (\n currentInst &&\n // maxComponentTreeSize will always be defined as we have a defaultProps. But ts needs a check so this is here.\n this.props.maxComponentTreeSize &&\n touchPath.length < this.props.maxComponentTreeSize\n ) {\n if (\n // If the loop gets to the boundary itself, break.\n currentInst.elementType?.displayName === TouchEventBoundary.displayName\n ) {\n break;\n }\n\n const info = getTouchedComponentInfo(currentInst, this.props.labelName);\n this._pushIfNotIgnored(touchPath, info);\n\n currentInst = currentInst.return;\n }\n\n const label = touchPath.find(info => info.label)?.label;\n if (touchPath.length > 0) {\n this._logTouchEvent(touchPath, label);\n }\n\n const span = startUserInteractionSpan({\n elementId: label,\n op: UI_ACTION_TOUCH,\n });\n if (span) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);\n\n // Apply custom attributes from sentry-span-attributes prop\n // Traverse the component tree to find custom attributes\n let instForAttributes: ElementInstance | undefined = e._targetInst;\n let customAttributes: Record<string, SpanAttributeValue> | undefined;\n\n while (instForAttributes) {\n if (instForAttributes.elementType?.displayName === TouchEventBoundary.displayName) {\n break;\n }\n\n customAttributes = getSpanAttributes(instForAttributes);\n if (customAttributes && Object.keys(customAttributes).length > 0) {\n break;\n }\n\n instForAttributes = instForAttributes.return;\n }\n\n if (customAttributes && Object.keys(customAttributes).length > 0) {\n span.setAttributes(customAttributes);\n }\n }\n }\n\n /**\n * Pushes the name to the componentTreeNames array if it is not ignored.\n */\n private _pushIfNotIgnored(touchPath: TouchedComponentInfo[], value: TouchedComponentInfo | undefined): boolean {\n if (!value) {\n return false;\n }\n\n if (!value.name && !value.label) {\n return false;\n }\n if (value.name && this._isNameIgnored(value.name)) {\n return false;\n }\n if (value.label && this._isNameIgnored(value.label)) {\n return false;\n }\n\n // Deduplicate same subsequent items.\n if (touchPath.length > 0 && JSON.stringify(touchPath[touchPath.length - 1]) === JSON.stringify(value)) {\n return false;\n }\n\n touchPath.push(value);\n return true;\n }\n}\n\nfunction getTouchedComponentInfo(currentInst: ElementInstance, labelKey: string | undefined): TouchedComponentInfo | undefined {\n const displayName = currentInst.elementType?.displayName;\n\n const props = currentInst.memoizedProps;\n if (!props) {\n // Early return if no props are available, as we can't extract any useful information\n if (displayName) {\n return {\n name: displayName,\n };\n }\n return undefined;\n }\n\n return dropUndefinedKeys<TouchedComponentInfo>({\n // provided by @sentry/babel-plugin-component-annotate\n name: getComponentName(props) || displayName,\n element: getElementName(props),\n file: getFileName(props),\n\n // `sentry-label` or user defined label key\n label: getLabelValue(props, labelKey),\n });\n}\n\nfunction getComponentName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_COMPONENT_PROP_KEY] === 'string' &&\n props[SENTRY_COMPONENT_PROP_KEY].length > 0 &&\n props[SENTRY_COMPONENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_COMPONENT_PROP_KEY] || undefined;\n}\n\nfunction getElementName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_ELEMENT_PROP_KEY] === 'string' &&\n props[SENTRY_ELEMENT_PROP_KEY].length > 0 &&\n props[SENTRY_ELEMENT_PROP_KEY] !== 'unknown' &&\n props[SENTRY_ELEMENT_PROP_KEY] || undefined;\n}\n\nfunction getFileName(props: Record<string, unknown>): string | undefined {\n return typeof props[SENTRY_FILE_PROP_KEY] === 'string' &&\n props[SENTRY_FILE_PROP_KEY].length > 0 &&\n props[SENTRY_FILE_PROP_KEY] !== 'unknown' &&\n props[SENTRY_FILE_PROP_KEY] || undefined;\n}\n\nfunction getLabelValue(props: Record<string, unknown>, labelKey: string | undefined): string | undefined {\n return typeof props[SENTRY_LABEL_PROP_KEY] === 'string' && props[SENTRY_LABEL_PROP_KEY].length > 0\n ? props[SENTRY_LABEL_PROP_KEY]\n // For some reason type narrowing doesn't work as expected with indexing when checking it all in one go in\n // the \"check-label\" if sentence, so we have to assign it to a variable here first\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n : typeof labelKey === 'string' && typeof props[labelKey] == 'string' && (props[labelKey] as string).length > 0\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ? (props[labelKey] as string)\n : undefined;\n}\n\nfunction getSpanAttributes(currentInst: ElementInstance): Record<string, SpanAttributeValue> | undefined {\n if (!currentInst.memoizedProps) {\n return undefined;\n }\n\n const props = currentInst.memoizedProps;\n const attributes = props[SENTRY_SPAN_ATTRIBUTES_PROP_KEY];\n\n // Validate that it's an object (not null, not array)\n if (\n typeof attributes === 'object' &&\n attributes !== null &&\n !Array.isArray(attributes)\n ) {\n return attributes as Record<string, SpanAttributeValue>;\n }\n\n return undefined;\n}\n\n/**\n * Convenience Higher-Order-Component for TouchEventBoundary\n * @param WrappedComponent any React Component\n * @param boundaryProps TouchEventBoundaryProps\n */\nconst withTouchEventBoundary = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InnerComponent: React.ComponentType<any>,\n boundaryProps?: TouchEventBoundaryProps,\n): React.FunctionComponent => {\n const WrappedComponent: React.FunctionComponent = props => (\n <TouchEventBoundary {...(boundaryProps ?? {})}>\n <InnerComponent {...props} />\n </TouchEventBoundary>\n );\n\n WrappedComponent.displayName = 'WithTouchEventBoundary';\n\n return WrappedComponent;\n};\n\nexport { TouchEventBoundary, withTouchEventBoundary };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"expoAsset.js","sourceRoot":"","sources":["../../../src/js/tracing/expoAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,SA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,EAAE;YAC1B,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC;SACxB;QACD,OAAO,UAAU,EAAE,EAAE,CAAC;KACvB;IACD,OAAO,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC;AACtC,CAAC","sourcesContent":["import { SPAN_ORIGIN_AUTO_RESOURCE_EXPO_ASSET } from './origin';\nimport { describeUrl, traceAsyncOperation } from './utils';\n\n/**\n * Internal interface for expo-asset's Asset instance.\n * We define this to avoid a hard dependency on expo-asset.\n */\nexport interface ExpoAssetInstance {\n name: string;\n type: string;\n hash: string | null;\n uri: string;\n localUri: string | null;\n width: number | null;\n height: number | null;\n downloaded: boolean;\n downloadAsync(): Promise<ExpoAssetInstance>;\n}\n\n/**\n * Represents the expo-asset `Asset` class with its static methods.\n * We only describe the methods that we instrument.\n */\nexport interface ExpoAsset {\n loadAsync(moduleId: number | number[] | string | string[]): Promise<ExpoAssetInstance[]>;\n fromModule(virtualAssetModule: number | string): ExpoAssetInstance;\n}\n\n/**\n * Wraps expo-asset's `Asset` class to add automated performance monitoring.\n *\n * This function instruments `Asset.loadAsync` static method\n * to create performance spans that measure how long asset loading takes.\n *\n * @param assetClass - The `Asset` class from `expo-asset`\n * @returns The same class with instrumented static methods\n *\n * @example\n * ```typescript\n * import { Asset } from 'expo-asset';\n * import * as Sentry from '@sentry/react-native';\n *\n * Sentry.wrapExpoAsset(Asset);\n * ```\n */\nexport function wrapExpoAsset<T extends ExpoAsset>(assetClass: T): T {\n if (!assetClass) {\n return assetClass;\n }\n\n if ((assetClass as T & { __sentryWrapped?: boolean }).__sentryWrapped) {\n return assetClass;\n }\n\n wrapLoadAsync(assetClass);\n\n (assetClass as T & { __sentryWrapped?: boolean }).__sentryWrapped = true;\n\n return assetClass;\n}\n\nfunction wrapLoadAsync<T extends ExpoAsset>(assetClass: T): void {\n if (!assetClass.loadAsync) {\n return;\n }\n\n const originalLoadAsync = assetClass.loadAsync.bind(assetClass);\n\n assetClass.loadAsync = ((moduleId: number | number[] | string | string[]): Promise<ExpoAssetInstance[]> => {\n const moduleIds = Array.isArray(moduleId) ? moduleId : [moduleId];\n const assetCount = moduleIds.length;\n const description = describeModuleIds(moduleIds);\n\n return traceAsyncOperation(\n {\n op: 'resource.asset',\n name: `Asset load ${description}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_RESOURCE_EXPO_ASSET,\n 'asset.count': assetCount,\n },\n },\n () => originalLoadAsync(moduleId),\n );\n }) as T['loadAsync'];\n}\n\nfunction describeModuleIds(moduleIds: (number | string)[]): string {\n if (moduleIds.length === 1) {\n const id = moduleIds[0];\n if (typeof id === 'string') {\n return describeUrl(id);\n }\n return `asset #${id}`;\n }\n return `${moduleIds.length} assets`;\n}\n"]}
1
+ {"version":3,"file":"expoAsset.js","sourceRoot":"","sources":["../../../src/js/tracing/expoAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA2B3D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAsB,UAAa;IAC9D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAK,UAAgD,CAAC,eAAe,EAAE,CAAC;QACtE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,UAAU,CAAC,CAAC;IAEzB,UAAgD,CAAC,eAAe,GAAG,IAAI,CAAC;IAEzE,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,aAAa,CAAsB,UAAa;IACvD,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEhE,UAAU,CAAC,SAAS,GAAG,CAAC,CAAC,QAA+C,EAAgC,EAAE;QACxG,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAClE,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;QACpC,MAAM,WAAW,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CACxB;YACE,EAAE,EAAE,gBAAgB;YACpB,IAAI,EAAE,cAAc,WAAW,EAAE;YACjC,UAAU,EAAE;gBACV,eAAe,EAAE,oCAAoC;gBACrD,aAAa,EAAE,UAAU;aAC1B;SACF,EACD,GAAG,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAClC,CAAC;IACJ,CAAC,CAAmB,CAAC;AACvB,CAAC;AAED,SAAS,iBAAiB,CAAC,SAA8B;IACvD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;YAC3B,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,UAAU,EAAE,EAAE,CAAC;IACxB,CAAC;IACD,OAAO,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC;AACtC,CAAC","sourcesContent":["import { SPAN_ORIGIN_AUTO_RESOURCE_EXPO_ASSET } from './origin';\nimport { describeUrl, traceAsyncOperation } from './utils';\n\n/**\n * Internal interface for expo-asset's Asset instance.\n * We define this to avoid a hard dependency on expo-asset.\n */\nexport interface ExpoAssetInstance {\n name: string;\n type: string;\n hash: string | null;\n uri: string;\n localUri: string | null;\n width: number | null;\n height: number | null;\n downloaded: boolean;\n downloadAsync(): Promise<ExpoAssetInstance>;\n}\n\n/**\n * Represents the expo-asset `Asset` class with its static methods.\n * We only describe the methods that we instrument.\n */\nexport interface ExpoAsset {\n loadAsync(moduleId: number | number[] | string | string[]): Promise<ExpoAssetInstance[]>;\n fromModule(virtualAssetModule: number | string): ExpoAssetInstance;\n}\n\n/**\n * Wraps expo-asset's `Asset` class to add automated performance monitoring.\n *\n * This function instruments `Asset.loadAsync` static method\n * to create performance spans that measure how long asset loading takes.\n *\n * @param assetClass - The `Asset` class from `expo-asset`\n * @returns The same class with instrumented static methods\n *\n * @example\n * ```typescript\n * import { Asset } from 'expo-asset';\n * import * as Sentry from '@sentry/react-native';\n *\n * Sentry.wrapExpoAsset(Asset);\n * ```\n */\nexport function wrapExpoAsset<T extends ExpoAsset>(assetClass: T): T {\n if (!assetClass) {\n return assetClass;\n }\n\n if ((assetClass as T & { __sentryWrapped?: boolean }).__sentryWrapped) {\n return assetClass;\n }\n\n wrapLoadAsync(assetClass);\n\n (assetClass as T & { __sentryWrapped?: boolean }).__sentryWrapped = true;\n\n return assetClass;\n}\n\nfunction wrapLoadAsync<T extends ExpoAsset>(assetClass: T): void {\n if (!assetClass.loadAsync) {\n return;\n }\n\n const originalLoadAsync = assetClass.loadAsync.bind(assetClass);\n\n assetClass.loadAsync = ((moduleId: number | number[] | string | string[]): Promise<ExpoAssetInstance[]> => {\n const moduleIds = Array.isArray(moduleId) ? moduleId : [moduleId];\n const assetCount = moduleIds.length;\n const description = describeModuleIds(moduleIds);\n\n return traceAsyncOperation(\n {\n op: 'resource.asset',\n name: `Asset load ${description}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_RESOURCE_EXPO_ASSET,\n 'asset.count': assetCount,\n },\n },\n () => originalLoadAsync(moduleId),\n );\n }) as T['loadAsync'];\n}\n\nfunction describeModuleIds(moduleIds: (number | string)[]): string {\n if (moduleIds.length === 1) {\n const id = moduleIds[0];\n if (typeof id === 'string') {\n return describeUrl(id);\n }\n return `asset #${id}`;\n }\n return `${moduleIds.length} assets`;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"expoImage.js","sourceRoot":"","sources":["../../../src/js/tracing/expoIm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C;KAC5B;IACD,IAAI,MAAM,CAAC,GAAG,EAAE;QACd,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAChC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["import { SPAN_STATUS_ERROR, SPAN_STATUS_OK, startInactiveSpan } from '@sentry/core';\nimport { SPAN_ORIGIN_AUTO_RESOURCE_EXPO_IMAGE } from './origin';\nimport { describeUrl, sanitizeUrl, traceAsyncOperation } from './utils';\n\n/**\n * Internal interface for expo-image's ImageSource.\n * We define this to avoid a hard dependency on expo-image.\n */\ninterface ExpoImageSource {\n uri?: string;\n headers?: Record<string, string>;\n width?: number | null;\n height?: number | null;\n cacheKey?: string;\n}\n\n/**\n * Internal interface for expo-image's ImageLoadOptions.\n * We define this to avoid a hard dependency on expo-image.\n */\ninterface ExpoImageLoadOptions {\n maxWidth?: number;\n maxHeight?: number;\n onError?(error: Error, retry: () => void): void;\n}\n\n/**\n * Internal interface for expo-image's ImageRef.\n * We define this to avoid a hard dependency on expo-image.\n */\ninterface ExpoImageRef {\n readonly width: number;\n readonly height: number;\n readonly scale: number;\n readonly mediaType: string | null;\n readonly isAnimated?: boolean;\n}\n\n/**\n * Represents the expo-image `Image` class with its static methods.\n * We only describe the methods that we instrument.\n */\nexport interface ExpoImage {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n prefetch(urls: string | string[], cachePolicyOrOptions?: any): Promise<boolean>;\n loadAsync(source: ExpoImageSource | string | number, options?: ExpoImageLoadOptions): Promise<ExpoImageRef>;\n clearMemoryCache?(): Promise<boolean>;\n clearDiskCache?(): Promise<boolean>;\n}\n\n/**\n * Wraps expo-image's `Image` class to add automated performance monitoring.\n *\n * This function instruments `Image.prefetch` and `Image.loadAsync` static methods\n * to create performance spans that measure how long image prefetching and loading take.\n *\n * @param imageClass - The `Image` class from `expo-image`\n * @returns The same class with instrumented static methods\n *\n * @example\n * ```typescript\n * import { Image } from 'expo-image';\n * import * as Sentry from '@sentry/react-native';\n *\n * Sentry.wrapExpoImage(Image);\n * ```\n */\nexport function wrapExpoImage<T extends ExpoImage>(imageClass: T): T {\n if (!imageClass) {\n return imageClass;\n }\n\n if ((imageClass as T & { __sentryWrapped?: boolean }).__sentryWrapped) {\n return imageClass;\n }\n\n wrapPrefetch(imageClass);\n wrapLoadAsync(imageClass);\n\n (imageClass as T & { __sentryWrapped?: boolean }).__sentryWrapped = true;\n\n return imageClass;\n}\n\nfunction wrapPrefetch<T extends ExpoImage>(imageClass: T): void {\n if (!imageClass.prefetch) {\n return;\n }\n\n const originalPrefetch = imageClass.prefetch.bind(imageClass);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n imageClass.prefetch = ((urls: string | string[], cachePolicyOrOptions?: any): Promise<boolean> => {\n const urlList = Array.isArray(urls) ? urls : [urls];\n const urlCount = urlList.length;\n const firstUrl = urlList[0] || 'unknown';\n const description = urlCount === 1 ? describeUrl(firstUrl) : `${urlCount} images`;\n\n const span = startInactiveSpan({\n op: 'resource.image.prefetch',\n name: `Image prefetch ${description}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_RESOURCE_EXPO_IMAGE,\n 'image.url_count': urlCount,\n ...(urlCount === 1 ? { 'image.url': sanitizeUrl(firstUrl) } : undefined),\n },\n });\n\n try {\n return originalPrefetch(urls, cachePolicyOrOptions)\n .then(result => {\n if (result) {\n span?.setStatus({ code: SPAN_STATUS_OK });\n } else {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: 'prefetch_failed' });\n }\n span?.end();\n return result;\n })\n .catch((error: unknown) => {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n });\n } catch (error) {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n }\n }) as T['prefetch'];\n}\n\nfunction wrapLoadAsync<T extends ExpoImage>(imageClass: T): void {\n if (!imageClass.loadAsync) {\n return;\n }\n\n const originalLoadAsync = imageClass.loadAsync.bind(imageClass);\n\n imageClass.loadAsync = ((\n source: ExpoImageSource | string | number,\n options?: ExpoImageLoadOptions,\n ): Promise<ExpoImageRef> => {\n const description = describeSource(source);\n\n const imageUrl =\n typeof source === 'string' ? source : typeof source === 'object' && source.uri ? source.uri : undefined;\n\n return traceAsyncOperation(\n {\n op: 'resource.image.load',\n name: `Image load ${description}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_RESOURCE_EXPO_IMAGE,\n ...(imageUrl ? { 'image.url': sanitizeUrl(imageUrl) } : undefined),\n },\n },\n () => originalLoadAsync(source, options),\n );\n }) as T['loadAsync'];\n}\n\nfunction describeSource(source: ExpoImageSource | string | number): string {\n if (typeof source === 'number') {\n return `asset #${source}`;\n }\n if (typeof source === 'string') {\n return describeUrl(source);\n }\n if (source.uri) {\n return describeUrl(source.uri);\n }\n return 'unknown source';\n}\n"]}
1
+ {"version":3,"file":"expoImage.js","sourceRoot":"","sources":["../../../src/js/tracing/expoImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAgDxE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAsB,UAAa;IAC9D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAK,UAAgD,CAAC,eAAe,EAAE,CAAC;QACtE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,YAAY,CAAC,UAAU,CAAC,CAAC;IACzB,aAAa,CAAC,UAAU,CAAC,CAAC;IAEzB,UAAgD,CAAC,eAAe,GAAG,IAAI,CAAC;IAEzE,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,YAAY,CAAs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AAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QAE1G,OAAO,mBAAmB,CACxB;YACE,EAAE,EAAE,qBAAqB;YACzB,IAAI,EAAE,cAAc,WAAW,EAAE;YACjC,UAAU,kBACR,eAAe,EAAE,oCAAoC,IAClD,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CACnE;SACF,EACD,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CACzC,CAAC;IACJ,CAAC,CAAmB,CAAC;AACvB,CAAC;AAED,SAAS,cAAc,CAAC,MAAyC;IAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,UAAU,MAAM,EAAE,CAAC;IAC5B,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["import { SPAN_STATUS_ERROR, SPAN_STATUS_OK, startInactiveSpan } from '@sentry/core';\nimport { SPAN_ORIGIN_AUTO_RESOURCE_EXPO_IMAGE } from './origin';\nimport { describeUrl, sanitizeUrl, traceAsyncOperation } from './utils';\n\n/**\n * Internal interface for expo-image's ImageSource.\n * We define this to avoid a hard dependency on expo-image.\n */\ninterface ExpoImageSource {\n uri?: string;\n headers?: Record<string, string>;\n width?: number | null;\n height?: number | null;\n cacheKey?: string;\n}\n\n/**\n * Internal interface for expo-image's ImageLoadOptions.\n * We define this to avoid a hard dependency on expo-image.\n */\ninterface ExpoImageLoadOptions {\n maxWidth?: number;\n maxHeight?: number;\n onError?(error: Error, retry: () => void): void;\n}\n\n/**\n * Internal interface for expo-image's ImageRef.\n * We define this to avoid a hard dependency on expo-image.\n */\ninterface ExpoImageRef {\n readonly width: number;\n readonly height: number;\n readonly scale: number;\n readonly mediaType: string | null;\n readonly isAnimated?: boolean;\n}\n\n/**\n * Represents the expo-image `Image` class with its static methods.\n * We only describe the methods that we instrument.\n */\nexport interface ExpoImage {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n prefetch(urls: string | string[], cachePolicyOrOptions?: any): Promise<boolean>;\n loadAsync(source: ExpoImageSource | string | number, options?: ExpoImageLoadOptions): Promise<ExpoImageRef>;\n clearMemoryCache?(): Promise<boolean>;\n clearDiskCache?(): Promise<boolean>;\n}\n\n/**\n * Wraps expo-image's `Image` class to add automated performance monitoring.\n *\n * This function instruments `Image.prefetch` and `Image.loadAsync` static methods\n * to create performance spans that measure how long image prefetching and loading take.\n *\n * @param imageClass - The `Image` class from `expo-image`\n * @returns The same class with instrumented static methods\n *\n * @example\n * ```typescript\n * import { Image } from 'expo-image';\n * import * as Sentry from '@sentry/react-native';\n *\n * Sentry.wrapExpoImage(Image);\n * ```\n */\nexport function wrapExpoImage<T extends ExpoImage>(imageClass: T): T {\n if (!imageClass) {\n return imageClass;\n }\n\n if ((imageClass as T & { __sentryWrapped?: boolean }).__sentryWrapped) {\n return imageClass;\n }\n\n wrapPrefetch(imageClass);\n wrapLoadAsync(imageClass);\n\n (imageClass as T & { __sentryWrapped?: boolean }).__sentryWrapped = true;\n\n return imageClass;\n}\n\nfunction wrapPrefetch<T extends ExpoImage>(imageClass: T): void {\n if (!imageClass.prefetch) {\n return;\n }\n\n const originalPrefetch = imageClass.prefetch.bind(imageClass);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n imageClass.prefetch = ((urls: string | string[], cachePolicyOrOptions?: any): Promise<boolean> => {\n const urlList = Array.isArray(urls) ? urls : [urls];\n const urlCount = urlList.length;\n const firstUrl = urlList[0] || 'unknown';\n const description = urlCount === 1 ? describeUrl(firstUrl) : `${urlCount} images`;\n\n const span = startInactiveSpan({\n op: 'resource.image.prefetch',\n name: `Image prefetch ${description}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_RESOURCE_EXPO_IMAGE,\n 'image.url_count': urlCount,\n ...(urlCount === 1 ? { 'image.url': sanitizeUrl(firstUrl) } : undefined),\n },\n });\n\n try {\n return originalPrefetch(urls, cachePolicyOrOptions)\n .then(result => {\n if (result) {\n span?.setStatus({ code: SPAN_STATUS_OK });\n } else {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: 'prefetch_failed' });\n }\n span?.end();\n return result;\n })\n .catch((error: unknown) => {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n });\n } catch (error) {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n }\n }) as T['prefetch'];\n}\n\nfunction wrapLoadAsync<T extends ExpoImage>(imageClass: T): void {\n if (!imageClass.loadAsync) {\n return;\n }\n\n const originalLoadAsync = imageClass.loadAsync.bind(imageClass);\n\n imageClass.loadAsync = ((\n source: ExpoImageSource | string | number,\n options?: ExpoImageLoadOptions,\n ): Promise<ExpoImageRef> => {\n const description = describeSource(source);\n\n const imageUrl =\n typeof source === 'string' ? source : typeof source === 'object' && source.uri ? source.uri : undefined;\n\n return traceAsyncOperation(\n {\n op: 'resource.image.load',\n name: `Image load ${description}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_RESOURCE_EXPO_IMAGE,\n ...(imageUrl ? { 'image.url': sanitizeUrl(imageUrl) } : undefined),\n },\n },\n () => originalLoadAsync(source, options),\n );\n }) as T['loadAsync'];\n}\n\nfunction describeSource(source: ExpoImageSource | string | number): string {\n if (typeof source === 'number') {\n return `asset #${source}`;\n }\n if (typeof source === 'string') {\n return describeUrl(source);\n }\n if (source.uri) {\n return describeUrl(source.uri);\n }\n return 'unknown source';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"expoRouter.js","sourceRoot":"","sources":["../../../src/js/tracing/expoRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAcjE;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAuB,MAAS;IAC5D,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAA,EAAE;QACrB,OAAO,MAAM,CAAC;KACf;IAED,oDAAoD;IACpD,IAAK,MAAoD,CAAC,uBAAuB,EAAE;QACjF,OAAO,MAAM,CAAC;KACf;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEtD,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAwD,EAAE,EAAE;QAC9E,sDAAsD;QACtD,IAAI,SAAS,GAAG,SAAS,CAAC;QAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,SAAS,GAAG,IAAI,CAAC;SAClB;aAAM,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;YAClF,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;SAC3B;QAED,MAAM,IAAI,GAAG,iBAAiB,CAAC;YAC7B,EAAE,EAAE,qBAAqB;YACzB,IAAI,EAAE,YAAY,SAAS,EAAE;YAC7B,UAAU,EAAE;gBACV,eAAe,EAAE,qCAAqC;gBACtD,YAAY,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAA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ACrE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;YACZ,MAAM,KAAK,CAAC;SACb;IACH,CAAC,CAA+B,CAAC;IAEjC,6CAA6C;IAC5C,MAAoD,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAErF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { SPAN_STATUS_ERROR, SPAN_STATUS_OK, startInactiveSpan } from '@sentry/core';\nimport { SPAN_ORIGIN_AUTO_EXPO_ROUTER_PREFETCH } from './origin';\n\n/**\n * Type definition for Expo Router's router object\n */\nexport interface ExpoRouter {\n prefetch?: (href: string | { pathname?: string; params?: Record<string, unknown> }) => void | Promise<void>;\n // Other router methods can be added here if needed\n push?: (...args: unknown[]) => void;\n replace?: (...args: unknown[]) => void;\n back?: () => void;\n navigate?: (...args: unknown[]) => void;\n}\n\n/**\n * Wraps Expo Router. It currently only does one thing: extends prefetch() method\n * to add automated performance monitoring.\n *\n * This function instruments the `prefetch` method of an Expo Router instance\n * to create performance spans that measure how long route prefetching takes.\n *\n * @param router - The Expo Router instance from `useRouter()` hook\n * @returns The same router instance with an instrumented prefetch method\n */\nexport function wrapExpoRouter<T extends ExpoRouter>(router: T): T {\n if (!router?.prefetch) {\n return router;\n }\n\n // Check if already wrapped to avoid double-wrapping\n if ((router as T & { __sentryPrefetchWrapped?: boolean }).__sentryPrefetchWrapped) {\n return router;\n }\n\n const originalPrefetch = router.prefetch.bind(router);\n\n router.prefetch = ((href: Parameters<NonNullable<ExpoRouter['prefetch']>>[0]) => {\n // Extract route name from href for better span naming\n let routeName = 'unknown';\n if (typeof href === 'string') {\n routeName = href;\n } else if (href && typeof href === 'object' && 'pathname' in href && href.pathname) {\n routeName = href.pathname;\n }\n\n const span = startInactiveSpan({\n op: 'navigation.prefetch',\n name: `Prefetch ${routeName}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_EXPO_ROUTER_PREFETCH,\n 'route.href': typeof href === 'string' ? href : JSON.stringify(href),\n 'route.name': routeName,\n },\n });\n\n try {\n const result = originalPrefetch(href);\n\n // Handle both promise and synchronous returns\n if (result && typeof result === 'object' && 'then' in result && typeof result.then === 'function') {\n return result\n .then(res => {\n span?.setStatus({ code: SPAN_STATUS_OK });\n span?.end();\n return res;\n })\n .catch((error: unknown) => {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n });\n } else {\n // Synchronous completion\n span?.setStatus({ code: SPAN_STATUS_OK });\n span?.end();\n return result;\n }\n } catch (error) {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n }\n }) as NonNullable<T['prefetch']>;\n\n // Mark as wrapped to prevent double-wrapping\n (router as T & { __sentryPrefetchWrapped?: boolean }).__sentryPrefetchWrapped = true;\n\n return router;\n}\n"]}
1
+ {"version":3,"file":"expoRouter.js","sourceRoot":"","sources":["../../../src/js/tracing/expoRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAcjE;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAuB,MAAS;IAC5D,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAA,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,oDAAoD;IACpD,IAAK,MAAoD,CAAC,uBAAuB,EAAE,CAAC;QAClF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEtD,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAwD,EAAE,EAAE;QAC9E,sDAAsD;QACtD,IAAI,SAAS,GAAG,SAAS,CAAC;QAC1B,IAAI,OAAO,IA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E,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;oBACZ,MAAM,KAAK,CAAC;gBACd,CAAC,CAAC,CAAC;YACP,CAAC;iBAAM,CAAC;gBACN,yBAAyB;gBACzB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;gBAC1C,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;gBACZ,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACrE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;YACZ,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAA+B,CAAC;IAEjC,6CAA6C;IAC5C,MAAoD,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAErF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { SPAN_STATUS_ERROR, SPAN_STATUS_OK, startInactiveSpan } from '@sentry/core';\nimport { SPAN_ORIGIN_AUTO_EXPO_ROUTER_PREFETCH } from './origin';\n\n/**\n * Type definition for Expo Router's router object\n */\nexport interface ExpoRouter {\n prefetch?: (href: string | { pathname?: string; params?: Record<string, unknown> }) => void | Promise<void>;\n // Other router methods can be added here if needed\n push?: (...args: unknown[]) => void;\n replace?: (...args: unknown[]) => void;\n back?: () => void;\n navigate?: (...args: unknown[]) => void;\n}\n\n/**\n * Wraps Expo Router. It currently only does one thing: extends prefetch() method\n * to add automated performance monitoring.\n *\n * This function instruments the `prefetch` method of an Expo Router instance\n * to create performance spans that measure how long route prefetching takes.\n *\n * @param router - The Expo Router instance from `useRouter()` hook\n * @returns The same router instance with an instrumented prefetch method\n */\nexport function wrapExpoRouter<T extends ExpoRouter>(router: T): T {\n if (!router?.prefetch) {\n return router;\n }\n\n // Check if already wrapped to avoid double-wrapping\n if ((router as T & { __sentryPrefetchWrapped?: boolean }).__sentryPrefetchWrapped) {\n return router;\n }\n\n const originalPrefetch = router.prefetch.bind(router);\n\n router.prefetch = ((href: Parameters<NonNullable<ExpoRouter['prefetch']>>[0]) => {\n // Extract route name from href for better span naming\n let routeName = 'unknown';\n if (typeof href === 'string') {\n routeName = href;\n } else if (href && typeof href === 'object' && 'pathname' in href && href.pathname) {\n routeName = href.pathname;\n }\n\n const span = startInactiveSpan({\n op: 'navigation.prefetch',\n name: `Prefetch ${routeName}`,\n attributes: {\n 'sentry.origin': SPAN_ORIGIN_AUTO_EXPO_ROUTER_PREFETCH,\n 'route.href': typeof href === 'string' ? href : JSON.stringify(href),\n 'route.name': routeName,\n },\n });\n\n try {\n const result = originalPrefetch(href);\n\n // Handle both promise and synchronous returns\n if (result && typeof result === 'object' && 'then' in result && typeof result.then === 'function') {\n return result\n .then(res => {\n span?.setStatus({ code: SPAN_STATUS_OK });\n span?.end();\n return res;\n })\n .catch((error: unknown) => {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n });\n } else {\n // Synchronous completion\n span?.setStatus({ code: SPAN_STATUS_OK });\n span?.end();\n return result;\n }\n } catch (error) {\n span?.setStatus({ code: SPAN_STATUS_ERROR, message: String(error) });\n span?.end();\n throw error;\n }\n }) as NonNullable<T['prefetch']>;\n\n // Mark as wrapped to prevent double-wrapping\n (router as T & { __sentryPrefetchWrapped?: boolean }).__sentryPrefetchWrapped = true;\n\n return router;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"gesturetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/gesturetracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,gCAAgC,EAAE,MAAM,c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AAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;aAClC;SACF;QACD,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;KACnB;IAED,aAAa,CAAC,KAAK,CAAC,CAAC;IAErB,KAAK,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG;IACvB,kBAAkB,EAAE,kBAAkB;IACtC,iBAAiB,EAAE,iBAAiB;IACpC,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,gBAAgB;IACjC,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,WAAW;CACf,CAAC","sourcesContent":["import type { Breadcrumb } from '@sentry/core';\nimport { addBreadcrumb, debug, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { startUserInteractionSpan } from './integrations/userInteraction';\nimport { UI_ACTION } from './ops';\nimport { SPAN_ORIGIN_AUTO_INTERACTION } from './origin';\n\nexport const DEFAULT_BREADCRUMB_CATEGORY = 'gesture';\nexport const DEFAULT_BREADCRUMB_TYPE = 'user';\n\nexport const GESTURE_POSTFIX_LENGTH = 'GestureHandler'.length;\nexport const ACTION_GESTURE_FALLBACK = 'gesture';\n\n/**\n * Internal interface following RNGH 2 Gesture Event API.\n * We need to use this to avoid importing RNGH 2 types and depending on it.\n * https://github.com/software-mansion/react-native-gesture-handler/blob/f0868f7ccf678c947ef65519ebf97ae149a10289/src/handlers/gestures/gesture.ts#L55\n * @hidden\n */\ntype GestureEvent = Record<string, unknown>;\n\n/**\n * Internal interface for RNGH 2 Gesture API.\n * We need to use this to avoid importing RNGH 2 types and depending on it.\n * https://github.com/software-mansion/react-native-gesture-handler/blob/2.9.0/src/handlers/gestures/gesture.ts#L120\n * @hidden\n */\ninterface BaseGesture {\n handlers?: {\n onBegin?: (event: GestureEvent) => void;\n onEnd?: (event: GestureEvent) => void;\n };\n handlerName: string;\n}\n\n/**\n * Patches React Native Gesture Handler v2 Gesture to start a transaction on gesture begin with the appropriate label.\n * Example: ShoppingCartScreen.dismissGesture\n */\nexport function sentryTraceGesture<GestureT>(\n /**\n * Label of the gesture to be used in transaction name.\n * Example: dismissGesture\n */\n label: string,\n gesture: GestureT,\n): GestureT {\n const gestureCandidate = gesture as unknown as BaseGesture | undefined | null;\n if (!gestureCandidate) {\n debug.warn('[GestureTracing] Gesture can not be undefined');\n return gesture;\n }\n if (!gestureCandidate.handlers) {\n debug.warn(\n '[GestureTracing] Can not wrap gesture without handlers. If you want to wrap a gesture composition wrap individual gestures.',\n );\n return gesture;\n }\n if (!label) {\n debug.warn('[GestureTracing] Can not wrap gesture without name.');\n return gesture;\n }\n const name =\n gestureCandidate.handlerName.length > GESTURE_POSTFIX_LENGTH\n ? gestureCandidate.handlerName\n .substring(0, gestureCandidate.handlerName.length - GESTURE_POSTFIX_LENGTH)\n .toLowerCase()\n : ACTION_GESTURE_FALLBACK;\n\n const originalOnBegin = gestureCandidate.handlers.onBegin;\n (gesture as unknown as Required<BaseGesture>).handlers.onBegin = (event: GestureEvent) => {\n const span = startUserInteractionSpan({ elementId: label, op: `${UI_ACTION}.${name}` });\n if (span) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);\n }\n\n addGestureBreadcrumb(`Gesture ${label} begin.`, { event, name });\n\n if (originalOnBegin) {\n originalOnBegin(event);\n }\n };\n\n const originalOnEnd = gestureCandidate.handlers.onEnd;\n (gesture as unknown as Required<BaseGesture>).handlers.onEnd = (event: GestureEvent) => {\n addGestureBreadcrumb(`Gesture ${label} end.`, { event, name });\n\n if (originalOnEnd) {\n originalOnEnd(event);\n }\n };\n\n return gesture;\n}\n\nfunction addGestureBreadcrumb(\n message: string,\n options: {\n event: Record<string, unknown> | undefined | null;\n name: string;\n },\n): void {\n const { event, name } = options;\n const crumb: Breadcrumb = {\n message,\n level: 'info',\n type: DEFAULT_BREADCRUMB_TYPE,\n category: DEFAULT_BREADCRUMB_CATEGORY,\n };\n\n if (event) {\n const data: Record<string, unknown> = {\n gesture: name,\n };\n for (const key of Object.keys(GestureEventKeys)) {\n const eventKey = GestureEventKeys[key as keyof typeof GestureEventKeys];\n if (eventKey in event) {\n data[eventKey] = event[eventKey];\n }\n }\n crumb.data = data;\n }\n\n addBreadcrumb(crumb);\n\n debug.log(`[GestureTracing] ${crumb.message}`);\n}\n\n/**\n * Selected keys from RNGH 2 Gesture Event API.\n * We only want to send relevant data to save on payload size.\n * @hidden\n */\nconst GestureEventKeys = {\n NUMBER_OF_POINTERS: 'numberOfPointers',\n NUMBER_OF_TOUCHES: 'numberOfTouches',\n FORCE: 'force',\n FORCE_CHANGE: 'forceChange',\n ROTATION: 'rotation',\n ROTATION_CHANGE: 'rotationChange',\n SCALE: 'scale',\n SCALE_CHANGE: 'scaleChange',\n DURATION: 'duration',\n VELOCITY: 'velocity',\n VELOCITY_X: 'velocityX',\n VELOCITY_Y: 'velocityY',\n} as const;\n"]}
1
+ {"version":3,"file":"gesturetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/gesturetracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C,MAAM,CAAC,MAAM,sBA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CAAC,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG;IACvB,kBAAkB,EAAE,kBAAkB;IACtC,iBAAiB,EAAE,iBAAiB;IACpC,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,gBAAgB;IACjC,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,WAAW;CACf,CAAC","sourcesContent":["import type { Breadcrumb } from '@sentry/core';\nimport { addBreadcrumb, debug, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { startUserInteractionSpan } from './integrations/userInteraction';\nimport { UI_ACTION } from './ops';\nimport { SPAN_ORIGIN_AUTO_INTERACTION } from './origin';\n\nexport const DEFAULT_BREADCRUMB_CATEGORY = 'gesture';\nexport const DEFAULT_BREADCRUMB_TYPE = 'user';\n\nexport const GESTURE_POSTFIX_LENGTH = 'GestureHandler'.length;\nexport const ACTION_GESTURE_FALLBACK = 'gesture';\n\n/**\n * Internal interface following RNGH 2 Gesture Event API.\n * We need to use this to avoid importing RNGH 2 types and depending on it.\n * https://github.com/software-mansion/react-native-gesture-handler/blob/f0868f7ccf678c947ef65519ebf97ae149a10289/src/handlers/gestures/gesture.ts#L55\n * @hidden\n */\ntype GestureEvent = Record<string, unknown>;\n\n/**\n * Internal interface for RNGH 2 Gesture API.\n * We need to use this to avoid importing RNGH 2 types and depending on it.\n * https://github.com/software-mansion/react-native-gesture-handler/blob/2.9.0/src/handlers/gestures/gesture.ts#L120\n * @hidden\n */\ninterface BaseGesture {\n handlers?: {\n onBegin?: (event: GestureEvent) => void;\n onEnd?: (event: GestureEvent) => void;\n };\n handlerName: string;\n}\n\n/**\n * Patches React Native Gesture Handler v2 Gesture to start a transaction on gesture begin with the appropriate label.\n * Example: ShoppingCartScreen.dismissGesture\n */\nexport function sentryTraceGesture<GestureT>(\n /**\n * Label of the gesture to be used in transaction name.\n * Example: dismissGesture\n */\n label: string,\n gesture: GestureT,\n): GestureT {\n const gestureCandidate = gesture as unknown as BaseGesture | undefined | null;\n if (!gestureCandidate) {\n debug.warn('[GestureTracing] Gesture can not be undefined');\n return gesture;\n }\n if (!gestureCandidate.handlers) {\n debug.warn(\n '[GestureTracing] Can not wrap gesture without handlers. If you want to wrap a gesture composition wrap individual gestures.',\n );\n return gesture;\n }\n if (!label) {\n debug.warn('[GestureTracing] Can not wrap gesture without name.');\n return gesture;\n }\n const name =\n gestureCandidate.handlerName.length > GESTURE_POSTFIX_LENGTH\n ? gestureCandidate.handlerName\n .substring(0, gestureCandidate.handlerName.length - GESTURE_POSTFIX_LENGTH)\n .toLowerCase()\n : ACTION_GESTURE_FALLBACK;\n\n const originalOnBegin = gestureCandidate.handlers.onBegin;\n (gesture as unknown as Required<BaseGesture>).handlers.onBegin = (event: GestureEvent) => {\n const span = startUserInteractionSpan({ elementId: label, op: `${UI_ACTION}.${name}` });\n if (span) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_INTERACTION);\n }\n\n addGestureBreadcrumb(`Gesture ${label} begin.`, { event, name });\n\n if (originalOnBegin) {\n originalOnBegin(event);\n }\n };\n\n const originalOnEnd = gestureCandidate.handlers.onEnd;\n (gesture as unknown as Required<BaseGesture>).handlers.onEnd = (event: GestureEvent) => {\n addGestureBreadcrumb(`Gesture ${label} end.`, { event, name });\n\n if (originalOnEnd) {\n originalOnEnd(event);\n }\n };\n\n return gesture;\n}\n\nfunction addGestureBreadcrumb(\n message: string,\n options: {\n event: Record<string, unknown> | undefined | null;\n name: string;\n },\n): void {\n const { event, name } = options;\n const crumb: Breadcrumb = {\n message,\n level: 'info',\n type: DEFAULT_BREADCRUMB_TYPE,\n category: DEFAULT_BREADCRUMB_CATEGORY,\n };\n\n if (event) {\n const data: Record<string, unknown> = {\n gesture: name,\n };\n for (const key of Object.keys(GestureEventKeys)) {\n const eventKey = GestureEventKeys[key as keyof typeof GestureEventKeys];\n if (eventKey in event) {\n data[eventKey] = event[eventKey];\n }\n }\n crumb.data = data;\n }\n\n addBreadcrumb(crumb);\n\n debug.log(`[GestureTracing] ${crumb.message}`);\n}\n\n/**\n * Selected keys from RNGH 2 Gesture Event API.\n * We only want to send relevant data to save on payload size.\n * @hidden\n */\nconst GestureEventKeys = {\n NUMBER_OF_POINTERS: 'numberOfPointers',\n NUMBER_OF_TOUCHES: 'numberOfTouches',\n FORCE: 'force',\n FORCE_CHANGE: 'forceChange',\n ROTATION: 'rotation',\n ROTATION_CHANGE: 'rotationChange',\n SCALE: 'scale',\n SCALE_CHANGE: 'scaleChange',\n DURATION: 'duration',\n VELOCITY: 'velocity',\n VELOCITY_X: 'velocityX',\n VELOCITY_Y: 'velocityY',\n} as const;\n"]}
@@ -37,6 +37,14 @@ export declare function _setRootComponentCreationTimestampMs(timestampMs: number
37
37
  * @private
38
38
  */
39
39
  export declare const _setAppStartEndData: (data: AppStartEndData) => void;
40
+ /**
41
+ * Updates only the endFrames on existing appStartEndData.
42
+ * Used after the async fetchNativeFrames completes to attach frame data
43
+ * without triggering the overwrite warning from _setAppStartEndData.
44
+ *
45
+ * @private
46
+ */
47
+ export declare const _updateAppStartEndFrames: (endFrames: NativeFramesResponse | null) => void;
40
48
  /**
41
49
  * For testing purposes only.
42
50
  *
@@ -53,7 +61,7 @@ export declare const appStartIntegration: ({ standalone, }?: {
53
61
  *
54
62
  * @default false
55
63
  */
56
- standalone?: boolean | undefined;
64
+ standalone?: boolean;
57
65
  }) => AppStartIntegration;
58
66
  export {};
59
67
  //# sourceMappingURL=appStart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appStart.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK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AAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACxC;AAQD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BzF;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAK7E;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAG9E;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,eAAe,KAAG,IAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,WAAW,oBAAoB,GAAG,IAAI,KAAG,IAIjF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sCAAsC,IAAI,IAAI,CAE7D;AAyBD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,kBAEjC;IACD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACjB,KAAG,mBAmVR,CAAC"}
@@ -44,9 +44,9 @@ export function captureAppStart() {
44
44
  *
45
45
  * @private
46
46
  */
47
- export function _captureAppStart({ isManual }) {
48
- var _a;
49
- return __awaiter(this, void 0, void 0, function* () {
47
+ export function _captureAppStart(_a) {
48
+ return __awaiter(this, arguments, void 0, function* ({ isManual }) {
49
+ var _b;
50
50
  const client = getClient();
51
51
  if (!client) {
52
52
  debug.warn('[AppStart] Could not capture App Start, missing client.');
@@ -54,21 +54,23 @@ export function _captureAppStart({ isManual }) {
54
54
  }
55
55
  isRecordedAppStartEndTimestampMsManual = isManual;
56
56
  const timestampMs = timestampInSeconds() * 1000;
57
- let endFrames = null;
57
+ // Set end timestamp immediately to avoid race with processEvent
58
+ // Frames data will be updated after the async fetch
59
+ _setAppStartEndData({
60
+ timestampMs,
61
+ endFrames: null,
62
+ });
58
63
  if (NATIVE.enableNative) {
59
64
  try {
60
- endFrames = yield NATIVE.fetchNativeFrames();
65
+ const endFrames = yield NATIVE.fetchNativeFrames();
61
66
  debug.log('[AppStart] Captured end frames for app start.', endFrames);
67
+ _updateAppStartEndFrames(endFrames);
62
68
  }
63
69
  catch (error) {
64
70
  debug.log('[AppStart] Failed to capture end frames for app start.', error);
65
71
  }
66
72
  }
67
- _setAppStartEndData({
68
- timestampMs,
69
- endFrames,
70
- });
71
- yield ((_a = client.getIntegrationByName(INTEGRATION_NAME)) === null || _a === void 0 ? void 0 : _a.captureStandaloneAppStart());
73
+ yield ((_b = client.getIntegrationByName(INTEGRATION_NAME)) === null || _b === void 0 ? void 0 : _b.captureStandaloneAppStart());
72
74
  });
73
75
  }
74
76
  /**
@@ -99,6 +101,18 @@ export const _setAppStartEndData = (data) => {
99
101
  appStartEndData && debug.warn('Overwriting already set app start end data.');
100
102
  appStartEndData = data;
101
103
  };
104
+ /**
105
+ * Updates only the endFrames on existing appStartEndData.
106
+ * Used after the async fetchNativeFrames completes to attach frame data
107
+ * without triggering the overwrite warning from _setAppStartEndData.
108
+ *
109
+ * @private
110
+ */
111
+ export const _updateAppStartEndFrames = (endFrames) => {
112
+ if (appStartEndData) {
113
+ appStartEndData.endFrames = endFrames;
114
+ }
115
+ };
102
116
  /**
103
117
  * For testing purposes only.
104
118
  *
@@ -137,6 +151,7 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
137
151
  let appStartDataFlushed = false;
138
152
  let afterAllSetupCalled = false;
139
153
  let firstStartedActiveRootSpanId = undefined;
154
+ let firstStartedActiveRootSpan = undefined;
140
155
  const setup = (client) => {
141
156
  _client = client;
142
157
  const { enableAppStartTracking } = client.getOptions();
@@ -158,6 +173,7 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
158
173
  debug.log('[AppStartIntegration] Resetting app start data flushed flag based on runApplication call.');
159
174
  appStartDataFlushed = false;
160
175
  firstStartedActiveRootSpanId = undefined;
176
+ firstStartedActiveRootSpan = undefined;
161
177
  }
162
178
  else {
163
179
  debug.log('[AppStartIntegration] Waiting for initial app start was flush, before updating based on runApplication call.');
@@ -177,7 +193,20 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
177
193
  });
178
194
  const recordFirstStartedActiveRootSpanId = (rootSpan) => {
179
195
  if (firstStartedActiveRootSpanId) {
180
- return;
196
+ // Check if the previously locked span was dropped after it ended (e.g., by
197
+ // ignoreEmptyRouteChangeTransactions or ignoreEmptyBackNavigation setting
198
+ // _sampled = false during spanEnd). If so, reset and allow this new span.
199
+ // We check here (at the next spanStart) rather than at spanEnd because
200
+ // the discard listeners run after the app start listener in registration order,
201
+ // so _sampled is not yet false when our own spanEnd listener would fire.
202
+ if (firstStartedActiveRootSpan && !spanIsSampled(firstStartedActiveRootSpan)) {
203
+ debug.log('[AppStart] Previously locked root span was unsampled after ending. Resetting to allow next transaction.');
204
+ resetFirstStartedActiveRootSpanId();
205
+ // Fall through to lock to this new span
206
+ }
207
+ else {
208
+ return;
209
+ }
181
210
  }
182
211
  if (!isRootSpan(rootSpan)) {
183
212
  return;
@@ -185,8 +214,18 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
185
214
  if (!spanIsSampled(rootSpan)) {
186
215
  return;
187
216
  }
217
+ firstStartedActiveRootSpan = rootSpan;
188
218
  setFirstStartedActiveRootSpanId(rootSpan.spanContext().spanId);
189
219
  };
220
+ /**
221
+ * Resets the first started active root span id and span reference to allow
222
+ * the next root span's transaction to attempt app start attachment.
223
+ */
224
+ const resetFirstStartedActiveRootSpanId = () => {
225
+ debug.log('[AppStart] Resetting first started active root span id to allow retry on next transaction.');
226
+ firstStartedActiveRootSpanId = undefined;
227
+ firstStartedActiveRootSpan = undefined;
228
+ };
190
229
  /**
191
230
  * For testing purposes only.
192
231
  * @private
@@ -248,10 +287,11 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
248
287
  });
249
288
  }
250
289
  function attachAppStartToTransactionEvent(event) {
251
- var _a;
252
290
  return __awaiter(this, void 0, void 0, function* () {
291
+ var _a;
253
292
  if (appStartDataFlushed) {
254
293
  // App start data is only relevant for the first transaction of the app run
294
+ debug.log('[AppStart] App start data already flushed. Skipping.');
255
295
  return;
256
296
  }
257
297
  if (!((_a = event.contexts) === null || _a === void 0 ? void 0 : _a.trace)) {
@@ -271,34 +311,42 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
271
311
  return;
272
312
  }
273
313
  }
314
+ // All failure paths below set appStartDataFlushed = true to prevent
315
+ // wasteful retries — these conditions won't change within the same app start.
274
316
  const appStart = yield NATIVE.fetchNativeAppStart();
275
317
  if (!appStart) {
276
318
  debug.warn('[AppStart] Failed to retrieve the app start metrics from the native layer.');
319
+ appStartDataFlushed = true;
277
320
  return;
278
321
  }
279
322
  if (appStart.has_fetched) {
280
323
  debug.warn('[AppStart] Measured app start metrics were already reported from the native layer.');
324
+ appStartDataFlushed = true;
281
325
  return;
282
326
  }
283
327
  const appStartTimestampMs = appStart.app_start_timestamp_ms;
284
328
  if (!appStartTimestampMs) {
285
329
  debug.warn('[AppStart] App start timestamp could not be loaded from the native layer.');
330
+ appStartDataFlushed = true;
286
331
  return;
287
332
  }
288
333
  const appStartEndTimestampMs = (appStartEndData === null || appStartEndData === void 0 ? void 0 : appStartEndData.timestampMs) || getBundleStartTimestampMs();
289
334
  if (!appStartEndTimestampMs) {
290
335
  debug.warn('[AppStart] Javascript failed to record app start end. `_setAppStartEndData` was not called nor could the bundle start be found.');
336
+ appStartDataFlushed = true;
291
337
  return;
292
338
  }
293
339
  const isAppStartWithinBounds = !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp * 1000 - MAX_APP_START_AGE_MS;
294
340
  if (!__DEV__ && !isAppStartWithinBounds) {
295
341
  debug.warn('[AppStart] App start timestamp is too far in the past to be used for app start span.');
342
+ appStartDataFlushed = true;
296
343
  return;
297
344
  }
298
345
  const appStartDurationMs = appStartEndTimestampMs - appStartTimestampMs;
299
346
  if (!__DEV__ && appStartDurationMs >= MAX_APP_START_DURATION_MS) {
300
347
  // Dev builds can have long app start waiting over minute for the first bundle to be produced
301
348
  debug.warn('[AppStart] App start duration is over a minute long, not adding app start span.');
349
+ appStartDataFlushed = true;
302
350
  return;
303
351
  }
304
352
  if (appStartDurationMs < 0) {
@@ -306,6 +354,7 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
306
354
  // and the app start end timestamp is not updated, for example
307
355
  // due to missing `Sentry.wrap(RootComponent)` call.
308
356
  debug.warn('[AppStart] Last recorded app start end timestamp is before the app start timestamp.', 'This is usually caused by missing `Sentry.wrap(RootComponent)` call.');
357
+ appStartDataFlushed = true;
309
358
  return;
310
359
  }
311
360
  appStartDataFlushed = true;