@sentry/react-native 5.23.0-alpha.0 → 5.23.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.
- package/CHANGELOG.md +62 -18
- package/LICENSE.md +1 -1
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +1 -54
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +0 -10
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +0 -10
- package/dist/js/NativeRNSentry.d.ts +0 -2
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/client.d.ts +0 -8
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +4 -20
- package/dist/js/client.js.map +1 -1
- package/dist/js/index.d.ts +5 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +5 -3
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts +8 -60
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +137 -209
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts +18 -0
- package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -0
- package/dist/js/integrations/debugsymbolicatorutils.js +70 -0
- package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -0
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +24 -49
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts +8 -15
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +74 -74
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/eventorigin.d.ts +8 -15
- package/dist/js/integrations/eventorigin.d.ts.map +1 -1
- package/dist/js/integrations/eventorigin.js +17 -17
- package/dist/js/integrations/eventorigin.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts +8 -15
- package/dist/js/integrations/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js +28 -32
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/integrations/exports.d.ts +16 -0
- package/dist/js/integrations/exports.d.ts.map +1 -0
- package/dist/js/integrations/exports.js +16 -0
- package/dist/js/integrations/exports.js.map +1 -0
- package/dist/js/integrations/index.d.ts +4 -1
- package/dist/js/integrations/index.d.ts.map +1 -1
- package/dist/js/integrations/index.js +5 -1
- package/dist/js/integrations/index.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts +8 -15
- package/dist/js/integrations/modulesloader.d.ts.map +1 -1
- package/dist/js/integrations/modulesloader.js +34 -31
- package/dist/js/integrations/modulesloader.js.map +1 -1
- package/dist/js/integrations/nativelinkederrors.d.ts +8 -51
- package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
- package/dist/js/integrations/nativelinkederrors.js +112 -124
- package/dist/js/integrations/nativelinkederrors.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts +8 -54
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +109 -199
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.d.ts +27 -0
- package/dist/js/integrations/reactnativeerrorhandlersutils.d.ts.map +1 -0
- package/dist/js/integrations/reactnativeerrorhandlersutils.js +77 -0
- package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -0
- package/dist/js/integrations/reactnativeinfo.d.ts +8 -15
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js +51 -51
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/integrations/release.d.ts +8 -15
- package/dist/js/integrations/release.d.ts.map +1 -1
- package/dist/js/integrations/release.js +55 -57
- package/dist/js/integrations/release.js.map +1 -1
- package/dist/js/integrations/rewriteframes.js +2 -2
- package/dist/js/integrations/rewriteframes.js.map +1 -1
- package/dist/js/integrations/screenshot.d.ts +8 -23
- package/dist/js/integrations/screenshot.d.ts.map +1 -1
- package/dist/js/integrations/screenshot.js +31 -47
- package/dist/js/integrations/screenshot.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts +8 -16
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +54 -41
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts +10 -2
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js +14 -9
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts +8 -18
- package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +46 -43
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/options.d.ts +2 -24
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/profiling/integration.d.ts +8 -32
- package/dist/js/profiling/integration.d.ts.map +1 -1
- package/dist/js/profiling/integration.js +120 -119
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/tracing/nativeframes.d.ts +0 -4
- package/dist/js/tracing/nativeframes.d.ts.map +1 -1
- package/dist/js/tracing/nativeframes.js +14 -14
- package/dist/js/tracing/nativeframes.js.map +1 -1
- package/dist/js/utils/environment.d.ts +0 -4
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +0 -8
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +1 -7
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +0 -24
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +14 -49
- package/ios/RNSentryDependencyContainer.h +4 -1
- package/ios/RNSentryDependencyContainer.m +4 -0
- package/ios/RNSentryFramesTrackerListener.h +6 -0
- package/ios/RNSentryFramesTrackerListener.m +4 -0
- package/ios/RNSentryOnDrawReporter.h +23 -0
- package/ios/RNSentryOnDrawReporter.m +5 -16
- package/ios/RNSentryRNSScreen.h +6 -0
- package/ios/RNSentryRNSScreen.m +6 -1
- package/package.json +12 -20
- package/src/js/NativeRNSentry.ts +0 -2
- package/ts3.8/dist/js/NativeRNSentry.d.ts +0 -2
- package/ts3.8/dist/js/client.d.ts +0 -8
- package/ts3.8/dist/js/index.d.ts +5 -3
- package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +8 -60
- package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +18 -0
- package/ts3.8/dist/js/integrations/devicecontext.d.ts +8 -15
- package/ts3.8/dist/js/integrations/eventorigin.d.ts +8 -15
- package/ts3.8/dist/js/integrations/expocontext.d.ts +8 -15
- package/ts3.8/dist/js/integrations/exports.d.ts +16 -0
- package/ts3.8/dist/js/integrations/index.d.ts +4 -1
- package/ts3.8/dist/js/integrations/modulesloader.d.ts +8 -15
- package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +8 -51
- package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +8 -54
- package/ts3.8/dist/js/integrations/reactnativeerrorhandlersutils.d.ts +27 -0
- package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +8 -15
- package/ts3.8/dist/js/integrations/release.d.ts +8 -15
- package/ts3.8/dist/js/integrations/screenshot.d.ts +8 -23
- package/ts3.8/dist/js/integrations/sdkinfo.d.ts +8 -16
- package/ts3.8/dist/js/integrations/spotlight.d.ts +10 -2
- package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +8 -18
- package/ts3.8/dist/js/options.d.ts +2 -24
- package/ts3.8/dist/js/profiling/integration.d.ts +8 -32
- package/ts3.8/dist/js/tracing/nativeframes.d.ts +0 -4
- package/ts3.8/dist/js/utils/environment.d.ts +0 -4
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +1 -7
- package/dist/js/integrations/mobilereplay.d.ts +0 -36
- package/dist/js/integrations/mobilereplay.d.ts.map +0 -1
- package/dist/js/integrations/mobilereplay.js +0 -97
- package/dist/js/integrations/mobilereplay.js.map +0 -1
- package/dist/js/utils/clientutils.d.ts +0 -8
- package/dist/js/utils/clientutils.d.ts.map +0 -1
- package/dist/js/utils/clientutils.js +0 -7
- package/dist/js/utils/clientutils.js.map +0 -1
- package/ts3.8/dist/js/integrations/mobilereplay.d.ts +0 -36
- package/ts3.8/dist/js/utils/clientutils.d.ts +0 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { EventProcessor, Integration, ThreadCpuProfile } from '@sentry/types';
|
|
1
|
+
import type { Integration, IntegrationClass, IntegrationFn, ThreadCpuProfile } from '@sentry/types';
|
|
3
2
|
import type { NativeAndroidProfileEvent, NativeProfileEvent } from './nativeTypes';
|
|
4
3
|
import type { AndroidCombinedProfileEvent, CombinedProfileEvent, HermesProfileEvent } from './types';
|
|
5
4
|
/**
|
|
@@ -7,36 +6,13 @@ import type { AndroidCombinedProfileEvent, CombinedProfileEvent, HermesProfileEv
|
|
|
7
6
|
*
|
|
8
7
|
* @experimental
|
|
9
8
|
*/
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
private _getCurrentHub?;
|
|
20
|
-
private _currentProfile;
|
|
21
|
-
private _currentProfileTimeout;
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
setupOnce(_: (e: EventProcessor) => void, getCurrentHub: () => Hub): void;
|
|
26
|
-
private _startCurrentProfileForActiveTransaction;
|
|
27
|
-
private _startCurrentProfile;
|
|
28
|
-
private _shouldStartProfiling;
|
|
29
|
-
/**
|
|
30
|
-
* Starts a new profile and links it to the transaction.
|
|
31
|
-
*/
|
|
32
|
-
private _startNewProfile;
|
|
33
|
-
/**
|
|
34
|
-
* Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.
|
|
35
|
-
*/
|
|
36
|
-
private _finishCurrentProfile;
|
|
37
|
-
private _createProfileEventFor;
|
|
38
|
-
private _clearCurrentProfileTimeout;
|
|
39
|
-
}
|
|
9
|
+
export declare const hermesProfilingIntegration: IntegrationFn;
|
|
10
|
+
/**
|
|
11
|
+
* Profiling integration creates a profile for each transaction and adds it to the event envelope.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Use `hermesProfilingIntegration()` instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare const HermesProfiling: IntegrationClass<Integration>;
|
|
40
16
|
/**
|
|
41
17
|
* Starts Profilers and returns the timestamp when profiling started in nanoseconds.
|
|
42
18
|
*/
|
|
@@ -18,10 +18,6 @@ export interface FramesMeasurements extends Measurements {
|
|
|
18
18
|
* Instrumentation to add native slow/frozen frames measurements onto transactions.
|
|
19
19
|
*/
|
|
20
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
21
|
/** The native frames at the finish time of the most recent span. */
|
|
26
22
|
private _lastSpanFinishFrames?;
|
|
27
23
|
constructor(addGlobalEventProcessor: (e: EventProcessor) => void, doesExist: () => boolean);
|
|
@@ -16,10 +16,6 @@ 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;
|
|
23
19
|
/** Returns Hermes Version if hermes is present in the runtime */
|
|
24
20
|
export declare function getHermesVersion(): string | undefined;
|
|
25
21
|
/** Returns default environment based on __DEV__ */
|
|
@@ -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.23.0
|
|
3
|
+
export declare const SDK_VERSION = "5.23.0";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Breadcrumb, Envelope, EnvelopeItem, Event, Package, SeverityLevel, User } from '@sentry/types';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
|
-
import type { MobileReplayOptions } from './integrations/mobilereplay';
|
|
4
3
|
import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, NativeStackFrames, Spec } from './NativeRNSentry';
|
|
5
4
|
import type { ReactNativeClientOptions } from './options';
|
|
6
5
|
import type * as Hermes from './profiling/hermes';
|
|
@@ -14,9 +13,6 @@ export interface Screenshot {
|
|
|
14
13
|
contentType: string;
|
|
15
14
|
filename: string;
|
|
16
15
|
}
|
|
17
|
-
export type NativeSdkOptions = Partial<ReactNativeClientOptions> & {
|
|
18
|
-
mobileReplayOptions: MobileReplayOptions | undefined;
|
|
19
|
-
};
|
|
20
16
|
interface SentryNativeWrapper {
|
|
21
17
|
enableNative: boolean;
|
|
22
18
|
nativeIsReady: boolean;
|
|
@@ -33,7 +29,7 @@ interface SentryNativeWrapper {
|
|
|
33
29
|
};
|
|
34
30
|
_isModuleLoaded(module: Spec | undefined): module is Spec;
|
|
35
31
|
isNativeAvailable(): boolean;
|
|
36
|
-
initNativeSdk(options:
|
|
32
|
+
initNativeSdk(options: Partial<ReactNativeClientOptions>): PromiseLike<boolean>;
|
|
37
33
|
closeNativeSdk(): PromiseLike<void>;
|
|
38
34
|
sendEnvelope(envelope: Envelope): Promise<void>;
|
|
39
35
|
captureScreenshot(): Promise<Screenshot[] | null>;
|
|
@@ -67,8 +63,6 @@ interface SentryNativeWrapper {
|
|
|
67
63
|
*/
|
|
68
64
|
fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;
|
|
69
65
|
initNativeReactNavigationNewFrameTracking(): Promise<void>;
|
|
70
|
-
startReplay(isHardCrash: boolean): Promise<string | null>;
|
|
71
|
-
getCurrentReplayId(): string | null;
|
|
72
66
|
}
|
|
73
67
|
/**
|
|
74
68
|
* Our internal interface for calling native functions
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAQhG,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD,KAAK,uBAAuB,GAAG,mBAAmB,GAAG;IACnD,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,mBAAmB,KAAoB,uBAqE3F,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { logger } from '@sentry/utils';
|
|
3
|
-
import { isHardCrash } from '../misc';
|
|
4
|
-
import { hasHooks } from '../utils/clientutils';
|
|
5
|
-
import { isExpoGo, notMobileOs } from '../utils/environment';
|
|
6
|
-
import { NATIVE } from '../wrapper';
|
|
7
|
-
export const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';
|
|
8
|
-
const defaultOptions = {
|
|
9
|
-
maskAllText: true,
|
|
10
|
-
maskAllImages: true,
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* The Mobile Replay Integration, let's you adjust the default mobile replay options.
|
|
14
|
-
* To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
|
|
15
|
-
*
|
|
16
|
-
* ```javascript
|
|
17
|
-
* Sentry.init({
|
|
18
|
-
* _experiments: {
|
|
19
|
-
* replaysOnErrorSampleRate: 1.0,
|
|
20
|
-
* replaysSessionSampleRate: 1.0,
|
|
21
|
-
* },
|
|
22
|
-
* integrations: [mobileReplayIntegration({
|
|
23
|
-
* // Adjust the default options
|
|
24
|
-
* })],
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @experimental
|
|
29
|
-
*/
|
|
30
|
-
export const mobileReplayIntegration = (initOptions = defaultOptions) => {
|
|
31
|
-
if (isExpoGo()) {
|
|
32
|
-
logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \`expo prebuild\` to enable it.`);
|
|
33
|
-
}
|
|
34
|
-
if (notMobileOs()) {
|
|
35
|
-
logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);
|
|
36
|
-
}
|
|
37
|
-
if (isExpoGo() || notMobileOs()) {
|
|
38
|
-
return mobileReplayIntegrationNoop();
|
|
39
|
-
}
|
|
40
|
-
const options = Object.assign(Object.assign({}, defaultOptions), initOptions);
|
|
41
|
-
function processEvent(event) {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const hasException = event.exception && event.exception.values && event.exception.values.length > 0;
|
|
44
|
-
if (!hasException) {
|
|
45
|
-
// Event is not an error, will not capture replay
|
|
46
|
-
return event;
|
|
47
|
-
}
|
|
48
|
-
const recordingReplayId = NATIVE.getCurrentReplayId();
|
|
49
|
-
if (recordingReplayId) {
|
|
50
|
-
logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`);
|
|
51
|
-
return event;
|
|
52
|
-
}
|
|
53
|
-
const replayId = yield NATIVE.startReplay(isHardCrash(event));
|
|
54
|
-
if (!replayId) {
|
|
55
|
-
logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);
|
|
56
|
-
return event;
|
|
57
|
-
}
|
|
58
|
-
return event;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function setup(client) {
|
|
62
|
-
if (!hasHooks(client)) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
client.on('createDsc', (dsc) => {
|
|
66
|
-
if (dsc.replay_id) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
// TODO: For better performance, we should emit replayId changes on native, and hold the replayId value in JS
|
|
70
|
-
const currentReplayId = NATIVE.getCurrentReplayId();
|
|
71
|
-
if (currentReplayId) {
|
|
72
|
-
dsc.replay_id = currentReplayId;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
// TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably
|
|
77
|
-
// https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45
|
|
78
|
-
return {
|
|
79
|
-
name: MOBILE_REPLAY_INTEGRATION_NAME,
|
|
80
|
-
setupOnce() {
|
|
81
|
-
/* Noop */
|
|
82
|
-
},
|
|
83
|
-
setup,
|
|
84
|
-
processEvent,
|
|
85
|
-
options: options,
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
const mobileReplayIntegrationNoop = () => {
|
|
89
|
-
return {
|
|
90
|
-
name: MOBILE_REPLAY_INTEGRATION_NAME,
|
|
91
|
-
setupOnce() {
|
|
92
|
-
/* Noop */
|
|
93
|
-
},
|
|
94
|
-
options: defaultOptions,
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=mobilereplay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1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ult } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n */\n maskAllText?: boolean;\n\n /**\n * Mask all text in recordings\n */\n maskAllImages?: boolean;\n}\n\nconst defaultOptions: Required<MobileReplayOptions> = {\n maskAllText: true,\n maskAllImages: true,\n};\n\ntype MobileReplayIntegration = IntegrationFnResult & {\n options: Required<MobileReplayOptions>;\n};\n\n/**\n * The Mobile Replay Integration, let's you adjust the default mobile replay options.\n * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.\n *\n * ```javascript\n * Sentry.init({\n * _experiments: {\n * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\n * },\n * integrations: [mobileReplayIntegration({\n * // Adjust the default options\n * })],\n * });\n * ```\n *\n * @experimental\n */\nexport const mobileReplayIntegration = (initOptions: MobileReplayOptions = defaultOptions): MobileReplayIntegration => {\n if (isExpoGo()) {\n logger.warn(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \\`expo prebuild\\` to enable it.`,\n );\n }\n if (notMobileOs()) {\n logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);\n }\n\n if (isExpoGo() || notMobileOs()) {\n return mobileReplayIntegrationNoop();\n }\n\n const options = { ...defaultOptions, ...initOptions };\n\n async function processEvent(event: Event): Promise<Event> {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n // Event is not an error, will not capture replay\n return event;\n }\n\n const recordingReplayId = NATIVE.getCurrentReplayId();\n if (recordingReplayId) {\n logger.debug(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`,\n );\n return event;\n }\n\n const replayId = await NATIVE.startReplay(isHardCrash(event));\n if (!replayId) {\n logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);\n return event;\n }\n\n return event;\n }\n\n function setup(client: Client): void {\n if (!hasHooks(client)) {\n return;\n }\n\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n if (dsc.replay_id) {\n return;\n }\n\n // TODO: For better performance, we should emit replayId changes on native, and hold the replayId value in JS\n const currentReplayId = NATIVE.getCurrentReplayId();\n if (currentReplayId) {\n dsc.replay_id = currentReplayId;\n }\n });\n }\n\n // TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably\n // https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n setup,\n processEvent,\n options: options,\n };\n};\n\nconst mobileReplayIntegrationNoop = (): MobileReplayIntegration => {\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n options: defaultOptions,\n };\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientutils.d.ts","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;CAAE,CAE1F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientutils.js","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import type { Client } from '@sentry/types';\n\n/**\n *\n */\nexport function hasHooks(client: Client): client is Client & { on: Required<Client>['on'] } {\n return client.on !== undefined;\n}\n"]}
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|