@sentry/react-native 8.5.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 (212) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/expo-handler/build.gradle +20 -0
  3. package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryExpoPackage.java +22 -0
  4. package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryReactNativeHostHandler.java +48 -0
  5. package/android/expo-stubs/README.md +7 -0
  6. package/android/expo-stubs/build.gradle +23 -0
  7. package/android/expo-stubs/gradle/wrapper/gradle-wrapper.jar +0 -0
  8. package/android/expo-stubs/gradle/wrapper/gradle-wrapper.properties +7 -0
  9. package/android/expo-stubs/gradlew +251 -0
  10. package/android/expo-stubs/gradlew.bat +94 -0
  11. package/android/expo-stubs/settings.gradle +1 -0
  12. package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/Package.java +11 -0
  13. package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +7 -0
  14. package/android/libs/expo-stubs.jar +0 -0
  15. package/android/libs/replay-stubs.jar +0 -0
  16. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +15 -11
  17. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  18. package/dist/js/NativeLogListener.js.map +1 -1
  19. package/dist/js/RNSentryReplayMaskNativeComponent.d.ts.map +1 -1
  20. package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts.map +1 -1
  21. package/dist/js/breadcrumb.js.map +1 -1
  22. package/dist/js/client.js.map +1 -1
  23. package/dist/js/feedback/FeedbackButton.js.map +1 -1
  24. package/dist/js/feedback/FeedbackWidget.js +6 -6
  25. package/dist/js/feedback/FeedbackWidget.js.map +1 -1
  26. package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +1 -1
  27. package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
  28. package/dist/js/feedback/FeedbackWidgetProvider.js.map +1 -1
  29. package/dist/js/feedback/ScreenshotButton.d.ts +1 -1
  30. package/dist/js/feedback/ScreenshotButton.js.map +1 -1
  31. package/dist/js/feedback/ShakeToReportBug.js.map +1 -1
  32. package/dist/js/feedback/defaults.js.map +1 -1
  33. package/dist/js/feedback/integration.d.ts +2 -2
  34. package/dist/js/feedback/integration.d.ts.map +1 -1
  35. package/dist/js/feedback/integration.js.map +1 -1
  36. package/dist/js/feedback/lazy.js.map +1 -1
  37. package/dist/js/feedback/utils.d.ts.map +1 -1
  38. package/dist/js/feedback/utils.js.map +1 -1
  39. package/dist/js/integrations/appRegistry.d.ts.map +1 -1
  40. package/dist/js/integrations/appRegistry.js.map +1 -1
  41. package/dist/js/integrations/breadcrumbs.d.ts.map +1 -1
  42. package/dist/js/integrations/debugsymbolicator.js +3 -3
  43. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  44. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  45. package/dist/js/integrations/default.js +1 -1
  46. package/dist/js/integrations/default.js.map +1 -1
  47. package/dist/js/integrations/devicecontext.js +1 -1
  48. package/dist/js/integrations/devicecontext.js.map +1 -1
  49. package/dist/js/integrations/expoconstants.js.map +1 -1
  50. package/dist/js/integrations/expocontext.js.map +1 -1
  51. package/dist/js/integrations/expoupdateslistener.js.map +1 -1
  52. package/dist/js/integrations/logEnricherIntegration.js +1 -1
  53. package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
  54. package/dist/js/integrations/modulesloader.js.map +1 -1
  55. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  56. package/dist/js/integrations/nativelinkederrors.js +1 -0
  57. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  58. package/dist/js/integrations/primitiveTagIntegration.js.map +1 -1
  59. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  60. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  61. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  62. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  63. package/dist/js/integrations/release.js +1 -1
  64. package/dist/js/integrations/release.js.map +1 -1
  65. package/dist/js/integrations/rewriteframes.js.map +1 -1
  66. package/dist/js/integrations/screenshot.js +1 -1
  67. package/dist/js/integrations/screenshot.js.map +1 -1
  68. package/dist/js/integrations/sdkinfo.js.map +1 -1
  69. package/dist/js/integrations/spotlight.js.map +1 -1
  70. package/dist/js/integrations/viewhierarchy.js +1 -1
  71. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  72. package/dist/js/misc.js.map +1 -1
  73. package/dist/js/options.d.ts +1 -1
  74. package/dist/js/options.js.map +1 -1
  75. package/dist/js/playground/examples.js.map +1 -1
  76. package/dist/js/playground/modal.d.ts +2 -2
  77. package/dist/js/playground/modal.d.ts.map +1 -1
  78. package/dist/js/playground/modal.js +6 -6
  79. package/dist/js/playground/modal.js.map +1 -1
  80. package/dist/js/profiling/cache.js.map +1 -1
  81. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  82. package/dist/js/profiling/debugid.js.map +1 -1
  83. package/dist/js/profiling/integration.d.ts.map +1 -1
  84. package/dist/js/profiling/integration.js.map +1 -1
  85. package/dist/js/profiling/utils.js.map +1 -1
  86. package/dist/js/replay/CustomMask.d.ts.map +1 -1
  87. package/dist/js/replay/CustomMask.js.map +1 -1
  88. package/dist/js/replay/CustomMask.web.d.ts.map +1 -1
  89. package/dist/js/replay/browserReplay.d.ts.map +1 -1
  90. package/dist/js/replay/browserReplay.js.map +1 -1
  91. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  92. package/dist/js/replay/mobilereplay.js +21 -2
  93. package/dist/js/replay/mobilereplay.js.map +1 -1
  94. package/dist/js/replay/networkUtils.d.ts +0 -1
  95. package/dist/js/replay/networkUtils.d.ts.map +1 -1
  96. package/dist/js/replay/networkUtils.js.map +1 -1
  97. package/dist/js/replay/xhrUtils.js.map +1 -1
  98. package/dist/js/scopeSync.js.map +1 -1
  99. package/dist/js/sdk.d.ts.map +1 -1
  100. package/dist/js/sdk.js +4 -2
  101. package/dist/js/sdk.js.map +1 -1
  102. package/dist/js/tools/ModulesCollector.js.map +1 -1
  103. package/dist/js/tools/easBuildHooks.js +13 -14
  104. package/dist/js/tools/easBuildHooks.js.map +1 -1
  105. package/dist/js/tools/enableLogger.js +1 -2
  106. package/dist/js/tools/enableLogger.js.map +1 -1
  107. package/dist/js/tools/metroMiddleware.d.ts.map +1 -1
  108. package/dist/js/tools/metroMiddleware.js.map +1 -1
  109. package/dist/js/tools/metroconfig.js +6 -7
  110. package/dist/js/tools/metroconfig.js.map +1 -1
  111. package/dist/js/tools/sentryBabelTransformerUtils.js +7 -7
  112. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  113. package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
  114. package/dist/js/tools/sentryMetroSerializer.js +2 -2
  115. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  116. package/dist/js/tools/sentryOptionsSerializer.js +1 -2
  117. package/dist/js/tools/sentryOptionsSerializer.js.map +1 -1
  118. package/dist/js/tools/sentryReleaseInjector.d.ts +1 -1
  119. package/dist/js/tools/sentryReleaseInjector.d.ts.map +1 -1
  120. package/dist/js/tools/sentryReleaseInjector.js.map +1 -1
  121. package/dist/js/tools/utils.d.ts.map +1 -1
  122. package/dist/js/tools/utils.js +7 -7
  123. package/dist/js/tools/utils.js.map +1 -1
  124. package/dist/js/tools/vendor/metro/countLines.d.ts.map +1 -1
  125. package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
  126. package/dist/js/tools/vendor/metro/utils.js.map +1 -1
  127. package/dist/js/touchevents.d.ts.map +1 -1
  128. package/dist/js/touchevents.js +2 -0
  129. package/dist/js/touchevents.js.map +1 -1
  130. package/dist/js/tracing/expoAsset.js.map +1 -1
  131. package/dist/js/tracing/expoImage.js.map +1 -1
  132. package/dist/js/tracing/expoRouter.js.map +1 -1
  133. package/dist/js/tracing/gesturetracing.js.map +1 -1
  134. package/dist/js/tracing/integrations/appStart.d.ts +1 -1
  135. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  136. package/dist/js/tracing/integrations/appStart.js +5 -5
  137. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  138. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
  139. package/dist/js/tracing/integrations/nativeFrames.js +4 -1
  140. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  141. package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  142. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
  143. package/dist/js/tracing/integrations/stalltracking.js +4 -1
  144. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  145. package/dist/js/tracing/integrations/timeToDisplayIntegration.js +14 -14
  146. package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
  147. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
  148. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  149. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
  150. package/dist/js/tracing/onSpanEndUtils.js +20 -13
  151. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  152. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  153. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  154. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  155. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  156. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  157. package/dist/js/tracing/reactnavigation.d.ts +3 -0
  158. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  159. package/dist/js/tracing/reactnavigation.js +4 -2
  160. package/dist/js/tracing/reactnavigation.js.map +1 -1
  161. package/dist/js/tracing/span.d.ts +2 -17
  162. package/dist/js/tracing/span.d.ts.map +1 -1
  163. package/dist/js/tracing/span.js.map +1 -1
  164. package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
  165. package/dist/js/tracing/timetodisplay.js.map +1 -1
  166. package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
  167. package/dist/js/tracing/timetodisplaynative.js.map +1 -1
  168. package/dist/js/tracing/utils.js.map +1 -1
  169. package/dist/js/transports/encodePolyfill.d.ts +1 -1
  170. package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
  171. package/dist/js/transports/encodePolyfill.js.map +1 -1
  172. package/dist/js/transports/native.js.map +1 -1
  173. package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
  174. package/dist/js/utils/encode.js.map +1 -1
  175. package/dist/js/utils/environment.js.map +1 -1
  176. package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
  177. package/dist/js/utils/normalize.js.map +1 -1
  178. package/dist/js/utils/outcome.js.map +1 -1
  179. package/dist/js/utils/primitiveConverter.js.map +1 -1
  180. package/dist/js/utils/release.js.map +1 -1
  181. package/dist/js/utils/rnlibraries.js.map +1 -1
  182. package/dist/js/utils/safe.js.map +1 -1
  183. package/dist/js/utils/worldwide.d.ts +0 -1
  184. package/dist/js/utils/worldwide.d.ts.map +1 -1
  185. package/dist/js/utils/xhr.d.ts +0 -1
  186. package/dist/js/utils/xhr.d.ts.map +1 -1
  187. package/dist/js/utils/xhr.js.map +1 -1
  188. package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
  189. package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
  190. package/dist/js/version.d.ts +1 -1
  191. package/dist/js/version.js +1 -1
  192. package/dist/js/version.js.map +1 -1
  193. package/dist/js/wrapper.d.ts.map +1 -1
  194. package/dist/js/wrapper.js +5 -6
  195. package/dist/js/wrapper.js.map +1 -1
  196. package/expo-module.config.json +7 -0
  197. package/ios/RNSentryStart.m +4 -1
  198. package/ios/RNSentryVersion.m +1 -1
  199. package/package.json +10 -10
  200. package/ts3.8/dist/js/feedback/ScreenshotButton.d.ts +1 -1
  201. package/ts3.8/dist/js/feedback/integration.d.ts +2 -2
  202. package/ts3.8/dist/js/options.d.ts +1 -1
  203. package/ts3.8/dist/js/playground/modal.d.ts +2 -2
  204. package/ts3.8/dist/js/replay/networkUtils.d.ts +0 -1
  205. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
  206. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  207. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +3 -0
  208. package/ts3.8/dist/js/tracing/span.d.ts +2 -17
  209. package/ts3.8/dist/js/transports/encodePolyfill.d.ts +1 -1
  210. package/ts3.8/dist/js/utils/worldwide.d.ts +0 -1
  211. package/ts3.8/dist/js/utils/xhr.d.ts +0 -1
  212. package/ts3.8/dist/js/version.d.ts +1 -1
