@sentry/react-native 5.3.0 → 5.4.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 (207) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +7 -8
  3. package/RNSentry.podspec +1 -1
  4. package/android/build.gradle +1 -1
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +13 -0
  6. package/dist/js/NativeRNSentry.d.ts +1 -1
  7. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  8. package/dist/js/NativeRNSentry.js.map +1 -1
  9. package/dist/js/breadcrumb.d.ts.map +1 -1
  10. package/dist/js/breadcrumb.js +3 -3
  11. package/dist/js/breadcrumb.js.map +1 -1
  12. package/dist/js/client.d.ts.map +1 -1
  13. package/dist/js/client.js +8 -5
  14. package/dist/js/client.js.map +1 -1
  15. package/dist/js/index.d.ts +1 -2
  16. package/dist/js/index.d.ts.map +1 -1
  17. package/dist/js/index.js +1 -5
  18. package/dist/js/index.js.map +1 -1
  19. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  20. package/dist/js/integrations/debugsymbolicator.js +1 -3
  21. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  22. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  23. package/dist/js/integrations/devicecontext.js +2 -4
  24. package/dist/js/integrations/devicecontext.js.map +1 -1
  25. package/dist/js/integrations/eventorigin.js +1 -1
  26. package/dist/js/integrations/eventorigin.js.map +1 -1
  27. package/dist/js/integrations/factory.d.ts.map +1 -1
  28. package/dist/js/integrations/factory.js +3 -1
  29. package/dist/js/integrations/factory.js.map +1 -1
  30. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  31. package/dist/js/integrations/modulesloader.js.map +1 -1
  32. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  33. package/dist/js/integrations/reactnativeerrorhandlers.js +2 -2
  34. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  35. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  36. package/dist/js/integrations/reactnativeinfo.js +1 -2
  37. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  38. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  39. package/dist/js/integrations/rewriteframes.js +2 -5
  40. package/dist/js/integrations/rewriteframes.js.map +1 -1
  41. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  42. package/dist/js/integrations/screenshot.js +2 -6
  43. package/dist/js/integrations/screenshot.js.map +1 -1
  44. package/dist/js/integrations/sdkinfo.js.map +1 -1
  45. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  46. package/dist/js/measurements.d.ts +2 -3
  47. package/dist/js/measurements.d.ts.map +1 -1
  48. package/dist/js/measurements.js +5 -8
  49. package/dist/js/measurements.js.map +1 -1
  50. package/dist/js/misc.d.ts.map +1 -1
  51. package/dist/js/misc.js +1 -3
  52. package/dist/js/misc.js.map +1 -1
  53. package/dist/js/options.d.ts +6 -6
  54. package/dist/js/options.d.ts.map +1 -1
  55. package/dist/js/options.js +1 -0
  56. package/dist/js/options.js.map +1 -1
  57. package/dist/js/scope.d.ts +2 -2
  58. package/dist/js/scope.d.ts.map +1 -1
  59. package/dist/js/scope.js +10 -7
  60. package/dist/js/scope.js.map +1 -1
  61. package/dist/js/sdk.d.ts +1 -1
  62. package/dist/js/sdk.d.ts.map +1 -1
  63. package/dist/js/sdk.js.map +1 -1
  64. package/dist/js/tools/ModulesCollector.d.ts.map +1 -1
  65. package/dist/js/tools/ModulesCollector.js +3 -7
  66. package/dist/js/tools/ModulesCollector.js.map +1 -1
  67. package/dist/js/tools/collectModules.js +1 -3
  68. package/dist/js/tools/collectModules.js.map +1 -1
  69. package/dist/js/touchevents.d.ts +1 -1
  70. package/dist/js/touchevents.d.ts.map +1 -1
  71. package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
  72. package/dist/js/tracing/gesturetracing.js +4 -2
  73. package/dist/js/tracing/gesturetracing.js.map +1 -1
  74. package/dist/js/tracing/index.d.ts +3 -3
  75. package/dist/js/tracing/index.d.ts.map +1 -1
  76. package/dist/js/tracing/index.js +2 -2
  77. package/dist/js/tracing/index.js.map +1 -1
  78. package/dist/js/tracing/nativeframes.d.ts +4 -4
  79. package/dist/js/tracing/nativeframes.d.ts.map +1 -1
  80. package/dist/js/tracing/nativeframes.js +15 -15
  81. package/dist/js/tracing/nativeframes.js.map +1 -1
  82. package/dist/js/tracing/ops.d.ts.map +1 -1
  83. package/dist/js/tracing/ops.js.map +1 -1
  84. package/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  85. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  86. package/dist/js/tracing/reactnativenavigation.js +4 -11
  87. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  88. package/dist/js/tracing/reactnativetracing.d.ts +2 -2
  89. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  90. package/dist/js/tracing/reactnativetracing.js +19 -16
  91. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  92. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  93. package/dist/js/tracing/reactnavigation.js.map +1 -1
  94. package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
  95. package/dist/js/tracing/reactnavigationv4.js +1 -2
  96. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  97. package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
  98. package/dist/js/tracing/routingInstrumentation.js.map +1 -1
  99. package/dist/js/tracing/stalltracking.d.ts +1 -1
  100. package/dist/js/tracing/stalltracking.d.ts.map +1 -1
  101. package/dist/js/tracing/stalltracking.js +9 -17
  102. package/dist/js/tracing/stalltracking.js.map +1 -1
  103. package/dist/js/tracing/transaction.d.ts.map +1 -1
  104. package/dist/js/tracing/transaction.js +2 -1
  105. package/dist/js/tracing/transaction.js.map +1 -1
  106. package/dist/js/tracing/types.d.ts.map +1 -1
  107. package/dist/js/tracing/types.js +1 -0
  108. package/dist/js/tracing/types.js.map +1 -1
  109. package/dist/js/tracing/utils.d.ts +1 -1
  110. package/dist/js/tracing/utils.d.ts.map +1 -1
  111. package/dist/js/tracing/utils.js.map +1 -1
  112. package/dist/js/transports/TextEncoder.d.ts.map +1 -1
  113. package/dist/js/transports/TextEncoder.js.map +1 -1
  114. package/dist/js/transports/native.d.ts +1 -1
  115. package/dist/js/transports/native.d.ts.map +1 -1
  116. package/dist/js/transports/native.js +1 -1
  117. package/dist/js/transports/native.js.map +1 -1
  118. package/dist/js/user.d.ts.map +1 -1
  119. package/dist/js/user.js +1 -0
  120. package/dist/js/user.js.map +1 -1
  121. package/dist/js/utils/envelope.d.ts.map +1 -1
  122. package/dist/js/utils/envelope.js +5 -2
  123. package/dist/js/utils/envelope.js.map +1 -1
  124. package/dist/js/utils/normalize.d.ts +5 -0
  125. package/dist/js/utils/normalize.d.ts.map +1 -0
  126. package/dist/js/utils/normalize.js +17 -0
  127. package/dist/js/utils/normalize.js.map +1 -0
  128. package/dist/js/utils/outcome.js +1 -1
  129. package/dist/js/utils/outcome.js.map +1 -1
  130. package/dist/js/utils/safe.d.ts.map +1 -1
  131. package/dist/js/utils/safe.js +1 -3
  132. package/dist/js/utils/safe.js.map +1 -1
  133. package/dist/js/vendor/buffer/index.d.ts +1 -1
  134. package/dist/js/vendor/buffer/index.d.ts.map +1 -1
  135. package/dist/js/vendor/buffer/index.js +1 -1
  136. package/dist/js/vendor/buffer/index.js.map +1 -1
  137. package/dist/js/vendor/buffer/utf8ToBytes.d.ts +0 -5
  138. package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -1
  139. package/dist/js/vendor/buffer/utf8ToBytes.js +29 -16
  140. package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
  141. package/dist/js/vendor/index.d.ts +1 -1
  142. package/dist/js/vendor/index.d.ts.map +1 -1
  143. package/dist/js/vendor/index.js +1 -1
  144. package/dist/js/vendor/index.js.map +1 -1
  145. package/dist/js/version.d.ts +1 -1
  146. package/dist/js/version.js +1 -1
  147. package/dist/js/version.js.map +1 -1
  148. package/dist/js/wrapper.d.ts.map +1 -1
  149. package/dist/js/wrapper.js +15 -20
  150. package/dist/js/wrapper.js.map +1 -1
  151. package/ios/RNSentry.mm +31 -3
  152. package/ios/RNSentry.xcodeproj/project.pbxproj +472 -0
  153. package/package.json +29 -16
  154. package/sentry.gradle +16 -8
  155. package/src/js/NativeRNSentry.ts +5 -8
  156. package/ts3.8/dist/js/NativeRNSentry.d.ts +80 -0
  157. package/ts3.8/dist/js/breadcrumb.d.ts +11 -0
  158. package/ts3.8/dist/js/client.d.ts +59 -0
  159. package/ts3.8/dist/js/index.d.ts +13 -0
  160. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +49 -0
  161. package/ts3.8/dist/js/integrations/devicecontext.d.ts +17 -0
  162. package/ts3.8/dist/js/integrations/eventorigin.d.ts +17 -0
  163. package/ts3.8/dist/js/integrations/factory.d.ts +7 -0
  164. package/ts3.8/dist/js/integrations/index.d.ts +9 -0
  165. package/ts3.8/dist/js/integrations/modulesloader.d.ts +17 -0
  166. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +54 -0
  167. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +23 -0
  168. package/ts3.8/dist/js/integrations/release.d.ts +17 -0
  169. package/ts3.8/dist/js/integrations/rewriteframes.d.ts +8 -0
  170. package/ts3.8/dist/js/integrations/screenshot.d.ts +23 -0
  171. package/ts3.8/dist/js/integrations/sdkinfo.d.ts +21 -0
  172. package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +20 -0
  173. package/ts3.8/dist/js/measurements.d.ts +13 -0
  174. package/ts3.8/dist/js/misc.d.ts +9 -0
  175. package/ts3.8/dist/js/options.d.ts +152 -0
  176. package/ts3.8/dist/js/scope.d.ts +54 -0
  177. package/ts3.8/dist/js/sdk.d.ts +63 -0
  178. package/ts3.8/dist/js/touchevents.d.ts +71 -0
  179. package/ts3.8/dist/js/tracing/gesturetracing.d.ts +20 -0
  180. package/ts3.8/dist/js/tracing/index.d.ts +10 -0
  181. package/ts3.8/dist/js/tracing/nativeframes.d.ts +64 -0
  182. package/ts3.8/dist/js/tracing/ops.d.ts +8 -0
  183. package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +85 -0
  184. package/ts3.8/dist/js/tracing/reactnativeprofiler.d.ts +12 -0
  185. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +142 -0
  186. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +83 -0
  187. package/ts3.8/dist/js/tracing/reactnavigationv4.d.ts +92 -0
  188. package/ts3.8/dist/js/tracing/routingInstrumentation.d.ts +52 -0
  189. package/ts3.8/dist/js/tracing/stalltracking.d.ts +94 -0
  190. package/ts3.8/dist/js/tracing/transaction.d.ts +7 -0
  191. package/ts3.8/dist/js/tracing/types.d.ts +29 -0
  192. package/ts3.8/dist/js/tracing/utils.d.ts +27 -0
  193. package/ts3.8/dist/js/transports/TextEncoder.d.ts +3 -0
  194. package/ts3.8/dist/js/transports/native.d.ts +39 -0
  195. package/ts3.8/dist/js/user.d.ts +6 -0
  196. package/ts3.8/dist/js/utils/envelope.d.ts +12 -0
  197. package/ts3.8/dist/js/utils/environment.d.ts +7 -0
  198. package/ts3.8/dist/js/utils/ignorerequirecyclelogs.d.ts +5 -0
  199. package/ts3.8/dist/js/utils/normalize.d.ts +5 -0
  200. package/ts3.8/dist/js/utils/outcome.d.ts +6 -0
  201. package/ts3.8/dist/js/utils/safe.d.ts +21 -0
  202. package/ts3.8/dist/js/utils/worldwide.d.ts +15 -0
  203. package/ts3.8/dist/js/vendor/buffer/index.d.ts +2 -0
  204. package/ts3.8/dist/js/vendor/buffer/utf8ToBytes.d.ts +5 -0
  205. package/ts3.8/dist/js/vendor/index.d.ts +2 -0
  206. package/ts3.8/dist/js/version.d.ts +4 -0
  207. package/ts3.8/dist/js/wrapper.d.ts +55 -0
