@sentry/react-native 5.7.1 → 5.8.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 (79) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/RNSentry.podspec +9 -4
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/MapConverter.java +134 -0
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +103 -15
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +14 -2
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +13 -2
  8. package/dist/js/NativeRNSentry.d.ts +13 -4
  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.map +1 -1
  12. package/dist/js/client.js +1 -0
  13. package/dist/js/client.js.map +1 -1
  14. package/dist/js/integrations/devicecontext.js +5 -5
  15. package/dist/js/integrations/devicecontext.js.map +1 -1
  16. package/dist/js/integrations/index.d.ts +1 -0
  17. package/dist/js/integrations/index.d.ts.map +1 -1
  18. package/dist/js/integrations/index.js +1 -0
  19. package/dist/js/integrations/index.js.map +1 -1
  20. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +5 -0
  21. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  22. package/dist/js/integrations/reactnativeerrorhandlers.js +31 -6
  23. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  24. package/dist/js/integrations/rewriteframes.d.ts +2 -0
  25. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  26. package/dist/js/integrations/rewriteframes.js +2 -2
  27. package/dist/js/integrations/rewriteframes.js.map +1 -1
  28. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  29. package/dist/js/integrations/sdkinfo.js +1 -2
  30. package/dist/js/integrations/sdkinfo.js.map +1 -1
  31. package/dist/js/profiling/cache.d.ts +9 -0
  32. package/dist/js/profiling/cache.d.ts.map +1 -0
  33. package/dist/js/profiling/cache.js +3 -0
  34. package/dist/js/profiling/cache.js.map +1 -0
  35. package/dist/js/profiling/convertHermesProfile.d.ts +27 -0
  36. package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -0
  37. package/dist/js/profiling/convertHermesProfile.js +141 -0
  38. package/dist/js/profiling/convertHermesProfile.js.map +1 -0
  39. package/dist/js/profiling/hermes.d.ts +52 -0
  40. package/dist/js/profiling/hermes.d.ts.map +1 -0
  41. package/dist/js/profiling/hermes.js +35 -0
  42. package/dist/js/profiling/hermes.js.map +1 -0
  43. package/dist/js/profiling/integration.d.ts +36 -0
  44. package/dist/js/profiling/integration.d.ts.map +1 -0
  45. package/dist/js/profiling/integration.js +151 -0
  46. package/dist/js/profiling/integration.js.map +1 -0
  47. package/dist/js/profiling/types.d.ts +5 -0
  48. package/dist/js/profiling/types.d.ts.map +1 -0
  49. package/dist/js/profiling/types.js +2 -0
  50. package/dist/js/profiling/types.js.map +1 -0
  51. package/dist/js/profiling/utils.d.ts +26 -0
  52. package/dist/js/profiling/utils.d.ts.map +1 -0
  53. package/dist/js/profiling/utils.js +135 -0
  54. package/dist/js/profiling/utils.js.map +1 -0
  55. package/dist/js/sdk.d.ts.map +1 -1
  56. package/dist/js/sdk.js +6 -1
  57. package/dist/js/sdk.js.map +1 -1
  58. package/dist/js/version.d.ts +1 -1
  59. package/dist/js/version.js +1 -1
  60. package/dist/js/version.js.map +1 -1
  61. package/dist/js/wrapper.d.ts +4 -2
  62. package/dist/js/wrapper.d.ts.map +1 -1
  63. package/dist/js/wrapper.js +36 -27
  64. package/dist/js/wrapper.js.map +1 -1
  65. package/ios/RNSentry.mm +75 -13
  66. package/package.json +14 -13
  67. package/src/js/NativeRNSentry.ts +7 -4
  68. package/ts3.8/dist/js/NativeRNSentry.d.ts +13 -4
  69. package/ts3.8/dist/js/integrations/index.d.ts +1 -0
  70. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +5 -0
  71. package/ts3.8/dist/js/integrations/rewriteframes.d.ts +2 -0
  72. package/ts3.8/dist/js/profiling/cache.d.ts +9 -0
  73. package/ts3.8/dist/js/profiling/convertHermesProfile.d.ts +27 -0
  74. package/ts3.8/dist/js/profiling/hermes.d.ts +52 -0
  75. package/ts3.8/dist/js/profiling/integration.d.ts +36 -0
  76. package/ts3.8/dist/js/profiling/types.d.ts +5 -0
  77. package/ts3.8/dist/js/profiling/utils.d.ts +26 -0
  78. package/ts3.8/dist/js/version.d.ts +1 -1
  79. package/ts3.8/dist/js/wrapper.d.ts +4 -2
