@sentry/react-native 5.0.0-alpha.3 → 5.0.0-alpha.5
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 +96 -6
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModule.java +12 -12
- package/dist/js/client.d.ts +16 -3
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +76 -6
- package/dist/js/client.js.map +1 -1
- package/dist/js/definitions.d.ts +2 -4
- package/dist/js/definitions.d.ts.map +1 -1
- package/dist/js/definitions.js.map +1 -1
- package/dist/js/index.d.ts +3 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +2 -2
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +3 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts +4 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +14 -7
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/misc.d.ts +9 -0
- package/dist/js/misc.d.ts.map +1 -0
- package/dist/js/misc.js +17 -0
- package/dist/js/misc.js.map +1 -0
- package/dist/js/options.d.ts +27 -6
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/scope.d.ts +9 -1
- package/dist/js/scope.d.ts.map +1 -1
- package/dist/js/scope.js +12 -0
- package/dist/js/scope.js.map +1 -1
- package/dist/js/sdk.d.ts +25 -0
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +73 -18
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +14 -5
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +10 -6
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.js +2 -2
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/utils.d.ts +1 -2
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js +2 -10
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/TextEncoder.d.ts +3 -0
- package/dist/js/transports/TextEncoder.d.ts.map +1 -0
- package/dist/js/transports/TextEncoder.js +12 -0
- package/dist/js/transports/TextEncoder.js.map +1 -0
- package/dist/js/utils/envelope.d.ts +12 -0
- package/dist/js/utils/envelope.d.ts.map +1 -0
- package/dist/js/utils/envelope.js +21 -0
- package/dist/js/utils/envelope.js.map +1 -0
- package/dist/js/utils/outcome.d.ts +6 -0
- package/dist/js/utils/outcome.d.ts.map +1 -0
- package/dist/js/utils/outcome.js +19 -0
- package/dist/js/utils/outcome.js.map +1 -0
- package/dist/js/utils/safe.d.ts +18 -0
- package/dist/js/utils/safe.d.ts.map +1 -0
- package/dist/js/utils/safe.js +46 -0
- package/dist/js/utils/safe.js.map +1 -0
- package/dist/js/vendor/buffer/index.d.ts +2 -0
- package/dist/js/vendor/buffer/index.d.ts.map +1 -0
- package/dist/js/vendor/buffer/index.js +2 -0
- package/dist/js/vendor/buffer/index.js.map +1 -0
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts +10 -0
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -0
- package/dist/js/vendor/buffer/utf8ToBytes.js +82 -0
- package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -0
- package/dist/js/vendor/index.d.ts +2 -0
- package/dist/js/vendor/index.d.ts.map +1 -0
- package/dist/js/vendor/index.js +2 -0
- package/dist/js/vendor/index.js.map +1 -0
- package/dist/js/version.d.ts +2 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +2 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +3 -2
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +62 -57
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.m +22 -35
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAW,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAW,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAM7F,aAAK,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAEnF,eAAO,MAAM,cAAc,EAAE,cAS5B,CAAC;AAEF,sCAAsC;AACtC,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC,OAAO,CAAC,cAAc,CAAwB;IAE9C;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CA8B7E"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { logger } from '@sentry/utils';
|
|
3
|
-
import { SDK_NAME, SDK_VERSION } from '../version';
|
|
3
|
+
import { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';
|
|
4
4
|
import { NATIVE } from '../wrapper';
|
|
5
|
+
export const defaultSdkInfo = {
|
|
6
|
+
name: SDK_NAME,
|
|
7
|
+
packages: [
|
|
8
|
+
{
|
|
9
|
+
name: SDK_PACKAGE_NAME,
|
|
10
|
+
version: SDK_VERSION,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
version: SDK_VERSION,
|
|
14
|
+
};
|
|
5
15
|
/** Default SdkInfo instrumentation */
|
|
6
16
|
export class SdkInfo {
|
|
7
17
|
constructor() {
|
|
@@ -30,14 +40,11 @@ export class SdkInfo {
|
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
event.platform = event.platform || 'javascript';
|
|
33
|
-
event.sdk = Object.assign(Object.assign({}, ((_a = event.sdk) !== null && _a !== void 0 ? _a : {})), {
|
|
43
|
+
event.sdk = Object.assign(Object.assign(Object.assign({}, ((_a = event.sdk) !== null && _a !== void 0 ? _a : {})), defaultSdkInfo), { packages: [
|
|
34
44
|
...((event.sdk && event.sdk.packages) || []),
|
|
35
45
|
...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
version: SDK_VERSION,
|
|
39
|
-
},
|
|
40
|
-
], version: SDK_VERSION });
|
|
46
|
+
...defaultSdkInfo.packages,
|
|
47
|
+
] });
|
|
41
48
|
return event;
|
|
42
49
|
}));
|
|
43
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAC,WAAW,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,M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AA,CAAC,CAAC;IACL,CAAC;;AA5CD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_PACKAGE_NAME,SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkInfo: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event) => {\n // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (NATIVE.platform === 'ios' && this._nativeSdkInfo === null) {\n try {\n this._nativeSdkInfo = await NATIVE.fetchNativeSdkInfo();\n } catch (e) {\n // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.\n logger.warn(\n '[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:'\n );\n logger.warn(e);\n }\n }\n\n event.platform = event.platform || 'javascript';\n event.sdk = {\n ...(event.sdk ?? {}),\n ...defaultSdkInfo,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n ...defaultSdkInfo.packages,\n ],\n };\n\n return event;\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnvelopeItem } from '@sentry/types';
|
|
2
|
+
declare type EnvelopeItemPayload = EnvelopeItem[1];
|
|
3
|
+
/**
|
|
4
|
+
* Extracts the hard crash information from the event exceptions.
|
|
5
|
+
* No exceptions or undefined handled are not hard crashes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isHardCrash(payload: EnvelopeItemPayload): boolean;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=misc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEb,MAAM,eAAe,CAAC;AAEvB,aAAK,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAUjE"}
|
package/dist/js/misc.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the hard crash information from the event exceptions.
|
|
3
|
+
* No exceptions or undefined handled are not hard crashes.
|
|
4
|
+
*/
|
|
5
|
+
export function isHardCrash(payload) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const values = typeof payload !== 'string' && 'exception' in payload && ((_a = payload.exception) === null || _a === void 0 ? void 0 : _a.values)
|
|
8
|
+
? payload.exception.values
|
|
9
|
+
: [];
|
|
10
|
+
for (const exception of values) {
|
|
11
|
+
if (!(((_b = exception.mechanism) === null || _b === void 0 ? void 0 : _b.handled) !== false)) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=misc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;;IACtD,MAAM,MAAM,GAAgB,OAAO,OAAO,KAAK,QAAQ,IAAI,WAAW,IAAI,OAAO,WAAI,OAAO,CAAC,SAAS,0CAAE,MAAM,CAAA;QAC5G,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM;QAC1B,CAAC,CAAC,EAAE,CAAC;IACP,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,CAAC,CAAC,OAAA,SAAS,CAAC,SAAS,0CAAE,OAAO,MAAK,KAAK,CAAC,EAAE;YAC7C,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import {\n EnvelopeItem,\n Exception,\n} from '@sentry/types';\n\ntype EnvelopeItemPayload = EnvelopeItem[1];\n\n/**\n * Extracts the hard crash information from the event exceptions.\n * No exceptions or undefined handled are not hard crashes.\n */\nexport function isHardCrash(payload: EnvelopeItemPayload): boolean {\n const values: Exception[] = typeof payload !== 'string' && 'exception' in payload && payload.exception?.values\n ? payload.exception.values\n : [];\n for (const exception of values) {\n if (!(exception.mechanism?.handled !== false)) {\n return true;\n }\n }\n return false;\n}\n"]}
|
package/dist/js/options.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export interface BaseReactNativeOptions {
|
|
|
43
43
|
* When enabled, certain personally identifiable information (PII) is added by active integrations.
|
|
44
44
|
*
|
|
45
45
|
* @default false
|
|
46
|
-
|
|
46
|
+
*/
|
|
47
47
|
sendDefaultPii?: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.
|
|
@@ -60,7 +60,7 @@ export interface BaseReactNativeOptions {
|
|
|
60
60
|
* https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/
|
|
61
61
|
*
|
|
62
62
|
* @default true
|
|
63
|
-
|
|
63
|
+
*/
|
|
64
64
|
enableOutOfMemoryTracking?: boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Set data to the inital scope
|
|
@@ -73,15 +73,36 @@ export interface BaseReactNativeOptions {
|
|
|
73
73
|
* Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections
|
|
74
74
|
*
|
|
75
75
|
* When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.
|
|
76
|
+
*
|
|
76
77
|
* @default true
|
|
77
78
|
*/
|
|
78
79
|
patchGlobalPromise?: boolean;
|
|
79
80
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
* The max cache items for capping the number of envelopes.
|
|
82
|
+
*
|
|
83
|
+
* @default 30
|
|
84
|
+
*/
|
|
84
85
|
maxCacheItems?: number;
|
|
86
|
+
/**
|
|
87
|
+
* When enabled, the SDK tracks when the application stops responding for a specific amount of
|
|
88
|
+
* time defined by the `appHangTimeoutInterval` option.
|
|
89
|
+
*
|
|
90
|
+
* iOS only
|
|
91
|
+
*
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
enableAppHangTracking?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The minimum amount of time an app should be unresponsive to be classified as an App Hanging.
|
|
97
|
+
* The actual amount may be a little longer.
|
|
98
|
+
* Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.
|
|
99
|
+
* Value should be in seconds.
|
|
100
|
+
*
|
|
101
|
+
* iOS only
|
|
102
|
+
*
|
|
103
|
+
* @default 2
|
|
104
|
+
*/
|
|
105
|
+
appHangsTimeoutInterval?: number;
|
|
85
106
|
}
|
|
86
107
|
/**
|
|
87
108
|
* Configuration options for the Sentry ReactNative SDK.
|
package/dist/js/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAA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;CACnD"}
|
package/dist/js/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseBrowserOptions } from '@sentry/browser/types/client';\nimport { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport { ProfilerProps } from '@sentry/react/types/profiler';\nimport { ClientOptions, Options } from '@sentry/types';\nimport { CaptureContext } from '@sentry/types/types/scope';\n\nimport { TouchEventBoundaryProps } from './touchevents';\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable scope sync from Java to NDK on Android */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseBrowserOptions } from '@sentry/browser/types/client';\nimport { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport { ProfilerProps } from '@sentry/react/types/profiler';\nimport { ClientOptions, Options } from '@sentry/types';\nimport { CaptureContext } from '@sentry/types/types/scope';\n\nimport { TouchEventBoundaryProps } from './touchevents';\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable scope sync from Java to NDK on Android */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. */\n enableAutoPerformanceTracking?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * @default true\n */\n enableOutOfMemoryTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangsTimeoutInterval?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions extends Options<BrowserTransportOptions>, BaseBrowserOptions, BaseReactNativeOptions {\n}\n\nexport interface ReactNativeClientOptions extends ClientOptions<BrowserTransportOptions>, BaseBrowserOptions, BaseReactNativeOptions {\n}\n\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n"]}
|
package/dist/js/scope.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Scope } from '@sentry/hub';
|
|
2
|
-
import { Breadcrumb, User } from '@sentry/types';
|
|
2
|
+
import { Attachment, Breadcrumb, User } from '@sentry/types';
|
|
3
3
|
/**
|
|
4
4
|
* Extends the scope methods to set scope on the Native SDKs
|
|
5
5
|
*/
|
|
@@ -42,5 +42,13 @@ export declare class ReactNativeScope extends Scope {
|
|
|
42
42
|
setContext(key: string, context: {
|
|
43
43
|
[key: string]: any;
|
|
44
44
|
} | null): this;
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
addAttachment(attachment: Attachment): this;
|
|
49
|
+
/**
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
clearAttachments(): this;
|
|
45
53
|
}
|
|
46
54
|
//# sourceMappingURL=scope.d.ts.map
|
package/dist/js/scope.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI7D;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI;IAKvC;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK/C;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAQrD;;OAEG;IAEI,SAAS,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI;IAOtD;;OAEG;IAEI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAK9C;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAK3E;;OAEG;IACI,gBAAgB,IAAI,IAAI;IAK/B;;OAEG;IAEI,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,GAAG,IAAI;IAK5E;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAIlD;;MAEE;IACK,gBAAgB,IAAI,IAAI;CAGhC"}
|
package/dist/js/scope.js
CHANGED
|
@@ -68,5 +68,17 @@ export class ReactNativeScope extends Scope {
|
|
|
68
68
|
NATIVE.setContext(key, context);
|
|
69
69
|
return super.setContext(key, context);
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* @inheritDoc
|
|
73
|
+
*/
|
|
74
|
+
addAttachment(attachment) {
|
|
75
|
+
return super.addAttachment(attachment);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @inheritDoc
|
|
79
|
+
*/
|
|
80
|
+
clearAttachments() {
|
|
81
|
+
return super.clearAttachments();
|
|
82
|
+
}
|
|
71
83
|
}
|
|
72
84
|
//# sourceMappingURL=scope.js.map
|
package/dist/js/scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC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U,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,UAAU,CAAC,GAAW,EAAE,OAAsC;QACnE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import { Scope } from '@sentry/hub';\nimport { Breadcrumb, User } from '@sentry/types';\n\nimport { NATIVE } from './wrapper';\n\n/**\n * Extends the scope methods to set scope on the Native SDKs\n */\nexport class ReactNativeScope extends Scope {\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n NATIVE.setUser(user);\n return super.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n NATIVE.setTag(key, value);\n return super.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): this {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach((key) => {\n NATIVE.setTag(key, tags[key]);\n });\n return super.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setExtras(extras: { [key: string]: any }): this {\n Object.keys(extras).forEach((key) => {\n NATIVE.setExtra(key, extras[key]);\n });\n return super.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any\n public setExtra(key: string, extra: any): this {\n NATIVE.setExtra(key, extra);\n return super.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n NATIVE.addBreadcrumb(breadcrumb);\n return super.addBreadcrumb(breadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n NATIVE.clearBreadcrumbs();\n return super.clearBreadcrumbs();\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(key: string, context: { [key: string]: any } | null): this {\n NATIVE.setContext(key, context);\n return super.setContext(key, context);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACI,OAAO,CAAC,IAAiB;QAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,GAAW,EAAE,KAAa;QACtC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,IAA+B;QAC5C,gEAAgE;QAChE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,SAAS,CAAC,MAA8B;QAC7C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAClC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,gHAAgH;IACzG,QAAQ,CAAC,GAAW,EAAE,KAAU;QACrC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB,EAAE,cAAuB;QAClE,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,UAAU,CAAC,GAAW,EAAE,OAAsC;QACnE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB;QACzC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED;;MAEE;IACK,gBAAgB;QACrB,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;CACF","sourcesContent":["import { Scope } from '@sentry/hub';\nimport { Attachment, Breadcrumb, User } from '@sentry/types';\n\nimport { NATIVE } from './wrapper';\n\n/**\n * Extends the scope methods to set scope on the Native SDKs\n */\nexport class ReactNativeScope extends Scope {\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n NATIVE.setUser(user);\n return super.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n NATIVE.setTag(key, value);\n return super.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): this {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach((key) => {\n NATIVE.setTag(key, tags[key]);\n });\n return super.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setExtras(extras: { [key: string]: any }): this {\n Object.keys(extras).forEach((key) => {\n NATIVE.setExtra(key, extras[key]);\n });\n return super.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any\n public setExtra(key: string, extra: any): this {\n NATIVE.setExtra(key, extra);\n return super.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n NATIVE.addBreadcrumb(breadcrumb);\n return super.addBreadcrumb(breadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n NATIVE.clearBreadcrumbs();\n return super.clearBreadcrumbs();\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(key: string, context: { [key: string]: any } | null): this {\n NATIVE.setContext(key, context);\n return super.setContext(key, context);\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n return super.addAttachment(attachment);\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\n return super.clearAttachments();\n }\n}\n"]}
|
package/dist/js/sdk.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Hub } from '@sentry/hub';
|
|
2
|
+
import { Scope, UserFeedback } from '@sentry/types';
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { ReactNativeOptions, ReactNativeWrapperOptions } from './options';
|
|
3
5
|
/**
|
|
@@ -34,4 +36,27 @@ export declare function flush(): Promise<boolean>;
|
|
|
34
36
|
* Closes the SDK, stops sending events.
|
|
35
37
|
*/
|
|
36
38
|
export declare function close(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Captures user feedback and sends it to Sentry.
|
|
41
|
+
*/
|
|
42
|
+
export declare function captureUserFeedback(feedback: UserFeedback): void;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new scope with and executes the given operation within.
|
|
45
|
+
* The scope is automatically removed once the operation
|
|
46
|
+
* finishes or throws.
|
|
47
|
+
*
|
|
48
|
+
* This is essentially a convenience function for:
|
|
49
|
+
*
|
|
50
|
+
* pushScope();
|
|
51
|
+
* callback();
|
|
52
|
+
* popScope();
|
|
53
|
+
*
|
|
54
|
+
* @param callback that will be enclosed into push/popScope.
|
|
55
|
+
*/
|
|
56
|
+
export declare function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']>;
|
|
57
|
+
/**
|
|
58
|
+
* Callback to set context information onto the scope.
|
|
59
|
+
* @param callback Callback function that receives Scope.
|
|
60
|
+
*/
|
|
61
|
+
export declare function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']>;
|
|
37
62
|
//# sourceMappingURL=sdk.d.ts.map
|
package/dist/js/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAY,MAAM,aAAa,CAAC;AAO5C,OAAO,EAAe,KAAK,EAAc,YAAY,EAAE,MAAM,eAA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
3
|
import { Hub, makeMain } from '@sentry/hub';
|
|
4
4
|
import { RewriteFrames } from '@sentry/integrations';
|
|
5
|
-
import { defaultIntegrations, defaultStackParser, getCurrentHub } from '@sentry/react';
|
|
5
|
+
import { defaultIntegrations as reactDefaultIntegrations, defaultStackParser, getCurrentHub, } from '@sentry/react';
|
|
6
6
|
import { getGlobalObject, logger, stackParserFromStackParserOptions } from '@sentry/utils';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { ReactNativeClient } from './client';
|
|
@@ -11,6 +11,8 @@ import { ReactNativeScope } from './scope';
|
|
|
11
11
|
import { TouchEventBoundary } from './touchevents';
|
|
12
12
|
import { ReactNativeProfiler, ReactNativeTracing } from './tracing';
|
|
13
13
|
import { makeReactNativeTransport } from './transports/native';
|
|
14
|
+
import { makeUtf8TextEncoder } from './transports/TextEncoder';
|
|
15
|
+
import { safeFactory, safeTracesSampler } from './utils/safe';
|
|
14
16
|
const IGNORED_DEFAULT_INTEGRATIONS = [
|
|
15
17
|
'GlobalHandlers',
|
|
16
18
|
'TryCatch',
|
|
@@ -22,37 +24,40 @@ const DEFAULT_OPTIONS = {
|
|
|
22
24
|
autoInitializeNativeSdk: true,
|
|
23
25
|
enableAutoPerformanceTracking: true,
|
|
24
26
|
enableOutOfMemoryTracking: true,
|
|
25
|
-
patchGlobalPromise: true
|
|
27
|
+
patchGlobalPromise: true,
|
|
28
|
+
transportOptions: {
|
|
29
|
+
textEncoder: makeUtf8TextEncoder(),
|
|
30
|
+
},
|
|
31
|
+
sendClientReports: true,
|
|
26
32
|
};
|
|
27
33
|
/**
|
|
28
34
|
* Inits the SDK and returns the final options.
|
|
29
35
|
*/
|
|
30
36
|
export function init(passedOptions) {
|
|
37
|
+
var _a;
|
|
31
38
|
const reactNativeHub = new Hub(undefined, new ReactNativeScope());
|
|
32
39
|
makeMain(reactNativeHub);
|
|
33
|
-
const options = Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), passedOptions), {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
options.integrations.push(integration);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
40
|
+
const options = Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), passedOptions), {
|
|
41
|
+
// If custom transport factory fails the SDK won't initialize
|
|
42
|
+
transport: passedOptions.transport || makeReactNativeTransport, transportOptions: Object.assign(Object.assign({}, DEFAULT_OPTIONS.transportOptions), ((_a = passedOptions.transportOptions) !== null && _a !== void 0 ? _a : {})), integrations: [], stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser), beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }), initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }), tracesSampler: safeTracesSampler(passedOptions.tracesSampler) });
|
|
39
43
|
// As long as tracing is opt in with either one of these options, then this is how we determine tracing is enabled.
|
|
40
44
|
const tracingEnabled = typeof options.tracesSampler !== 'undefined' ||
|
|
41
45
|
typeof options.tracesSampleRate !== 'undefined';
|
|
46
|
+
const defaultIntegrations = passedOptions.defaultIntegrations || [];
|
|
42
47
|
if (passedOptions.defaultIntegrations === undefined) {
|
|
43
|
-
|
|
48
|
+
defaultIntegrations.push(new ReactNativeErrorHandlers({
|
|
44
49
|
patchGlobalPromise: options.patchGlobalPromise,
|
|
45
50
|
}));
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
...
|
|
51
|
+
defaultIntegrations.push(new Release());
|
|
52
|
+
defaultIntegrations.push(...[
|
|
53
|
+
...reactDefaultIntegrations.filter((i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)),
|
|
49
54
|
]);
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
defaultIntegrations.push(new EventOrigin());
|
|
56
|
+
defaultIntegrations.push(new SdkInfo());
|
|
52
57
|
if (__DEV__) {
|
|
53
|
-
|
|
58
|
+
defaultIntegrations.push(new DebugSymbolicator());
|
|
54
59
|
}
|
|
55
|
-
|
|
60
|
+
defaultIntegrations.push(new RewriteFrames({
|
|
56
61
|
iteratee: (frame) => {
|
|
57
62
|
if (frame.filename) {
|
|
58
63
|
frame.filename = frame.filename
|
|
@@ -73,14 +78,18 @@ export function init(passedOptions) {
|
|
|
73
78
|
},
|
|
74
79
|
}));
|
|
75
80
|
if (options.enableNative) {
|
|
76
|
-
|
|
81
|
+
defaultIntegrations.push(new DeviceContext());
|
|
77
82
|
}
|
|
78
83
|
if (tracingEnabled) {
|
|
79
84
|
if (options.enableAutoPerformanceTracking) {
|
|
80
|
-
|
|
85
|
+
defaultIntegrations.push(new ReactNativeTracing());
|
|
81
86
|
}
|
|
82
87
|
}
|
|
83
88
|
}
|
|
89
|
+
options.integrations = getIntegrationsToSetup({
|
|
90
|
+
integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),
|
|
91
|
+
defaultIntegrations,
|
|
92
|
+
});
|
|
84
93
|
initAndBind(ReactNativeClient, options);
|
|
85
94
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any
|
|
86
95
|
if (getGlobalObject().HermesInternal) {
|
|
@@ -168,4 +177,50 @@ export function close() {
|
|
|
168
177
|
}
|
|
169
178
|
});
|
|
170
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Captures user feedback and sends it to Sentry.
|
|
182
|
+
*/
|
|
183
|
+
export function captureUserFeedback(feedback) {
|
|
184
|
+
var _a;
|
|
185
|
+
(_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.captureUserFeedback(feedback);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates a new scope with and executes the given operation within.
|
|
189
|
+
* The scope is automatically removed once the operation
|
|
190
|
+
* finishes or throws.
|
|
191
|
+
*
|
|
192
|
+
* This is essentially a convenience function for:
|
|
193
|
+
*
|
|
194
|
+
* pushScope();
|
|
195
|
+
* callback();
|
|
196
|
+
* popScope();
|
|
197
|
+
*
|
|
198
|
+
* @param callback that will be enclosed into push/popScope.
|
|
199
|
+
*/
|
|
200
|
+
export function withScope(callback) {
|
|
201
|
+
const safeCallback = (scope) => {
|
|
202
|
+
try {
|
|
203
|
+
callback(scope);
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
logger.error('Error while running withScope callback', e);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
getCurrentHub().withScope(safeCallback);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Callback to set context information onto the scope.
|
|
213
|
+
* @param callback Callback function that receives Scope.
|
|
214
|
+
*/
|
|
215
|
+
export function configureScope(callback) {
|
|
216
|
+
const safeCallback = (scope) => {
|
|
217
|
+
try {
|
|
218
|
+
callback(scope);
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
logger.error('Error while running configureScope callback', e);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
getCurrentHub().configureScope(safeCallback);
|
|
225
|
+
}
|
|
171
226
|
//# sourceMappingURL=sdk.js.map
|
package/dist/js/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAA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,yBAAyB,CAAC,CAAC;SACzC;IACH,CAAC;CAAA","sourcesContent":["import { getIntegrationsToSetup, initAndBind, setExtra } from '@sentry/core';\nimport { Hub, makeMain } from '@sentry/hub';\nimport { RewriteFrames } from '@sentry/integrations';\nimport { defaultIntegrations, defaultStackParser, getCurrentHub } from '@sentry/react';\nimport { Integration, StackFrame } from '@sentry/types';\nimport { getGlobalObject, logger, stackParserFromStackParserOptions } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { ReactNativeClient } from './client';\nimport {\n DebugSymbolicator,\n DeviceContext,\n EventOrigin,\n ReactNativeErrorHandlers,\n Release,\n SdkInfo,\n} from './integrations';\nimport { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { ReactNativeScope } from './scope';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler, ReactNativeTracing } from './tracing';\nimport { makeReactNativeTransport } from './transports/native';\n\nconst IGNORED_DEFAULT_INTEGRATIONS = [\n 'GlobalHandlers', // We will use the react-native internal handlers\n 'TryCatch', // We don't need this\n];\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNative: true,\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracking: true,\n enableOutOfMemoryTracking: true,\n patchGlobalPromise: true\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n const reactNativeHub = new Hub(undefined, new ReactNativeScope());\n makeMain(reactNativeHub);\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n transport: passedOptions.transport || makeReactNativeTransport,\n integrations: getIntegrationsToSetup(passedOptions),\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser)\n };\n\n function addIntegration(integration: Integration): void {\n if (options.integrations.filter((i) => i.name == integration.name).length === 0) {\n options.integrations.push(integration);\n }\n }\n\n // As long as tracing is opt in with either one of these options, then this is how we determine tracing is enabled.\n const tracingEnabled =\n typeof options.tracesSampler !== 'undefined' ||\n typeof options.tracesSampleRate !== 'undefined';\n\n if (passedOptions.defaultIntegrations === undefined) {\n addIntegration(new ReactNativeErrorHandlers({\n patchGlobalPromise: options.patchGlobalPromise,\n }));\n addIntegration(new Release());\n options.integrations.push(...[\n ...defaultIntegrations.filter(\n (i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)\n ),\n ]);\n\n addIntegration(new EventOrigin());\n addIntegration(new SdkInfo());\n\n if (__DEV__) {\n addIntegration(new DebugSymbolicator());\n }\n\n addIntegration(new RewriteFrames({\n iteratee: (frame: StackFrame) => {\n if (frame.filename) {\n frame.filename = frame.filename\n .replace(/^file:\\/\\//, '')\n .replace(/^address at /, '')\n .replace(/^.*\\/[^.]+(\\.app|CodePush|.*(?=\\/))/, '');\n\n if (\n frame.filename !== '[native code]' &&\n frame.filename !== 'native'\n ) {\n const appPrefix = 'app://';\n // We always want to have a triple slash\n frame.filename =\n frame.filename.indexOf('/') === 0\n ? `${appPrefix}${frame.filename}`\n : `${appPrefix}/${frame.filename}`;\n }\n }\n return frame;\n },\n }));\n if (options.enableNative) {\n addIntegration(new DeviceContext());\n }\n if (tracingEnabled) {\n if (options.enableAutoPerformanceTracking) {\n addIntegration(new ReactNativeTracing());\n }\n }\n }\n\n initAndBind(ReactNativeClient, options);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any\n if (getGlobalObject<any>().HermesInternal) {\n getCurrentHub().setTag('hermes', 'true');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const tracingIntegration = getCurrentHub().getIntegration(ReactNativeTracing);\n if (tracingIntegration) {\n tracingIntegration.useAppStartWithProfiler = true;\n }\n\n const profilerProps = {\n ...(options?.profilerProps ?? {}),\n name: RootComponent.displayName ?? 'Root',\n };\n\n const RootApp: React.FC<P> = (appProps) => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ReactNativeProfiler {...profilerProps}>\n <RootComponent {...appProps} />\n </ReactNativeProfiler>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * Deprecated. Sets the release on the event.\n * NOTE: Does not set the release on sessions.\n * @deprecated\n */\nexport function setRelease(release: string): void {\n setExtra('__sentry_release', release);\n}\n\n/**\n * Deprecated. Sets the dist on the event.\n * NOTE: Does not set the dist on sessions.\n * @deprecated\n */\nexport function setDist(dist: string): void {\n setExtra('__sentry_dist', dist);\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n if (client) {\n client.nativeCrash();\n }\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n logger.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n logger.error('Failed to close the SDK');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,mBAAmB,IAAI,wB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ACV,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC;IACF,aAAa,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACF,MAAM,UAAU,cAAc,CAAC,QAAgC;IAC9D,MAAM,YAAY,GAAG,CAAC,KAAY,EAAQ,EAAE;QAC1C,IAAI;YACF,QAAQ,CAAC,KAAK,CAAC,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,6CAA6C,EAAE,CAAC,CAAC,CAAC;SAChE;IACH,CAAC,CAAC;IACF,aAAa,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { getIntegrationsToSetup, initAndBind, setExtra } from '@sentry/core';\nimport { Hub, makeMain } from '@sentry/hub';\nimport { RewriteFrames } from '@sentry/integrations';\nimport {\n defaultIntegrations as reactDefaultIntegrations,\n defaultStackParser,\n getCurrentHub,\n} from '@sentry/react';\nimport { Integration, Scope, StackFrame, UserFeedback } from '@sentry/types';\nimport { getGlobalObject, logger, stackParserFromStackParserOptions } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { ReactNativeClient } from './client';\nimport {\n DebugSymbolicator,\n DeviceContext,\n EventOrigin,\n ReactNativeErrorHandlers,\n Release,\n SdkInfo,\n} from './integrations';\nimport { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { ReactNativeScope } from './scope';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler, ReactNativeTracing } from './tracing';\nimport { makeReactNativeTransport } from './transports/native';\nimport { makeUtf8TextEncoder } from './transports/TextEncoder';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\n\nconst IGNORED_DEFAULT_INTEGRATIONS = [\n 'GlobalHandlers', // We will use the react-native internal handlers\n 'TryCatch', // We don't need this\n];\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNative: true,\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracking: true,\n enableOutOfMemoryTracking: true,\n patchGlobalPromise: true,\n transportOptions: {\n textEncoder: makeUtf8TextEncoder(),\n },\n sendClientReports: true,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n const reactNativeHub = new Hub(undefined, new ReactNativeScope());\n makeMain(reactNativeHub);\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport || makeReactNativeTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n },\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }),\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n tracesSampler: safeTracesSampler(passedOptions.tracesSampler),\n };\n\n // As long as tracing is opt in with either one of these options, then this is how we determine tracing is enabled.\n const tracingEnabled =\n typeof options.tracesSampler !== 'undefined' ||\n typeof options.tracesSampleRate !== 'undefined';\n\n const defaultIntegrations: Integration[] = passedOptions.defaultIntegrations || [];\n if (passedOptions.defaultIntegrations === undefined) {\n defaultIntegrations.push(new ReactNativeErrorHandlers({\n patchGlobalPromise: options.patchGlobalPromise,\n }));\n defaultIntegrations.push(new Release());\n defaultIntegrations.push(...[\n ...reactDefaultIntegrations.filter(\n (i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)\n ),\n ]);\n\n defaultIntegrations.push(new EventOrigin());\n defaultIntegrations.push(new SdkInfo());\n\n if (__DEV__) {\n defaultIntegrations.push(new DebugSymbolicator());\n }\n\n defaultIntegrations.push(new RewriteFrames({\n iteratee: (frame: StackFrame) => {\n if (frame.filename) {\n frame.filename = frame.filename\n .replace(/^file:\\/\\//, '')\n .replace(/^address at /, '')\n .replace(/^.*\\/[^.]+(\\.app|CodePush|.*(?=\\/))/, '');\n\n if (\n frame.filename !== '[native code]' &&\n frame.filename !== 'native'\n ) {\n const appPrefix = 'app://';\n // We always want to have a triple slash\n frame.filename =\n frame.filename.indexOf('/') === 0\n ? `${appPrefix}${frame.filename}`\n : `${appPrefix}/${frame.filename}`;\n }\n }\n return frame;\n },\n }));\n if (options.enableNative) {\n defaultIntegrations.push(new DeviceContext());\n }\n if (tracingEnabled) {\n if (options.enableAutoPerformanceTracking) {\n defaultIntegrations.push(new ReactNativeTracing());\n }\n }\n }\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any\n if (getGlobalObject<any>().HermesInternal) {\n getCurrentHub().setTag('hermes', 'true');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const tracingIntegration = getCurrentHub().getIntegration(ReactNativeTracing);\n if (tracingIntegration) {\n tracingIntegration.useAppStartWithProfiler = true;\n }\n\n const profilerProps = {\n ...(options?.profilerProps ?? {}),\n name: RootComponent.displayName ?? 'Root',\n };\n\n const RootApp: React.FC<P> = (appProps) => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ReactNativeProfiler {...profilerProps}>\n <RootComponent {...appProps} />\n </ReactNativeProfiler>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * Deprecated. Sets the release on the event.\n * NOTE: Does not set the release on sessions.\n * @deprecated\n */\nexport function setRelease(release: string): void {\n setExtra('__sentry_release', release);\n}\n\n/**\n * Deprecated. Sets the dist on the event.\n * NOTE: Does not set the dist on sessions.\n * @deprecated\n */\nexport function setDist(dist: string): void {\n setExtra('__sentry_dist', dist);\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n if (client) {\n client.nativeCrash();\n }\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n logger.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getCurrentHub().getClient<ReactNativeClient>();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n logger.error('Failed to close the SDK');\n }\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\n export function captureUserFeedback(feedback: UserFeedback): void {\n getCurrentHub().getClient<ReactNativeClient>()?.captureUserFeedback(feedback);\n }\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {\n const safeCallback = (scope: Scope): void => {\n try {\n callback(scope);\n } catch (e) {\n logger.error('Error while running withScope callback', e);\n }\n };\n getCurrentHub().withScope(safeCallback);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\n export function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n const safeCallback = (scope: Scope): void => {\n try {\n callback(scope);\n } catch (e) {\n logger.error('Error while running configureScope callback', e);\n }\n };\n getCurrentHub().configureScope(safeCallback);\n}\n"]}
|
|
@@ -6,6 +6,14 @@ import { NativeFramesInstrumentation } from './nativeframes';
|
|
|
6
6
|
import { StallTrackingInstrumentation } from './stalltracking';
|
|
7
7
|
import { BeforeNavigate } from './types';
|
|
8
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;
|
|
9
17
|
/**
|
|
10
18
|
* The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of
|
|
11
19
|
* the last finished span as the endtime for the transaction.
|
|
@@ -13,15 +21,16 @@ export interface ReactNativeTracingOptions extends RequestInstrumentationOptions
|
|
|
13
21
|
*
|
|
14
22
|
* Default: 1000
|
|
15
23
|
*/
|
|
16
|
-
|
|
24
|
+
idleTimeoutMs: number;
|
|
17
25
|
/**
|
|
18
|
-
* The maximum duration
|
|
26
|
+
* The maximum duration (transaction duration + idle timeout) of a transaction
|
|
27
|
+
* before it will be marked as "deadline_exceeded".
|
|
19
28
|
* If you never want to mark a transaction set it to 0.
|
|
20
|
-
* Time is in
|
|
29
|
+
* Time is in ms.
|
|
21
30
|
*
|
|
22
|
-
* Default:
|
|
31
|
+
* Default: 600000
|
|
23
32
|
*/
|
|
24
|
-
|
|
33
|
+
finalTimeoutMs: number;
|
|
25
34
|
/**
|
|
26
35
|
* The routing instrumentation to be used with the tracing integration.
|
|
27
36
|
* There is no routing instrumentation if nothing is passed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO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