@@ -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,wBAAw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ourcesContent":["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,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,C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anAttributeValue } 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,SAAS,CAAC;AA2B3D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAsB,UAAa;IAC9D,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,UAAU,CAAC;KACnB;IAED,IAAK,UAAgD,CAAC,eAAe,EAAE;QACrE,OAAO,UAAU,CAAC;KACnB;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;QACzB,OAAO;KACR;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;QAC1B,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,OAAO,EAAE,KAAK,QAAQ,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,OA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AC;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/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;QACf,OAAO,UAAU,CAAC;KACnB;IAED,IAAK,UAAgD,CAAC,eAAe,EAAE;QACrE,OAAO,UAAU,CAAC;KACnB;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,CAAsB,UAAa;IACtD,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;QACxB,OAAO;KACR;IAED,MAAM,gBAAgB,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE9D,8DAA8D;IAC9D,UAAU,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAuB,EAAE,oBAA0B,EAAoB,EAAE;QAC/F,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E,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;QAC9B,OAAO,UAAU,MAAM,EAAE,CAAC;KAC3B;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;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;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,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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M;gBACL,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;aACf;SACF;QAAC,OAAO,KAAK,EAAE;YACd,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;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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_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,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,sBAAsB,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAwBjD;;;GAGG;AACH,MAAM,UAAU,kBAAkB;AAChC;;;GAGG;AACH,KAAa,EACb,OAAiB;IAEjB,MAAM,gBAAgB,GAAG,OAAoD,CAAC;IAC9E,IAAI,CAAC,gBAAgB,EAAE;QACrB,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAC5D,OAAO,OAAO,CAAC;KAChB;IACD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE;QAC9B,KAAK,CAAC,IAAI,CACR,6HAA6H,CAC9H,CAAC;QACF,OAAO,OAAO,CAAC;KAChB;IACD,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;QAClE,OAAO,OAAO,CAAC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KAAK,GAAe;QACxB,OAAO;QACP,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,uBAAuB;QAC7B,QAAQ,EAAE,2BAA2B;KACtC,CAAC;IAEF,IAAI,KAAK,EAAE;QACT,MAAM,IAAI,GAA4B;YACpC,OAAO,EAAE,IAAI;SACd,CAAC;QACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC/C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAoC,CAAC,CAAC;YACxE,IAAI,QAAQ,IAAI,KAAK,EAAE;gBACrB,IAAI,CAAC,QAAQ,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/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AG,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAChD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAoC,CAAC,CAAC;YACxE,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;gBACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;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"]}
@@ -61,7 +61,7 @@ export declare const appStartIntegration: ({ standalone, }?: {
61
61
  *
62
62
  * @default false
63
63
  */
64
- standalone?: boolean | undefined;
64
+ standalone?: boolean;
65
65
  }) => AppStartIntegration;
66
66
  export {};
67
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,EAAiB,WAAW,EAAoC,MAAM,cAAc,CAAC;AAiBjG,OAAO,KAAK,EAA0B,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAgBzF,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C,yBAAyB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD,CAAC;AAeF,UAAU,eAAe;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,SAAU,eAAe,KAAG,IAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,cAAe,oBAAoB,GAAG,IAAI,KAAG,IAIjF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sCAAsC,IAAI,IAAI,CAE7D;AAyBD;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAG9B;;;;;OAKG;;MAEI,mBAmVR,CAAC"}
1
+ {"version":3,"file":"appStart.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,WAAW,EAAoC,MAAM,cAAc,CAAC;AAiBjG,OAAO,KAAK,EAA0B,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAgBzF,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C,yBAAyB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD,CAAC;AAeF,UAAU,eAAe;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.');
@@ -70,7 +70,7 @@ export function _captureAppStart({ isManual }) {
70
70
  debug.log('[AppStart] Failed to capture end frames for app start.', error);
71
71
  }
72
72
  }
