@sentry/react-native 5.24.1 → 5.25.0-alpha.2

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 (85) hide show
  1. package/CHANGELOG.md +76 -2
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +56 -2
  5. package/android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java +178 -0
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +10 -0
  8. package/dist/js/NativeRNSentry.d.ts +2 -0
  9. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  10. package/dist/js/NativeRNSentry.js.map +1 -1
  11. package/dist/js/client.d.ts +4 -0
  12. package/dist/js/client.d.ts.map +1 -1
  13. package/dist/js/client.js +12 -2
  14. package/dist/js/client.js.map +1 -1
  15. package/dist/js/integrations/default.d.ts.map +1 -1
  16. package/dist/js/integrations/default.js +9 -1
  17. package/dist/js/integrations/default.js.map +1 -1
  18. package/dist/js/integrations/exports.d.ts +2 -1
  19. package/dist/js/integrations/exports.d.ts.map +1 -1
  20. package/dist/js/integrations/exports.js +2 -1
  21. package/dist/js/integrations/exports.js.map +1 -1
  22. package/dist/js/integrations/index.d.ts +1 -0
  23. package/dist/js/integrations/index.d.ts.map +1 -1
  24. package/dist/js/integrations/index.js +1 -0
  25. package/dist/js/integrations/index.js.map +1 -1
  26. package/dist/js/options.d.ts +24 -2
  27. package/dist/js/options.d.ts.map +1 -1
  28. package/dist/js/options.js.map +1 -1
  29. package/dist/js/replay/mobilereplay.d.ts +36 -0
  30. package/dist/js/replay/mobilereplay.d.ts.map +1 -0
  31. package/dist/js/replay/mobilereplay.js +99 -0
  32. package/dist/js/replay/mobilereplay.js.map +1 -0
  33. package/dist/js/replay/networkUtils.d.ts +8 -0
  34. package/dist/js/replay/networkUtils.d.ts.map +1 -0
  35. package/dist/js/replay/networkUtils.js +52 -0
  36. package/dist/js/replay/networkUtils.js.map +1 -0
  37. package/dist/js/replay/xhrUtils.d.ts +6 -0
  38. package/dist/js/replay/xhrUtils.d.ts.map +1 -0
  39. package/dist/js/replay/xhrUtils.js +31 -0
  40. package/dist/js/replay/xhrUtils.js.map +1 -0
  41. package/dist/js/touchevents.d.ts +4 -0
  42. package/dist/js/touchevents.d.ts.map +1 -1
  43. package/dist/js/touchevents.js +93 -53
  44. package/dist/js/touchevents.js.map +1 -1
  45. package/dist/js/utils/clientutils.d.ts +10 -0
  46. package/dist/js/utils/clientutils.d.ts.map +1 -0
  47. package/dist/js/utils/clientutils.js +9 -0
  48. package/dist/js/utils/clientutils.js.map +1 -0
  49. package/dist/js/utils/environment.d.ts +4 -0
  50. package/dist/js/utils/environment.d.ts.map +1 -1
  51. package/dist/js/utils/environment.js +8 -0
  52. package/dist/js/utils/environment.js.map +1 -1
  53. package/dist/js/utils/worldwide.d.ts +6 -0
  54. package/dist/js/utils/worldwide.d.ts.map +1 -1
  55. package/dist/js/utils/worldwide.js.map +1 -1
  56. package/dist/js/version.d.ts +1 -1
  57. package/dist/js/version.d.ts.map +1 -1
  58. package/dist/js/version.js +1 -1
  59. package/dist/js/version.js.map +1 -1
  60. package/dist/js/wrapper.d.ts +7 -1
  61. package/dist/js/wrapper.d.ts.map +1 -1
  62. package/dist/js/wrapper.js +24 -0
  63. package/dist/js/wrapper.js.map +1 -1
  64. package/ios/RNSentry.mm +33 -1
  65. package/ios/RNSentryReplay.h +8 -0
  66. package/ios/RNSentryReplay.m +60 -0
  67. package/ios/RNSentryReplayBreadcrumbConverter.h +16 -0
  68. package/ios/RNSentryReplayBreadcrumbConverter.m +172 -0
  69. package/package.json +1 -1
  70. package/scripts/expo-upload-sourcemaps.js +10 -10
  71. package/src/js/NativeRNSentry.ts +2 -0
  72. package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
  73. package/ts3.8/dist/js/client.d.ts +4 -0
  74. package/ts3.8/dist/js/integrations/exports.d.ts +2 -1
  75. package/ts3.8/dist/js/integrations/index.d.ts +1 -0
  76. package/ts3.8/dist/js/options.d.ts +24 -2
  77. package/ts3.8/dist/js/replay/mobilereplay.d.ts +36 -0
  78. package/ts3.8/dist/js/replay/networkUtils.d.ts +8 -0
  79. package/ts3.8/dist/js/replay/xhrUtils.d.ts +6 -0
  80. package/ts3.8/dist/js/touchevents.d.ts +4 -0
  81. package/ts3.8/dist/js/utils/clientutils.d.ts +10 -0
  82. package/ts3.8/dist/js/utils/environment.d.ts +4 -0
  83. package/ts3.8/dist/js/utils/worldwide.d.ts +6 -0
  84. package/ts3.8/dist/js/version.d.ts +1 -1
  85. package/ts3.8/dist/js/wrapper.d.ts +7 -1