@@ -0,0 +1,36 @@
1
+ import type { EventProcessor, Hub, Integration } from '@sentry/types';
2
+ export declare const MAX_PROFILE_DURATION_MS: number;
3
+ /**
4
+ * Profiling integration creates a profile for each transaction and adds it to the event envelope.
5
+ *
6
+ * @experimental
7
+ */
8
+ export declare class HermesProfiling implements Integration {
9
+ /**
10
+ * @inheritDoc
11
+ */
12
+ static id: string;
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ name: string;
17
+ private _getCurrentHub?;
18
+ private _currentProfile;
19
+ private _currentProfileTimeout;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ setupOnce(_: (e: EventProcessor) => void, getCurrentHub: () => Hub): void;
24
+ private _shouldStartProfiling;
25
+ /**
26
+ * Starts a new profile and links it to the transaction.
27
+ */
28
+ private _startNewProfile;
29
+ /**
30
+ * Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.
31
+ */
32
+ private _finishCurrentProfile;
33
+ private _createProfileEventFor;
34
+ private _clearCurrentProfileTimeout;
35
+ }
36
+ //# sourceMappingURL=integration.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { ThreadCpuProfile } from '@sentry/types';
2
+ export interface RawThreadCpuProfile extends ThreadCpuProfile {
3
+ profile_id?: string;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { Envelope, Event, Profile } from '@sentry/types';
2
+ import type { RawThreadCpuProfile } from './types';
3
+ /**
4
+ *
5
+ */
6
+ export declare function isValidProfile(profile: RawThreadCpuProfile): profile is RawThreadCpuProfile & {
7
+ profile_id: string;
8
+ };
9
+ /**
10
+ * Finds transactions with profile_id context in the envelope
11
+ * @param envelope
12
+ * @returns
13
+ */
14
+ export declare function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[];
15
+ /**
16
+ * Creates a profiling envelope item, if the profile does not pass validation, returns null.
17
+ * @param event
18
+ * @returns {Profile | null}
19
+ */
20
+ export declare function createProfilingEvent(profile: RawThreadCpuProfile, event: Event): Profile | null;
21
+ /**
22
+ * Adds items to envelope if they are not already present - mutates the envelope.
23
+ * @param envelope
24
+ */
25
+ export declare function addProfilesToEnvelope(envelope: Envelope, profiles: Profile[]): Envelope;
26
+ //# sourceMappingURL=utils.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.7.1";
3
+ export declare const SDK_VERSION = "5.8.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -2,6 +2,7 @@ import type { Breadcrumb, Envelope, EnvelopeItem, Event, Package, SeverityLevel,
2
2
  import { Platform } from 'react-native';
3
3
  import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, Spec } from './NativeRNSentry';
4
4
  import type { ReactNativeClientOptions } from './options';
5
+ import type * as Hermes from './profiling/hermes';
5
6
  export interface Screenshot {
6
7
  data: Uint8Array;
7
8
  contentType: string;
@@ -22,14 +23,13 @@ interface SentryNativeWrapper {
22
23
  [key: string]: string;
23
24
  };
24
25
  _isModuleLoaded(module: Spec | undefined): module is Spec;
25
- _getBreadcrumbs(event: Event): Breadcrumb[] | undefined;
26
26
  isNativeAvailable(): boolean;
27
27
  initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;
28
28
  closeNativeSdk(): PromiseLike<void>;
29
29
  sendEnvelope(envelope: Envelope): Promise<void>;
30
30
  captureScreenshot(): Promise<Screenshot[] | null>;
31
31
  fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;
32
- fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse>;
32
+ fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;
33
33
  fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;
34
34
  fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;
35
35
  fetchNativeSdkInfo(): PromiseLike<Package | null>;
@@ -46,6 +46,8 @@ interface SentryNativeWrapper {
46
46
  nativeCrash(): void;
47
47
  fetchModules(): Promise<Record<string, string> | null>;
48
48
  fetchViewHierarchy(): PromiseLike<Uint8Array | null>;
49
+ startProfiling(): boolean;
50
+ stopProfiling(): Hermes.Profile | null;
49
51
  }
50
52
  /**
51
53
  * Our internal interface for calling native functions