73
- 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());
74
74
  });
75
75
  }
76
76
  /**
@@ -287,8 +287,8 @@ export const appStartIntegration = ({ standalone = false, } = {}) => {
287
287
  });
288
288
  }
289
289
  function attachAppStartToTransactionEvent(event) {
290
- var _a;
291
290
  return __awaiter(this, void 0, void 0, function* () {
291
+ var _a;
292
292
  if (appStartDataFlushed) {
293
293
  // App start data is only relevant for the first transaction of the app run
294
294
  debug.log('[AppStart] App start data already flushed. Skipping.');
@@ -1 +1 @@
1
- {"version":3,"file":"appStart.js","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EACL,KAAK,EACL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,gCAAgC,EAChC,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,cAAc,IAAI,0BAA0B,EAC5C,cAAc,IAAI,0BAA0B,GAC7C,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,cAAc,IAAI,iBAAiB,EACnC,cAAc,IAAI,iBAAiB,EACnC,OAAO,IAAI,UAAU,GACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC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B,EAAE;QACjE,OAAO,mBAAmB,CAAC,UAAU,EAAE;YACrC,WAAW,EAAE,6BAA6B;YAC1C,eAAe,EAAE,eAAe,CAAC,kBAAkB,GAAG,IAAI;YAC1D,SAAS,EAAE,WAAW,GAAG,IAAI;YAC7B,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,mBAAmB,CAAC,UAAU,EAAE;YACrC,WAAW,EAAE,YAAY;YACzB,eAAe,EAAE,eAAe,CAAC,kBAAkB,GAAG,IAAI;YAC1D,SAAS,EAAE,eAAe,CAAC,gBAAgB,GAAG,IAAI;YAClD,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;KACJ;AACH,CAAC","sourcesContent":["/* eslint-disable complexity, max-lines */\nimport type { Client, Event, Integration, Span, SpanJSON, TransactionEvent } from '@sentry/core';\nimport {\n debug,\n getCapturedScopesOnSpan,\n getClient,\n getCurrentScope,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n spanIsSampled,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\nimport { getAppRegistryIntegration } from '../../integrations/appRegistry';\nimport {\n APP_START_COLD as APP_START_COLD_MEASUREMENT,\n APP_START_WARM as APP_START_WARM_MEASUREMENT,\n} from '../../measurements';\nimport type { NativeAppStartResponse, NativeFramesResponse } from '../../NativeRNSentry';\nimport type { ReactNativeClientOptions } from '../../options';\nimport { convertSpanToTransaction, isRootSpan, setEndTimeValue } from '../../utils/span';\nimport { NATIVE } from '../../wrapper';\nimport {\n APP_START_COLD as APP_START_COLD_OP,\n APP_START_WARM as APP_START_WARM_OP,\n UI_LOAD as UI_LOAD_OP,\n} from '../ops';\nimport { SPAN_ORIGIN_AUTO_APP_START, SPAN_ORIGIN_MANUAL_APP_START } from '../origin';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '../semanticAttributes';\nimport { setMainThreadInfo } from '../span';\nimport { createChildSpanJSON, createSpanJSON, getBundleStartTimestampMs } from '../utils';\n\nconst INTEGRATION_NAME = 'AppStart';\n\nexport type AppStartIntegration = Integration & {\n captureStandaloneAppStart: () => Promise<void>;\n};\n\n/**\n * We filter out app start more than 60s.\n * This could be due to many different reasons.\n * We've seen app starts with hours, days and even months.\n */\nconst MAX_APP_START_DURATION_MS = 60_000;\n\n/** We filter out App starts which timestamp is 60s and more before the transaction start */\nconst MAX_APP_START_AGE_MS = 60_000;\n\n/** App Start transaction name */\nconst APP_START_TX_NAME = 'App Start';\n\ninterface AppStartEndData {\n timestampMs: number;\n endFrames: NativeFramesResponse | null;\n}\n\nlet appStartEndData: AppStartEndData | undefined = undefined;\nlet isRecordedAppStartEndTimestampMsManual = false;\n\nlet rootComponentCreationTimestampMs: number | undefined = undefined;\nlet isRootComponentCreationTimestampMsManual = false;\n\n/**\n * Records the application start end.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function captureAppStart(): Promise<void> {\n return _captureAppStart({ isManual: true });\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport async function _captureAppStart({ isManual }: { isManual: boolean }): Promise<void> {\n const client = getClient();\n if (!client) {\n debug.warn('[AppStart] Could not capture App Start, missing client.');\n return;\n }\n\n isRecordedAppStartEndTimestampMsManual = isManual;\n\n const timestampMs = timestampInSeconds() * 1000;\n\n // Set end timestamp immediately to avoid race with processEvent\n // Frames data will be updated after the async fetch\n _setAppStartEndData({\n timestampMs,\n endFrames: null,\n });\n\n if (NATIVE.enableNative) {\n try {\n const endFrames = await NATIVE.fetchNativeFrames();\n debug.log('[AppStart] Captured end frames for app start.', endFrames);\n _updateAppStartEndFrames(endFrames);\n } catch (error) {\n debug.log('[AppStart] Failed to capture end frames for app start.', error);\n }\n }\n\n await client.getIntegrationByName<AppStartIntegration>(INTEGRATION_NAME)?.captureStandaloneAppStart();\n}\n\n/**\n * Sets the root component first constructor call timestamp.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function setRootComponentCreationTimestampMs(timestampMs: number): void {\n appStartEndData?.timestampMs && debug.warn('Setting Root component creation timestamp after app start end is set.');\n rootComponentCreationTimestampMs && debug.warn('Overwriting already set root component creation timestamp.');\n rootComponentCreationTimestampMs = timestampMs;\n isRootComponentCreationTimestampMsManual = true;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport function _setRootComponentCreationTimestampMs(timestampMs: number): void {\n setRootComponentCreationTimestampMs(timestampMs);\n isRootComponentCreationTimestampMsManual = false;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport const _setAppStartEndData = (data: AppStartEndData): void => {\n appStartEndData && debug.warn('Overwriting already set app start end data.');\n appStartEndData = data;\n};\n\n/**\n * Updates only the endFrames on existing appStartEndData.\n * Used after the async fetchNativeFrames completes to attach frame data\n * without triggering the overwrite warning from _setAppStartEndData.\n *\n * @private\n */\nexport const _updateAppStartEndFrames = (endFrames: NativeFramesResponse | null): void => {\n if (appStartEndData) {\n appStartEndData.endFrames = endFrames;\n }\n};\n\n/**\n * For testing purposes only.\n *\n * @private\n */\nexport function _clearRootComponentCreationTimestampMs(): void {\n rootComponentCreationTimestampMs = undefined;\n}\n\n/**\n * Attaches frame data to a span's data object.\n */\nfunction attachFrameDataToSpan(span: SpanJSON, frames: NativeFramesResponse): void {\n if (frames.totalFrames <= 0 && frames.slowFrames <= 0 && frames.totalFrames <= 0) {\n debug.warn(`[AppStart] Detected zero slow or frozen frames. Not adding measurements to spanId (${span.span_id}).`);\n return;\n }\n span.data = span.data || {};\n span.data['frames.total'] = frames.totalFrames;\n span.data['frames.slow'] = frames.slowFrames;\n span.data['frames.frozen'] = frames.frozenFrames;\n\n debug.log('[AppStart] Attached frame data to span.', {\n spanId: span.span_id,\n frameData: {\n total: frames.totalFrames,\n slow: frames.slowFrames,\n frozen: frames.frozenFrames,\n },\n });\n}\n\n/**\n * Adds AppStart spans from the native layer to the transaction event.\n */\nexport const appStartIntegration = ({\n standalone = false,\n}: {\n /**\n * Should the integration send App Start as a standalone root span (transaction)?\n * If false, App Start will be added as a child span to the first transaction.\n *\n * @default false\n */\n standalone?: boolean;\n} = {}): AppStartIntegration => {\n let _client: Client | undefined = undefined;\n let isEnabled = true;\n let appStartDataFlushed = false;\n let afterAllSetupCalled = false;\n let firstStartedActiveRootSpanId: string | undefined = undefined;\n let firstStartedActiveRootSpan: Span | undefined = undefined;\n\n const setup = (client: Client): void => {\n _client = client;\n const { enableAppStartTracking } = client.getOptions() as ReactNativeClientOptions;\n\n if (!enableAppStartTracking) {\n isEnabled = false;\n debug.warn('[AppStart] App start tracking is disabled.');\n }\n\n client.on('spanStart', recordFirstStartedActiveRootSpanId);\n };\n\n const afterAllSetup = (client: Client): void => {\n if (afterAllSetupCalled) {\n return;\n }\n afterAllSetupCalled = true;\n\n // TODO: automatically set standalone based on the presence of the native layer navigation integration\n\n getAppRegistryIntegration(client)?.onRunApplication(() => {\n if (appStartDataFlushed) {\n debug.log('[AppStartIntegration] Resetting app start data flushed flag based on runApplication call.');\n appStartDataFlushed = false;\n firstStartedActiveRootSpanId = undefined;\n firstStartedActiveRootSpan = undefined;\n } else {\n debug.log(\n '[AppStartIntegration] Waiting for initial app start was flush, before updating based on runApplication call.',\n );\n }\n });\n };\n\n const processEvent = async (event: Event): Promise<Event> => {\n if (!isEnabled || standalone) {\n return event;\n }\n\n if (event.type !== 'transaction') {\n // App start data is only relevant for transactions\n return event;\n }\n\n await attachAppStartToTransactionEvent(event as TransactionEvent);\n\n return event;\n };\n\n const recordFirstStartedActiveRootSpanId = (rootSpan: Span): void => {\n if (firstStartedActiveRootSpanId) {\n // Check if the previously locked span was dropped after it ended (e.g., by\n // ignoreEmptyRouteChangeTransactions or ignoreEmptyBackNavigation setting\n // _sampled = false during spanEnd). If so, reset and allow this new span.\n // We check here (at the next spanStart) rather than at spanEnd because\n // the discard listeners run after the app start listener in registration order,\n // so _sampled is not yet false when our own spanEnd listener would fire.\n if (firstStartedActiveRootSpan && !spanIsSampled(firstStartedActiveRootSpan)) {\n debug.log(\n '[AppStart] Previously locked root span was unsampled after ending. Resetting to allow next transaction.',\n );\n resetFirstStartedActiveRootSpanId();\n // Fall through to lock to this new span\n } else {\n return;\n }\n }\n\n if (!isRootSpan(rootSpan)) {\n return;\n }\n\n if (!spanIsSampled(rootSpan)) {\n return;\n }\n\n firstStartedActiveRootSpan = rootSpan;\n setFirstStartedActiveRootSpanId(rootSpan.spanContext().spanId);\n };\n\n /**\n * Resets the first started active root span id and span reference to allow\n * the next root span's transaction to attempt app start attachment.\n */\n const resetFirstStartedActiveRootSpanId = (): void => {\n debug.log('[AppStart] Resetting first started active root span id to allow retry on next transaction.');\n firstStartedActiveRootSpanId = undefined;\n firstStartedActiveRootSpan = undefined;\n };\n\n /**\n * For testing purposes only.\n * @private\n */\n const setFirstStartedActiveRootSpanId = (spanId: string | undefined): void => {\n firstStartedActiveRootSpanId = spanId;\n debug.log('[AppStart] First started active root span id recorded.', firstStartedActiveRootSpanId);\n };\n\n async function captureStandaloneAppStart(): Promise<void> {\n if (!_client) {\n // If client is not set, SDK was not initialized, logger is thus disabled\n // eslint-disable-next-line no-console\n console.warn('[AppStart] Could not capture App Start, missing client, call `Sentry.init` first.');\n return;\n }\n\n if (!standalone) {\n debug.log(\n '[AppStart] App start tracking is enabled. App start will be added to the first transaction as a child span.',\n );\n return;\n }\n\n debug.log('[AppStart] App start tracking standalone root span (transaction).');\n\n if (!appStartEndData?.endFrames && NATIVE.enableNative) {\n try {\n const endFrames = await NATIVE.fetchNativeFrames();\n debug.log('[AppStart] Captured end frames for standalone app start.', endFrames);\n\n const currentTimestamp = appStartEndData?.timestampMs || timestampInSeconds() * 1000;\n _setAppStartEndData({\n timestampMs: currentTimestamp,\n endFrames,\n });\n } catch (error) {\n debug.log('[AppStart] Failed to capture frames for standalone app start.', error);\n }\n }\n\n const span = startInactiveSpan({\n forceTransaction: true,\n name: APP_START_TX_NAME,\n op: UI_LOAD_OP,\n });\n if (span instanceof SentryNonRecordingSpan) {\n // Tracing is disabled or the transaction was sampled\n return;\n }\n\n setEndTimeValue(span, timestampInSeconds());\n _client.emit('spanEnd', span);\n\n const event = convertSpanToTransaction(span);\n if (!event) {\n debug.warn('[AppStart] Failed to convert App Start span to transaction.');\n return;\n }\n\n await attachAppStartToTransactionEvent(event);\n if (!event.spans || event.spans.length === 0) {\n // No spans were added to the transaction, so we don't need to send it\n return;\n }\n\n const scope = getCapturedScopesOnSpan(span).scope || getCurrentScope();\n scope.captureEvent(event);\n }\n\n async function attachAppStartToTransactionEvent(event: TransactionEvent): Promise<void> {\n if (appStartDataFlushed) {\n // App start data is only relevant for the first transaction of the app run\n debug.log('[AppStart] App start data already flushed. Skipping.');\n return;\n }\n\n if (!event.contexts?.trace) {\n debug.warn('[AppStart] Transaction event is missing trace context. Can not attach app start.');\n return;\n }\n\n // When standalone is true, we create our own transaction and don't need to verify\n // it matches the first navigation transaction. When standalone is false, we need to\n // ensure we're attaching app start to the first transaction (not a later one).\n if (!standalone) {\n if (!firstStartedActiveRootSpanId) {\n debug.warn('[AppStart] No first started active root span id recorded. Can not attach app start.');\n return;\n }\n\n if (firstStartedActiveRootSpanId !== event.contexts.trace.span_id) {\n debug.warn(\n '[AppStart] First started active root span id does not match the transaction event span id. Can not attached app start.',\n );\n return;\n }\n }\n\n // All failure paths below set appStartDataFlushed = true to prevent\n // wasteful retries — these conditions won't change within the same app start.\n const appStart = await NATIVE.fetchNativeAppStart();\n if (!appStart) {\n debug.warn('[AppStart] Failed to retrieve the app start metrics from the native layer.');\n appStartDataFlushed = true;\n return;\n }\n if (appStart.has_fetched) {\n debug.warn('[AppStart] Measured app start metrics were already reported from the native layer.');\n appStartDataFlushed = true;\n return;\n }\n\n const appStartTimestampMs = appStart.app_start_timestamp_ms;\n if (!appStartTimestampMs) {\n debug.warn('[AppStart] App start timestamp could not be loaded from the native layer.');\n appStartDataFlushed = true;\n return;\n }\n\n const appStartEndTimestampMs = appStartEndData?.timestampMs || getBundleStartTimestampMs();\n if (!appStartEndTimestampMs) {\n debug.warn(\n '[AppStart] Javascript failed to record app start end. `_setAppStartEndData` was not called nor could the bundle start be found.',\n );\n appStartDataFlushed = true;\n return;\n }\n\n const isAppStartWithinBounds =\n !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp * 1_000 - MAX_APP_START_AGE_MS;\n if (!__DEV__ && !isAppStartWithinBounds) {\n debug.warn('[AppStart] App start timestamp is too far in the past to be used for app start span.');\n appStartDataFlushed = true;\n return;\n }\n\n const appStartDurationMs = appStartEndTimestampMs - appStartTimestampMs;\n if (!__DEV__ && appStartDurationMs >= MAX_APP_START_DURATION_MS) {\n // Dev builds can have long app start waiting over minute for the first bundle to be produced\n debug.warn('[AppStart] App start duration is over a minute long, not adding app start span.');\n appStartDataFlushed = true;\n return;\n }\n\n if (appStartDurationMs < 0) {\n // This can happen when MainActivity on Android is recreated,\n // and the app start end timestamp is not updated, for example\n // due to missing `Sentry.wrap(RootComponent)` call.\n debug.warn(\n '[AppStart] Last recorded app start end timestamp is before the app start timestamp.',\n 'This is usually caused by missing `Sentry.wrap(RootComponent)` call.',\n );\n appStartDataFlushed = true;\n return;\n }\n\n appStartDataFlushed = true;\n\n event.contexts.trace.data = event.contexts.trace.data || {};\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_OP] = UI_LOAD_OP;\n event.contexts.trace.op = UI_LOAD_OP;\n\n const origin = isRecordedAppStartEndTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START;\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = origin;\n event.contexts.trace.origin = origin;\n\n const appStartTimestampSeconds = appStartTimestampMs / 1000;\n event.start_timestamp = appStartTimestampSeconds;\n\n event.spans = event.spans || [];\n /** event.spans reference */\n const children: SpanJSON[] = event.spans;\n\n const maybeTtidSpan = children.find(({ op }) => op === 'ui.load.initial_display');\n if (maybeTtidSpan) {\n maybeTtidSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_initial_display', maybeTtidSpan);\n }\n\n const maybeTtfdSpan = children.find(({ op }) => op === 'ui.load.full_display');\n if (maybeTtfdSpan) {\n maybeTtfdSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_full_display', maybeTtfdSpan);\n }\n\n const appStartEndTimestampSeconds = appStartEndTimestampMs / 1000;\n if (event.timestamp && event.timestamp < appStartEndTimestampSeconds) {\n debug.log(\n '[AppStart] Transaction event timestamp is before app start end. Adjusting transaction event timestamp.',\n );\n event.timestamp = appStartEndTimestampSeconds;\n }\n\n const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;\n const appStartSpanJSON: SpanJSON = createSpanJSON({\n op,\n description: appStart.type === 'cold' ? 'Cold Start' : 'Warm Start',\n start_timestamp: appStartTimestampSeconds,\n timestamp: appStartEndTimestampSeconds,\n trace_id: event.contexts.trace.trace_id,\n parent_span_id: event.contexts.trace.span_id,\n origin,\n });\n\n if (appStartEndData?.endFrames) {\n attachFrameDataToSpan(appStartSpanJSON, appStartEndData.endFrames);\n }\n\n const jsExecutionSpanJSON = createJSExecutionStartSpan(appStartSpanJSON, rootComponentCreationTimestampMs);\n\n const appStartSpans = [\n appStartSpanJSON,\n ...(jsExecutionSpanJSON ? [jsExecutionSpanJSON] : []),\n ...convertNativeSpansToSpanJSON(appStartSpanJSON, appStart.spans),\n ];\n\n children.push(...appStartSpans);\n debug.log('[AppStart] Added app start spans to transaction event.', JSON.stringify(appStartSpans, undefined, 2));\n\n const measurementKey = appStart.type === 'cold' ? APP_START_COLD_MEASUREMENT : APP_START_WARM_MEASUREMENT;\n const measurementValue = {\n value: appStartDurationMs,\n unit: 'millisecond',\n };\n event.measurements = event.measurements || {};\n event.measurements[measurementKey] = measurementValue;\n debug.log(\n '[AppStart] Added app start measurement to transaction event.',\n JSON.stringify(measurementValue, undefined, 2),\n );\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n afterAllSetup,\n processEvent,\n captureStandaloneAppStart,\n setFirstStartedActiveRootSpanId,\n } as AppStartIntegration;\n};\n\nfunction setSpanDurationAsMeasurementOnTransactionEvent(event: TransactionEvent, label: string, span: SpanJSON): void {\n if (!span.timestamp || !span.start_timestamp) {\n debug.warn('Span is missing start or end timestamp. Cam not set measurement on transaction event.');\n return;\n }\n\n event.measurements = event.measurements || {};\n event.measurements[label] = {\n value: (span.timestamp - span.start_timestamp) * 1000,\n unit: 'millisecond',\n };\n}\n\n/**\n * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.\n */\nfunction createJSExecutionStartSpan(\n parentSpan: SpanJSON,\n rootComponentCreationTimestampMs: number | undefined,\n): SpanJSON | undefined {\n const bundleStartTimestampMs = getBundleStartTimestampMs();\n if (!bundleStartTimestampMs) {\n return undefined;\n }\n\n const bundleStartTimestampSeconds = bundleStartTimestampMs / 1000;\n if (bundleStartTimestampSeconds < parentSpan.start_timestamp) {\n debug.warn('Bundle start timestamp is before the app start span start timestamp. Skipping JS execution span.');\n return undefined;\n }\n\n if (!rootComponentCreationTimestampMs) {\n debug.warn('Missing the root component first constructor call timestamp.');\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Start',\n start_timestamp: bundleStartTimestampSeconds,\n timestamp: bundleStartTimestampSeconds,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Before React Root',\n start_timestamp: bundleStartTimestampSeconds,\n timestamp: rootComponentCreationTimestampMs / 1000,\n origin: isRootComponentCreationTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START,\n });\n}\n\n/**\n * Adds native spans to the app start span.\n */\nfunction convertNativeSpansToSpanJSON(parentSpan: SpanJSON, nativeSpans: NativeAppStartResponse['spans']): SpanJSON[] {\n return nativeSpans\n .filter(span => span.start_timestamp_ms / 1000 >= parentSpan.start_timestamp)\n .map(span => {\n if (span.description === 'UIKit init') {\n return setMainThreadInfo(createUIKitSpan(parentSpan, span));\n }\n\n return setMainThreadInfo(\n createChildSpanJSON(parentSpan, {\n description: span.description,\n start_timestamp: span.start_timestamp_ms / 1000,\n timestamp: span.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n }),\n );\n });\n}\n\n/**\n * UIKit init is measured by the native layers till the native SDK start\n * RN initializes the native SDK later, the end timestamp would be wrong\n */\nfunction createUIKitSpan(parentSpan: SpanJSON, nativeUIKitSpan: NativeAppStartResponse['spans'][number]): SpanJSON {\n const bundleStart = getBundleStartTimestampMs();\n\n // If UIKit init ends after the bundle start, the native SDK was auto-initialized\n // and so the end timestamp is incorrect.\n // The timestamps can't equal, as RN initializes after UIKit.\n if (bundleStart && bundleStart < nativeUIKitSpan.end_timestamp_ms) {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init to JS Exec Start',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: bundleStart / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n } else {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: nativeUIKitSpan.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"appStart.js","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/appStart.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EACL,KAAK,EACL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,gCAAgC,EAChC,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,cAAc,IAAI,0BAA0B,EAC5C,c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eAAe,EAAE,eAAe,CAAC,kBAAkB,GAAG,IAAI;YAC1D,SAAS,EAAE,eAAe,CAAC,gBAAgB,GAAG,IAAI;YAClD,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable complexity, max-lines */\nimport type { Client, Event, Integration, Span, SpanJSON, TransactionEvent } from '@sentry/core';\nimport {\n debug,\n getCapturedScopesOnSpan,\n getClient,\n getCurrentScope,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n spanIsSampled,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\nimport { getAppRegistryIntegration } from '../../integrations/appRegistry';\nimport {\n APP_START_COLD as APP_START_COLD_MEASUREMENT,\n APP_START_WARM as APP_START_WARM_MEASUREMENT,\n} from '../../measurements';\nimport type { NativeAppStartResponse, NativeFramesResponse } from '../../NativeRNSentry';\nimport type { ReactNativeClientOptions } from '../../options';\nimport { convertSpanToTransaction, isRootSpan, setEndTimeValue } from '../../utils/span';\nimport { NATIVE } from '../../wrapper';\nimport {\n APP_START_COLD as APP_START_COLD_OP,\n APP_START_WARM as APP_START_WARM_OP,\n UI_LOAD as UI_LOAD_OP,\n} from '../ops';\nimport { SPAN_ORIGIN_AUTO_APP_START, SPAN_ORIGIN_MANUAL_APP_START } from '../origin';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '../semanticAttributes';\nimport { setMainThreadInfo } from '../span';\nimport { createChildSpanJSON, createSpanJSON, getBundleStartTimestampMs } from '../utils';\n\nconst INTEGRATION_NAME = 'AppStart';\n\nexport type AppStartIntegration = Integration & {\n captureStandaloneAppStart: () => Promise<void>;\n};\n\n/**\n * We filter out app start more than 60s.\n * This could be due to many different reasons.\n * We've seen app starts with hours, days and even months.\n */\nconst MAX_APP_START_DURATION_MS = 60_000;\n\n/** We filter out App starts which timestamp is 60s and more before the transaction start */\nconst MAX_APP_START_AGE_MS = 60_000;\n\n/** App Start transaction name */\nconst APP_START_TX_NAME = 'App Start';\n\ninterface AppStartEndData {\n timestampMs: number;\n endFrames: NativeFramesResponse | null;\n}\n\nlet appStartEndData: AppStartEndData | undefined = undefined;\nlet isRecordedAppStartEndTimestampMsManual = false;\n\nlet rootComponentCreationTimestampMs: number | undefined = undefined;\nlet isRootComponentCreationTimestampMsManual = false;\n\n/**\n * Records the application start end.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function captureAppStart(): Promise<void> {\n return _captureAppStart({ isManual: true });\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport async function _captureAppStart({ isManual }: { isManual: boolean }): Promise<void> {\n const client = getClient();\n if (!client) {\n debug.warn('[AppStart] Could not capture App Start, missing client.');\n return;\n }\n\n isRecordedAppStartEndTimestampMsManual = isManual;\n\n const timestampMs = timestampInSeconds() * 1000;\n\n // Set end timestamp immediately to avoid race with processEvent\n // Frames data will be updated after the async fetch\n _setAppStartEndData({\n timestampMs,\n endFrames: null,\n });\n\n if (NATIVE.enableNative) {\n try {\n const endFrames = await NATIVE.fetchNativeFrames();\n debug.log('[AppStart] Captured end frames for app start.', endFrames);\n _updateAppStartEndFrames(endFrames);\n } catch (error) {\n debug.log('[AppStart] Failed to capture end frames for app start.', error);\n }\n }\n\n await client.getIntegrationByName<AppStartIntegration>(INTEGRATION_NAME)?.captureStandaloneAppStart();\n}\n\n/**\n * Sets the root component first constructor call timestamp.\n * Used automatically by `Sentry.wrap` and `Sentry.ReactNativeProfiler`.\n */\nexport function setRootComponentCreationTimestampMs(timestampMs: number): void {\n appStartEndData?.timestampMs && debug.warn('Setting Root component creation timestamp after app start end is set.');\n rootComponentCreationTimestampMs && debug.warn('Overwriting already set root component creation timestamp.');\n rootComponentCreationTimestampMs = timestampMs;\n isRootComponentCreationTimestampMsManual = true;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport function _setRootComponentCreationTimestampMs(timestampMs: number): void {\n setRootComponentCreationTimestampMs(timestampMs);\n isRootComponentCreationTimestampMsManual = false;\n}\n\n/**\n * For internal use only.\n *\n * @private\n */\nexport const _setAppStartEndData = (data: AppStartEndData): void => {\n appStartEndData && debug.warn('Overwriting already set app start end data.');\n appStartEndData = data;\n};\n\n/**\n * Updates only the endFrames on existing appStartEndData.\n * Used after the async fetchNativeFrames completes to attach frame data\n * without triggering the overwrite warning from _setAppStartEndData.\n *\n * @private\n */\nexport const _updateAppStartEndFrames = (endFrames: NativeFramesResponse | null): void => {\n if (appStartEndData) {\n appStartEndData.endFrames = endFrames;\n }\n};\n\n/**\n * For testing purposes only.\n *\n * @private\n */\nexport function _clearRootComponentCreationTimestampMs(): void {\n rootComponentCreationTimestampMs = undefined;\n}\n\n/**\n * Attaches frame data to a span's data object.\n */\nfunction attachFrameDataToSpan(span: SpanJSON, frames: NativeFramesResponse): void {\n if (frames.totalFrames <= 0 && frames.slowFrames <= 0 && frames.totalFrames <= 0) {\n debug.warn(`[AppStart] Detected zero slow or frozen frames. Not adding measurements to spanId (${span.span_id}).`);\n return;\n }\n span.data = span.data || {};\n span.data['frames.total'] = frames.totalFrames;\n span.data['frames.slow'] = frames.slowFrames;\n span.data['frames.frozen'] = frames.frozenFrames;\n\n debug.log('[AppStart] Attached frame data to span.', {\n spanId: span.span_id,\n frameData: {\n total: frames.totalFrames,\n slow: frames.slowFrames,\n frozen: frames.frozenFrames,\n },\n });\n}\n\n/**\n * Adds AppStart spans from the native layer to the transaction event.\n */\nexport const appStartIntegration = ({\n standalone = false,\n}: {\n /**\n * Should the integration send App Start as a standalone root span (transaction)?\n * If false, App Start will be added as a child span to the first transaction.\n *\n * @default false\n */\n standalone?: boolean;\n} = {}): AppStartIntegration => {\n let _client: Client | undefined = undefined;\n let isEnabled = true;\n let appStartDataFlushed = false;\n let afterAllSetupCalled = false;\n let firstStartedActiveRootSpanId: string | undefined = undefined;\n let firstStartedActiveRootSpan: Span | undefined = undefined;\n\n const setup = (client: Client): void => {\n _client = client;\n const { enableAppStartTracking } = client.getOptions() as ReactNativeClientOptions;\n\n if (!enableAppStartTracking) {\n isEnabled = false;\n debug.warn('[AppStart] App start tracking is disabled.');\n }\n\n client.on('spanStart', recordFirstStartedActiveRootSpanId);\n };\n\n const afterAllSetup = (client: Client): void => {\n if (afterAllSetupCalled) {\n return;\n }\n afterAllSetupCalled = true;\n\n // TODO: automatically set standalone based on the presence of the native layer navigation integration\n\n getAppRegistryIntegration(client)?.onRunApplication(() => {\n if (appStartDataFlushed) {\n debug.log('[AppStartIntegration] Resetting app start data flushed flag based on runApplication call.');\n appStartDataFlushed = false;\n firstStartedActiveRootSpanId = undefined;\n firstStartedActiveRootSpan = undefined;\n } else {\n debug.log(\n '[AppStartIntegration] Waiting for initial app start was flush, before updating based on runApplication call.',\n );\n }\n });\n };\n\n const processEvent = async (event: Event): Promise<Event> => {\n if (!isEnabled || standalone) {\n return event;\n }\n\n if (event.type !== 'transaction') {\n // App start data is only relevant for transactions\n return event;\n }\n\n await attachAppStartToTransactionEvent(event as TransactionEvent);\n\n return event;\n };\n\n const recordFirstStartedActiveRootSpanId = (rootSpan: Span): void => {\n if (firstStartedActiveRootSpanId) {\n // Check if the previously locked span was dropped after it ended (e.g., by\n // ignoreEmptyRouteChangeTransactions or ignoreEmptyBackNavigation setting\n // _sampled = false during spanEnd). If so, reset and allow this new span.\n // We check here (at the next spanStart) rather than at spanEnd because\n // the discard listeners run after the app start listener in registration order,\n // so _sampled is not yet false when our own spanEnd listener would fire.\n if (firstStartedActiveRootSpan && !spanIsSampled(firstStartedActiveRootSpan)) {\n debug.log(\n '[AppStart] Previously locked root span was unsampled after ending. Resetting to allow next transaction.',\n );\n resetFirstStartedActiveRootSpanId();\n // Fall through to lock to this new span\n } else {\n return;\n }\n }\n\n if (!isRootSpan(rootSpan)) {\n return;\n }\n\n if (!spanIsSampled(rootSpan)) {\n return;\n }\n\n firstStartedActiveRootSpan = rootSpan;\n setFirstStartedActiveRootSpanId(rootSpan.spanContext().spanId);\n };\n\n /**\n * Resets the first started active root span id and span reference to allow\n * the next root span's transaction to attempt app start attachment.\n */\n const resetFirstStartedActiveRootSpanId = (): void => {\n debug.log('[AppStart] Resetting first started active root span id to allow retry on next transaction.');\n firstStartedActiveRootSpanId = undefined;\n firstStartedActiveRootSpan = undefined;\n };\n\n /**\n * For testing purposes only.\n * @private\n */\n const setFirstStartedActiveRootSpanId = (spanId: string | undefined): void => {\n firstStartedActiveRootSpanId = spanId;\n debug.log('[AppStart] First started active root span id recorded.', firstStartedActiveRootSpanId);\n };\n\n async function captureStandaloneAppStart(): Promise<void> {\n if (!_client) {\n // If client is not set, SDK was not initialized, logger is thus disabled\n // eslint-disable-next-line no-console\n console.warn('[AppStart] Could not capture App Start, missing client, call `Sentry.init` first.');\n return;\n }\n\n if (!standalone) {\n debug.log(\n '[AppStart] App start tracking is enabled. App start will be added to the first transaction as a child span.',\n );\n return;\n }\n\n debug.log('[AppStart] App start tracking standalone root span (transaction).');\n\n if (!appStartEndData?.endFrames && NATIVE.enableNative) {\n try {\n const endFrames = await NATIVE.fetchNativeFrames();\n debug.log('[AppStart] Captured end frames for standalone app start.', endFrames);\n\n const currentTimestamp = appStartEndData?.timestampMs || timestampInSeconds() * 1000;\n _setAppStartEndData({\n timestampMs: currentTimestamp,\n endFrames,\n });\n } catch (error) {\n debug.log('[AppStart] Failed to capture frames for standalone app start.', error);\n }\n }\n\n const span = startInactiveSpan({\n forceTransaction: true,\n name: APP_START_TX_NAME,\n op: UI_LOAD_OP,\n });\n if (span instanceof SentryNonRecordingSpan) {\n // Tracing is disabled or the transaction was sampled\n return;\n }\n\n setEndTimeValue(span, timestampInSeconds());\n _client.emit('spanEnd', span);\n\n const event = convertSpanToTransaction(span);\n if (!event) {\n debug.warn('[AppStart] Failed to convert App Start span to transaction.');\n return;\n }\n\n await attachAppStartToTransactionEvent(event);\n if (!event.spans || event.spans.length === 0) {\n // No spans were added to the transaction, so we don't need to send it\n return;\n }\n\n const scope = getCapturedScopesOnSpan(span).scope || getCurrentScope();\n scope.captureEvent(event);\n }\n\n async function attachAppStartToTransactionEvent(event: TransactionEvent): Promise<void> {\n if (appStartDataFlushed) {\n // App start data is only relevant for the first transaction of the app run\n debug.log('[AppStart] App start data already flushed. Skipping.');\n return;\n }\n\n if (!event.contexts?.trace) {\n debug.warn('[AppStart] Transaction event is missing trace context. Can not attach app start.');\n return;\n }\n\n // When standalone is true, we create our own transaction and don't need to verify\n // it matches the first navigation transaction. When standalone is false, we need to\n // ensure we're attaching app start to the first transaction (not a later one).\n if (!standalone) {\n if (!firstStartedActiveRootSpanId) {\n debug.warn('[AppStart] No first started active root span id recorded. Can not attach app start.');\n return;\n }\n\n if (firstStartedActiveRootSpanId !== event.contexts.trace.span_id) {\n debug.warn(\n '[AppStart] First started active root span id does not match the transaction event span id. Can not attached app start.',\n );\n return;\n }\n }\n\n // All failure paths below set appStartDataFlushed = true to prevent\n // wasteful retries — these conditions won't change within the same app start.\n const appStart = await NATIVE.fetchNativeAppStart();\n if (!appStart) {\n debug.warn('[AppStart] Failed to retrieve the app start metrics from the native layer.');\n appStartDataFlushed = true;\n return;\n }\n if (appStart.has_fetched) {\n debug.warn('[AppStart] Measured app start metrics were already reported from the native layer.');\n appStartDataFlushed = true;\n return;\n }\n\n const appStartTimestampMs = appStart.app_start_timestamp_ms;\n if (!appStartTimestampMs) {\n debug.warn('[AppStart] App start timestamp could not be loaded from the native layer.');\n appStartDataFlushed = true;\n return;\n }\n\n const appStartEndTimestampMs = appStartEndData?.timestampMs || getBundleStartTimestampMs();\n if (!appStartEndTimestampMs) {\n debug.warn(\n '[AppStart] Javascript failed to record app start end. `_setAppStartEndData` was not called nor could the bundle start be found.',\n );\n appStartDataFlushed = true;\n return;\n }\n\n const isAppStartWithinBounds =\n !!event.start_timestamp && appStartTimestampMs >= event.start_timestamp * 1_000 - MAX_APP_START_AGE_MS;\n if (!__DEV__ && !isAppStartWithinBounds) {\n debug.warn('[AppStart] App start timestamp is too far in the past to be used for app start span.');\n appStartDataFlushed = true;\n return;\n }\n\n const appStartDurationMs = appStartEndTimestampMs - appStartTimestampMs;\n if (!__DEV__ && appStartDurationMs >= MAX_APP_START_DURATION_MS) {\n // Dev builds can have long app start waiting over minute for the first bundle to be produced\n debug.warn('[AppStart] App start duration is over a minute long, not adding app start span.');\n appStartDataFlushed = true;\n return;\n }\n\n if (appStartDurationMs < 0) {\n // This can happen when MainActivity on Android is recreated,\n // and the app start end timestamp is not updated, for example\n // due to missing `Sentry.wrap(RootComponent)` call.\n debug.warn(\n '[AppStart] Last recorded app start end timestamp is before the app start timestamp.',\n 'This is usually caused by missing `Sentry.wrap(RootComponent)` call.',\n );\n appStartDataFlushed = true;\n return;\n }\n\n appStartDataFlushed = true;\n\n event.contexts.trace.data = event.contexts.trace.data || {};\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_OP] = UI_LOAD_OP;\n event.contexts.trace.op = UI_LOAD_OP;\n\n const origin = isRecordedAppStartEndTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START;\n event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = origin;\n event.contexts.trace.origin = origin;\n\n const appStartTimestampSeconds = appStartTimestampMs / 1000;\n event.start_timestamp = appStartTimestampSeconds;\n\n event.spans = event.spans || [];\n /** event.spans reference */\n const children: SpanJSON[] = event.spans;\n\n const maybeTtidSpan = children.find(({ op }) => op === 'ui.load.initial_display');\n if (maybeTtidSpan) {\n maybeTtidSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_initial_display', maybeTtidSpan);\n }\n\n const maybeTtfdSpan = children.find(({ op }) => op === 'ui.load.full_display');\n if (maybeTtfdSpan) {\n maybeTtfdSpan.start_timestamp = appStartTimestampSeconds;\n setSpanDurationAsMeasurementOnTransactionEvent(event, 'time_to_full_display', maybeTtfdSpan);\n }\n\n const appStartEndTimestampSeconds = appStartEndTimestampMs / 1000;\n if (event.timestamp && event.timestamp < appStartEndTimestampSeconds) {\n debug.log(\n '[AppStart] Transaction event timestamp is before app start end. Adjusting transaction event timestamp.',\n );\n event.timestamp = appStartEndTimestampSeconds;\n }\n\n const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;\n const appStartSpanJSON: SpanJSON = createSpanJSON({\n op,\n description: appStart.type === 'cold' ? 'Cold Start' : 'Warm Start',\n start_timestamp: appStartTimestampSeconds,\n timestamp: appStartEndTimestampSeconds,\n trace_id: event.contexts.trace.trace_id,\n parent_span_id: event.contexts.trace.span_id,\n origin,\n });\n\n if (appStartEndData?.endFrames) {\n attachFrameDataToSpan(appStartSpanJSON, appStartEndData.endFrames);\n }\n\n const jsExecutionSpanJSON = createJSExecutionStartSpan(appStartSpanJSON, rootComponentCreationTimestampMs);\n\n const appStartSpans = [\n appStartSpanJSON,\n ...(jsExecutionSpanJSON ? [jsExecutionSpanJSON] : []),\n ...convertNativeSpansToSpanJSON(appStartSpanJSON, appStart.spans),\n ];\n\n children.push(...appStartSpans);\n debug.log('[AppStart] Added app start spans to transaction event.', JSON.stringify(appStartSpans, undefined, 2));\n\n const measurementKey = appStart.type === 'cold' ? APP_START_COLD_MEASUREMENT : APP_START_WARM_MEASUREMENT;\n const measurementValue = {\n value: appStartDurationMs,\n unit: 'millisecond',\n };\n event.measurements = event.measurements || {};\n event.measurements[measurementKey] = measurementValue;\n debug.log(\n '[AppStart] Added app start measurement to transaction event.',\n JSON.stringify(measurementValue, undefined, 2),\n );\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n afterAllSetup,\n processEvent,\n captureStandaloneAppStart,\n setFirstStartedActiveRootSpanId,\n } as AppStartIntegration;\n};\n\nfunction setSpanDurationAsMeasurementOnTransactionEvent(event: TransactionEvent, label: string, span: SpanJSON): void {\n if (!span.timestamp || !span.start_timestamp) {\n debug.warn('Span is missing start or end timestamp. Cam not set measurement on transaction event.');\n return;\n }\n\n event.measurements = event.measurements || {};\n event.measurements[label] = {\n value: (span.timestamp - span.start_timestamp) * 1000,\n unit: 'millisecond',\n };\n}\n\n/**\n * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.\n */\nfunction createJSExecutionStartSpan(\n parentSpan: SpanJSON,\n rootComponentCreationTimestampMs: number | undefined,\n): SpanJSON | undefined {\n const bundleStartTimestampMs = getBundleStartTimestampMs();\n if (!bundleStartTimestampMs) {\n return undefined;\n }\n\n const bundleStartTimestampSeconds = bundleStartTimestampMs / 1000;\n if (bundleStartTimestampSeconds < parentSpan.start_timestamp) {\n debug.warn('Bundle start timestamp is before the app start span start timestamp. Skipping JS execution span.');\n return undefined;\n }\n\n if (!rootComponentCreationTimestampMs) {\n debug.warn('Missing the root component first constructor call timestamp.');\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Start',\n start_timestamp: bundleStartTimestampSeconds,\n timestamp: bundleStartTimestampSeconds,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n\n return createChildSpanJSON(parentSpan, {\n description: 'JS Bundle Execution Before React Root',\n start_timestamp: bundleStartTimestampSeconds,\n timestamp: rootComponentCreationTimestampMs / 1000,\n origin: isRootComponentCreationTimestampMsManual ? SPAN_ORIGIN_MANUAL_APP_START : SPAN_ORIGIN_AUTO_APP_START,\n });\n}\n\n/**\n * Adds native spans to the app start span.\n */\nfunction convertNativeSpansToSpanJSON(parentSpan: SpanJSON, nativeSpans: NativeAppStartResponse['spans']): SpanJSON[] {\n return nativeSpans\n .filter(span => span.start_timestamp_ms / 1000 >= parentSpan.start_timestamp)\n .map(span => {\n if (span.description === 'UIKit init') {\n return setMainThreadInfo(createUIKitSpan(parentSpan, span));\n }\n\n return setMainThreadInfo(\n createChildSpanJSON(parentSpan, {\n description: span.description,\n start_timestamp: span.start_timestamp_ms / 1000,\n timestamp: span.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n }),\n );\n });\n}\n\n/**\n * UIKit init is measured by the native layers till the native SDK start\n * RN initializes the native SDK later, the end timestamp would be wrong\n */\nfunction createUIKitSpan(parentSpan: SpanJSON, nativeUIKitSpan: NativeAppStartResponse['spans'][number]): SpanJSON {\n const bundleStart = getBundleStartTimestampMs();\n\n // If UIKit init ends after the bundle start, the native SDK was auto-initialized\n // and so the end timestamp is incorrect.\n // The timestamps can't equal, as RN initializes after UIKit.\n if (bundleStart && bundleStart < nativeUIKitSpan.end_timestamp_ms) {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init to JS Exec Start',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: bundleStart / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n } else {\n return createChildSpanJSON(parentSpan, {\n description: 'UIKit Init',\n start_timestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n timestamp: nativeUIKitSpan.end_timestamp_ms / 1000,\n origin: SPAN_ORIGIN_AUTO_APP_START,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nativeFrames.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/nativeFrames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,WAAW,EAAE,YAAY,EAAE,eAAe,EAAQ,MAAM,cAAc,CAAC;AAkCpG,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;IACvD,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;IACtD,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;CACzD;AAOD,eAAO,MAAM,8BAA8B,WAAY,OAAO,GAAG,SAAS,KAAG,WAAW,GAAG,SAQ1F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAO,WA8N1C,CAAC"}
1
+ {"version":3,"file":"nativeFrames.d.ts","sourceRoot":"","sources":["../../../../src/js/tracing/integrations/nativeFrames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,WAAW,EAAE,YAAY,EAAE,eAAe,EAAQ,MAAM,cAAc,CAAC;AAkCpG,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;IACvD,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;IACtD,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;CACzD;AAOD,eAAO,MAAM,8BAA8B,GAAI,QAAQ,OAAO,GAAG,SAAS,KAAG,WAAW,GAAG,SAQ1F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAO,WAkO1C,CAAC"}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { debug, getRootSpan, spanToJSON, timestampInSeconds } from '@sentry/core';
10
+ import { debug, getRootSpan, spanIsSampled, spanToJSON, timestampInSeconds } from '@sentry/core';
11
11
  import { AsyncExpiringMap } from '../../utils/AsyncExpiringMap';
12
12
  import { isRootSpan } from '../../utils/span';
13
13
  import { NATIVE } from '../../wrapper';
@@ -67,6 +67,9 @@ export const nativeFramesIntegration = () => {
67
67
  client.on('spanEnd', fetchEndFramesForSpan);
68
68
  };
69
69
  const fetchStartFramesForSpan = (span) => {
70
+ if (!spanIsSampled(span)) {
71
+ return;
72
+ }
70
73
  const spanId = span.spanContext().spanId;
71
74
  const spanType = isRootSpan(span) ? 'root' : 'child';
72
75
  debug.log(`[${INTEGRATION_NAME}] Fetching frames for ${spanType} span start (${spanId}).`);