@sentry/react-native 7.0.0-beta.2 → 7.0.0-rc.1
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/RNSentryModuleImpl.java +29 -0
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/dist/js/index.d.ts +1 -1
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/options.d.ts +8 -0
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/tracing/span.d.ts.map +1 -1
- package/dist/js/tracing/span.js +6 -0
- package/dist/js/tracing/span.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/ios/RNSentry.h +7 -1
- package/ios/RNSentry.mm +34 -21
- package/ios/RNSentryReplay.mm +4 -0
- package/ios/RNSentryReplayBreadcrumbConverter.h +1 -1
- package/ios/RNSentryReplayBreadcrumbConverter.m +17 -4
- package/ios/RNSentryReplayQuality.h +13 -0
- package/ios/RNSentryReplayQuality.m +25 -0
- package/ios/RNSentryVersion.m +1 -1
- package/ios/SentrySDKWrapper.h +18 -0
- package/ios/SentrySDKWrapper.m +31 -0
- package/package.json +4 -4
- package/scripts/expo-upload-sourcemaps.js +4 -1
- package/scripts/sentry-xcode-debug-files.sh +25 -2
- package/scripts/sentry-xcode.sh +23 -3
- package/sentry.gradle +27 -6
- package/ts3.8/dist/js/index.d.ts +1 -1
- package/ts3.8/dist/js/options.d.ts +8 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
package/RNSentry.podspec
CHANGED
|
@@ -44,7 +44,7 @@ Pod::Spec.new do |s|
|
|
|
44
44
|
|
|
45
45
|
s.compiler_flags = other_cflags
|
|
46
46
|
|
|
47
|
-
s.dependency 'Sentry/HybridSDK', '8.53.
|
|
47
|
+
s.dependency 'Sentry/HybridSDK', '8.53.2'
|
|
48
48
|
|
|
49
49
|
if defined? install_modules_dependencies
|
|
50
50
|
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
|
|
@@ -45,6 +45,7 @@ import io.sentry.SentryExecutorService;
|
|
|
45
45
|
import io.sentry.SentryLevel;
|
|
46
46
|
import io.sentry.SentryOptions;
|
|
47
47
|
import io.sentry.SentryReplayOptions;
|
|
48
|
+
import io.sentry.SentryReplayOptions.SentryReplayQuality;
|
|
48
49
|
import io.sentry.UncaughtExceptionHandlerIntegration;
|
|
49
50
|
import io.sentry.android.core.AndroidLogger;
|
|
50
51
|
import io.sentry.android.core.AndroidProfiler;
|
|
@@ -87,6 +88,7 @@ import java.util.ArrayList;
|
|
|
87
88
|
import java.util.HashMap;
|
|
88
89
|
import java.util.Iterator;
|
|
89
90
|
import java.util.List;
|
|
91
|
+
import java.util.Locale;
|
|
90
92
|
import java.util.Map;
|
|
91
93
|
import java.util.Properties;
|
|
92
94
|
import java.util.Set;
|
|
@@ -381,6 +383,12 @@ public class RNSentryModuleImpl {
|
|
|
381
383
|
? rnOptions.getDouble("replaysOnErrorSampleRate")
|
|
382
384
|
: null);
|
|
383
385
|
|
|
386
|
+
if (rnOptions.hasKey("replaysSessionQuality")) {
|
|
387
|
+
final String qualityString = rnOptions.getString("replaysSessionQuality");
|
|
388
|
+
final SentryReplayQuality quality = parseReplayQuality(qualityString);
|
|
389
|
+
androidReplayOptions.setQuality(quality);
|
|
390
|
+
}
|
|
391
|
+
|
|
384
392
|
if (!rnOptions.hasKey("mobileReplayOptions")) {
|
|
385
393
|
return androidReplayOptions;
|
|
386
394
|
}
|
|
@@ -409,6 +417,27 @@ public class RNSentryModuleImpl {
|
|
|
409
417
|
return androidReplayOptions;
|
|
410
418
|
}
|
|
411
419
|
|
|
420
|
+
private SentryReplayQuality parseReplayQuality(@Nullable String qualityString) {
|
|
421
|
+
if (qualityString == null) {
|
|
422
|
+
return SentryReplayQuality.MEDIUM;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
try {
|
|
426
|
+
switch (qualityString.toLowerCase(Locale.ROOT)) {
|
|
427
|
+
case "low":
|
|
428
|
+
return SentryReplayQuality.LOW;
|
|
429
|
+
case "medium":
|
|
430
|
+
return SentryReplayQuality.MEDIUM;
|
|
431
|
+
case "high":
|
|
432
|
+
return SentryReplayQuality.HIGH;
|
|
433
|
+
default:
|
|
434
|
+
return SentryReplayQuality.MEDIUM;
|
|
435
|
+
}
|
|
436
|
+
} catch (Exception e) {
|
|
437
|
+
return SentryReplayQuality.MEDIUM;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
412
441
|
public void crash() {
|
|
413
442
|
throw new RuntimeException("TEST - Sentry Client Crash (only works in release mode)");
|
|
414
443
|
}
|
|
@@ -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 = "7.0.0-
|
|
5
|
+
static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.0.0-rc.1";
|
|
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/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Breadcrumb, SdkInfo, Event, Exception, SendFeedbackParams, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, UserFeedback, ErrorEvent, TransactionEvent, } from '@sentry/core';
|
|
2
|
-
export { addBreadcrumb, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, lastEventId, } from '@sentry/core';
|
|
2
|
+
export { addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, lastEventId, } from '@sentry/core';
|
|
3
3
|
export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
4
4
|
export { logger, consoleLoggingIntegration, featureFlagsIntegration, type FeatureFlagsIntegration, } from '@sentry/browser';
|
|
5
5
|
export * from './integrations/exports';
|
package/dist/js/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iB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AC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,MAAM,EACN,yBAAyB,EACzB,uBAAuB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,iBAAiB,CAAC;AAEzB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,EACnC,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/js/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { addBreadcrumb, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, lastEventId, } from '@sentry/core';
|
|
1
|
+
export { addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, lastEventId, } from '@sentry/core';
|
|
2
2
|
export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
3
3
|
export { logger, consoleLoggingIntegration, featureFlagsIntegration, } from '@sentry/browser';
|
|
4
4
|
export * from './integrations/exports';
|
package/dist/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,MAAM,EACN,yBAAyB,EACzB,uBAAuB,GAExB,MAAM,iBAAiB,CAAC;AAEzB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,EACnC,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type {\n Breadcrumb,\n SdkInfo,\n Event,\n Exception,\n SendFeedbackParams,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n ErrorEvent,\n TransactionEvent,\n} from '@sentry/core';\n\nexport {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureFeedback,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n getRootSpan,\n withActiveSpan,\n suppressTracing,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n lastEventId,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport {\n logger,\n consoleLoggingIntegration,\n featureFlagsIntegration,\n type FeatureFlagsIntegration,\n} from '@sentry/browser';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, withScope, crashedLastRun } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n createTimeToFullDisplay,\n createTimeToInitialDisplay,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n\nexport { Mask, Unmask } from './replay/CustomMask';\n\nexport { FeedbackButton } from './feedback/FeedbackButton';\nexport { FeedbackWidget } from './feedback/FeedbackWidget';\nexport { showFeedbackWidget, showFeedbackButton, hideFeedbackButton } from './feedback/FeedbackWidgetManager';\n\nexport { getDataFromUri } from './wrapper';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,MAAM,EACN,yBAAyB,EACzB,uBAAuB,GAExB,MAAM,iBAAiB,CAAC;AAEzB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,EACnC,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type {\n Breadcrumb,\n SdkInfo,\n Event,\n Exception,\n SendFeedbackParams,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n ErrorEvent,\n TransactionEvent,\n} from '@sentry/core';\n\nexport {\n addBreadcrumb,\n addIntegration,\n captureException,\n captureEvent,\n captureFeedback,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n getRootSpan,\n withActiveSpan,\n suppressTracing,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n lastEventId,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport {\n logger,\n consoleLoggingIntegration,\n featureFlagsIntegration,\n type FeatureFlagsIntegration,\n} from '@sentry/browser';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, withScope, crashedLastRun } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n createTimeToFullDisplay,\n createTimeToInitialDisplay,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n\nexport { Mask, Unmask } from './replay/CustomMask';\n\nexport { FeedbackButton } from './feedback/FeedbackButton';\nexport { FeedbackWidget } from './feedback/FeedbackWidget';\nexport { showFeedbackWidget, showFeedbackButton, hideFeedbackButton } from './feedback/FeedbackWidgetManager';\n\nexport { getDataFromUri } from './wrapper';\n"]}
|
package/dist/js/options.d.ts
CHANGED
|
@@ -207,6 +207,13 @@ export interface BaseReactNativeOptions {
|
|
|
207
207
|
* problems.
|
|
208
208
|
*/
|
|
209
209
|
shutdownTimeout?: number;
|
|
210
|
+
/**
|
|
211
|
+
* Defines the quality of the session replay. The higher the quality, the more accurate the replay
|
|
212
|
+
* will be, but also more data to transfer and more CPU load.
|
|
213
|
+
*
|
|
214
|
+
* @default 'medium'
|
|
215
|
+
*/
|
|
216
|
+
replaysSessionQuality?: SentryReplayQuality;
|
|
210
217
|
/**
|
|
211
218
|
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
212
219
|
*/
|
|
@@ -243,6 +250,7 @@ export interface BaseReactNativeOptions {
|
|
|
243
250
|
*/
|
|
244
251
|
useThreadsForMessageStack?: boolean;
|
|
245
252
|
}
|
|
253
|
+
export type SentryReplayQuality = 'low' | 'medium' | 'high';
|
|
246
254
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
247
255
|
/**
|
|
248
256
|
* @deprecated use `maxQueueSize` in the root of the SDK options.
|
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,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC3D,KAAK,uBAAuB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE,KAAK,kBAAkB,GAAG,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;AACtE,KAAK,uBAAuB,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,eAAe,CAAC,CAAC;AAExF,MAAM,WAAW,sB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,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,aAAa,CAAC,2BAA2B,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC,EACjF,sBAAsB;CAAG;AAE7B,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;IAEzE,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAiBtE"}
|
package/dist/js/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAqT/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { BrowserOptions, Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { isExpoGo } from './utils/environment';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\ntype BrowserExperiments = NonNullable<BrowserOptions['_experiments']>;\ntype SharedExperimentsSubset = Pick<BrowserExperiments, 'enableLogs' | 'beforeSendLog'>;\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 NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\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. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: 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 * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: 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 appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: SharedExperimentsSubset & {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.\n *\n * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app’s runtime, regardless of the number of C++ modules or how they’re linked. It helps in obtaining accurate stack traces.\n *\n * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.\n *\n * @default false\n */\n enableUnhandledCPPExceptionsV2?: boolean;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n if (isExpoGo()) {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA+T/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { BrowserOptions, Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { isExpoGo } from './utils/environment';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\ntype BrowserExperiments = NonNullable<BrowserOptions['_experiments']>;\ntype SharedExperimentsSubset = Pick<BrowserExperiments, 'enableLogs' | 'beforeSendLog'>;\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 NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\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. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: 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 * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: 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 appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Defines the quality of the session replay. The higher the quality, the more accurate the replay\n * will be, but also more data to transfer and more CPU load.\n *\n * @default 'medium'\n */\n replaysSessionQuality?: SentryReplayQuality;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: SharedExperimentsSubset & {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.\n *\n * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app’s runtime, regardless of the number of C++ modules or how they’re linked. It helps in obtaining accurate stack traces.\n *\n * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.\n *\n * @default false\n */\n enableUnhandledCPPExceptionsV2?: boolean;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport type SentryReplayQuality = 'low' | 'medium' | 'high';\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n if (isExpoGo()) {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":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C;AAC5C,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAExD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAMxD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAI9D"}
|
package/dist/js/tracing/span.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { generateTraceId, getActiveSpan, getClient, getCurrentScope, logger, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SentryNonRecordingSpan, SPAN_STATUS_ERROR, spanToJSON, startIdleSpan as coreStartIdleSpan, } from '@sentry/core';
|
|
2
|
+
import { AppState } from 'react-native';
|
|
2
3
|
import { isRootSpan } from '../utils/span';
|
|
3
4
|
import { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';
|
|
4
5
|
import { SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM, SPAN_ORIGIN_MANUAL_INTERACTION, } from './origin';
|
|
@@ -40,6 +41,11 @@ export const startIdleSpan = (startSpanOption, { finalTimeout, idleTimeout }) =>
|
|
|
40
41
|
logger.warn("[startIdleSpan] Can't create idle span, missing client.");
|
|
41
42
|
return new SentryNonRecordingSpan();
|
|
42
43
|
}
|
|
44
|
+
const currentAppState = AppState.currentState;
|
|
45
|
+
if (currentAppState === 'background') {
|
|
46
|
+
logger.debug(`[startIdleSpan] App is already in background, not starting span for ${startSpanOption.name}`);
|
|
47
|
+
return new SentryNonRecordingSpan();
|
|
48
|
+
}
|
|
43
49
|
getCurrentScope().setPropagationContext({ traceId: generateTraceId(), sampleRand: Math.random() });
|
|
44
50
|
const span = coreStartIdleSpan(startSpanOption, { finalTimeout, idleTimeout });
|
|
45
51
|
cancelInBackground(client, span);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.js","sourceRoot":"","sources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AAC,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,qBAAqB,CAAC;IACxD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { Client, Scope, Span, SpanJSON, StartSpanOptions } from '@sentry/core';\nimport {\n generateTraceId,\n getActiveSpan,\n getClient,\n getCurrentScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n SPAN_STATUS_ERROR,\n spanToJSON,\n startIdleSpan as coreStartIdleSpan,\n} from '@sentry/core';\nimport { isRootSpan } from '../utils/span';\nimport { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';\nimport {\n SPAN_ORIGIN_AUTO_INTERACTION,\n SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM,\n SPAN_ORIGIN_MANUAL_INTERACTION,\n} from './origin';\n\nexport const DEFAULT_NAVIGATION_SPAN_NAME = 'Route Change';\n\nexport const defaultIdleOptions: {\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 finalTimeout: 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 idleTimeout: number;\n} = {\n idleTimeout: 1_000,\n finalTimeout: 60_0000,\n};\n\nexport const startIdleNavigationSpan = (\n startSpanOption: StartSpanOptions,\n {\n finalTimeout = defaultIdleOptions.finalTimeout,\n idleTimeout = defaultIdleOptions.idleTimeout,\n }: Partial<typeof defaultIdleOptions> = {},\n): Span | undefined => {\n const client = getClient();\n if (!client) {\n logger.warn(\"[startIdleNavigationSpan] Can't create route change span, missing client.\");\n return undefined;\n }\n\n const activeSpan = getActiveSpan();\n clearActiveSpanFromScope(getCurrentScope());\n if (activeSpan && isRootSpan(activeSpan) && isSentryInteractionSpan(activeSpan)) {\n logger.log(\n `[startIdleNavigationSpan] Canceling ${\n spanToJSON(activeSpan).op\n } transaction because of a new navigation root span.`,\n );\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n activeSpan.end();\n }\n\n const finalStartSpanOptions = {\n ...getDefaultIdleNavigationSpanOptions(),\n ...startSpanOption,\n };\n\n const idleSpan = startIdleSpan(finalStartSpanOptions, { finalTimeout, idleTimeout });\n logger.log(\n `[startIdleNavigationSpan] Starting ${finalStartSpanOptions.op || 'unknown op'} transaction \"${\n finalStartSpanOptions.name\n }\" on scope`,\n );\n\n adjustTransactionDuration(client, idleSpan, finalTimeout);\n\n idleSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM);\n return idleSpan;\n};\n\n/**\n * Starts an idle span from `@sentry/core` with React Native application\n * context awareness.\n *\n * - Span will be started with new propagation context.\n * - Span will be canceled if the app goes to background.\n */\nexport const startIdleSpan = (\n startSpanOption: StartSpanOptions,\n { finalTimeout, idleTimeout }: { finalTimeout: number | undefined; idleTimeout: number | undefined },\n): Span => {\n const client = getClient();\n if (!client) {\n logger.warn(\"[startIdleSpan] Can't create idle span, missing client.\");\n return new SentryNonRecordingSpan();\n }\n\n getCurrentScope().setPropagationContext({ traceId: generateTraceId(), sampleRand: Math.random() });\n\n const span = coreStartIdleSpan(startSpanOption, { finalTimeout, idleTimeout });\n cancelInBackground(client, span);\n return span;\n};\n\n/**\n * Returns the default options for the idle navigation span.\n */\nexport function getDefaultIdleNavigationSpanOptions(): StartSpanOptions {\n return {\n name: DEFAULT_NAVIGATION_SPAN_NAME,\n op: 'navigation',\n forceTransaction: true,\n scope: getCurrentScope(),\n };\n}\n\n/**\n * Checks if the span is a Sentry User Interaction span.\n */\nexport function isSentryInteractionSpan(span: Span): boolean {\n return [SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_MANUAL_INTERACTION].includes(spanToJSON(span).origin || '');\n}\n\nexport const SCOPE_SPAN_FIELD = '_sentrySpan';\n\nexport type ScopeWithMaybeSpan = Scope & {\n [SCOPE_SPAN_FIELD]?: Span;\n};\n\n/**\n * Removes the active span from the scope.\n */\nexport function clearActiveSpanFromScope(scope: ScopeWithMaybeSpan): void {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete scope[SCOPE_SPAN_FIELD];\n}\n\n/**\n * Ensures that all created spans have an operation name.\n */\nexport function addDefaultOpForSpanFrom(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).op) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'default');\n }\n });\n}\n\nexport const SPAN_THREAD_NAME = 'thread.name';\nexport const SPAN_THREAD_NAME_MAIN = 'main';\nexport const SPAN_THREAD_NAME_JAVASCRIPT = 'javascript';\n\n/**\n * Adds Javascript thread info to spans.\n * Ref: https://reactnative.dev/architecture/threading-model\n */\nexport function addThreadInfoToSpan(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).data?.[SPAN_THREAD_NAME]) {\n span.setAttribute(SPAN_THREAD_NAME, SPAN_THREAD_NAME_JAVASCRIPT);\n }\n });\n}\n\n/**\n * Sets the Main thread info to the span.\n */\nexport function setMainThreadInfo(spanJSON: SpanJSON): SpanJSON {\n spanJSON.data = spanJSON.data || {};\n spanJSON.data[SPAN_THREAD_NAME] = SPAN_THREAD_NAME_MAIN;\n return spanJSON;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,eAAe,EACf,MAAM,EACN,4BAA4B,EAC5B,gCAAgC,EAChC,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,aAAa,IAAI,iBAAiB,GACnC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc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AI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,qBAAqB,CAAC;IACxD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { Client, Scope, Span, SpanJSON, StartSpanOptions } from '@sentry/core';\nimport {\n generateTraceId,\n getActiveSpan,\n getClient,\n getCurrentScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n SPAN_STATUS_ERROR,\n spanToJSON,\n startIdleSpan as coreStartIdleSpan,\n} from '@sentry/core';\nimport { AppState } from 'react-native';\nimport { isRootSpan } from '../utils/span';\nimport { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';\nimport {\n SPAN_ORIGIN_AUTO_INTERACTION,\n SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM,\n SPAN_ORIGIN_MANUAL_INTERACTION,\n} from './origin';\n\nexport const DEFAULT_NAVIGATION_SPAN_NAME = 'Route Change';\n\nexport const defaultIdleOptions: {\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 finalTimeout: 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 idleTimeout: number;\n} = {\n idleTimeout: 1_000,\n finalTimeout: 60_0000,\n};\n\nexport const startIdleNavigationSpan = (\n startSpanOption: StartSpanOptions,\n {\n finalTimeout = defaultIdleOptions.finalTimeout,\n idleTimeout = defaultIdleOptions.idleTimeout,\n }: Partial<typeof defaultIdleOptions> = {},\n): Span | undefined => {\n const client = getClient();\n if (!client) {\n logger.warn(\"[startIdleNavigationSpan] Can't create route change span, missing client.\");\n return undefined;\n }\n\n const activeSpan = getActiveSpan();\n clearActiveSpanFromScope(getCurrentScope());\n if (activeSpan && isRootSpan(activeSpan) && isSentryInteractionSpan(activeSpan)) {\n logger.log(\n `[startIdleNavigationSpan] Canceling ${\n spanToJSON(activeSpan).op\n } transaction because of a new navigation root span.`,\n );\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n activeSpan.end();\n }\n\n const finalStartSpanOptions = {\n ...getDefaultIdleNavigationSpanOptions(),\n ...startSpanOption,\n };\n\n const idleSpan = startIdleSpan(finalStartSpanOptions, { finalTimeout, idleTimeout });\n logger.log(\n `[startIdleNavigationSpan] Starting ${finalStartSpanOptions.op || 'unknown op'} transaction \"${\n finalStartSpanOptions.name\n }\" on scope`,\n );\n\n adjustTransactionDuration(client, idleSpan, finalTimeout);\n\n idleSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM);\n return idleSpan;\n};\n\n/**\n * Starts an idle span from `@sentry/core` with React Native application\n * context awareness.\n *\n * - Span will be started with new propagation context.\n * - Span will be canceled if the app goes to background.\n */\nexport const startIdleSpan = (\n startSpanOption: StartSpanOptions,\n { finalTimeout, idleTimeout }: { finalTimeout: number | undefined; idleTimeout: number | undefined },\n): Span => {\n const client = getClient();\n if (!client) {\n logger.warn(\"[startIdleSpan] Can't create idle span, missing client.\");\n return new SentryNonRecordingSpan();\n }\n\n const currentAppState = AppState.currentState;\n if (currentAppState === 'background') {\n logger.debug(`[startIdleSpan] App is already in background, not starting span for ${startSpanOption.name}`);\n return new SentryNonRecordingSpan();\n }\n\n getCurrentScope().setPropagationContext({ traceId: generateTraceId(), sampleRand: Math.random() });\n\n const span = coreStartIdleSpan(startSpanOption, { finalTimeout, idleTimeout });\n cancelInBackground(client, span);\n return span;\n};\n\n/**\n * Returns the default options for the idle navigation span.\n */\nexport function getDefaultIdleNavigationSpanOptions(): StartSpanOptions {\n return {\n name: DEFAULT_NAVIGATION_SPAN_NAME,\n op: 'navigation',\n forceTransaction: true,\n scope: getCurrentScope(),\n };\n}\n\n/**\n * Checks if the span is a Sentry User Interaction span.\n */\nexport function isSentryInteractionSpan(span: Span): boolean {\n return [SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_MANUAL_INTERACTION].includes(spanToJSON(span).origin || '');\n}\n\nexport const SCOPE_SPAN_FIELD = '_sentrySpan';\n\nexport type ScopeWithMaybeSpan = Scope & {\n [SCOPE_SPAN_FIELD]?: Span;\n};\n\n/**\n * Removes the active span from the scope.\n */\nexport function clearActiveSpanFromScope(scope: ScopeWithMaybeSpan): void {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete scope[SCOPE_SPAN_FIELD];\n}\n\n/**\n * Ensures that all created spans have an operation name.\n */\nexport function addDefaultOpForSpanFrom(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).op) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'default');\n }\n });\n}\n\nexport const SPAN_THREAD_NAME = 'thread.name';\nexport const SPAN_THREAD_NAME_MAIN = 'main';\nexport const SPAN_THREAD_NAME_JAVASCRIPT = 'javascript';\n\n/**\n * Adds Javascript thread info to spans.\n * Ref: https://reactnative.dev/architecture/threading-model\n */\nexport function addThreadInfoToSpan(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).data?.[SPAN_THREAD_NAME]) {\n span.setAttribute(SPAN_THREAD_NAME, SPAN_THREAD_NAME_JAVASCRIPT);\n }\n });\n}\n\n/**\n * Sets the Main thread info to the span.\n */\nexport function setMainThreadInfo(spanJSON: SpanJSON): SpanJSON {\n spanJSON.data = spanJSON.data || {};\n spanJSON.data[SPAN_THREAD_NAME] = SPAN_THREAD_NAME_MAIN;\n return spanJSON;\n}\n"]}
|
package/dist/js/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
|
|
2
2
|
export declare const SDK_NAME = "sentry.javascript.react-native";
|
|
3
|
-
export declare const SDK_VERSION = "7.0.0-
|
|
3
|
+
export declare const SDK_VERSION = "7.0.0-rc.1";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/js/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,eAAe,CAAC"}
|
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,
|
|
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,YAAY,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.0.0-rc.1';\n"]}
|
package/ios/RNSentry.h
CHANGED
|
@@ -9,12 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
#import <Sentry/Sentry.h>
|
|
11
11
|
#import <Sentry/SentryDebugImageProvider.h>
|
|
12
|
-
#import <Sentry/SentryOptions.h>
|
|
13
12
|
|
|
14
13
|
typedef int (*SymbolicateCallbackType)(const void *, Dl_info *);
|
|
15
14
|
|
|
15
|
+
@class SentryOptions;
|
|
16
|
+
@class SentryEvent;
|
|
17
|
+
|
|
18
|
+
#if CROSS_PLATFORM_TEST
|
|
19
|
+
@interface SentrySDKInternal : NSObject
|
|
20
|
+
#else
|
|
16
21
|
@interface
|
|
17
22
|
SentrySDK (Private)
|
|
23
|
+
#endif
|
|
18
24
|
@property (nonatomic, nullable, readonly, class) SentryOptions *options;
|
|
19
25
|
@end
|
|
20
26
|
|
package/ios/RNSentry.mm
CHANGED
|
@@ -21,10 +21,22 @@
|
|
|
21
21
|
#import <Sentry/PrivateSentrySDKOnly.h>
|
|
22
22
|
#import <Sentry/SentryAppStartMeasurement.h>
|
|
23
23
|
#import <Sentry/SentryBinaryImageCache.h>
|
|
24
|
+
#import <Sentry/SentryBreadcrumb.h>
|
|
24
25
|
#import <Sentry/SentryDebugImageProvider+HybridSDKs.h>
|
|
26
|
+
#import <Sentry/SentryDebugMeta.h>
|
|
25
27
|
#import <Sentry/SentryDependencyContainer.h>
|
|
28
|
+
#import <Sentry/SentryEvent.h>
|
|
29
|
+
#import <Sentry/SentryException.h>
|
|
26
30
|
#import <Sentry/SentryFormatter.h>
|
|
27
|
-
#import <Sentry/SentryOptions
|
|
31
|
+
#import <Sentry/SentryOptions.h>
|
|
32
|
+
#import <Sentry/SentryUser.h>
|
|
33
|
+
#if __has_include(<Sentry/SentryOptions+HybridSDKs.h>)
|
|
34
|
+
# define USE_SENTRY_OPTIONS 1
|
|
35
|
+
# import <Sentry/SentryOptions+HybridSDKs.h>
|
|
36
|
+
#else
|
|
37
|
+
# define USE_SENTRY_OPTIONS 0
|
|
38
|
+
# import <Sentry/SentryOptionsInternal.h>
|
|
39
|
+
#endif
|
|
28
40
|
#import <Sentry/SentryScreenFrames.h>
|
|
29
41
|
|
|
30
42
|
// This guard prevents importing Hermes in JSC apps
|
|
@@ -51,15 +63,7 @@
|
|
|
51
63
|
|
|
52
64
|
#import "RNSentryExperimentalOptions.h"
|
|
53
65
|
#import "RNSentryVersion.h"
|
|
54
|
-
|
|
55
|
-
@interface
|
|
56
|
-
SentrySDK (RNSentry)
|
|
57
|
-
|
|
58
|
-
+ (void)captureEnvelope:(SentryEnvelope *)envelope;
|
|
59
|
-
|
|
60
|
-
+ (void)storeEnvelope:(SentryEnvelope *)envelope;
|
|
61
|
-
|
|
62
|
-
@end
|
|
66
|
+
#import "SentrySDKWrapper.h"
|
|
63
67
|
|
|
64
68
|
static bool hasFetchedAppStart;
|
|
65
69
|
|
|
@@ -107,7 +111,7 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
107
111
|
[PrivateSentrySDKOnly addSdkPackage:REACT_NATIVE_SDK_PACKAGE_NAME
|
|
108
112
|
version:REACT_NATIVE_SDK_PACKAGE_VERSION];
|
|
109
113
|
|
|
110
|
-
[
|
|
114
|
+
[SentrySDKWrapper startWithOptions:sentryOptions];
|
|
111
115
|
|
|
112
116
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
113
117
|
BOOL appIsActive =
|
|
@@ -243,8 +247,13 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
243
247
|
[RNSentryReplay updateOptions:mutableOptions];
|
|
244
248
|
#endif
|
|
245
249
|
|
|
250
|
+
#if USE_SENTRY_OPTIONS
|
|
246
251
|
SentryOptions *sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions
|
|
247
252
|
didFailWithError:errorPointer];
|
|
253
|
+
#else
|
|
254
|
+
SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions
|
|
255
|
+
didFailWithError:errorPointer];
|
|
256
|
+
#endif
|
|
248
257
|
if (*errorPointer != nil) {
|
|
249
258
|
return nil;
|
|
250
259
|
}
|
|
@@ -432,7 +441,11 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, fetchNativePackageName)
|
|
|
432
441
|
- (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAddr
|
|
433
442
|
symbolicate:(SymbolicateCallbackType)symbolicate
|
|
434
443
|
{
|
|
444
|
+
#if CROSS_PLATFORM_TEST
|
|
445
|
+
BOOL shouldSymbolicateLocally = [SentrySDKInternal.options debug];
|
|
446
|
+
#else
|
|
435
447
|
BOOL shouldSymbolicateLocally = [SentrySDK.options debug];
|
|
448
|
+
#endif
|
|
436
449
|
NSString *appPackageName = [[NSBundle mainBundle] executablePath];
|
|
437
450
|
|
|
438
451
|
NSMutableSet<NSString *> *_Nonnull imagesAddrToRetrieveDebugMetaImages =
|
|
@@ -520,7 +533,7 @@ RCT_EXPORT_METHOD(fetchNativeDeviceContexts
|
|
|
520
533
|
__block NSMutableDictionary<NSString *, id> *serializedScope;
|
|
521
534
|
// Temp work around until sorted out this API in sentry-cocoa.
|
|
522
535
|
// TODO: If the callback isnt' executed the promise wouldn't be resolved.
|
|
523
|
-
[
|
|
536
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
524
537
|
serializedScope = [[scope serialize] mutableCopy];
|
|
525
538
|
|
|
526
539
|
NSDictionary<NSString *, id> *user = [serializedScope valueForKey:@"user"];
|
|
@@ -724,7 +737,7 @@ RCT_EXPORT_METHOD(fetchViewHierarchy
|
|
|
724
737
|
|
|
725
738
|
RCT_EXPORT_METHOD(setUser : (NSDictionary *)userKeys otherUserKeys : (NSDictionary *)userDataKeys)
|
|
726
739
|
{
|
|
727
|
-
[
|
|
740
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
728
741
|
[scope setUser:[RNSentry userFrom:userKeys otherUserKeys:userDataKeys]];
|
|
729
742
|
}];
|
|
730
743
|
}
|
|
@@ -773,7 +786,7 @@ RCT_EXPORT_METHOD(setUser : (NSDictionary *)userKeys otherUserKeys : (NSDictiona
|
|
|
773
786
|
|
|
774
787
|
RCT_EXPORT_METHOD(addBreadcrumb : (NSDictionary *)breadcrumb)
|
|
775
788
|
{
|
|
776
|
-
[
|
|
789
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
777
790
|
[scope addBreadcrumb:[RNSentryBreadcrumb from:breadcrumb]];
|
|
778
791
|
}];
|
|
779
792
|
|
|
@@ -787,12 +800,12 @@ RCT_EXPORT_METHOD(addBreadcrumb : (NSDictionary *)breadcrumb)
|
|
|
787
800
|
|
|
788
801
|
RCT_EXPORT_METHOD(clearBreadcrumbs)
|
|
789
802
|
{
|
|
790
|
-
[
|
|
803
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs]; }];
|
|
791
804
|
}
|
|
792
805
|
|
|
793
806
|
RCT_EXPORT_METHOD(setExtra : (NSString *)key extra : (NSString *)extra)
|
|
794
807
|
{
|
|
795
|
-
[
|
|
808
|
+
[SentrySDKWrapper
|
|
796
809
|
configureScope:^(SentryScope *_Nonnull scope) { [scope setExtraValue:extra forKey:key]; }];
|
|
797
810
|
}
|
|
798
811
|
|
|
@@ -802,7 +815,7 @@ RCT_EXPORT_METHOD(setContext : (NSString *)key context : (NSDictionary *)context
|
|
|
802
815
|
return;
|
|
803
816
|
}
|
|
804
817
|
|
|
805
|
-
[
|
|
818
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
806
819
|
if (context == nil) {
|
|
807
820
|
[scope removeContextForKey:key];
|
|
808
821
|
} else {
|
|
@@ -813,17 +826,17 @@ RCT_EXPORT_METHOD(setContext : (NSString *)key context : (NSDictionary *)context
|
|
|
813
826
|
|
|
814
827
|
RCT_EXPORT_METHOD(setTag : (NSString *)key value : (NSString *)value)
|
|
815
828
|
{
|
|
816
|
-
[
|
|
829
|
+
[SentrySDKWrapper
|
|
817
830
|
configureScope:^(SentryScope *_Nonnull scope) { [scope setTagValue:value forKey:key]; }];
|
|
818
831
|
}
|
|
819
832
|
|
|
820
|
-
RCT_EXPORT_METHOD(crash) { [
|
|
833
|
+
RCT_EXPORT_METHOD(crash) { [SentrySDKWrapper crash]; }
|
|
821
834
|
|
|
822
835
|
RCT_EXPORT_METHOD(closeNativeSdk
|
|
823
836
|
: (RCTPromiseResolveBlock)resolve rejecter
|
|
824
837
|
: (RCTPromiseRejectBlock)reject)
|
|
825
838
|
{
|
|
826
|
-
[
|
|
839
|
+
[SentrySDKWrapper close];
|
|
827
840
|
resolve(@YES);
|
|
828
841
|
}
|
|
829
842
|
|
|
@@ -1026,7 +1039,7 @@ RCT_EXPORT_METHOD(crashedLastRun
|
|
|
1026
1039
|
: (RCTPromiseResolveBlock)resolve rejecter
|
|
1027
1040
|
: (RCTPromiseRejectBlock)reject)
|
|
1028
1041
|
{
|
|
1029
|
-
resolve(@([
|
|
1042
|
+
resolve(@([SentrySDKWrapper crashedLastRun]));
|
|
1030
1043
|
}
|
|
1031
1044
|
|
|
1032
1045
|
// Thanks to this guard, we won't compile this code when we build for the old architecture.
|
package/ios/RNSentryReplay.mm
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#import "RNSentryReplay.h"
|
|
2
2
|
#import "RNSentryReplayBreadcrumbConverterHelper.h"
|
|
3
|
+
#import "RNSentryReplayQuality.h"
|
|
3
4
|
#import "RNSentryVersion.h"
|
|
4
5
|
#import "React/RCTTextView.h"
|
|
5
6
|
#import "Replay/RNSentryReplayMask.h"
|
|
@@ -22,9 +23,12 @@
|
|
|
22
23
|
NSLog(@"Setting up session replay");
|
|
23
24
|
NSDictionary *replayOptions = options[@"mobileReplayOptions"] ?: @{};
|
|
24
25
|
|
|
26
|
+
NSString *qualityString = options[@"replaysSessionQuality"];
|
|
27
|
+
|
|
25
28
|
[options setValue:@{
|
|
26
29
|
@"sessionSampleRate" : options[@"replaysSessionSampleRate"] ?: [NSNull null],
|
|
27
30
|
@"errorSampleRate" : options[@"replaysOnErrorSampleRate"] ?: [NSNull null],
|
|
31
|
+
@"quality" : @([RNSentryReplayQuality parseReplayQuality:qualityString]),
|
|
28
32
|
@"maskAllImages" : replayOptions[@"maskAllImages"] ?: [NSNull null],
|
|
29
33
|
@"maskAllText" : replayOptions[@"maskAllText"] ?: [NSNull null],
|
|
30
34
|
@"enableViewRendererV2" : replayOptions[@"enableViewRendererV2"] ?: [NSNull null],
|
|
@@ -50,10 +50,23 @@
|
|
|
50
50
|
SentryRRWebEvent *nativeBreadcrumb = [self->defaultConverter convertFrom:breadcrumb];
|
|
51
51
|
|
|
52
52
|
// ignore native navigation breadcrumbs
|
|
53
|
-
if (nativeBreadcrumb
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (nativeBreadcrumb) {
|
|
54
|
+
@try {
|
|
55
|
+
id data = [nativeBreadcrumb valueForKey:@"data"];
|
|
56
|
+
if (data && [data isKindOfClass:[NSDictionary class]]) {
|
|
57
|
+
NSDictionary *dataDict = (NSDictionary *)data;
|
|
58
|
+
id payload = dataDict[@"payload"];
|
|
59
|
+
if (payload && [payload isKindOfClass:[NSDictionary class]]) {
|
|
60
|
+
NSDictionary *payloadDict = (NSDictionary *)payload;
|
|
61
|
+
NSString *category = payloadDict[@"category"];
|
|
62
|
+
if ([category isEqualToString:@"navigation"]) {
|
|
63
|
+
return nil;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} @catch (NSException *exception) {
|
|
68
|
+
// Just continue without ignoring native navigation breadcrumbs
|
|
69
|
+
}
|
|
57
70
|
}
|
|
58
71
|
|
|
59
72
|
return nativeBreadcrumb;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
|
|
5
|
+
typedef NS_ENUM(NSInteger, SentryReplayQuality);
|
|
6
|
+
|
|
7
|
+
@interface RNSentryReplayQuality : NSObject
|
|
8
|
+
|
|
9
|
+
+ (SentryReplayQuality)parseReplayQuality:(NSString *_Nullable)qualityString;
|
|
10
|
+
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#import "RNSentryReplayQuality.h"
|
|
2
|
+
@import Sentry;
|
|
3
|
+
|
|
4
|
+
@implementation RNSentryReplayQuality
|
|
5
|
+
|
|
6
|
+
+ (SentryReplayQuality)parseReplayQuality:(NSString *_Nullable)qualityString
|
|
7
|
+
{
|
|
8
|
+
if (qualityString == nil) {
|
|
9
|
+
return SentryReplayQualityMedium;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
NSString *lowercaseQuality = [qualityString lowercaseString];
|
|
13
|
+
|
|
14
|
+
if ([lowercaseQuality isEqualToString:@"low"]) {
|
|
15
|
+
return SentryReplayQualityLow;
|
|
16
|
+
} else if ([lowercaseQuality isEqualToString:@"medium"]) {
|
|
17
|
+
return SentryReplayQualityMedium;
|
|
18
|
+
} else if ([lowercaseQuality isEqualToString:@"high"]) {
|
|
19
|
+
return SentryReplayQualityHigh;
|
|
20
|
+
} else {
|
|
21
|
+
return SentryReplayQualityMedium;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@end
|
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 = @"7.0.0-
|
|
6
|
+
NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.0.0-rc.1";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
@class SentryOptions;
|
|
4
|
+
@class SentryScope;
|
|
5
|
+
|
|
6
|
+
@interface SentrySDKWrapper : NSObject
|
|
7
|
+
|
|
8
|
+
+ (void)configureScope:(void (^)(SentryScope *scope))callback;
|
|
9
|
+
|
|
10
|
+
+ (void)crash;
|
|
11
|
+
|
|
12
|
+
+ (void)close;
|
|
13
|
+
|
|
14
|
+
+ (BOOL)crashedLastRun;
|
|
15
|
+
|
|
16
|
+
+ (void)startWithOptions:(SentryOptions *)options;
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#import "SentrySDKWrapper.h"
|
|
2
|
+
@import Sentry;
|
|
3
|
+
|
|
4
|
+
@implementation SentrySDKWrapper
|
|
5
|
+
|
|
6
|
+
+ (void)startWithOptions:(SentryOptions *)options
|
|
7
|
+
{
|
|
8
|
+
[SentrySDK startWithOptions:options];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
+ (void)crash
|
|
12
|
+
{
|
|
13
|
+
[SentrySDK crash];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
+ (void)close
|
|
17
|
+
{
|
|
18
|
+
[SentrySDK close];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
+ (BOOL)crashedLastRun
|
|
22
|
+
{
|
|
23
|
+
return [SentrySDK crashedLastRun];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+ (void)configureScope:(void (^)(SentryScope *scope))callback
|
|
27
|
+
{
|
|
28
|
+
[SentrySDK configureScope:callback];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@end
|
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": "7.0.0-
|
|
5
|
+
"version": "7.0.0-rc.1",
|
|
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": "
|
|
68
|
+
"@sentry/babel-plugin-component-annotate": "4.0.2",
|
|
69
69
|
"@sentry/browser": "9.22.0",
|
|
70
|
-
"@sentry/cli": "2.
|
|
70
|
+
"@sentry/cli": "2.50.2",
|
|
71
71
|
"@sentry/core": "9.22.0",
|
|
72
72
|
"@sentry/react": "9.22.0",
|
|
73
73
|
"@sentry/types": "9.22.0"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@sentry-internal/eslint-config-sdk": "9.22.0",
|
|
81
81
|
"@sentry-internal/eslint-plugin-sdk": "9.22.0",
|
|
82
82
|
"@sentry-internal/typescript": "9.22.0",
|
|
83
|
-
"@sentry/wizard": "
|
|
83
|
+
"@sentry/wizard": "6.1.0",
|
|
84
84
|
"@testing-library/react-native": "^12.7.2",
|
|
85
85
|
"@types/jest": "^29.5.13",
|
|
86
86
|
"@types/node": "^20.9.3",
|
|
@@ -129,7 +129,10 @@ try {
|
|
|
129
129
|
console.warn(error);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
const sentryBuildPluginPath = path.join(projectRoot, '.env.sentry-build-plugin');
|
|
133
|
+
if (fs.existsSync(sentryBuildPluginPath)) {
|
|
134
|
+
loadDotenv();
|
|
135
|
+
}
|
|
133
136
|
|
|
134
137
|
let sentryOrg = getEnvVar(SENTRY_ORG);
|
|
135
138
|
let sentryUrl = getEnvVar(SENTRY_URL);
|
|
@@ -24,10 +24,33 @@ LOCAL_NODE_BINARY=${NODE_BINARY:-node}
|
|
|
24
24
|
RN_PROJECT_ROOT="${PROJECT_DIR}/.."
|
|
25
25
|
|
|
26
26
|
[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
|
|
27
|
-
[ -z "$SENTRY_DOTENV_PATH" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
|
|
27
|
+
[ -z "$SENTRY_DOTENV_PATH" ] && [ -f "$RN_PROJECT_ROOT/.env.sentry-build-plugin" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
|
|
28
28
|
|
|
29
29
|
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
|
|
30
|
-
[ -z "$
|
|
30
|
+
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
|
|
31
|
+
|
|
32
|
+
if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
|
|
33
|
+
# Try standard resolution safely
|
|
34
|
+
RESOLVED_PATH=$(
|
|
35
|
+
"$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))" 2>/dev/null
|
|
36
|
+
) || true
|
|
37
|
+
if [ -n "$RESOLVED_PATH" ]; then
|
|
38
|
+
SENTRY_CLI_PACKAGE_PATH="$RESOLVED_PATH/bin/sentry-cli"
|
|
39
|
+
else
|
|
40
|
+
# Fallback: parse NODE_PATH from the .bin/sentry-cli shim (file generated by PNPM)
|
|
41
|
+
PNPM_BIN_PATH="$PWD/../node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"
|
|
42
|
+
|
|
43
|
+
if [ -f "$PNPM_BIN_PATH" ]; then
|
|
44
|
+
CLI_FILE_TEXT=$(cat "$PNPM_BIN_PATH")
|
|
45
|
+
|
|
46
|
+
# Filter where PNPM stored Sentry CLI
|
|
47
|
+
NODE_PATH_LINE=$(echo "$CLI_FILE_TEXT" | grep -oE 'NODE_PATH="[^"]+"' | head -n1)
|
|
48
|
+
NODE_PATH_VALUE=$(echo "$NODE_PATH_LINE" | sed -E 's/^NODE_PATH="([^"]+)".*/\1/')
|
|
49
|
+
SENTRY_CLI_PACKAGE_PATH=${NODE_PATH_VALUE%%/bin*}
|
|
50
|
+
fi
|
|
51
|
+
fi
|
|
52
|
+
fi
|
|
53
|
+
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="$SENTRY_CLI_PACKAGE_PATH"
|
|
31
54
|
|
|
32
55
|
[[ $SENTRY_INCLUDE_NATIVE_SOURCES == "true" ]] && INCLUDE_SOURCES_FLAG="--include-sources" || INCLUDE_SOURCES_FLAG=""
|
|
33
56
|
|
package/scripts/sentry-xcode.sh
CHANGED
|
@@ -13,11 +13,31 @@ LOCAL_NODE_BINARY=${NODE_BINARY:-node}
|
|
|
13
13
|
RN_PROJECT_ROOT="${PROJECT_DIR}/.."
|
|
14
14
|
|
|
15
15
|
[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
|
|
16
|
-
[ -z "$SENTRY_DOTENV_PATH" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
|
|
16
|
+
[ -z "$SENTRY_DOTENV_PATH" ] && [ -f "$RN_PROJECT_ROOT/.env.sentry-build-plugin" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
|
|
17
17
|
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
|
|
18
18
|
|
|
19
|
-
[ -z "$SENTRY_CLI_EXECUTABLE" ]
|
|
20
|
-
|
|
19
|
+
if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
|
|
20
|
+
# Try standard resolution safely
|
|
21
|
+
RESOLVED_PATH=$(
|
|
22
|
+
"$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))" 2>/dev/null
|
|
23
|
+
) || true
|
|
24
|
+
if [ -n "$RESOLVED_PATH" ]; then
|
|
25
|
+
SENTRY_CLI_PACKAGE_PATH="$RESOLVED_PATH/bin/sentry-cli"
|
|
26
|
+
else
|
|
27
|
+
# Fallback: parse NODE_PATH from the .bin/sentry-cli shim (file generated by PNPM)
|
|
28
|
+
PNPM_BIN_PATH="$PWD/../node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"
|
|
29
|
+
|
|
30
|
+
if [ -f "$PNPM_BIN_PATH" ]; then
|
|
31
|
+
CLI_FILE_TEXT=$(cat "$PNPM_BIN_PATH")
|
|
32
|
+
|
|
33
|
+
# Filter where PNPM stored Sentry CLI
|
|
34
|
+
NODE_PATH_LINE=$(echo "$CLI_FILE_TEXT" | grep -oE 'NODE_PATH="[^"]+"' | head -n1)
|
|
35
|
+
NODE_PATH_VALUE=$(echo "$NODE_PATH_LINE" | sed -E 's/^NODE_PATH="([^"]+)".*/\1/')
|
|
36
|
+
SENTRY_CLI_PACKAGE_PATH=${NODE_PATH_VALUE%%/bin*}
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
fi
|
|
40
|
+
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="$SENTRY_CLI_PACKAGE_PATH"
|
|
21
41
|
|
|
22
42
|
REACT_NATIVE_XCODE=$1
|
|
23
43
|
|
package/sentry.gradle
CHANGED
|
@@ -167,11 +167,7 @@ project.afterEvaluate {
|
|
|
167
167
|
project.logger.info("file not found '$propertiesFile' for '$variant'")
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
def
|
|
171
|
-
try {
|
|
172
|
-
resolvedCliPackage = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir).text.trim()).getParentFile();
|
|
173
|
-
} catch (Throwable ignored) {}
|
|
174
|
-
def cliPackage = resolvedCliPackage != null && resolvedCliPackage.exists() ? resolvedCliPackage.getAbsolutePath() : "$reactRoot/node_modules/@sentry/cli"
|
|
170
|
+
def cliPackage = resolveSentryCliPackagePath(reactRoot)
|
|
175
171
|
def cliExecutable = sentryProps.get("cli.executable", "$cliPackage/bin/sentry-cli")
|
|
176
172
|
|
|
177
173
|
// fix path separator for Windows
|
|
@@ -205,7 +201,7 @@ project.afterEvaluate {
|
|
|
205
201
|
|
|
206
202
|
project.logger.lifecycle("Sentry-CLI arguments: ${args}")
|
|
207
203
|
def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c', 'node'] : []
|
|
208
|
-
if (!System.getenv('SENTRY_DOTENV_PATH')) {
|
|
204
|
+
if (!System.getenv('SENTRY_DOTENV_PATH') && file("$reactRoot/.env.sentry-build-plugin").exists()) {
|
|
209
205
|
environment('SENTRY_DOTENV_PATH', "$reactRoot/.env.sentry-build-plugin")
|
|
210
206
|
}
|
|
211
207
|
commandLine(*osCompatibility, *args)
|
|
@@ -306,6 +302,31 @@ def resolveSentryReactNativeSDKPath(reactRoot) {
|
|
|
306
302
|
return sentryPackage
|
|
307
303
|
}
|
|
308
304
|
|
|
305
|
+
def resolveSentryCliPackagePath(reactRoot) {
|
|
306
|
+
def resolvedCliPath = null
|
|
307
|
+
try {
|
|
308
|
+
resolvedCliPath = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir).text.trim()).getParentFile();
|
|
309
|
+
} catch (Throwable ignored) { // Check if it's located in .pnpm
|
|
310
|
+
try {
|
|
311
|
+
def pnpmRefPath = reactRoot.toString() + "/node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"
|
|
312
|
+
def sentryCliFile = new File(pnpmRefPath)
|
|
313
|
+
|
|
314
|
+
if (sentryCliFile.exists()) {
|
|
315
|
+
def cliFileText = sentryCliFile.text
|
|
316
|
+
def matcher = cliFileText =~ /NODE_PATH="([^"]*?)@sentry\/cli\//
|
|
317
|
+
|
|
318
|
+
if (matcher.find()) {
|
|
319
|
+
def match = matcher.group(1)
|
|
320
|
+
resolvedCliPath = new File(match + "@sentry/cli")
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
} catch (Throwable ignored2) {} // if the resolve fails we fallback to the default path
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
def cliPackage = resolvedCliPath != null && resolvedCliPath.exists() ? resolvedCliPath.getAbsolutePath() : "$reactRoot/node_modules/@sentry/cli"
|
|
327
|
+
return cliPackage
|
|
328
|
+
}
|
|
329
|
+
|
|
309
330
|
/** Compose lookup map of build variants - to - outputs. */
|
|
310
331
|
def extractReleasesInfo() {
|
|
311
332
|
def releases = [:]
|
package/ts3.8/dist/js/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Breadcrumb, SdkInfo, Event, Exception, SendFeedbackParams, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, UserFeedback, ErrorEvent, TransactionEvent, } from '@sentry/core';
|
|
2
|
-
export { addBreadcrumb, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, lastEventId, } from '@sentry/core';
|
|
2
|
+
export { addBreadcrumb, addIntegration, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, lastEventId, } from '@sentry/core';
|
|
3
3
|
export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
4
4
|
export type { FeatureFlagsIntegration } from '@sentry/browser';
|
|
5
5
|
export { logger, consoleLoggingIntegration, featureFlagsIntegration } from '@sentry/browser';
|
|
@@ -207,6 +207,13 @@ export interface BaseReactNativeOptions {
|
|
|
207
207
|
* problems.
|
|
208
208
|
*/
|
|
209
209
|
shutdownTimeout?: number;
|
|
210
|
+
/**
|
|
211
|
+
* Defines the quality of the session replay. The higher the quality, the more accurate the replay
|
|
212
|
+
* will be, but also more data to transfer and more CPU load.
|
|
213
|
+
*
|
|
214
|
+
* @default 'medium'
|
|
215
|
+
*/
|
|
216
|
+
replaysSessionQuality?: SentryReplayQuality;
|
|
210
217
|
/**
|
|
211
218
|
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
212
219
|
*/
|
|
@@ -243,6 +250,7 @@ export interface BaseReactNativeOptions {
|
|
|
243
250
|
*/
|
|
244
251
|
useThreadsForMessageStack?: boolean;
|
|
245
252
|
}
|
|
253
|
+
export type SentryReplayQuality = 'low' | 'medium' | 'high';
|
|
246
254
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
247
255
|
/**
|
|
248
256
|
* @deprecated use `maxQueueSize` in the root of the SDK options.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
|
|
2
2
|
export declare const SDK_NAME = "sentry.javascript.react-native";
|
|
3
|
-
export declare const SDK_VERSION = "7.0.0-
|
|
3
|
+
export declare const SDK_VERSION = "7.0.0-rc.1";
|
|
4
4
|
//# sourceMappingURL=version.d.ts.map
|