@@ -0,0 +1,54 @@
1
+ import { Scope } from '@sentry/core';
2
+ import type { Attachment, Breadcrumb, User } from '@sentry/types';
3
+ /**
4
+ * Extends the scope methods to set scope on the Native SDKs
5
+ */
6
+ export declare class ReactNativeScope extends Scope {
7
+ /**
8
+ * @inheritDoc
9
+ */
10
+ setUser(user: User | null): this;
11
+ /**
12
+ * @inheritDoc
13
+ */
14
+ setTag(key: string, value: string): this;
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ setTags(tags: {
19
+ [key: string]: string;
20
+ }): this;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ setExtras(extras: {
25
+ [key: string]: any;
26
+ }): this;
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ setExtra(key: string, extra: any): this;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ clearBreadcrumbs(): this;
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ setContext(key: string, context: {
43
+ [key: string]: any;
44
+ } | null): this;
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ addAttachment(attachment: Attachment): this;
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ clearAttachments(): this;
53
+ }
54
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1,63 @@
1
+ import type { Scope } from '@sentry/core';
2
+ import { Hub } from '@sentry/core';
3
+ import type { UserFeedback } from '@sentry/types';
4
+ import * as React from 'react';
5
+ import type { ReactNativeOptions, ReactNativeWrapperOptions } from './options';
6
+ /**
7
+ * Inits the SDK and returns the final options.
8
+ */
9
+ export declare function init(passedOptions: ReactNativeOptions): void;
10
+ /**
11
+ * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.
12
+ */
13
+ export declare function wrap<P extends JSX.IntrinsicAttributes>(RootComponent: React.ComponentType<P>, options?: ReactNativeWrapperOptions): React.ComponentType<P>;
14
+ /**
15
+ * Deprecated. Sets the release on the event.
16
+ * NOTE: Does not set the release on sessions.
17
+ * @deprecated
18
+ */
19
+ export declare function setRelease(release: string): void;
20
+ /**
21
+ * Deprecated. Sets the dist on the event.
22
+ * NOTE: Does not set the dist on sessions.
23
+ * @deprecated
24
+ */
25
+ export declare function setDist(dist: string): void;
26
+ /**
27
+ * If native client is available it will trigger a native crash.
28
+ * Use this only for testing purposes.
29
+ */
30
+ export declare function nativeCrash(): void;
31
+ /**
32
+ * Flushes all pending events in the queue to disk.
33
+ * Use this before applying any realtime updates such as code-push or expo updates.
34
+ */
35
+ export declare function flush(): Promise<boolean>;
36
+ /**
37
+ * Closes the SDK, stops sending events.
38
+ */
39
+ export declare function close(): Promise<void>;
40
+ /**
41
+ * Captures user feedback and sends it to Sentry.
42
+ */
43
+ export declare function captureUserFeedback(feedback: UserFeedback): void;
44
+ /**
45
+ * Creates a new scope with and executes the given operation within.
46
+ * The scope is automatically removed once the operation
47
+ * finishes or throws.
48
+ *
49
+ * This is essentially a convenience function for:
50
+ *
51
+ * pushScope();
52
+ * callback();
53
+ * popScope();
54
+ *
55
+ * @param callback that will be enclosed into push/popScope.
56
+ */
57
+ export declare function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']>;
58
+ /**
59
+ * Callback to set context information onto the scope.
60
+ * @param callback Callback function that receives Scope.
61
+ */
62
+ export declare function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']>;
63
+ //# sourceMappingURL=sdk.d.ts.map
@@ -0,0 +1,71 @@
1
+ import * as React from 'react';
2
+ export declare type TouchEventBoundaryProps = {
3
+ /**
4
+ * The category assigned to the breadcrumb that is logged by the touch event.
5
+ */
6
+ breadcrumbCategory?: string;
7
+ /**
8
+ * The type assigned to the breadcrumb that is logged by the touch event.
9
+ */
10
+ breadcrumbType?: string;
11
+ /**
12
+ * The max number of components to display when logging a touch's component tree.
13
+ */
14
+ maxComponentTreeSize?: number;
15
+ /**
16
+ * Component name(s) to ignore when logging the touch event. This prevents unhelpful logs such as
17
+ * "Touch event within element: View" where you still can't tell which View it occurred in.
18
+ */
19
+ ignoreNames?: Array<string | RegExp>;
20
+ /**
21
+ * Deprecated, use ignoreNames instead
22
+ * @deprecated
23
+ */
24
+ ignoredDisplayNames?: Array<string | RegExp>;
25
+ /**
26
+ * React Node wrapped by TouchEventBoundary.
27
+ */
28
+ children?: React.ReactNode;
29
+ /**
30
+ * Label Name used to identify the touched element.
31
+ */
32
+ labelName?: string;
33
+ };
34
+ /**
35
+ * Boundary to log breadcrumbs for interaction events.
36
+ */
37
+ declare class TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {
38
+ static displayName: string;
39
+ static defaultProps: Partial<TouchEventBoundaryProps>;
40
+ readonly name: string;
41
+ private _tracingIntegration;
42
+ /**
43
+ * Registers the TouchEventBoundary as a Sentry Integration.
44
+ */
45
+ componentDidMount(): void;
46
+ /**
47
+ *
48
+ */
49
+ render(): React.ReactNode;
50
+ /**
51
+ * Logs the touch event given the component tree names and a label.
52
+ */
53
+ private _logTouchEvent;
54
+ /**
55
+ * Checks if the name is supposed to be ignored.
56
+ */
57
+ private _isNameIgnored;
58
+ /**
59
+ * Traverses through the component tree when a touch happens and logs it.
60
+ * @param e
61
+ */
62
+ private _onTouchStart;
63
+ }
64
+ /**
65
+ * Convenience Higher-Order-Component for TouchEventBoundary
66
+ * @param WrappedComponent any React Component
67
+ * @param boundaryProps TouchEventBoundaryProps
68
+ */
69
+ declare const withTouchEventBoundary: (InnerComponent: React.ComponentType<any>, boundaryProps?: TouchEventBoundaryProps | undefined) => React.FunctionComponent;
70
+ export { TouchEventBoundary, withTouchEventBoundary };
71
+ //# sourceMappingURL=touchevents.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { Hub } from '@sentry/types';
2
+ export declare const DEFAULT_BREADCRUMB_CATEGORY = "gesture";
3
+ export declare const DEFAULT_BREADCRUMB_TYPE = "user";
4
+ export declare const GESTURE_POSTFIX_LENGTH: number;
5
+ export declare const ACTION_GESTURE_FALLBACK = "gesture";
6
+ interface GestureTracingOptions {
7
+ getCurrentHub: () => Hub;
8
+ }
9
+ /**
10
+ * Patches React Native Gesture Handler v2 Gesture to start a transaction on gesture begin with the appropriate label.
11
+ * Example: ShoppingCartScreen.dismissGesture
12
+ */
13
+ export declare function sentryTraceGesture<GestureT>(
14
+ /**
15
+ * Label of the gesture to be used in transaction name.
16
+ * Example: dismissGesture
17
+ */
18
+ label: string, gesture: GestureT, options?: Partial<GestureTracingOptions>): GestureT;
19
+ export {};
20
+ //# sourceMappingURL=gesturetracing.d.ts.map
@@ -0,0 +1,10 @@
1
+ export { ReactNativeTracing } from './reactnativetracing';
2
+ export { RoutingInstrumentation, RoutingInstrumentationInstance } from './routingInstrumentation';
3
+ export { ReactNavigationInstrumentation, ReactNavigationV5Instrumentation, } from './reactnavigation';
4
+ export { ReactNavigationV4Instrumentation } from './reactnavigationv4';
5
+ export { ReactNativeNavigationInstrumentation } from './reactnativenavigation';
6
+ export { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigationTransactionContext } from './types';
7
+ export { ReactNativeProfiler } from './reactnativeprofiler';
8
+ export { sentryTraceGesture } from './gesturetracing';
9
+ export * from './ops';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,64 @@
1
+ import type { Transaction } from '@sentry/core';
2
+ import type { EventProcessor, Measurements, MeasurementUnit } from '@sentry/types';
3
+ export interface FramesMeasurements extends Measurements {
4
+ frames_total: {
5
+ value: number;
6
+ unit: MeasurementUnit;
7
+ };
8
+ frames_slow: {
9
+ value: number;
10
+ unit: MeasurementUnit;
11
+ };
12
+ frames_frozen: {
13
+ value: number;
14
+ unit: MeasurementUnit;
15
+ };
16
+ }
17
+ /**
18
+ * Instrumentation to add native slow/frozen frames measurements onto transactions.
19
+ */
20
+ export declare class NativeFramesInstrumentation {
21
+ /** The native frames at the transaction finish time, keyed by traceId. */
22
+ private _finishFrames;
23
+ /** The listeners for each native frames response, keyed by traceId */
24
+ private _framesListeners;
25
+ /** The native frames at the finish time of the most recent span. */
26
+ private _lastSpanFinishFrames?;
27
+ constructor(addGlobalEventProcessor: (e: EventProcessor) => void, doesExist: () => boolean);
28
+ /**
29
+ * To be called when a transaction is started.
30
+ * Logs the native frames at this start point and instruments child span finishes.
31
+ */
32
+ onTransactionStart(transaction: Transaction): void;
33
+ /**
34
+ * To be called when a transaction is finished
35
+ */
36
+ onTransactionFinish(transaction: Transaction): void;
37
+ /**
38
+ * Called on a span finish to fetch native frames to support transactions with trimEnd.
39
+ * Only to be called when a span does not have an end timestamp.
40
+ */
41
+ private _onSpanFinish;
42
+ /**
43
+ * Returns the computed frames measurements and awaits for them if they are not ready yet.
44
+ */
45
+ private _getFramesMeasurements;
46
+ /**
47
+ * Returns the computed frames measurements given ready data
48
+ */
49
+ private _prepareMeasurements;
50
+ /**
51
+ * Fetch finish frames for a transaction at the current time. Calls any awaiting listeners.
52
+ */
53
+ private _fetchFramesForTransaction;
54
+ /**
55
+ * On a finish frames failure, we cancel the await.
56
+ */
57
+ private _cancelFinishFrames;
58
+ /**
59
+ * Adds frames measurements to an event. Called from a valid event processor.
60
+ * Awaits for finish frames if needed.
61
+ */
62
+ private _processEvent;
63
+ }
64
+ //# sourceMappingURL=nativeframes.d.ts.map
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT = "default";
2
+ export declare const NAVIGATION = "navigation";
3
+ export declare const UI_LOAD = "ui.load";
4
+ export declare const UI_ACTION = "ui.action";
5
+ export declare const UI_ACTION_TOUCH = "ui.action.touch";
6
+ export declare const APP_START_COLD = "app.start.cold";
7
+ export declare const APP_START_WARM = "app.start.warm";
8
+ //# sourceMappingURL=ops.d.ts.map
@@ -0,0 +1,85 @@
1
+ import type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';
2
+ import type { OnConfirmRoute, TransactionCreator } from './routingInstrumentation';
3
+ import { InternalRoutingInstrumentation } from './routingInstrumentation';
4
+ import type { BeforeNavigate } from './types';
5
+ interface ReactNativeNavigationOptions {
6
+ /**
7
+ * How long the instrumentation will wait for the route to mount after a change has been initiated,
8
+ * before the transaction is discarded.
9
+ * Time is in ms.
10
+ *
11
+ * Default: 1000
12
+ */
13
+ routeChangeTimeoutMs: number;
14
+ /**
15
+ * Instrumentation will create a transaction on tab change.
16
+ * By default only navigation commands create transactions.
17
+ *
18
+ * Default: true
19
+ */
20
+ enableTabsInstrumentation: boolean;
21
+ }
22
+ interface ComponentEvent {
23
+ componentId: string;
24
+ }
25
+ declare type ComponentType = 'Component' | 'TopBarTitle' | 'TopBarBackground' | 'TopBarButton';
26
+ export interface ComponentWillAppearEvent extends ComponentEvent {
27
+ componentName: string;
28
+ passProps?: Record<string | number | symbol, unknown>;
29
+ componentType: ComponentType;
30
+ }
31
+ export interface EventSubscription {
32
+ remove(): void;
33
+ }
34
+ export interface BottomTabPressedEvent {
35
+ tabIndex: number;
36
+ }
37
+ export interface EventsRegistry {
38
+ registerComponentWillAppearListener(callback: (event: ComponentWillAppearEvent) => void): EmitterSubscription;
39
+ registerCommandListener(callback: (name: string, params: unknown) => void): EventSubscription;
40
+ registerBottomTabPressedListener(callback: (event: BottomTabPressedEvent) => void): EmitterSubscription;
41
+ }
42
+ export interface NavigationDelegate {
43
+ events: () => EventsRegistry;
44
+ }
45
+ /**
46
+ * Instrumentation for React Native Navigation. See docs or sample app for usage.
47
+ *
48
+ * How this works:
49
+ * - `_onCommand` is called every time a commands happens and sets an IdleTransaction on the scope without any route context.
50
+ * - `_onComponentWillAppear` is then called AFTER the state change happens due to a dispatch and sets the route context onto the active transaction.
51
+ * - If `_onComponentWillAppear` isn't called within `options.routeChangeTimeoutMs` of the dispatch, then the transaction is not sampled and finished.
52
+ */
53
+ export declare class ReactNativeNavigationInstrumentation extends InternalRoutingInstrumentation {
54
+ static instrumentationName: string;
55
+ readonly name: string;
56
+ private _navigation;
57
+ private _options;
58
+ private _prevComponentEvent;
59
+ private _latestTransaction?;
60
+ private _recentComponentIds;
61
+ private _stateChangeTimeout?;
62
+ constructor(
63
+ /** The react native navigation `NavigationDelegate`. This is usually the import named `Navigation`. */
64
+ navigation: unknown, options?: Partial<ReactNativeNavigationOptions>);
65
+ /**
66
+ * Registers the event listeners for React Native Navigation
67
+ */
68
+ registerRoutingInstrumentation(listener: TransactionCreator, beforeNavigate: BeforeNavigate, onConfirmRoute: OnConfirmRoute): void;
69
+ /**
70
+ * To be called when a navigation is initiated. (Command, BottomTabSelected, etc.)
71
+ */
72
+ private _onNavigation;
73
+ /**
74
+ * To be called AFTER the state has been changed to populate the transaction with the current route.
75
+ */
76
+ private _onComponentWillAppear;
77
+ /** Creates final transaction context before confirmation */
78
+ private _prepareFinalContext;
79
+ /** Cancels the latest transaction so it does not get sent to Sentry. */
80
+ private _discardLatestTransaction;
81
+ /** Cancels the latest transaction so it does not get sent to Sentry. */
82
+ private _clearStateChangeTimeout;
83
+ }
84
+ export {};
85
+ //# sourceMappingURL=reactnativenavigation.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { Profiler } from '@sentry/react';
2
+ /**
3
+ * Custom profiler for the React Native app root.
4
+ */
5
+ export declare class ReactNativeProfiler extends Profiler {
6
+ readonly name: string;
7
+ /**
8
+ * Get the app root mount time.
9
+ */
10
+ componentDidMount(): void;
11
+ }
12
+ //# sourceMappingURL=reactnativeprofiler.d.ts.map
@@ -0,0 +1,142 @@
1
+ import type { RequestInstrumentationOptions } from '@sentry/browser';
2
+ import type { Hub, Transaction } from '@sentry/core';
3
+ import type { EventProcessor, Integration, Transaction as TransactionType } from '@sentry/types';
4
+ import type { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';
5
+ import { NativeFramesInstrumentation } from './nativeframes';
6
+ import { StallTrackingInstrumentation } from './stalltracking';
7
+ import type { BeforeNavigate } from './types';
8
+ export interface ReactNativeTracingOptions extends RequestInstrumentationOptions {
9
+ /**
10
+ * @deprecated Replaced by idleTimeoutMs
11
+ */
12
+ idleTimeout: number;
13
+ /**
14
+ * @deprecated Replaced by maxTransactionDurationMs
15
+ */
16
+ maxTransactionDuration: number;
17
+ /**
18
+ * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of
19
+ * the last finished span as the endtime for the transaction.
20
+ * Time is in ms.
21
+ *
22
+ * Default: 1000
23
+ */
24
+ idleTimeoutMs: number;
25
+ /**
26
+ * The maximum duration (transaction duration + idle timeout) of a transaction
27
+ * before it will be marked as "deadline_exceeded".
28
+ * If you never want to mark a transaction set it to 0.
29
+ * Time is in ms.
30
+ *
31
+ * Default: 600000
32
+ */
33
+ finalTimeoutMs: number;
34
+ /**
35
+ * The routing instrumentation to be used with the tracing integration.
36
+ * There is no routing instrumentation if nothing is passed.
37
+ */
38
+ routingInstrumentation?: RoutingInstrumentationInstance;
39
+ /**
40
+ * Does not sample transactions that are from routes that have been seen any more and don't have any spans.
41
+ * This removes a lot of the clutter as most back navigation transactions are now ignored.
42
+ *
43
+ * Default: true
44
+ */
45
+ ignoreEmptyBackNavigationTransactions: boolean;
46
+ /**
47
+ * beforeNavigate is called before a navigation transaction is created and allows users to modify transaction
48
+ * context data, or drop the transaction entirely (by setting `sampled = false` in the context).
49
+ *
50
+ * @param context: The context data which will be passed to `startTransaction` by default
51
+ *
52
+ * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.
53
+ */
54
+ beforeNavigate: BeforeNavigate;
55
+ /**
56
+ * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation
57
+ * an app start transaction will be started.
58
+ *
59
+ * Default: true
60
+ */
61
+ enableAppStartTracking: boolean;
62
+ /**
63
+ * Track slow/frozen frames from the native layer and adds them as measurements to all transactions.
64
+ */
65
+ enableNativeFramesTracking: boolean;
66
+ /**
67
+ * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.
68
+ */
69
+ enableStallTracking: boolean;
70
+ /**
71
+ * Trace User Interaction events like touch and gestures.
72
+ */
73
+ enableUserInteractionTracing: boolean;
74
+ }
75
+ /**
76
+ * Tracing integration for React Native.
77
+ */
78
+ export declare class ReactNativeTracing implements Integration {
79
+ /**
80
+ * @inheritDoc
81
+ */
82
+ static id: string;
83
+ /** We filter out App starts more than 60s */
84
+ private static _maxAppStart;
85
+ /**
86
+ * @inheritDoc
87
+ */
88
+ name: string;
89
+ /** ReactNativeTracing options */
90
+ options: ReactNativeTracingOptions;
91
+ nativeFramesInstrumentation?: NativeFramesInstrumentation;
92
+ stallTrackingInstrumentation?: StallTrackingInstrumentation;
93
+ useAppStartWithProfiler: boolean;
94
+ private _inflightInteractionTransaction?;
95
+ private _getCurrentHub?;
96
+ private _awaitingAppStartData?;
97
+ private _appStartFinishTimestamp?;
98
+ private _currentRoute?;
99
+ constructor(options?: Partial<ReactNativeTracingOptions>);
100
+ /**
101
+ * Registers routing and request instrumentation.
102
+ */
103
+ setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
104
+ /**
105
+ * To be called on a transaction start. Can have async methods
106
+ */
107
+ onTransactionStart(transaction: Transaction): void;
108
+ /**
109
+ * To be called on a transaction finish. Cannot have async methods.
110
+ */
111
+ onTransactionFinish(transaction: Transaction, endTimestamp?: number): void;
112
+ /**
113
+ * Called by the ReactNativeProfiler component on first component mount.
114
+ */
115
+ onAppStartFinish(endTimestamp: number): void;
116
+ /**
117
+ * Starts a new transaction for a user interaction.
118
+ * @param userInteractionId Consists of `op` representation UI Event and `elementId` unique element identifier on current screen.
119
+ */
120
+ startUserInteractionTransaction(userInteractionId: {
121
+ elementId: string | undefined;
122
+ op: string;
123
+ }): TransactionType | undefined;
124
+ /**
125
+ * Instruments the app start measurements on the first route transaction.
126
+ * Starts a route transaction if there isn't routing instrumentation.
127
+ */
128
+ private _instrumentAppStart;
129
+ /**
130
+ * Adds app start measurements and starts a child span on a transaction.
131
+ */
132
+ private _addAppStartData;
133
+ /** To be called when the route changes, but BEFORE the components of the new route mount. */
134
+ private _onRouteWillChange;
135
+ /**
136
+ * Creates a breadcrumb and sets the current route as a tag.
137
+ */
138
+ private _onConfirmRoute;
139
+ /** Create routing idle transaction. */
140
+ private _createRouteTransaction;
141
+ }
142
+ //# sourceMappingURL=reactnativetracing.d.ts.map
@@ -0,0 +1,83 @@
1
+ import type { OnConfirmRoute, TransactionCreator } from './routingInstrumentation';
2
+ import { InternalRoutingInstrumentation } from './routingInstrumentation';
3
+ import type { BeforeNavigate } from './types';
4
+ export interface NavigationRoute {
5
+ name: string;
6
+ key: string;
7
+ params?: Record<string, any>;
8
+ }
9
+ interface ReactNavigationOptions {
10
+ /**
11
+ * How long the instrumentation will wait for the route to mount after a change has been initiated,
12
+ * before the transaction is discarded.
13
+ * Time is in ms.
14
+ *
15
+ * Default: 1000
16
+ */
17
+ routeChangeTimeoutMs: number;
18
+ }
19
+ /**
20
+ * Instrumentation for React-Navigation V5 and above. See docs or sample app for usage.
21
+ *
22
+ * How this works:
23
+ * - `_onDispatch` is called every time a dispatch happens and sets an IdleTransaction on the scope without any route context.
24
+ * - `_onStateChange` is then called AFTER the state change happens due to a dispatch and sets the route context onto the active transaction.
25
+ * - If `_onStateChange` isn't called within `STATE_CHANGE_TIMEOUT_DURATION` of the dispatch, then the transaction is not sampled and finished.
26
+ */
27
+ export declare class ReactNavigationInstrumentation extends InternalRoutingInstrumentation {
28
+ static instrumentationName: string;
29
+ readonly name: string;
30
+ private _navigationContainer;
31
+ private readonly _maxRecentRouteLen;
32
+ private _latestRoute?;
33
+ private _latestTransaction?;
34
+ private _initialStateHandled;
35
+ private _stateChangeTimeout?;
36
+ private _recentRouteKeys;
37
+ private _options;
38
+ constructor(options?: Partial<ReactNavigationOptions>);
39
+ /**
40
+ * Extends by calling _handleInitialState at the end.
41
+ */
42
+ registerRoutingInstrumentation(listener: TransactionCreator, beforeNavigate: BeforeNavigate, onConfirmRoute: OnConfirmRoute): void;
43
+ /**
44
+ * Pass the ref to the navigation container to register it to the instrumentation
45
+ * @param navigationContainerRef Ref to a `NavigationContainer`
46
+ */
47
+ registerNavigationContainer(navigationContainerRef: any): void;
48
+ /**
49
+ * To be called on every React-Navigation action dispatch.
50
+ * It does not name the transaction or populate it with route information. Instead, it waits for the state to fully change
51
+ * and gets the route information from there, @see _onStateChange
52
+ */
53
+ private _onDispatch;
54
+ /**
55
+ * To be called AFTER the state has been changed to populate the transaction with the current route.
56
+ */
57
+ private _onStateChange;
58
+ /** Creates final transaction context before confirmation */
59
+ private _prepareFinalContext;
60
+ /** Pushes a recent route key, and removes earlier routes when there is greater than the max length */
61
+ private _pushRecentRouteKey;
62
+ /** Cancels the latest transaction so it does not get sent to Sentry. */
63
+ private _discardLatestTransaction;
64
+ /**
65
+ *
66
+ */
67
+ private _clearStateChangeTimeout;
68
+ }
69
+ /**
70
+ * Backwards compatibility alias for ReactNavigationInstrumentation
71
+ * @deprecated Use ReactNavigationInstrumentation
72
+ */
73
+ export declare const ReactNavigationV5Instrumentation: typeof ReactNavigationInstrumentation;
74
+ export declare const BLANK_TRANSACTION_CONTEXT: {
75
+ name: string;
76
+ op: string;
77
+ tags: {
78
+ 'routing.instrumentation': string;
79
+ };
80
+ data: {};
81
+ };
82
+ export {};
83
+ //# sourceMappingURL=reactnavigation.d.ts.map