@@ -0,0 +1,36 @@
1
+ import type { IntegrationFnResult } from '@sentry/types';
2
+ export declare const MOBILE_REPLAY_INTEGRATION_NAME = "MobileReplay";
3
+ export interface MobileReplayOptions {
4
+ /**
5
+ * Mask all text in recordings
6
+ */
7
+ maskAllText?: boolean;
8
+ /**
9
+ * Mask all text in recordings
10
+ */
11
+ maskAllImages?: boolean;
12
+ }
13
+ type MobileReplayIntegration = IntegrationFnResult & {
14
+ options: Required<MobileReplayOptions>;
15
+ };
16
+ /**
17
+ * The Mobile Replay Integration, let's you adjust the default mobile replay options.
18
+ * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
19
+ *
20
+ * ```javascript
21
+ * Sentry.init({
22
+ * _experiments: {
23
+ * replaysOnErrorSampleRate: 1.0,
24
+ * replaysSessionSampleRate: 1.0,
25
+ * },
26
+ * integrations: [mobileReplayIntegration({
27
+ * // Adjust the default options
28
+ * })],
29
+ * });
30
+ * ```
31
+ *
32
+ * @experimental
33
+ */
34
+ export declare const mobileReplayIntegration: (initOptions?: MobileReplayOptions) => MobileReplayIntegration;
35
+ export {};
36
+ //# sourceMappingURL=mobilereplay.d.ts.map
@@ -0,0 +1,8 @@
1
+ /// <reference types="react-native" />
2
+ /// <reference types="react" />
3
+ /** Convert a Content-Length header to number/undefined. */
4
+ export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
5
+ export type RequestBody = null | Blob | FormData | URLSearchParams | string | ArrayBuffer | undefined;
6
+ /** Get the size of a body. */
7
+ export declare function getBodySize(body: RequestBody): number | undefined;
8
+ //# sourceMappingURL=networkUtils.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { Breadcrumb, BreadcrumbHint } from '@sentry/types';
2
+ /**
3
+ * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
4
+ */
5
+ export declare function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void;
6
+ //# sourceMappingURL=xhrUtils.d.ts.map
@@ -60,6 +60,10 @@ declare class TouchEventBoundary extends React.Component<TouchEventBoundaryProps
60
60
  * @param e
61
61
  */
62
62
  private _onTouchStart;
63
+ /**
64
+ * Pushes the name to the componentTreeNames array if it is not ignored.
65
+ */
66
+ private _pushIfNotIgnored;
63
67
  }
