@sentry/react-native 6.13.1 → 6.14.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/RNSentry.podspec +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/dist/js/client.d.ts +12 -0
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +19 -0
- package/dist/js/client.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts +18 -0
- package/dist/js/integrations/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js +20 -12
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts +14 -1
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js +9 -1
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +4 -1
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +5 -1
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/ios/RNSentryReplay.mm +1 -2
- package/ios/RNSentryVersion.m +1 -1
- package/package.json +6 -6
- package/ts3.8/dist/js/client.d.ts +12 -0
- package/ts3.8/dist/js/integrations/expocontext.d.ts +18 -0
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +14 -1
- package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +4 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
package/RNSentry.podspec
CHANGED
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
|
|
38
38
|
s.compiler_flags = other_cflags
|
|
39
39
|
|
|
40
|
-
s.dependency 'Sentry/HybridSDK', '8.
|
|
40
|
+
s.dependency 'Sentry/HybridSDK', '8.50.2'
|
|
41
41
|
|
|
42
42
|
if defined? install_modules_dependencies
|
|
43
43
|
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
|
|
@@ -2,7 +2,7 @@ package io.sentry.react;
|
|
|
2
2
|
|
|
3
3
|
class RNSentryVersion {
|
|
4
4
|
static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
|
|
5
|
-
static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.
|
|
5
|
+
static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.14.0";
|
|
6
6
|
static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
|
|
7
7
|
static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
|
|
8
8
|
static final String REACT_NATIVE_SDK_NAME = "sentry.javascript.react-native";
|
package/dist/js/client.d.ts
CHANGED
|
@@ -44,6 +44,18 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
|
|
|
44
44
|
* @inheritDoc
|
|
45
45
|
*/
|
|
46
46
|
init(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Register a hook on this client.
|
|
49
|
+
*
|
|
50
|
+
* (Generic method signature to allow for custom React Native Client events.)
|
|
51
|
+
*/
|
|
52
|
+
on(hook: string, callback: unknown): () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Emit a hook that was previously registered via `on()`.
|
|
55
|
+
*
|
|
56
|
+
* (Generic method signature to allow for custom React Native Client events.)
|
|
57
|
+
*/
|
|
58
|
+
emit(hook: string, ...rest: unknown[]): void;
|
|
47
59
|
/**
|
|
48
60
|
* Starts native client with dsn and options
|
|
49
61
|
*/
|
package/dist/js/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,QAAQ,EACR,KAAK,EACL,SAAS,EAET,aAAa,EACb,4BAA4B,EAC5B,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAA+C,MAAM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;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,GAAE,SAAc,GAAG,WAAW,CAAC,KAAK,CAAC;IAIvF;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAIrG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;;OAGG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAUxD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,4BAA4B,CAAC;IAiClF;;OAEG;IACI,IAAI,IAAI,IAAI;IAKnB;;;;OAIG;IACI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,IAAI;IAKtD;;;;OAIG;IACI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAKnD;;OAEG;IACH,OAAO,CAAC,cAAc;IA6BtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAa9B"}
|
package/dist/js/client.js
CHANGED
|
@@ -112,6 +112,24 @@ export class ReactNativeClient extends BaseClient {
|
|
|
112
112
|
super.init();
|
|
113
113
|
this._initNativeSdk();
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Register a hook on this client.
|
|
117
|
+
*
|
|
118
|
+
* (Generic method signature to allow for custom React Native Client events.)
|
|
119
|
+
*/
|
|
120
|
+
on(hook, callback) {
|
|
121
|
+
// @ts-expect-error on from the base class doesn't support generic types
|
|
122
|
+
return super.on(hook, callback);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Emit a hook that was previously registered via `on()`.
|
|
126
|
+
*
|
|
127
|
+
* (Generic method signature to allow for custom React Native Client events.)
|
|
128
|
+
*/
|
|
129
|
+
emit(hook, ...rest) {
|
|
130
|
+
// @ts-expect-error emit from the base class doesn't support generic types
|
|
131
|
+
super.emit(hook, ...rest);
|
|
132
|
+
}
|
|
115
133
|
/**
|
|
116
134
|
* Starts native client with dsn and options
|
|
117
135
|
*/
|
|
@@ -130,6 +148,7 @@ export class ReactNativeClient extends BaseClient {
|
|
|
130
148
|
.then((didCallNativeInit) => {
|
|
131
149
|
var _a, _b;
|
|
132
150
|
(_b = (_a = this._options).onReady) === null || _b === void 0 ? void 0 : _b.call(_a, { didCallNativeInit });
|
|
151
|
+
this.emit('afterInit');
|
|
133
152
|
})
|
|
134
153
|
.then(undefined, error => {
|
|
135
154
|
logger.error('The OnReady callback threw an error: ', error);
|
package/dist/js/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYvE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAA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,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/core';\nimport { BaseClient, dateTimestampInSeconds, logger, SentryError } from '@sentry/core';\nimport { Alert } from 'react-native';\n\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { getDefaultSidecarUrl } from './integrations/spotlight';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs(ReactNativeLibraries.ReactNativeVersion?.version);\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n // We default this to true, as it is the safer scenario\n options.parentSpanIsAlwaysRootSpan =\n options.parentSpanIsAlwaysRootSpan === undefined ? true : options.parentSpanIsAlwaysRootSpan;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n defaultSidecarUrl: getDefaultSidecarUrl(),\n devServerUrl: getDevServer()?.url || '',\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYvE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAoC;IAGzE;;;OAGG;IACH,YAAmB,OAAiC;;QAClD,sBAAsB,CAAC,MAAA,oBAAoB,CAAC,kBAAkB,0CAAE,OAAO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AW,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/core';\nimport { BaseClient, dateTimestampInSeconds, logger, SentryError } from '@sentry/core';\nimport { Alert } from 'react-native';\n\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { getDefaultSidecarUrl } from './integrations/spotlight';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs(ReactNativeLibraries.ReactNativeVersion?.version);\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n // We default this to true, as it is the safer scenario\n options.parentSpanIsAlwaysRootSpan =\n options.parentSpanIsAlwaysRootSpan === undefined ? true : options.parentSpanIsAlwaysRootSpan;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Register a hook on this client.\n *\n * (Generic method signature to allow for custom React Native Client events.)\n */\n public on(hook: string, callback: unknown): () => void {\n // @ts-expect-error on from the base class doesn't support generic types\n return super.on(hook, callback);\n }\n\n /**\n * Emit a hook that was previously registered via `on()`.\n *\n * (Generic method signature to allow for custom React Native Client events.)\n */\n public emit(hook: string, ...rest: unknown[]): void {\n // @ts-expect-error emit from the base class doesn't support generic types\n super.emit(hook, ...rest);\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n defaultSidecarUrl: getDefaultSidecarUrl(),\n devServerUrl: getDevServer()?.url || '',\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n this.emit('afterInit');\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
|
|
@@ -2,4 +2,22 @@ import { type Integration } from '@sentry/core';
|
|
|
2
2
|
export declare const OTA_UPDATES_CONTEXT_KEY = "ota_updates";
|
|
3
3
|
/** Load device context from expo modules. */
|
|
4
4
|
export declare const expoContextIntegration: () => Integration;
|
|
5
|
+
/**
|
|
6
|
+
* @internal Exposed for testing purposes
|
|
7
|
+
*/
|
|
8
|
+
export declare function getExpoUpdatesContext(): ExpoUpdatesContext;
|
|
9
|
+
type ExpoUpdatesContext = Partial<{
|
|
10
|
+
is_enabled: boolean;
|
|
11
|
+
is_embedded_launch: boolean;
|
|
12
|
+
is_emergency_launch: boolean;
|
|
13
|
+
is_using_embedded_assets: boolean;
|
|
14
|
+
update_id: string;
|
|
15
|
+
channel: string;
|
|
16
|
+
runtime_version: string;
|
|
17
|
+
check_automatically: string;
|
|
18
|
+
emergency_launch_reason: string;
|
|
19
|
+
launch_duration: number;
|
|
20
|
+
created_at: string;
|
|
21
|
+
}>;
|
|
22
|
+
export {};
|
|
5
23
|
//# sourceMappingURL=expocontext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,WAAW,EAA0B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,WAAW,EAA0B,MAAM,cAAc,CAAC;AASxG,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,QAAO,WA0DzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAqC1D;AAwDD,KAAK,kBAAkB,GAAG,OAAO,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC"}
|
|
@@ -7,8 +7,13 @@ export const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';
|
|
|
7
7
|
/** Load device context from expo modules. */
|
|
8
8
|
export const expoContextIntegration = () => {
|
|
9
9
|
let _expoUpdatesContextCached;
|
|
10
|
-
function setup() {
|
|
11
|
-
|
|
10
|
+
function setup(client) {
|
|
11
|
+
client.on('afterInit', () => {
|
|
12
|
+
if (!client.getOptions().enableNative) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
setExpoUpdatesNativeContext();
|
|
16
|
+
});
|
|
12
17
|
}
|
|
13
18
|
function setExpoUpdatesNativeContext() {
|
|
14
19
|
if (!isExpo() || isExpoGo()) {
|
|
@@ -47,7 +52,10 @@ export const expoContextIntegration = () => {
|
|
|
47
52
|
processEvent,
|
|
48
53
|
};
|
|
49
54
|
};
|
|
50
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @internal Exposed for testing purposes
|
|
57
|
+
*/
|
|
58
|
+
export function getExpoUpdatesContext() {
|
|
51
59
|
const expoUpdates = getExpoUpdates();
|
|
52
60
|
if (!expoUpdates) {
|
|
53
61
|
return {
|
|
@@ -60,19 +68,19 @@ function getExpoUpdatesContext() {
|
|
|
60
68
|
is_emergency_launch: !!expoUpdates.isEmergencyLaunch,
|
|
61
69
|
is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,
|
|
62
70
|
};
|
|
63
|
-
if (typeof expoUpdates.updateId === 'string') {
|
|
64
|
-
updatesContext.update_id = expoUpdates.updateId;
|
|
71
|
+
if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {
|
|
72
|
+
updatesContext.update_id = expoUpdates.updateId.toLowerCase();
|
|
65
73
|
}
|
|
66
|
-
if (typeof expoUpdates.channel === 'string') {
|
|
67
|
-
updatesContext.channel = expoUpdates.channel;
|
|
74
|
+
if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {
|
|
75
|
+
updatesContext.channel = expoUpdates.channel.toLowerCase();
|
|
68
76
|
}
|
|
69
|
-
if (typeof expoUpdates.runtimeVersion === 'string') {
|
|
70
|
-
updatesContext.runtime_version = expoUpdates.runtimeVersion;
|
|
77
|
+
if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {
|
|
78
|
+
updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();
|
|
71
79
|
}
|
|
72
|
-
if (typeof expoUpdates.checkAutomatically === 'string') {
|
|
73
|
-
updatesContext.check_automatically = expoUpdates.checkAutomatically;
|
|
80
|
+
if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {
|
|
81
|
+
updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();
|
|
74
82
|
}
|
|
75
|
-
if (typeof expoUpdates.emergencyLaunchReason === 'string') {
|
|
83
|
+
if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {
|
|
76
84
|
updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;
|
|
77
85
|
}
|
|
78
86
|
if (typeof expoUpdates.launchDuration === 'number') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGxG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAErD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,IAAI,yBAAyD,CAAC;IAE9D,SAAS,KAAK,CAAC,MAAyB;QACtC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,E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,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { type DeviceContext, type Event, type Integration, type OsContext, logger } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\nimport { isExpo, isExpoGo } from '../utils/environment';\nimport { getExpoDevice, getExpoUpdates } from '../utils/expomodules';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\nexport const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): Integration => {\n let _expoUpdatesContextCached: ExpoUpdatesContext | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!client.getOptions().enableNative) {\n return;\n }\n\n setExpoUpdatesNativeContext();\n });\n }\n\n function setExpoUpdatesNativeContext(): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesContextCached();\n\n try {\n // Ensures native errors and crashes have the same context as JS errors\n NATIVE.setContext(OTA_UPDATES_CONTEXT_KEY, expoUpdates);\n } catch (error) {\n logger.error('Error setting Expo updates context:', error);\n }\n }\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n addExpoGoContext(event);\n addExpoUpdatesContext(event);\n return event;\n }\n\n function addExpoUpdatesContext(event: Event): void {\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...getExpoUpdatesContextCached(),\n };\n }\n\n function getExpoUpdatesContextCached(): ExpoUpdatesContext {\n if (_expoUpdatesContextCached) {\n return _expoUpdatesContextCached;\n }\n\n return (_expoUpdatesContextCached = getExpoUpdatesContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoUpdatesContext(): ExpoUpdatesContext {\n const expoUpdates = getExpoUpdates();\n if (!expoUpdates) {\n return {\n is_enabled: false,\n };\n }\n\n const updatesContext: ExpoUpdatesContext = {\n is_enabled: !!expoUpdates.isEnabled,\n is_embedded_launch: !!expoUpdates.isEmbeddedLaunch,\n is_emergency_launch: !!expoUpdates.isEmergencyLaunch,\n is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,\n };\n\n if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {\n updatesContext.update_id = expoUpdates.updateId.toLowerCase();\n }\n if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {\n updatesContext.channel = expoUpdates.channel.toLowerCase();\n }\n if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {\n updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();\n }\n if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {\n updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();\n }\n if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {\n updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;\n }\n if (typeof expoUpdates.launchDuration === 'number') {\n updatesContext.launch_duration = expoUpdates.launchDuration;\n }\n if (expoUpdates.createdAt instanceof Date) {\n updatesContext.created_at = expoUpdates.createdAt.toISOString();\n }\n return updatesContext;\n}\n\nfunction addExpoGoContext(event: Event): void {\n if (!isExpoGo()) {\n return;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n\ntype ExpoUpdatesContext = Partial<{\n is_enabled: boolean;\n is_embedded_launch: boolean;\n is_emergency_launch: boolean;\n is_using_embedded_assets: boolean;\n update_id: string;\n channel: string;\n runtime_version: string;\n check_automatically: string;\n emergency_launch_reason: string;\n launch_duration: number;\n created_at: string;\n}>;\n"]}
|
|
@@ -28,9 +28,22 @@ export interface MobileReplayOptions {
|
|
|
28
28
|
*
|
|
29
29
|
* - Experiment: This is an experimental feature and is therefore disabled by default.
|
|
30
30
|
*
|
|
31
|
-
* @
|
|
31
|
+
* @deprecated Use `enableViewRendererV2` instead.
|
|
32
32
|
*/
|
|
33
33
|
enableExperimentalViewRenderer?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Enables up to 5x faster new view renderer used by the Session Replay integration on iOS.
|
|
36
|
+
*
|
|
37
|
+
* Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing
|
|
38
|
+
* interruptions and visual lag. [Our benchmarks](https://github.com/getsentry/sentry-cocoa/pull/4940) have shown a significant improvement of
|
|
39
|
+
* **up to 4-5x faster rendering** (reducing `~160ms` to `~36ms` per frame) on older devices.
|
|
40
|
+
*
|
|
41
|
+
* - Experiment: In case you are noticing issues with the new view renderer, please report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).
|
|
42
|
+
* Eventually, we will remove this feature flag and use the new view renderer by default.
|
|
43
|
+
*
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
enableViewRendererV2?: boolean;
|
|
34
47
|
/**
|
|
35
48
|
* Enables up to 5x faster but incomplete view rendering used by the Session Replay integration on iOS.
|
|
36
49
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,WAAW,EAAE,MAAM,cAAc,CAAC;AASvF,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;OASG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,WAAW,EAAE,MAAM,cAAc,CAAC;AASvF,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;OASG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAwBD,KAAK,uBAAuB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,mBAAmB,KAAoB,uBAuE3F,CAAC"}
|
|
@@ -19,8 +19,16 @@ const defaultOptions = {
|
|
|
19
19
|
maskAllImages: true,
|
|
20
20
|
maskAllVectors: true,
|
|
21
21
|
enableExperimentalViewRenderer: false,
|
|
22
|
+
enableViewRendererV2: true,
|
|
22
23
|
enableFastViewRendering: false,
|
|
23
24
|
};
|
|
25
|
+
function mergeOptions(initOptions) {
|
|
26
|
+
const merged = Object.assign(Object.assign({}, defaultOptions), initOptions);
|
|
27
|
+
if (initOptions.enableViewRendererV2 === undefined && initOptions.enableExperimentalViewRenderer !== undefined) {
|
|
28
|
+
merged.enableViewRendererV2 = initOptions.enableExperimentalViewRenderer;
|
|
29
|
+
}
|
|
30
|
+
return merged;
|
|
31
|
+
}
|
|
24
32
|
/**
|
|
25
33
|
* The Mobile Replay Integration, let's you adjust the default mobile replay options.
|
|
26
34
|
* To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
|
|
@@ -47,7 +55,7 @@ export const mobileReplayIntegration = (initOptions = defaultOptions) => {
|
|
|
47
55
|
if (isExpoGo() || notMobileOs()) {
|
|
48
56
|
return mobileReplayIntegrationNoop();
|
|
49
57
|
}
|
|
50
|
-
const options =
|
|
58
|
+
const options = mergeOptions(initOptions);
|
|
51
59
|
function processEvent(event) {
|
|
52
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
61
|
const hasException = event.exception && event.exception.values && event.exception.values.length > 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobilereplay.js","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CA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CAAC,WAAW,EAAE,CAAC,GAA2B,EAAE,EAAE;YACrD,IAAI,GAAG,CAAC,SAAS,EAAE;gBACjB,OAAO;aACR;YAED,6GAA6G;YAC7G,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;YACpD,IAAI,eAAe,EAAE;gBACnB,GAAG,CAAC,SAAS,GAAG,eAAe,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,CAAC;IACxE,CAAC;IAED,iHAAiH;IACjH,8GAA8G;IAC9G,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,KAAK;QACL,YAAY;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAA4B,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Client, DynamicSamplingContext, Event, Integration } from '@sentry/core';\nimport { logger } from '@sentry/core';\n\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllText?: boolean;\n\n /**\n * Mask all images in recordings\n *\n * @default true\n */\n maskAllImages?: boolean;\n\n /**\n * Mask all vector graphics in recordings\n * Supports `react-native-svg`\n *\n * @default true\n */\n maskAllVectors?: boolean;\n\n /**\n * Enables the up to 5x faster experimental view renderer used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag.\n *\n * - Experiment: This is an experimental feature and is therefore disabled by default.\n *\n * @deprecated Use `enableViewRendererV2` instead.\n */\n enableExperimentalViewRenderer?: boolean;\n\n /**\n * Enables up to 5x faster new view renderer used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag. [Our benchmarks](https://github.com/getsentry/sentry-cocoa/pull/4940) have shown a significant improvement of\n * **up to 4-5x faster rendering** (reducing `~160ms` to `~36ms` per frame) on older devices.\n *\n * - Experiment: In case you are noticing issues with the new view renderer, please report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).\n * Eventually, we will remove this feature flag and use the new view renderer by default.\n *\n * @default true\n */\n enableViewRendererV2?: boolean;\n\n /**\n * Enables up to 5x faster but incomplete view rendering used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag.\n *\n * - Note: This flag can only be used together with `enableExperimentalViewRenderer` with up to 20% faster render times.\n * - Experiment: This is an experimental feature and is therefore disabled by default.\n *\n * @default false\n */\n enableFastViewRendering?: boolean;\n}\n\nconst defaultOptions: Required<MobileReplayOptions> = {\n maskAllText: true,\n maskAllImages: true,\n maskAllVectors: true,\n enableExperimentalViewRenderer: false,\n enableViewRendererV2: true,\n enableFastViewRendering: false,\n};\n\nfunction mergeOptions(initOptions: Partial<MobileReplayOptions>): Required<MobileReplayOptions> {\n const merged = {\n ...defaultOptions,\n ...initOptions,\n };\n\n if (initOptions.enableViewRendererV2 === undefined && initOptions.enableExperimentalViewRenderer !== undefined) {\n merged.enableViewRendererV2 = initOptions.enableExperimentalViewRenderer;\n }\n\n return merged;\n}\n\ntype MobileReplayIntegration = Integration & {\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 * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\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 = mergeOptions(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.captureReplay(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 client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);\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"]}
|
|
@@ -18,7 +18,10 @@ export interface ReactNativeTracingOptions {
|
|
|
18
18
|
/**
|
|
19
19
|
* Flag to disable patching all together for fetch requests.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* Fetch in React Native is a `whatwg-fetch` polyfill which uses XHR under the hood.
|
|
22
|
+
* This causes duplicates when both `traceFetch` and `traceXHR` are enabled at the same time.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
22
25
|
*/
|
|
23
26
|
traceFetch: boolean;
|
|
24
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAS,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjF,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB
|
|
1
|
+
{"version":3,"file":"reactnativetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAS,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjF,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;OAOG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;IAElE;;;;;OAKG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/D;AASD,eAAO,MAAM,gCAAgC,EAAE,yBAQ9C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,6BAA6B,aAC/B,QAAQ,yBAAyB,CAAC;aAElC,yBAAyB;WAC3B,uBAAuB;6BACL,MAAM,KAAK,IAAI;CA8DzC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE7F;;GAEG;AACH,wBAAgB,uCAAuC,IAAI,6BAA6B,GAAG,SAAS,CAOnG;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,6BAA6B,GAAG,SAAS,CAE1G"}
|
|
@@ -12,7 +12,11 @@ function getDefaultTracePropagationTargets() {
|
|
|
12
12
|
return [/.*/];
|
|
13
13
|
}
|
|
14
14
|
export const defaultReactNativeTracingOptions = {
|
|
15
|
-
|
|
15
|
+
// Fetch in React Native is a `whatwg-fetch` polyfill which uses XHR under the hood.
|
|
16
|
+
// This causes duplicates when both `traceFetch` and `traceXHR` are enabled at the same time.
|
|
17
|
+
// https://github.com/facebook/react-native/blob/28945c68da056ab2ac01de7e542a845b2bca6096/packages/react-native/Libraries/Network/fetch.js
|
|
18
|
+
// (RN Web uses browsers native fetch implementation)
|
|
19
|
+
traceFetch: isWeb() ? true : false,
|
|
16
20
|
traceXHR: true,
|
|
17
21
|
enableHTTPTimings: true,
|
|
18
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AA0DrD,SAAS,iCAAiC;IACxC,IAAI,KAAK,EAAE,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,MAAM,CAA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QAChC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAE5B,0BAA0B,CAAC,MAAM,EAAE;YACjC,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,QAAQ,EAAE,YAAY,CAAC,QAAQ;YAC/B,0BAA0B,EAAE,YAAY,CAAC,0BAA0B;YACnE,uBAAuB,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,uBAAuB,IAAI,iCAAiC,EAAE;SAC5G,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,KAAY,EAAS,EAAE;QAC3C,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,YAAY,EAAE;YACxC,KAAK,CAAC,QAAQ,CAAC,GAAG,mBAAK,UAAU,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,IAAK,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAE,CAAC;SAClF;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK;QACL,YAAY;QACZ,OAAO,EAAE,YAAY;QACrB,KAAK;QACL,eAAe,EAAE,CAAC,KAAa,EAAE,EAAE;YACjC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC;QAC7B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAIF;;GAEG;AACH,MAAM,UAAU,uCAAuC;IACrD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,gCAAgC,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAAC,MAAc;IAC7D,OAAO,MAAM,CAAC,oBAAoB,CAAC,gBAAgB,CAA8C,CAAC;AACpG,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport { instrumentOutgoingRequests } from '@sentry/browser';\nimport type { Client, Event, Integration, StartSpanOptions } from '@sentry/core';\nimport { getClient } from '@sentry/core';\n\nimport { isWeb } from '../utils/environment';\nimport { getDevServer } from './../integrations/debugsymbolicatorutils';\nimport { addDefaultOpForSpanFrom, addThreadInfoToSpan, defaultIdleOptions } from './span';\n\nexport const INTEGRATION_NAME = 'ReactNativeTracing';\n\nexport interface ReactNativeTracingOptions {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n *\n * @default 1_000 (ms)\n */\n idleTimeoutMs?: number;\n\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * @default 60_0000 (ms)\n */\n finalTimeoutMs?: number;\n\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Fetch in React Native is a `whatwg-fetch` polyfill which uses XHR under the hood.\n * This causes duplicates when both `traceFetch` and `traceXHR` are enabled at the same time.\n *\n * @default false\n */\n traceFetch: boolean;\n\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * @default true\n */\n traceXHR: boolean;\n\n /**\n * If true, Sentry will capture http timings and add them to the corresponding http spans.\n *\n * @default true\n */\n enableHTTPTimings: boolean;\n\n /**\n * A callback which is called before a span for a navigation is started.\n * It receives the options passed to `startSpan`, and expects to return an updated options object.\n */\n beforeStartSpan?: (options: StartSpanOptions) => StartSpanOptions;\n\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * @default (url: string) => true\n */\n shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\nfunction getDefaultTracePropagationTargets(): RegExp[] | undefined {\n if (isWeb()) {\n return undefined;\n }\n return [/.*/];\n}\n\nexport const defaultReactNativeTracingOptions: ReactNativeTracingOptions = {\n // Fetch in React Native is a `whatwg-fetch` polyfill which uses XHR under the hood.\n // This causes duplicates when both `traceFetch` and `traceXHR` are enabled at the same time.\n // https://github.com/facebook/react-native/blob/28945c68da056ab2ac01de7e542a845b2bca6096/packages/react-native/Libraries/Network/fetch.js\n // (RN Web uses browsers native fetch implementation)\n traceFetch: isWeb() ? true : false,\n traceXHR: true,\n enableHTTPTimings: true,\n};\n\nexport type ReactNativeTracingState = {\n currentRoute: string | undefined;\n};\n\nexport const reactNativeTracingIntegration = (\n options: Partial<ReactNativeTracingOptions> = {},\n): Integration & {\n options: ReactNativeTracingOptions;\n state: ReactNativeTracingState;\n setCurrentRoute: (route: string) => void;\n} => {\n const state: ReactNativeTracingState = {\n currentRoute: undefined,\n };\n\n const finalOptions = {\n ...defaultReactNativeTracingOptions,\n ...options,\n beforeStartSpan: options.beforeStartSpan ?? ((options: StartSpanOptions) => options),\n finalTimeoutMs: options.finalTimeoutMs ?? defaultIdleOptions.finalTimeout,\n idleTimeoutMs: options.idleTimeoutMs ?? defaultIdleOptions.idleTimeout,\n };\n\n const userShouldCreateSpanForRequest = finalOptions.shouldCreateSpanForRequest;\n\n // Drop Dev Server Spans\n const devServerUrl = getDevServer()?.url;\n const finalShouldCreateSpanForRequest =\n devServerUrl === undefined\n ? userShouldCreateSpanForRequest\n : (url: string): boolean => {\n if (url.startsWith(devServerUrl)) {\n return false;\n }\n if (userShouldCreateSpanForRequest) {\n return userShouldCreateSpanForRequest(url);\n }\n return true;\n };\n\n finalOptions.shouldCreateSpanForRequest = finalShouldCreateSpanForRequest;\n\n const setup = (client: Client): void => {\n addDefaultOpForSpanFrom(client);\n addThreadInfoToSpan(client);\n\n instrumentOutgoingRequests(client, {\n traceFetch: finalOptions.traceFetch,\n traceXHR: finalOptions.traceXHR,\n shouldCreateSpanForRequest: finalOptions.shouldCreateSpanForRequest,\n tracePropagationTargets: client.getOptions().tracePropagationTargets || getDefaultTracePropagationTargets(),\n });\n };\n\n const processEvent = (event: Event): Event => {\n if (event.contexts && state.currentRoute) {\n event.contexts.app = { view_names: [state.currentRoute], ...event.contexts.app };\n }\n return event;\n };\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n options: finalOptions,\n state,\n setCurrentRoute: (route: string) => {\n state.currentRoute = route;\n },\n };\n};\n\nexport type ReactNativeTracingIntegration = ReturnType<typeof reactNativeTracingIntegration>;\n\n/**\n * Returns the current React Native Tracing integration.\n */\nexport function getCurrentReactNativeTracingIntegration(): ReactNativeTracingIntegration | undefined {\n const client = getClient();\n if (!client) {\n return undefined;\n }\n\n return getReactNativeTracingIntegration(client);\n}\n\n/**\n * Returns React Native Tracing integration of given client.\n */\nexport function getReactNativeTracingIntegration(client: Client): ReactNativeTracingIntegration | undefined {\n return client.getIntegrationByName(INTEGRATION_NAME) as ReactNativeTracingIntegration | undefined;\n}\n"]}
|
package/dist/js/version.d.ts
CHANGED
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '6.14.0';\n"]}
|
package/ios/RNSentryReplay.mm
CHANGED
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
@"errorSampleRate" : options[@"replaysOnErrorSampleRate"] ?: [NSNull null],
|
|
28
28
|
@"maskAllImages" : replayOptions[@"maskAllImages"] ?: [NSNull null],
|
|
29
29
|
@"maskAllText" : replayOptions[@"maskAllText"] ?: [NSNull null],
|
|
30
|
-
@"
|
|
31
|
-
?: [NSNull null],
|
|
30
|
+
@"enableViewRendererV2" : replayOptions[@"enableViewRendererV2"] ?: [NSNull null],
|
|
32
31
|
@"enableFastViewRendering" : replayOptions[@"enableFastViewRendering"] ?: [NSNull null],
|
|
33
32
|
@"maskedViewClasses" : [RNSentryReplay getReplayRNRedactClasses:replayOptions],
|
|
34
33
|
@"sdkInfo" :
|
package/ios/RNSentryVersion.m
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
NSString *const NATIVE_SDK_NAME = @"sentry.cocoa.react-native";
|
|
4
4
|
NSString *const REACT_NATIVE_SDK_NAME = @"sentry.javascript.react-native";
|
|
5
5
|
NSString *const REACT_NATIVE_SDK_PACKAGE_NAME = @"npm:@sentry/react-native";
|
|
6
|
-
NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"6.
|
|
6
|
+
NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"6.14.0";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sentry/react-native",
|
|
3
3
|
"homepage": "https://github.com/getsentry/sentry-react-native",
|
|
4
4
|
"repository": "https://github.com/getsentry/sentry-react-native",
|
|
5
|
-
"version": "6.
|
|
5
|
+
"version": "6.14.0",
|
|
6
6
|
"description": "Official Sentry SDK for react-native",
|
|
7
7
|
"typings": "dist/js/index.d.ts",
|
|
8
8
|
"types": "dist/js/index.d.ts",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"react-native": ">=0.65.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@sentry/babel-plugin-component-annotate": "3.
|
|
68
|
+
"@sentry/babel-plugin-component-annotate": "3.4.0",
|
|
69
69
|
"@sentry/browser": "8.54.0",
|
|
70
|
-
"@sentry/cli": "2.
|
|
70
|
+
"@sentry/cli": "2.45.0",
|
|
71
71
|
"@sentry/core": "8.54.0",
|
|
72
72
|
"@sentry/react": "8.54.0",
|
|
73
73
|
"@sentry/types": "8.54.0",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@babel/core": "^7.25.2",
|
|
78
|
-
"@expo/metro-config": "0.
|
|
78
|
+
"@expo/metro-config": "~0.20.0",
|
|
79
79
|
"@mswjs/interceptors": "^0.25.15",
|
|
80
80
|
"@react-native/babel-preset": "0.77.1",
|
|
81
81
|
"@sentry-internal/eslint-config-sdk": "8.54.0",
|
|
82
82
|
"@sentry-internal/eslint-plugin-sdk": "8.54.0",
|
|
83
83
|
"@sentry-internal/typescript": "8.54.0",
|
|
84
|
-
"@sentry/wizard": "4.
|
|
84
|
+
"@sentry/wizard": "4.9.0",
|
|
85
85
|
"@testing-library/react-native": "^12.7.2",
|
|
86
86
|
"@types/jest": "^29.5.13",
|
|
87
87
|
"@types/node": "^20.9.3",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"eslint": "^7.6.0",
|
|
99
99
|
"eslint-plugin-react": "^7.20.6",
|
|
100
100
|
"eslint-plugin-react-native": "^3.8.1",
|
|
101
|
-
"expo": "^
|
|
101
|
+
"expo": "^53.0.0",
|
|
102
102
|
"expo-module-scripts": "3.1.0",
|
|
103
103
|
"jest": "^29.6.2",
|
|
104
104
|
"jest-environment-jsdom": "^29.6.2",
|
|
@@ -44,6 +44,18 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
|
|
|
44
44
|
* @inheritDoc
|
|
45
45
|
*/
|
|
46
46
|
init(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Register a hook on this client.
|
|
49
|
+
*
|
|
50
|
+
* (Generic method signature to allow for custom React Native Client events.)
|
|
51
|
+
*/
|
|
52
|
+
on(hook: string, callback: unknown): () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Emit a hook that was previously registered via `on()`.
|
|
55
|
+
*
|
|
56
|
+
* (Generic method signature to allow for custom React Native Client events.)
|
|
57
|
+
*/
|
|
58
|
+
emit(hook: string, ...rest: unknown[]): void;
|
|
47
59
|
/**
|
|
48
60
|
* Starts native client with dsn and options
|
|
49
61
|
*/
|
|
@@ -2,4 +2,22 @@ import type { Integration } from '@sentry/core';
|
|
|
2
2
|
export declare const OTA_UPDATES_CONTEXT_KEY = "ota_updates";
|
|
3
3
|
/** Load device context from expo modules. */
|
|
4
4
|
export declare const expoContextIntegration: () => Integration;
|
|
5
|
+
/**
|
|
6
|
+
* @internal Exposed for testing purposes
|
|
7
|
+
*/
|
|
8
|
+
export declare function getExpoUpdatesContext(): ExpoUpdatesContext;
|
|
9
|
+
type ExpoUpdatesContext = Partial<{
|
|
10
|
+
is_enabled: boolean;
|
|
11
|
+
is_embedded_launch: boolean;
|
|
12
|
+
is_emergency_launch: boolean;
|
|
13
|
+
is_using_embedded_assets: boolean;
|
|
14
|
+
update_id: string;
|
|
15
|
+
channel: string;
|
|
16
|
+
runtime_version: string;
|
|
17
|
+
check_automatically: string;
|
|
18
|
+
emergency_launch_reason: string;
|
|
19
|
+
launch_duration: number;
|
|
20
|
+
created_at: string;
|
|
21
|
+
}>;
|
|
22
|
+
export {};
|
|
5
23
|
//# sourceMappingURL=expocontext.d.ts.map
|
|
@@ -28,9 +28,22 @@ export interface MobileReplayOptions {
|
|
|
28
28
|
*
|
|
29
29
|
* - Experiment: This is an experimental feature and is therefore disabled by default.
|
|
30
30
|
*
|
|
31
|
-
* @
|
|
31
|
+
* @deprecated Use `enableViewRendererV2` instead.
|
|
32
32
|
*/
|
|
33
33
|
enableExperimentalViewRenderer?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Enables up to 5x faster new view renderer used by the Session Replay integration on iOS.
|
|
36
|
+
*
|
|
37
|
+
* Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing
|
|
38
|
+
* interruptions and visual lag. [Our benchmarks](https://github.com/getsentry/sentry-cocoa/pull/4940) have shown a significant improvement of
|
|
39
|
+
* **up to 4-5x faster rendering** (reducing `~160ms` to `~36ms` per frame) on older devices.
|
|
40
|
+
*
|
|
41
|
+
* - Experiment: In case you are noticing issues with the new view renderer, please report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).
|
|
42
|
+
* Eventually, we will remove this feature flag and use the new view renderer by default.
|
|
43
|
+
*
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
enableViewRendererV2?: boolean;
|
|
34
47
|
/**
|
|
35
48
|
* Enables up to 5x faster but incomplete view rendering used by the Session Replay integration on iOS.
|
|
36
49
|
*
|
|
@@ -18,7 +18,10 @@ export interface ReactNativeTracingOptions {
|
|
|
18
18
|
/**
|
|
19
19
|
* Flag to disable patching all together for fetch requests.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* Fetch in React Native is a `whatwg-fetch` polyfill which uses XHR under the hood.
|
|
22
|
+
* This causes duplicates when both `traceFetch` and `traceXHR` are enabled at the same time.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
22
25
|
*/
|
|
23
26
|
traceFetch: boolean;
|
|
24
27
|
/**
|