64
68
  /**
65
69
  * Convenience Higher-Order-Component for TouchEventBoundary
@@ -0,0 +1,10 @@
1
+ import type { Client } from '@sentry/types';
2
+ /**
3
+ * Checks if the provided Sentry client has hooks implemented.
4
+ * @param client The Sentry client object to check.
5
+ * @returns True if the client has hooks, false otherwise.
6
+ */
7
+ export declare function hasHooks(client: Client): client is Client & {
8
+ on: Required<Client>['on'];
9
+ };
10
+ //# sourceMappingURL=clientutils.d.ts.map
@@ -16,6 +16,10 @@ export declare function getExpoGoVersion(): string | undefined;
16
16
  export declare function getExpoSdkVersion(): string | undefined;
17
17
  /** Checks if the current platform is not web */
18
18
  export declare function notWeb(): boolean;
19
+ /** Checks if the current platform is supported mobile platform (iOS or Android) */
20
+ export declare function isMobileOs(): boolean;
21
+ /** Checks if the current platform is not supported mobile platform (iOS or Android) */
22
+ export declare function notMobileOs(): boolean;
19
23
  /** Returns Hermes Version if hermes is present in the runtime */
20
24
  export declare function getHermesVersion(): string | undefined;
21
25
  /** Returns default environment based on __DEV__ */
@@ -22,7 +22,13 @@ export interface ReactNativeInternalGlobal extends InternalGlobal {
22
22
  };
23
23
  __BUNDLE_START_TIME__?: number;
24
24
  nativePerformanceNow?: () => number;
25
+ TextEncoder?: TextEncoder;
25
26
  }
27
+ type TextEncoder = {
28
+ new (): TextEncoder;
29
+ encode(input?: string): Uint8Array;
30
+ };
26
31
  /** Get's the global object for the current JavaScript runtime */
27
32
  export declare const RN_GLOBAL_OBJ: ReactNativeInternalGlobal;
33
+ export {};
28
34
  //# sourceMappingURL=worldwide.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "5.24.1";
3
+ export declare const SDK_VERSION = "5.25.0-alpha.2";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -4,6 +4,7 @@ import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFrames
4
4
  import type { ReactNativeClientOptions } from './options';
5
5
  import type * as Hermes from './profiling/hermes';
6
6
  import type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';
7
+ import type { MobileReplayOptions } from './replay/mobilereplay';
7
8
  /**
8
9
  * Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.
9
10
  */
@@ -13,6 +14,9 @@ export interface Screenshot {
13
14
  contentType: string;
14
15
  filename: string;
15
16
  }
17
+ export type NativeSdkOptions = Partial<ReactNativeClientOptions> & {
18
+ mobileReplayOptions: MobileReplayOptions | undefined;
19
+ };
16
20
  interface SentryNativeWrapper {
17
21
  enableNative: boolean;
18
22
  nativeIsReady: boolean;
@@ -29,7 +33,7 @@ interface SentryNativeWrapper {
29
33
  };
30
34
  _isModuleLoaded(module: Spec | undefined): module is Spec;
31
35
  isNativeAvailable(): boolean;
32
- initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;
36
+ initNativeSdk(options: NativeSdkOptions): PromiseLike<boolean>;
33
37
  closeNativeSdk(): PromiseLike<void>;
34
38
  sendEnvelope(envelope: Envelope): Promise<void>;
35
39
  captureScreenshot(): Promise<Screenshot[] | null>;
@@ -63,6 +67,8 @@ interface SentryNativeWrapper {
63
67
  */
64
68
  fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;
65
69
  initNativeReactNavigationNewFrameTracking(): Promise<void>;
70
+ captureReplay(isHardCrash: boolean): Promise<string | null>;
71
+ getCurrentReplayId(): string | null;
66
72
  }
67
73
  /**
68
74
  * Our internal interface for calling native functions