@sentry/react-native 6.18.1 → 6.20.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 +3 -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/tools/sentryMetroSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +7 -2
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/utils.d.ts.map +1 -1
- package/dist/js/tools/utils.js +32 -8
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.js +28 -6
- package/dist/js/tools/vendor/metro/utils.js.map +1 -1
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +2 -1
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +1 -0
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.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/RNSentry.h +7 -1
- package/ios/RNSentry.mm +52 -22
- package/ios/RNSentryReplay.mm +4 -0
- package/ios/RNSentryReplayBreadcrumbConverter.h +1 -1
- 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 +8 -6
- package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
- package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
- package/scripts/expo-upload-sourcemaps.js +5 -2
- package/scripts/sentry-xcode-debug-files.sh +1 -1
- package/scripts/sentry-xcode.sh +1 -1
- package/scripts/sentry_utils.rb +4 -0
- package/sentry.gradle +2 -3
- 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/utils/worldwide.d.ts +1 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
package/RNSentry.podspec
CHANGED
|
@@ -6,6 +6,7 @@ rn_package = parse_rn_package_json()
|
|
|
6
6
|
rn_version = get_rn_version(rn_package)
|
|
7
7
|
is_hermes_default = is_hermes_default(rn_version)
|
|
8
8
|
is_profiling_supported = is_profiling_supported(rn_version)
|
|
9
|
+
is_new_hermes_runtime = is_new_hermes_runtime(rn_version)
|
|
9
10
|
|
|
10
11
|
# Use different Folly configuration for RN 0.80.0+
|
|
11
12
|
if should_use_folly_flags(rn_version)
|
|
@@ -21,7 +22,8 @@ is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] == "1"
|
|
|
21
22
|
is_using_hermes = (ENV['USE_HERMES'] == nil && is_hermes_default) || ENV['USE_HERMES'] == '1'
|
|
22
23
|
new_arch_enabled_flag = (is_new_arch_enabled ? folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED" : "")
|
|
23
24
|
sentry_profiling_supported_flag = (is_profiling_supported ? " -DSENTRY_PROFILING_SUPPORTED=1" : "")
|
|
24
|
-
|
|
25
|
+
new_hermes_runtime_flag = (is_new_hermes_runtime ? " -DNEW_HERMES_RUNTIME" : "")
|
|
26
|
+
other_cflags = "$(inherited)" + new_arch_enabled_flag + sentry_profiling_supported_flag + new_hermes_runtime_flag
|
|
25
27
|
|
|
26
28
|
Pod::Spec.new do |s|
|
|
27
29
|
s.name = 'RNSentry'
|
|
@@ -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;
|
|
@@ -86,6 +87,7 @@ import java.nio.charset.Charset;
|
|
|
86
87
|
import java.util.HashMap;
|
|
87
88
|
import java.util.Iterator;
|
|
88
89
|
import java.util.List;
|
|
90
|
+
import java.util.Locale;
|
|
89
91
|
import java.util.Map;
|
|
90
92
|
import java.util.Properties;
|
|
91
93
|
import java.util.concurrent.CountDownLatch;
|
|
@@ -370,6 +372,12 @@ public class RNSentryModuleImpl {
|
|
|
370
372
|
? rnOptions.getDouble("replaysOnErrorSampleRate")
|
|
371
373
|
: null);
|
|
372
374
|
|
|
375
|
+
if (rnOptions.hasKey("replaysSessionQuality")) {
|
|
376
|
+
final String qualityString = rnOptions.getString("replaysSessionQuality");
|
|
377
|
+
final SentryReplayQuality quality = parseReplayQuality(qualityString);
|
|
378
|
+
androidReplayOptions.setQuality(quality);
|
|
379
|
+
}
|
|
380
|
+
|
|
373
381
|
if (!rnOptions.hasKey("mobileReplayOptions")) {
|
|
374
382
|
return androidReplayOptions;
|
|
375
383
|
}
|
|
@@ -398,6 +406,27 @@ public class RNSentryModuleImpl {
|
|
|
398
406
|
return androidReplayOptions;
|
|
399
407
|
}
|
|
400
408
|
|
|
409
|
+
private SentryReplayQuality parseReplayQuality(@Nullable String qualityString) {
|
|
410
|
+
if (qualityString == null) {
|
|
411
|
+
return SentryReplayQuality.MEDIUM;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
try {
|
|
415
|
+
switch (qualityString.toLowerCase(Locale.ROOT)) {
|
|
416
|
+
case "low":
|
|
417
|
+
return SentryReplayQuality.LOW;
|
|
418
|
+
case "medium":
|
|
419
|
+
return SentryReplayQuality.MEDIUM;
|
|
420
|
+
case "high":
|
|
421
|
+
return SentryReplayQuality.HIGH;
|
|
422
|
+
default:
|
|
423
|
+
return SentryReplayQuality.MEDIUM;
|
|
424
|
+
}
|
|
425
|
+
} catch (Exception e) {
|
|
426
|
+
return SentryReplayQuality.MEDIUM;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
401
430
|
public void crash() {
|
|
402
431
|
throw new RuntimeException("TEST - Sentry Client Crash (only works in release mode)");
|
|
403
432
|
}
|
|
@@ -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.20.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/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Breadcrumb, Request, 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, metricsDefault as metrics, 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, metricsDefault as metrics, lastEventId, } from '@sentry/core';
|
|
3
3
|
export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
4
4
|
export * from './integrations/exports';
|
|
5
5
|
export { SDK_NAME, SDK_VERSION } from './version';
|
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,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,iBAAiB,EACjB,cAAc,IAAI,OAAO,EACzB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,cAAc,wBAA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E,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, metricsDefault as metrics, 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, metricsDefault as metrics, lastEventId, } from '@sentry/core';
|
|
2
2
|
export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
3
3
|
export * from './integrations/exports';
|
|
4
4
|
export { SDK_NAME, SDK_VERSION } from './version';
|
package/dist/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,E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B,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\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 metricsDefault as metrics,\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 * 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, captureUserFeedback, 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":"AAkBA,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,cAAc,IAAI,OAAO,EACzB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,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,mBAAmB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC9G,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 Request,\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 metricsDefault as metrics,\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 * 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, captureUserFeedback, 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
|
@@ -198,6 +198,13 @@ export interface BaseReactNativeOptions {
|
|
|
198
198
|
* 1.0 will record all sessions and 0 will record none.
|
|
199
199
|
*/
|
|
200
200
|
replaysOnErrorSampleRate?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Defines the quality of the session replay. The higher the quality, the more accurate the replay
|
|
203
|
+
* will be, but also more data to transfer and more CPU load.
|
|
204
|
+
*
|
|
205
|
+
* @default 'medium'
|
|
206
|
+
*/
|
|
207
|
+
replaysSessionQuality?: SentryReplayQuality;
|
|
201
208
|
/**
|
|
202
209
|
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
203
210
|
*/
|
|
@@ -234,6 +241,7 @@ export interface BaseReactNativeOptions {
|
|
|
234
241
|
*/
|
|
235
242
|
useThreadsForMessageStack?: boolean;
|
|
236
243
|
}
|
|
244
|
+
export type SentryReplayQuality = 'low' | 'medium' | 'high';
|
|
237
245
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
238
246
|
/**
|
|
239
247
|
* @deprecated use `maxQueueSize` in the root of the SDK options.
|
package/dist/js/options.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;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 { Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\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 * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\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?: ProfilerProps;\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 const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\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;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAoTvD;;;;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,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,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 { Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\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 * 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?: {\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?: ProfilerProps;\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 const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\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":"sentryMetroSerializer.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sentryMetroSerializer.d.ts","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAU,eAAe,EAA4D,MAAM,SAAS,CAAC;AAmBjH;;GAEG;AACH,wBAAgB,uCAAuC,CAAC,EACtD,UAAU,EACV,OAAO,GACR,EAAE;IACD,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,EAAE,CAcX;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,sBAAuB,eAAe,KAAG,eAsDhF,CAAC"}
|
|
@@ -10,10 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.createSentryMetroSerializer = exports.unstable_beforeAssetSerializationPlugin = void 0;
|
|
12
12
|
const crypto = require("crypto");
|
|
13
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
14
|
-
const countLines = require("metro/src/lib/countLines");
|
|
15
13
|
const utils_1 = require("./utils");
|
|
16
14
|
const utils_2 = require("./vendor/metro/utils");
|
|
15
|
+
let countLines;
|
|
16
|
+
try {
|
|
17
|
+
countLines = require('metro/private/lib/countLines');
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
countLines = require('metro/src/lib/countLines');
|
|
21
|
+
}
|
|
17
22
|
const DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__';
|
|
18
23
|
const DEBUG_ID_MODULE_PATH = '__debugid__';
|
|
19
24
|
const PRELUDE_MODULE_PATH = '__prelude__';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryMetroSerializer.js","sourceRoot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J,IAAI,EAAE,WAAW;oBACjB,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC;oBAClC,GAAG,EAAE,EAAE;iBACR;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE;QACrC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACnB;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,sEAAsE;IACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import * as crypto from 'crypto';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as countLines from 'metro/src/lib/countLines';\n\nimport type { Bundle, MetroSerializer, MetroSerializerOutput, SerializedBundle, VirtualJSOutput } from './utils';\nimport { createDebugIdSnippet, createSet, determineDebugIdFromBundleSource, stringToUUID } from './utils';\nimport { createDefaultMetroSerializer } from './vendor/metro/utils';\n\ntype SourceMap = Record<string, unknown>;\n\nconst DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__';\nconst DEBUG_ID_MODULE_PATH = '__debugid__';\nconst PRELUDE_MODULE_PATH = '__prelude__';\nconst SOURCE_MAP_COMMENT = '//# sourceMappingURL=';\nconst DEBUG_ID_COMMENT = '//# debugId=';\n\n/**\n * Adds Sentry Debug ID polyfill module to the bundle.\n */\nexport function unstable_beforeAssetSerializationPlugin({\n premodules,\n debugId,\n}: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n}): Module[] {\n if (!debugId) {\n return premodules;\n }\n\n const debugIdModuleExists = premodules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // eslint-disable-next-line no-console\n console.warn('\\n\\nDebug ID module found. Skipping Sentry Debug ID module...\\n\\n');\n return premodules;\n }\n\n const debugIdModule = createDebugIdModule(debugId);\n return [...addDebugIdModule(premodules, debugIdModule)];\n}\n\n/**\n * Creates a Metro serializer that adds Debug ID module to the plain bundle.\n * The Debug ID module is a virtual module that provides a debug ID in runtime.\n *\n * RAM Bundles do not support custom serializers.\n */\nexport const createSentryMetroSerializer = (customSerializer?: MetroSerializer): MetroSerializer => {\n const serializer = customSerializer || createDefaultMetroSerializer();\n return async function (entryPoint, preModules, graph, options) {\n if (graph.transformOptions.hot) {\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModuleExists = preModules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // eslint-disable-next-line no-console\n console.warn('Debug ID module found. Skipping Sentry Debug ID module...');\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModule = createDebugIdModule(DEBUG_ID_PLACE_HOLDER);\n options.sentryBundleCallback = createSentryBundleCallback(debugIdModule);\n const modifiedPreModules = addDebugIdModule(preModules, debugIdModule);\n\n // Run wrapped serializer\n const serializerResult = serializer(entryPoint, modifiedPreModules, graph, options);\n const { code: bundleCode, map: bundleMapString } = await extractSerializerResult(serializerResult);\n\n // Add debug id comment to the bundle\n const debugId = determineDebugIdFromBundleSource(bundleCode);\n if (!debugId) {\n throw new Error(\n 'Debug ID was not found in the bundle. Call `options.sentryBundleCallback` if you are using a custom serializer.',\n );\n }\n // Only print debug id for command line builds => not hot reload from dev server\n // eslint-disable-next-line no-console\n console.log('info ' + `Bundle Debug ID: ${debugId}`);\n\n const debugIdComment = `${DEBUG_ID_COMMENT}${debugId}`;\n const indexOfSourceMapComment = bundleCode.lastIndexOf(SOURCE_MAP_COMMENT);\n const bundleCodeWithDebugId =\n indexOfSourceMapComment === -1\n ? // If source map comment is missing lets just add the debug id comment\n `${bundleCode}\\n${debugIdComment}`\n : // If source map comment is present lets add the debug id comment before it\n `${bundleCode.substring(0, indexOfSourceMapComment) + debugIdComment}\\n${bundleCode.substring(\n indexOfSourceMapComment,\n )}`;\n\n const bundleMap: SourceMap = JSON.parse(bundleMapString);\n // For now we write both fields until we know what will become the standard - if ever.\n bundleMap['debug_id'] = debugId;\n bundleMap['debugId'] = debugId;\n\n return {\n code: bundleCodeWithDebugId,\n map: JSON.stringify(bundleMap),\n };\n };\n};\n\n/**\n * This function is expected to be called after serializer creates the final bundle object\n * and before the source maps are generated.\n *\n * It injects a debug ID into the bundle and returns the modified bundle.\n *\n * Access it via `options.sentryBundleCallback` in your custom serializer.\n */\nfunction createSentryBundleCallback(debugIdModule: Module<VirtualJSOutput> & { setSource: (code: string) => void }) {\n return (bundle: Bundle) => {\n const debugId = calculateDebugId(bundle);\n debugIdModule.setSource(injectDebugId(debugIdModule.getSource().toString(), debugId));\n bundle.pre = injectDebugId(bundle.pre, debugId);\n return bundle;\n };\n}\n\nfunction addDebugIdModule(\n preModules: readonly Module<MixedOutput>[],\n debugIdModule: Module<VirtualJSOutput>,\n): readonly Module<MixedOutput>[] {\n const modifiedPreModules = [...preModules];\n if (\n modifiedPreModules.length > 0 &&\n modifiedPreModules[0] !== undefined &&\n modifiedPreModules[0].path === PRELUDE_MODULE_PATH\n ) {\n // prelude module must be first as it measures the bundle startup time\n modifiedPreModules.unshift(preModules[0] as Module<VirtualJSOutput>);\n modifiedPreModules[1] = debugIdModule;\n } else {\n modifiedPreModules.unshift(debugIdModule);\n }\n return modifiedPreModules;\n}\n\nasync function extractSerializerResult(serializerResult: MetroSerializerOutput): Promise<SerializedBundle> {\n if (typeof serializerResult === 'string') {\n return { code: serializerResult, map: '{}' };\n }\n\n if ('map' in serializerResult) {\n return { code: serializerResult.code, map: serializerResult.map };\n }\n\n const awaitedResult = await serializerResult;\n if (typeof awaitedResult === 'string') {\n return { code: awaitedResult, map: '{}' };\n }\n\n return { code: awaitedResult.code, map: awaitedResult.map };\n}\n\nfunction createDebugIdModule(debugId: string): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n let debugIdCode = createDebugIdSnippet(debugId);\n\n return {\n setSource: (code: string) => {\n debugIdCode = code;\n },\n dependencies: new Map(),\n getSource: () => Buffer.from(debugIdCode),\n inverseDependencies: createSet(),\n path: DEBUG_ID_MODULE_PATH,\n output: [\n {\n type: 'js/script/virtual',\n data: {\n code: debugIdCode,\n lineCount: countLines(debugIdCode),\n map: [],\n },\n },\n ],\n };\n}\n\nfunction calculateDebugId(bundle: Bundle): string {\n const hash = crypto.createHash('md5');\n hash.update(bundle.pre);\n for (const [, code] of bundle.modules) {\n hash.update(code);\n }\n hash.update(bundle.post);\n\n const debugId = stringToUUID(hash.digest('hex'));\n return debugId;\n}\n\nfunction injectDebugId(code: string, debugId: string): string {\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n return code.replace(new RegExp(DEBUG_ID_PLACE_HOLDER, 'g'), debugId);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sentryMetroSerializer.js","sourceRoot":"","sources":["../../../src/js/tools/sentryMetroSerializer.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAiC;AAMjC,mCAA0G;AAC1G,gDAAoE;AAEpE,IAAI,UAAiC,CAAC;AACtC,IAAI;IACF,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;CACtD;AAAC,OAAO,CAAC,EAAE;IACV,UAAU,GAAG,OAAO,CAAC,0BAA0B,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AC;AAED,SAAS,gBAAgB,CAAC,MAAc;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE;QACrC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACnB;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,sEAAsE;IACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import * as crypto from 'crypto';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type * as countLinesType from 'metro/private/lib/countLines';\n\nimport type { Bundle, MetroSerializer, MetroSerializerOutput, SerializedBundle, VirtualJSOutput } from './utils';\nimport { createDebugIdSnippet, createSet, determineDebugIdFromBundleSource, stringToUUID } from './utils';\nimport { createDefaultMetroSerializer } from './vendor/metro/utils';\n\nlet countLines: typeof countLinesType;\ntry {\n countLines = require('metro/private/lib/countLines');\n} catch (e) {\n countLines = require('metro/src/lib/countLines');\n}\n\ntype SourceMap = Record<string, unknown>;\n\nconst DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__';\nconst DEBUG_ID_MODULE_PATH = '__debugid__';\nconst PRELUDE_MODULE_PATH = '__prelude__';\nconst SOURCE_MAP_COMMENT = '//# sourceMappingURL=';\nconst DEBUG_ID_COMMENT = '//# debugId=';\n\n/**\n * Adds Sentry Debug ID polyfill module to the bundle.\n */\nexport function unstable_beforeAssetSerializationPlugin({\n premodules,\n debugId,\n}: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n}): Module[] {\n if (!debugId) {\n return premodules;\n }\n\n const debugIdModuleExists = premodules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // eslint-disable-next-line no-console\n console.warn('\\n\\nDebug ID module found. Skipping Sentry Debug ID module...\\n\\n');\n return premodules;\n }\n\n const debugIdModule = createDebugIdModule(debugId);\n return [...addDebugIdModule(premodules, debugIdModule)];\n}\n\n/**\n * Creates a Metro serializer that adds Debug ID module to the plain bundle.\n * The Debug ID module is a virtual module that provides a debug ID in runtime.\n *\n * RAM Bundles do not support custom serializers.\n */\nexport const createSentryMetroSerializer = (customSerializer?: MetroSerializer): MetroSerializer => {\n const serializer = customSerializer || createDefaultMetroSerializer();\n return async function (entryPoint, preModules, graph, options) {\n if (graph.transformOptions.hot) {\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModuleExists = preModules.findIndex(module => module.path === DEBUG_ID_MODULE_PATH) != -1;\n if (debugIdModuleExists) {\n // eslint-disable-next-line no-console\n console.warn('Debug ID module found. Skipping Sentry Debug ID module...');\n return serializer(entryPoint, preModules, graph, options);\n }\n\n const debugIdModule = createDebugIdModule(DEBUG_ID_PLACE_HOLDER);\n options.sentryBundleCallback = createSentryBundleCallback(debugIdModule);\n const modifiedPreModules = addDebugIdModule(preModules, debugIdModule);\n\n // Run wrapped serializer\n const serializerResult = serializer(entryPoint, modifiedPreModules, graph, options);\n const { code: bundleCode, map: bundleMapString } = await extractSerializerResult(serializerResult);\n\n // Add debug id comment to the bundle\n const debugId = determineDebugIdFromBundleSource(bundleCode);\n if (!debugId) {\n throw new Error(\n 'Debug ID was not found in the bundle. Call `options.sentryBundleCallback` if you are using a custom serializer.',\n );\n }\n // Only print debug id for command line builds => not hot reload from dev server\n // eslint-disable-next-line no-console\n console.log('info ' + `Bundle Debug ID: ${debugId}`);\n\n const debugIdComment = `${DEBUG_ID_COMMENT}${debugId}`;\n const indexOfSourceMapComment = bundleCode.lastIndexOf(SOURCE_MAP_COMMENT);\n const bundleCodeWithDebugId =\n indexOfSourceMapComment === -1\n ? // If source map comment is missing lets just add the debug id comment\n `${bundleCode}\\n${debugIdComment}`\n : // If source map comment is present lets add the debug id comment before it\n `${bundleCode.substring(0, indexOfSourceMapComment) + debugIdComment}\\n${bundleCode.substring(\n indexOfSourceMapComment,\n )}`;\n\n const bundleMap: SourceMap = JSON.parse(bundleMapString);\n // For now we write both fields until we know what will become the standard - if ever.\n bundleMap['debug_id'] = debugId;\n bundleMap['debugId'] = debugId;\n\n return {\n code: bundleCodeWithDebugId,\n map: JSON.stringify(bundleMap),\n };\n };\n};\n\n/**\n * This function is expected to be called after serializer creates the final bundle object\n * and before the source maps are generated.\n *\n * It injects a debug ID into the bundle and returns the modified bundle.\n *\n * Access it via `options.sentryBundleCallback` in your custom serializer.\n */\nfunction createSentryBundleCallback(debugIdModule: Module<VirtualJSOutput> & { setSource: (code: string) => void }) {\n return (bundle: Bundle) => {\n const debugId = calculateDebugId(bundle);\n debugIdModule.setSource(injectDebugId(debugIdModule.getSource().toString(), debugId));\n bundle.pre = injectDebugId(bundle.pre, debugId);\n return bundle;\n };\n}\n\nfunction addDebugIdModule(\n preModules: readonly Module<MixedOutput>[],\n debugIdModule: Module<VirtualJSOutput>,\n): readonly Module<MixedOutput>[] {\n const modifiedPreModules = [...preModules];\n if (\n modifiedPreModules.length > 0 &&\n modifiedPreModules[0] !== undefined &&\n modifiedPreModules[0].path === PRELUDE_MODULE_PATH\n ) {\n // prelude module must be first as it measures the bundle startup time\n modifiedPreModules.unshift(preModules[0] as Module<VirtualJSOutput>);\n modifiedPreModules[1] = debugIdModule;\n } else {\n modifiedPreModules.unshift(debugIdModule);\n }\n return modifiedPreModules;\n}\n\nasync function extractSerializerResult(serializerResult: MetroSerializerOutput): Promise<SerializedBundle> {\n if (typeof serializerResult === 'string') {\n return { code: serializerResult, map: '{}' };\n }\n\n if ('map' in serializerResult) {\n return { code: serializerResult.code, map: serializerResult.map };\n }\n\n const awaitedResult = await serializerResult;\n if (typeof awaitedResult === 'string') {\n return { code: awaitedResult, map: '{}' };\n }\n\n return { code: awaitedResult.code, map: awaitedResult.map };\n}\n\nfunction createDebugIdModule(debugId: string): Module<VirtualJSOutput> & { setSource: (code: string) => void } {\n let debugIdCode = createDebugIdSnippet(debugId);\n\n return {\n setSource: (code: string) => {\n debugIdCode = code;\n },\n dependencies: new Map(),\n getSource: () => Buffer.from(debugIdCode),\n inverseDependencies: createSet(),\n path: DEBUG_ID_MODULE_PATH,\n output: [\n {\n type: 'js/script/virtual',\n data: {\n code: debugIdCode,\n lineCount: countLines(debugIdCode),\n map: [],\n },\n },\n ],\n };\n}\n\nfunction calculateDebugId(bundle: Bundle): string {\n const hash = crypto.createHash('md5');\n hash.update(bundle.pre);\n for (const [, code] of bundle.modules) {\n hash.update(code);\n }\n hash.update(bundle.post);\n\n const debugId = stringToUUID(hash.digest('hex'));\n return debugId;\n}\n\nfunction injectDebugId(code: string, debugId: string): string {\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n return code.replace(new RegExp(DEBUG_ID_PLACE_HOLDER, 'g'), debugId);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,WAAW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}
|
package/dist/js/tools/utils.js
CHANGED
|
@@ -42,18 +42,42 @@ exports.determineDebugIdFromBundleSource = determineDebugIdFromBundleSource;
|
|
|
42
42
|
* https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js
|
|
43
43
|
*/
|
|
44
44
|
function resolveSetCreator() {
|
|
45
|
+
const CountingSetFromPrivate = safeRequireCountingSetFromPrivate();
|
|
46
|
+
if (CountingSetFromPrivate) {
|
|
47
|
+
return () => new CountingSetFromPrivate.default();
|
|
48
|
+
}
|
|
49
|
+
const CountingSetFromSrc = safeRequireCountingSetFromSrc();
|
|
50
|
+
if (CountingSetFromSrc) {
|
|
51
|
+
return () => new CountingSetFromSrc.default();
|
|
52
|
+
}
|
|
53
|
+
return () => new Set();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.
|
|
57
|
+
*
|
|
58
|
+
* https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js
|
|
59
|
+
*/
|
|
60
|
+
function safeRequireCountingSetFromSrc() {
|
|
61
|
+
try {
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
|
|
63
|
+
return require('metro/src/lib/CountingSet');
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* CountingSet was moved to private in Metro 0.83.0. (all src exports were moved to private)
|
|
71
|
+
*
|
|
72
|
+
* https://github.com/facebook/metro/commit/ae6f42372ed361611b5672705f22081c2022cf28
|
|
73
|
+
*/
|
|
74
|
+
function safeRequireCountingSetFromPrivate() {
|
|
45
75
|
try {
|
|
46
76
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
|
|
47
|
-
|
|
48
|
-
return () => new MetroSet();
|
|
77
|
+
return require('metro/private/lib/CountingSet');
|
|
49
78
|
}
|
|
50
79
|
catch (e) {
|
|
51
|
-
|
|
52
|
-
return () => new Set();
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
throw e;
|
|
56
|
-
}
|
|
80
|
+
return undefined;
|
|
57
81
|
}
|
|
58
82
|
}
|
|
59
83
|
exports.createSet = resolveSetCreator();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":";;AAAA,iCAAiC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tools/utils.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAqCjC;;GAEG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,OAAO,+JAA+J,OAAO,2CAA2C,OAAO,eAAe,CAAC;AACjP,CAAC;AAFD,oDAEC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErC,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAW,CAAC;IAE9F,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,SAAS,CACjF,EAAE,EACF,EAAE,CACH,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;AACtF,CAAC;AAbD,oCAaC;AAED;;;;;;;GAOG;AACH,SAAgB,gCAAgC,CAAC,IAAY;IAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CACtB,mGAAmG,CACpG,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC;AALD,4EAKC;AAED;;;;GAIG;AACH,SAAS,iBAAiB;IACxB,MAAM,sBAAsB,GAAG,iCAAiC,EAAE,CAAC;IACnE,IAAI,sBAAsB,EAAE;QAC1B,OAAO,GAAG,EAAE,CAAC,IAAI,sBAAsB,CAAC,OAAO,EAAE,CAAC;KACnD;IAED,MAAM,kBAAkB,GAAG,6BAA6B,EAAE,CAAC;IAC3D,IAAI,kBAAkB,EAAE;QACtB,OAAO,GAAG,EAAE,CAAC,IAAI,kBAAkB,CAAC,OAAO,EAAE,CAAC;KAC/C;IAED,OAAO,GAAG,EAAE,CAAC,IAAI,GAAG,EAAoC,CAAC;AAC3D,CAAC;AAED;;;;GAIG;AACH,SAAS,6BAA6B;IACpC,IAAI;QACF,iGAAiG;QACjG,OAAO,OAAO,CAAC,2BAA2B,CAAC,CAAC;KAC7C;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iCAAiC;IACxC,IAAI;QACF,iGAAiG;QACjG,OAAO,OAAO,CAAC,+BAA+B,CAAC,CAAC;KACjD;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAEY,QAAA,SAAS,GAAG,iBAAiB,EAAE,CAAC","sourcesContent":["import * as crypto from 'crypto';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { Module, ReadOnlyGraph, SerializerOptions } from 'metro';\nimport type CountingSet from 'metro/src/lib/CountingSet'; // types are in src but exports are in private\n\n// Variant of MixedOutput\n// https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/DeltaBundler/types.flow.js#L21\nexport type VirtualJSOutput = {\n type: 'js/script/virtual';\n data: {\n code: string;\n lineCount: number;\n map: [];\n };\n};\n\nexport type Bundle = {\n modules: Array<[id: number, code: string]>;\n post: string;\n pre: string;\n};\n\nexport type SentryMetroSerializerOptionsExtras = {\n sentryBundleCallback?: (bundle: Bundle) => Bundle;\n};\n\nexport type SerializedBundle = { code: string; map: string };\n\nexport type MetroSerializerOutput = string | SerializedBundle | Promise<string | SerializedBundle>;\n\nexport type MetroSerializer = (\n entryPoint: string,\n preModules: ReadonlyArray<Module>,\n graph: ReadOnlyGraph,\n options: SerializerOptions & SentryMetroSerializerOptionsExtras,\n) => MetroSerializerOutput;\n\n/**\n * Returns minified Debug ID code snippet.\n */\nexport function createDebugIdSnippet(debugId: string): string {\n return `var _sentryDebugIds,_sentryDebugIdIdentifier;void 0===_sentryDebugIds&&(_sentryDebugIds={});try{var stack=(new Error).stack;stack&&(_sentryDebugIds[stack]=\"${debugId}\",_sentryDebugIdIdentifier=\"sentry-dbid-${debugId}\")}catch(e){}`;\n}\n\n/**\n * Deterministically hashes a string and turns the hash into a uuid.\n *\n * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/58271f1af2ade6b3e64d393d70376ae53bc5bd2f/packages/bundler-plugin-core/src/utils.ts#L174\n */\nexport function stringToUUID(str: string): string {\n const md5sum = crypto.createHash('md5');\n md5sum.update(str);\n const md5Hash = md5sum.digest('hex');\n\n // Position 16 is fixed to either 8, 9, a, or b in the uuid v4 spec (10xx in binary)\n // RFC 4122 section 4.4\n const v4variant = ['8', '9', 'a', 'b'][md5Hash.substring(16, 17).charCodeAt(0) % 4] as string;\n\n return `${md5Hash.substring(0, 8)}-${md5Hash.substring(8, 12)}-4${md5Hash.substring(\n 13,\n 16,\n )}-${v4variant}${md5Hash.substring(17, 20)}-${md5Hash.substring(20)}`.toLowerCase();\n}\n\n/**\n * Looks for a particular string pattern (`sdbid-[debug ID]`) in the bundle\n * source and extracts the bundle's debug ID from it.\n *\n * The string pattern is injected via the debug ID injection snipped.\n *\n * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/40f918458ed449d8b3eabaf64d13c08218213f65/packages/bundler-plugin-core/src/debug-id-upload.ts#L293-L294\n */\nexport function determineDebugIdFromBundleSource(code: string): string | undefined {\n const match = code.match(\n /sentry-dbid-([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12})/,\n );\n return match ? match[1] : undefined;\n}\n\n/**\n * CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.\n *\n * https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js\n */\nfunction resolveSetCreator(): () => CountingSet<string> {\n const CountingSetFromPrivate = safeRequireCountingSetFromPrivate();\n if (CountingSetFromPrivate) {\n return () => new CountingSetFromPrivate.default();\n }\n\n const CountingSetFromSrc = safeRequireCountingSetFromSrc();\n if (CountingSetFromSrc) {\n return () => new CountingSetFromSrc.default();\n }\n\n return () => new Set() as unknown as CountingSet<string>;\n}\n\n/**\n * CountingSet was added in Metro 0.72.0 before that NodeJS Set was used.\n *\n * https://github.com/facebook/metro/blob/fc29a1177f883144674cf85a813b58567f69d545/packages/metro/src/lib/CountingSet.js\n */\nfunction safeRequireCountingSetFromSrc(): { default: new <T>() => CountingSet<T> } | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies\n return require('metro/src/lib/CountingSet');\n } catch (e) {\n return undefined;\n }\n}\n\n/**\n * CountingSet was moved to private in Metro 0.83.0. (all src exports were moved to private)\n *\n * https://github.com/facebook/metro/commit/ae6f42372ed361611b5672705f22081c2022cf28\n */\nfunction safeRequireCountingSetFromPrivate(): { default: new <T>() => CountingSet<T> } | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies\n return require('metro/private/lib/CountingSet');\n } catch (e) {\n return undefined;\n }\n}\n\nexport const createSet = resolveSetCreator();\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAiChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAOnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UACpB,aAAa;2BAIK,MAAM,KAAK,MAAM;MAEzC,SAAS,MAAM,EAMjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,QAAO,eAqC/C,CAAC"}
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
// Vendored / modified from @facebook/metro
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createDefaultMetroSerializer = exports.getSortedModules = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
let baseJSBundle;
|
|
5
|
+
try {
|
|
6
|
+
baseJSBundle = require('metro/private/DeltaBundler/Serializers/baseJSBundle');
|
|
7
|
+
}
|
|
8
|
+
catch (e) {
|
|
9
|
+
baseJSBundle = require('metro/src/DeltaBundler/Serializers/baseJSBundle');
|
|
10
|
+
}
|
|
11
|
+
let sourceMapString;
|
|
12
|
+
try {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
14
|
+
const sourceMapStringModule = require('metro/private/DeltaBundler/Serializers/sourceMapString');
|
|
15
|
+
sourceMapString = sourceMapStringModule.sourceMapString;
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
sourceMapString = require('metro/src/DeltaBundler/Serializers/sourceMapString');
|
|
19
|
+
if ('sourceMapString' in sourceMapString) {
|
|
20
|
+
// Changed to named export in https://github.com/facebook/metro/commit/34148e61200a508923315fbe387b26d1da27bf4b
|
|
21
|
+
// Metro 0.81.0 and 0.80.10 patch
|
|
22
|
+
sourceMapString = sourceMapString.sourceMapString;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
let bundleToString;
|
|
26
|
+
try {
|
|
27
|
+
bundleToString = require('metro/private/lib/bundleToString');
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
bundleToString = require('metro/src/lib/bundleToString');
|
|
31
|
+
}
|
|
10
32
|
/**
|
|
11
33
|
* This function ensures that modules in source maps are sorted in the same
|
|
12
34
|
* order as in a plain JS bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AAAA,2CAA2C;;;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AAAA,2CAA2C;;;AAgC3C,IAAI,YAAqC,CAAC;AAC1C,IAAI;IACF,YAAY,GAAG,OAAO,CAAC,qDAAqD,CAAC,CAAC;CAC/E;AAAC,OAAO,CAAC,EAAE;IACV,YAAY,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAC;CAC3E;AAED,IAAI,eAA2C,CAAC;AAChD,IAAI;IACF,8DAA8D;IAC9D,MAAM,qBAAqB,GAAG,OAAO,CAAC,wDAAwD,CAAC,CA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AAE,IAAI,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAC9B,sEAAsE;YACtE,OAAO,IAAI,CAAC;SACb;QAED,IAAI,uBAA2D,CAAC;QAChE,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;YACzC,uBAAuB,GAAG,eAAe,CAAC;SAC3C;aAAM,IACL,OAAO,eAAe,KAAK,QAAQ;YACnC,eAAe,IAAI,IAAI;YACvB,iBAAiB,IAAI,eAAe;YACpC,OAAO,eAAe,CAAC,iBAAiB,CAAC,KAAK,UAAU,EACxD;YACA,uBAAuB,GAAI,eAA4C,CAAC,eAAe,CAAC;SACzF;aAAM;YACL,MAAM,IAAI,KAAK,CAAC;;;CAGrB,CAAC,CAAC;SACE;QAED,oEAAoE;QACpE,MAAM,GAAG,GAAG,uBAAuB,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,IAAA,wBAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;YACxF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;SACrD,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,4BAA4B,gCAqCvC","sourcesContent":["// Vendored / modified from @facebook/metro\n\n// https://github.com/facebook/metro/commit/9b85f83c9cc837d8cd897aa7723be7da5b296067\n\n// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport type * as baseJSBundleType from 'metro/private/DeltaBundler/Serializers/baseJSBundle';\nimport type * as sourceMapStringType from 'metro/private/DeltaBundler/Serializers/sourceMapString';\nimport type * as bundleToStringType from 'metro/private/lib/bundleToString';\n\nlet baseJSBundle: typeof baseJSBundleType;\ntry {\n baseJSBundle = require('metro/private/DeltaBundler/Serializers/baseJSBundle');\n} catch (e) {\n baseJSBundle = require('metro/src/DeltaBundler/Serializers/baseJSBundle');\n}\n\nlet sourceMapString: typeof sourceMapStringType;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const sourceMapStringModule = require('metro/private/DeltaBundler/Serializers/sourceMapString');\n sourceMapString = (sourceMapStringModule as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n} catch (e) {\n sourceMapString = require('metro/src/DeltaBundler/Serializers/sourceMapString');\n if ('sourceMapString' in sourceMapString) {\n // Changed to named export in https://github.com/facebook/metro/commit/34148e61200a508923315fbe387b26d1da27bf4b\n // Metro 0.81.0 and 0.80.10 patch\n sourceMapString = (sourceMapString as { sourceMapString: typeof sourceMapStringType }).sourceMapString;\n }\n}\n\nlet bundleToString: typeof bundleToStringType;\ntry {\n bundleToString = require('metro/private/lib/bundleToString');\n} catch (e) {\n bundleToString = require('metro/src/lib/bundleToString');\n}\n\nimport type { MetroSerializer } from '../../utils';\n\ntype NewSourceMapStringExport = {\n // Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28\n sourceMapString: typeof sourceMapString;\n};\n\n/**\n * This function ensures that modules in source maps are sorted in the same\n * order as in a plain JS bundle.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984\n */\nexport const getSortedModules = (\n graph: ReadOnlyGraph,\n {\n createModuleId,\n }: {\n createModuleId: (file: string) => number;\n },\n): readonly Module[] => {\n const modules = [...graph.dependencies.values()];\n // Sort by IDs\n return modules.sort(\n (a: Module<MixedOutput>, b: Module<MixedOutput>) => createModuleId(a.path) - createModuleId(b.path),\n );\n};\n\n/**\n * Creates the default Metro plain bundle serializer.\n * Because Metro exports only the intermediate serializer functions, we need to\n * assemble the final serializer ourselves. We have to work with the modules the same as Metro does\n * to avoid unexpected changes in the final bundle.\n *\n * This is used when the user does not provide a custom serializer.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277\n */\nexport const createDefaultMetroSerializer = (): MetroSerializer => {\n return (entryPoint, preModules, graph, options) => {\n // baseJSBundle assigns IDs to modules in a consistent order\n let bundle = baseJSBundle(entryPoint, preModules, graph, options);\n if (options.sentryBundleCallback && !graph.transformOptions.hot) {\n bundle = options.sentryBundleCallback(bundle);\n }\n const { code } = bundleToString(bundle);\n if (graph.transformOptions.hot) {\n // Hot means running in dev server, sourcemaps are generated on demand\n return code;\n }\n\n let sourceMapStringFunction: typeof sourceMapString | undefined;\n if (typeof sourceMapString === 'function') {\n sourceMapStringFunction = sourceMapString;\n } else if (\n typeof sourceMapString === 'object' &&\n sourceMapString != null &&\n 'sourceMapString' in sourceMapString &&\n typeof sourceMapString['sourceMapString'] === 'function'\n ) {\n sourceMapStringFunction = (sourceMapString as NewSourceMapStringExport).sourceMapString;\n } else {\n throw new Error(`\n[@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.\nPlease check the version of Metro you are using and report the issue at http://www.github.com/getsentry/sentry-react-native/issues\n`);\n }\n\n // Always generate source maps, can't use Sentry without source maps\n const map = sourceMapStringFunction([...preModules, ...getSortedModules(graph, options)], {\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList,\n });\n return { code, map };\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAMA,0DAA0D;AAC1D,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAMA,0DAA0D;AAC1D,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,oDAAoD;AACpD,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAM1D;AAED,+CAA+C;AAC/C,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAED,kCAAkC;AAClC,wBAAgB,QAAQ,IAAI,OAAO,CAGlC;AAED,yCAAyC;AACzC,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAGrD;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAKtD;AAED,4CAA4C;AAC5C,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,gDAAgD;AAChD,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAED,mFAAmF;AACnF,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,uFAAuF;AACvF,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAMrD;AAED,mDAAmD;AACnD,wBAAgB,qBAAqB,IAAI,aAAa,GAAG,YAAY,CAEpE;AAED,iDAAiD;AACjD,wBAAgB,yBAAyB,IAAI,OAAO,CASnD"}
|
|
@@ -8,7 +8,8 @@ export function isHermesEnabled() {
|
|
|
8
8
|
}
|
|
9
9
|
/** Checks if the React Native TurboModules are enabled */
|
|
10
10
|
export function isTurboModuleEnabled() {
|
|
11
|
-
|
|
11
|
+
// Reference: https://github.com/facebook/react-native/blob/641a79dc5137b69a3c0813413b9fb82d0b9df783/packages/react-native/src/private/featureflags/ReactNativeFeatureFlagsBase.js#L110
|
|
12
|
+
return RN_GLOBAL_OBJ.RN$Bridgeless === true || RN_GLOBAL_OBJ.__turboModuleProxy != null;
|
|
12
13
|
}
|
|
13
14
|
/** Checks if the React Native Fabric renderer is running */
|
|
14
15
|
export function isFabricEnabled() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/js/utils/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,0DAA0D;AAC1D,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC;AACxC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,oBAAoB;IAClC,OAAO,aAAa,CAAC,kBAAkB,IAAI,IAAI,CAAC;
|
|
1
|
+
{"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AC,cAAc,CAAC,oBAAoB,EAAE,CAAC,qBAAqB,CAAC,CAC3E,CAAC;AACJ,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;AAClF,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,yBAAyB;IACvC,IACE,OAAO,aAAa,CAAC,OAAO,KAAK,WAAW;QAC5C,aAAa,CAAC,OAAO,CAAC,GAAG;QACzB,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,KAAK,MAAM,EAClE;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { Platform } from 'react-native';\n\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { getExpoConstants } from './expomodules';\nimport { ReactNativeLibraries } from './rnlibraries';\n\n/** Checks if the React Native Hermes engine is running */\nexport function isHermesEnabled(): boolean {\n return !!RN_GLOBAL_OBJ.HermesInternal;\n}\n\n/** Checks if the React Native TurboModules are enabled */\nexport function isTurboModuleEnabled(): boolean {\n // Reference: https://github.com/facebook/react-native/blob/641a79dc5137b69a3c0813413b9fb82d0b9df783/packages/react-native/src/private/featureflags/ReactNativeFeatureFlagsBase.js#L110\n return RN_GLOBAL_OBJ.RN$Bridgeless === true || RN_GLOBAL_OBJ.__turboModuleProxy != null;\n}\n\n/** Checks if the React Native Fabric renderer is running */\nexport function isFabricEnabled(): boolean {\n return RN_GLOBAL_OBJ.nativeFabricUIManager != null;\n}\n\n/** Returns React Native Version as semver string */\nexport function getReactNativeVersion(): string | undefined {\n if (!ReactNativeLibraries.ReactNativeVersion) {\n return undefined;\n }\n const RNV = ReactNativeLibraries.ReactNativeVersion.version;\n return `${RNV.major}.${RNV.minor}.${RNV.patch}${RNV.prerelease != null ? `-${RNV.prerelease}` : ''}`;\n}\n\n/** Checks if Expo is present in the runtime */\nexport function isExpo(): boolean {\n return RN_GLOBAL_OBJ.expo != null;\n}\n\n/** Check if JS runs in Expo Go */\nexport function isExpoGo(): boolean {\n const expoConstants = getExpoConstants();\n return (expoConstants && expoConstants.appOwnership) === 'expo';\n}\n\n/** Check Expo Go version if available */\nexport function getExpoGoVersion(): string | undefined {\n const expoConstants = getExpoConstants();\n return typeof expoConstants?.expoVersion === 'string' ? expoConstants.expoVersion : undefined;\n}\n\n/** Returns Expo SDK version if available */\nexport function getExpoSdkVersion(): string | undefined {\n const expoConstants = getExpoConstants();\n const [, expoSdkVersion] =\n typeof expoConstants?.manifest?.runtimeVersion === 'string' ? expoConstants.manifest.runtimeVersion.split(':') : [];\n return expoSdkVersion;\n}\n\n/** Checks if the current platform is web */\nexport function isWeb(): boolean {\n return Platform.OS === 'web';\n}\n\n/** Checks if the current platform is not web */\nexport function notWeb(): boolean {\n return Platform.OS !== 'web';\n}\n\n/** Checks if the current platform is supported mobile platform (iOS or Android) */\nexport function isMobileOs(): boolean {\n return Platform.OS === 'ios' || Platform.OS === 'android';\n}\n\n/** Checks if the current platform is not supported mobile platform (iOS or Android) */\nexport function notMobileOs(): boolean {\n return !isMobileOs();\n}\n\n/** Returns Hermes Version if hermes is present in the runtime */\nexport function getHermesVersion(): string | undefined {\n return (\n RN_GLOBAL_OBJ.HermesInternal &&\n RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties &&\n RN_GLOBAL_OBJ.HermesInternal.getRuntimeProperties()['OSS Release Version']\n );\n}\n\n/** Returns default environment based on __DEV__ */\nexport function getDefaultEnvironment(): 'development' | 'production' {\n return typeof __DEV__ !== 'undefined' && __DEV__ ? 'development' : 'production';\n}\n\n/** Check if SDK runs in Metro Dev Server side */\nexport function isRunningInMetroDevServer(): boolean {\n if (\n typeof RN_GLOBAL_OBJ.process !== 'undefined' &&\n RN_GLOBAL_OBJ.process.env &&\n RN_GLOBAL_OBJ.process.env.___SENTRY_METRO_DEV_SERVER___ === 'true'\n ) {\n return true;\n }\n return false;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,MAAM,WAAW,qCAAqC;IACpD,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,kFAAkF;AAClF,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE;QACf,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;QAChE,6BAA6B,CAAC,EAAE,CAAC,OAAO,EAAE,qCAAqC,KAAK,IAAI,CAAC;QACzF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;KAC5B,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;IACvC,OAAO,CAAC,EAAE;QACR,GAAG,CAAC,EAAE;YACJ,6BAA6B,CAAC,EAAE,MAAM,CAAC;SACxC,CAAC;KACH,CAAC;IACF,qBAAqB,CAAC,E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AAO,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;IACvC,OAAO,CAAC,EAAE;QACR,GAAG,CAAC,EAAE;YACJ,6BAA6B,CAAC,EAAE,MAAM,CAAC;SACxC,CAAC;KACH,CAAC;IACF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,WAAW,CAAC;IACpB,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CACpC,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,aAAa,2BAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"worldwide.js","sourceRoot":"","sources":["../../../src/js/utils/worldwide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0C1C,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,UAAuC,CAAC","sourcesContent":["import type { InternalGlobal } from '@sentry/core';\nimport { GLOBAL_OBJ } from '@sentry/core';\nimport type { ErrorUtils } from 'react-native/types';\n\nimport type { ExpoGlobalObject } from './expoglobalobject';\nexport interface HermesPromiseRejectionTrackingOptions {\n allRejections: boolean;\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** Internal Global object interface with common and Sentry specific properties */\nexport interface ReactNativeInternalGlobal extends InternalGlobal {\n __sentry_rn_v4_registered?: boolean;\n __sentry_rn_v5_registered?: boolean;\n HermesInternal?: {\n getRuntimeProperties?: () => Record<string, string | undefined>;\n enablePromiseRejectionTracker?: (options: HermesPromiseRejectionTrackingOptions) => void;\n hasPromise?: () => boolean;\n };\n Promise: unknown;\n __turboModuleProxy: unknown;\n RN$Bridgeless: unknown;\n nativeFabricUIManager: unknown;\n ErrorUtils?: ErrorUtils;\n expo?: ExpoGlobalObject;\n XMLHttpRequest?: typeof XMLHttpRequest;\n process?: {\n env?: {\n ___SENTRY_METRO_DEV_SERVER___?: string;\n };\n };\n __BUNDLE_START_TIME__?: number;\n nativePerformanceNow?: () => number;\n TextEncoder?: TextEncoder;\n alert?: (message: string) => void;\n}\n\ntype TextEncoder = {\n new (): TextEncoder;\n encode(input?: string): Uint8Array;\n};\n\n/** Get's the global object for the current JavaScript runtime */\nexport const RN_GLOBAL_OBJ = GLOBAL_OBJ as ReactNativeInternalGlobal;\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.20.0';\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
|
|
|
@@ -106,7 +110,7 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
106
110
|
[PrivateSentrySDKOnly addSdkPackage:REACT_NATIVE_SDK_PACKAGE_NAME
|
|
107
111
|
version:REACT_NATIVE_SDK_PACKAGE_VERSION];
|
|
108
112
|
|
|
109
|
-
[
|
|
113
|
+
[SentrySDKWrapper startWithOptions:sentryOptions];
|
|
110
114
|
|
|
111
115
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
112
116
|
BOOL appIsActive =
|
|
@@ -165,8 +169,13 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
165
169
|
[RNSentryReplay updateOptions:mutableOptions];
|
|
166
170
|
#endif
|
|
167
171
|
|
|
172
|
+
#if USE_SENTRY_OPTIONS
|
|
168
173
|
SentryOptions *sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions
|
|
169
174
|
didFailWithError:errorPointer];
|
|
175
|
+
#else
|
|
176
|
+
SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions
|
|
177
|
+
didFailWithError:errorPointer];
|
|
178
|
+
#endif
|
|
170
179
|
if (*errorPointer != nil) {
|
|
171
180
|
return nil;
|
|
172
181
|
}
|
|
@@ -352,7 +361,11 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, fetchNativePackageName)
|
|
|
352
361
|
- (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAddr
|
|
353
362
|
symbolicate:(SymbolicateCallbackType)symbolicate
|
|
354
363
|
{
|
|
364
|
+
#if CROSS_PLATFORM_TEST
|
|
365
|
+
BOOL shouldSymbolicateLocally = [SentrySDKInternal.options debug];
|
|
366
|
+
#else
|
|
355
367
|
BOOL shouldSymbolicateLocally = [SentrySDK.options debug];
|
|
368
|
+
#endif
|
|
356
369
|
NSString *appPackageName = [[NSBundle mainBundle] executablePath];
|
|
357
370
|
|
|
358
371
|
NSMutableSet<NSString *> *_Nonnull imagesAddrToRetrieveDebugMetaImages =
|
|
@@ -440,7 +453,7 @@ RCT_EXPORT_METHOD(fetchNativeDeviceContexts
|
|
|
440
453
|
__block NSMutableDictionary<NSString *, id> *serializedScope;
|
|
441
454
|
// Temp work around until sorted out this API in sentry-cocoa.
|
|
442
455
|
// TODO: If the callback isnt' executed the promise wouldn't be resolved.
|
|
443
|
-
[
|
|
456
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
444
457
|
serializedScope = [[scope serialize] mutableCopy];
|
|
445
458
|
|
|
446
459
|
NSDictionary<NSString *, id> *user = [serializedScope valueForKey:@"user"];
|
|
@@ -644,7 +657,7 @@ RCT_EXPORT_METHOD(fetchViewHierarchy
|
|
|
644
657
|
|
|
645
658
|
RCT_EXPORT_METHOD(setUser : (NSDictionary *)userKeys otherUserKeys : (NSDictionary *)userDataKeys)
|
|
646
659
|
{
|
|
647
|
-
[
|
|
660
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
648
661
|
[scope setUser:[RNSentry userFrom:userKeys otherUserKeys:userDataKeys]];
|
|
649
662
|
}];
|
|
650
663
|
}
|
|
@@ -693,7 +706,7 @@ RCT_EXPORT_METHOD(setUser : (NSDictionary *)userKeys otherUserKeys : (NSDictiona
|
|
|
693
706
|
|
|
694
707
|
RCT_EXPORT_METHOD(addBreadcrumb : (NSDictionary *)breadcrumb)
|
|
695
708
|
{
|
|
696
|
-
[
|
|
709
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
697
710
|
[scope addBreadcrumb:[RNSentryBreadcrumb from:breadcrumb]];
|
|
698
711
|
}];
|
|
699
712
|
|
|
@@ -707,12 +720,12 @@ RCT_EXPORT_METHOD(addBreadcrumb : (NSDictionary *)breadcrumb)
|
|
|
707
720
|
|
|
708
721
|
RCT_EXPORT_METHOD(clearBreadcrumbs)
|
|
709
722
|
{
|
|
710
|
-
[
|
|
723
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) { [scope clearBreadcrumbs]; }];
|
|
711
724
|
}
|
|
712
725
|
|
|
713
726
|
RCT_EXPORT_METHOD(setExtra : (NSString *)key extra : (NSString *)extra)
|
|
714
727
|
{
|
|
715
|
-
[
|
|
728
|
+
[SentrySDKWrapper
|
|
716
729
|
configureScope:^(SentryScope *_Nonnull scope) { [scope setExtraValue:extra forKey:key]; }];
|
|
717
730
|
}
|
|
718
731
|
|
|
@@ -722,7 +735,7 @@ RCT_EXPORT_METHOD(setContext : (NSString *)key context : (NSDictionary *)context
|
|
|
722
735
|
return;
|
|
723
736
|
}
|
|
724
737
|
|
|
725
|
-
[
|
|
738
|
+
[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
|
|
726
739
|
if (context == nil) {
|
|
727
740
|
[scope removeContextForKey:key];
|
|
728
741
|
} else {
|
|
@@ -733,17 +746,17 @@ RCT_EXPORT_METHOD(setContext : (NSString *)key context : (NSDictionary *)context
|
|
|
733
746
|
|
|
734
747
|
RCT_EXPORT_METHOD(setTag : (NSString *)key value : (NSString *)value)
|
|
735
748
|
{
|
|
736
|
-
[
|
|
749
|
+
[SentrySDKWrapper
|
|
737
750
|
configureScope:^(SentryScope *_Nonnull scope) { [scope setTagValue:value forKey:key]; }];
|
|
738
751
|
}
|
|
739
752
|
|
|
740
|
-
RCT_EXPORT_METHOD(crash) { [
|
|
753
|
+
RCT_EXPORT_METHOD(crash) { [SentrySDKWrapper crash]; }
|
|
741
754
|
|
|
742
755
|
RCT_EXPORT_METHOD(closeNativeSdk
|
|
743
756
|
: (RCTPromiseResolveBlock)resolve rejecter
|
|
744
757
|
: (RCTPromiseRejectBlock)reject)
|
|
745
758
|
{
|
|
746
|
-
[
|
|
759
|
+
[SentrySDKWrapper close];
|
|
747
760
|
resolve(@YES);
|
|
748
761
|
}
|
|
749
762
|
|
|
@@ -819,7 +832,15 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, startProfiling : (BOOL)platf
|
|
|
819
832
|
{
|
|
820
833
|
#if SENTRY_PROFILING_ENABLED
|
|
821
834
|
try {
|
|
835
|
+
# ifdef NEW_HERMES_RUNTIME
|
|
836
|
+
auto *hermesAPI = facebook::jsi::castInterface<facebook::hermes::IHermesRootAPI>(
|
|
837
|
+
facebook::hermes::makeHermesRootAPI());
|
|
838
|
+
if (hermesAPI) {
|
|
839
|
+
hermesAPI->enableSamplingProfiler();
|
|
840
|
+
}
|
|
841
|
+
# else
|
|
822
842
|
facebook::hermes::HermesRuntime::enableSamplingProfiler();
|
|
843
|
+
# endif
|
|
823
844
|
if (nativeProfileTraceId == nil && nativeProfileStartTime == 0 && platformProfilers) {
|
|
824
845
|
# if SENTRY_TARGET_PROFILING_SUPPORTED
|
|
825
846
|
nativeProfileTraceId = [RNSentryId newId];
|
|
@@ -879,10 +900,19 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, stopProfiling)
|
|
|
879
900
|
nativeProfileTraceId = nil;
|
|
880
901
|
nativeProfileStartTime = 0;
|
|
881
902
|
|
|
882
|
-
facebook::hermes::HermesRuntime::disableSamplingProfiler();
|
|
883
903
|
std::stringstream ss;
|
|
904
|
+
# ifdef NEW_HERMES_RUNTIME
|
|
905
|
+
auto *hermesAPI = facebook::jsi::castInterface<facebook::hermes::IHermesRootAPI>(
|
|
906
|
+
facebook::hermes::makeHermesRootAPI());
|
|
907
|
+
if (hermesAPI) {
|
|
908
|
+
hermesAPI->disableSamplingProfiler();
|
|
909
|
+
hermesAPI->dumpSampledTraceToStream(ss);
|
|
910
|
+
}
|
|
911
|
+
# else
|
|
912
|
+
facebook::hermes::HermesRuntime::disableSamplingProfiler();
|
|
884
913
|
// Before RN 0.69 Hermes used llvh::raw_ostream (profiling is supported for 0.69 and newer)
|
|
885
914
|
facebook::hermes::HermesRuntime::dumpSampledTraceToStream(ss);
|
|
915
|
+
# endif
|
|
886
916
|
|
|
887
917
|
std::string s = ss.str();
|
|
888
918
|
NSString *data = [NSString stringWithCString:s.c_str()
|
|
@@ -946,7 +976,7 @@ RCT_EXPORT_METHOD(crashedLastRun
|
|
|
946
976
|
: (RCTPromiseResolveBlock)resolve rejecter
|
|
947
977
|
: (RCTPromiseRejectBlock)reject)
|
|
948
978
|
{
|
|
949
|
-
resolve(@([
|
|
979
|
+
resolve(@([SentrySDKWrapper crashedLastRun]));
|
|
950
980
|
}
|
|
951
981
|
|
|
952
982
|
// 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],
|
|
@@ -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 = @"6.
|
|
6
|
+
NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"6.20.0";
|
|
@@ -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": "6.
|
|
5
|
+
"version": "6.20.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",
|
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
"clean:plugin": "expo-module clean plugin",
|
|
31
31
|
"circularDepCheck": "madge --circular dist/js/index.js && madge --circular metro.js && madge --circular expo.js",
|
|
32
32
|
"test": "yarn test:sdk && yarn test:tools",
|
|
33
|
-
"test:sdk": "
|
|
33
|
+
"test:sdk": "sh -c 'if [ \"$CI\" = \"true\" ]; then yarn test:sdk-ci; else yarn test:sdk-local; fi'",
|
|
34
|
+
"test:sdk-ci": "npx jest",
|
|
35
|
+
"test:sdk-local": "jest --maxWorkers=8",
|
|
34
36
|
"test:tools": "npx jest --config jest.config.tools.js",
|
|
35
37
|
"test:watch": "npx jest --watch",
|
|
36
38
|
"yalc:add:sentry-javascript": "yalc add @sentry/browser @sentry/core @sentry/react @sentry/types",
|
|
@@ -65,9 +67,9 @@
|
|
|
65
67
|
"react-native": ">=0.65.0"
|
|
66
68
|
},
|
|
67
69
|
"dependencies": {
|
|
68
|
-
"@sentry/babel-plugin-component-annotate": "
|
|
70
|
+
"@sentry/babel-plugin-component-annotate": "4.1.1",
|
|
69
71
|
"@sentry/browser": "8.55.0",
|
|
70
|
-
"@sentry/cli": "2.
|
|
72
|
+
"@sentry/cli": "2.51.1",
|
|
71
73
|
"@sentry/core": "8.55.0",
|
|
72
74
|
"@sentry/react": "8.55.0",
|
|
73
75
|
"@sentry/types": "8.55.0",
|
|
@@ -81,7 +83,7 @@
|
|
|
81
83
|
"@sentry-internal/eslint-config-sdk": "8.55.0",
|
|
82
84
|
"@sentry-internal/eslint-plugin-sdk": "8.55.0",
|
|
83
85
|
"@sentry-internal/typescript": "8.55.0",
|
|
84
|
-
"@sentry/wizard": "
|
|
86
|
+
"@sentry/wizard": "6.2.0",
|
|
85
87
|
"@testing-library/react-native": "^12.7.2",
|
|
86
88
|
"@types/jest": "^29.5.13",
|
|
87
89
|
"@types/node": "^20.9.3",
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
"jest-environment-jsdom": "^29.6.2",
|
|
105
107
|
"jest-extended": "^4.0.2",
|
|
106
108
|
"madge": "^6.1.0",
|
|
107
|
-
"metro": "0.
|
|
109
|
+
"metro": "0.83.1",
|
|
108
110
|
"prettier": "^2.0.5",
|
|
109
111
|
"react": "18.3.1",
|
|
110
112
|
"react-native": "0.77.1",
|
|
@@ -8,7 +8,7 @@ export interface SentryAndroidGradlePluginOptions {
|
|
|
8
8
|
includeNativeSources?: boolean;
|
|
9
9
|
includeSourceContext?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const sentryAndroidGradlePluginVersion = "5.
|
|
11
|
+
export declare const sentryAndroidGradlePluginVersion = "5.9.0";
|
|
12
12
|
/**
|
|
13
13
|
* Adds the Sentry Android Gradle Plugin to the project.
|
|
14
14
|
* https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-sentry-agp
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withSentryAndroidGradlePlugin = exports.sentryAndroidGradlePluginVersion = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
|
-
exports.sentryAndroidGradlePluginVersion = '5.
|
|
6
|
+
exports.sentryAndroidGradlePluginVersion = '5.9.0';
|
|
7
7
|
/**
|
|
8
8
|
* Adds the Sentry Android Gradle Plugin to the project.
|
|
9
9
|
* https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-sentry-agp
|
|
@@ -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);
|
|
@@ -231,7 +234,7 @@ if (numAssetsUploaded === totalAssets) {
|
|
|
231
234
|
console.log('✅ Uploaded bundles and sourcemaps to Sentry successfully.');
|
|
232
235
|
} else {
|
|
233
236
|
console.warn(
|
|
234
|
-
`⚠️ Uploaded ${numAssetsUploaded} of ${totalAssets} bundles and sourcemaps. ${numAssetsUploaded === 0 ? 'Ensure you are running `expo export` with the `--
|
|
237
|
+
`⚠️ Uploaded ${numAssetsUploaded} of ${totalAssets} bundles and sourcemaps. ${numAssetsUploaded === 0 ? 'Ensure you are running `expo export` with the `--source-maps` flag.' : ''
|
|
235
238
|
}`,
|
|
236
239
|
);
|
|
237
240
|
}
|
|
@@ -24,7 +24,7 @@ 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
30
|
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
|
package/scripts/sentry-xcode.sh
CHANGED
|
@@ -13,7 +13,7 @@ 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
19
|
if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
|
package/scripts/sentry_utils.rb
CHANGED
package/sentry.gradle
CHANGED
|
@@ -201,7 +201,7 @@ project.afterEvaluate {
|
|
|
201
201
|
|
|
202
202
|
project.logger.lifecycle("Sentry-CLI arguments: ${args}")
|
|
203
203
|
def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c', 'node'] : []
|
|
204
|
-
if (!System.getenv('SENTRY_DOTENV_PATH')) {
|
|
204
|
+
if (!System.getenv('SENTRY_DOTENV_PATH') && file("$reactRoot/.env.sentry-build-plugin").exists()) {
|
|
205
205
|
environment('SENTRY_DOTENV_PATH', "$reactRoot/.env.sentry-build-plugin")
|
|
206
206
|
}
|
|
207
207
|
commandLine(*osCompatibility, *args)
|
|
@@ -305,8 +305,7 @@ def resolveSentryReactNativeSDKPath(reactRoot) {
|
|
|
305
305
|
def resolveSentryCliPackagePath(reactRoot) {
|
|
306
306
|
def resolvedCliPath = null
|
|
307
307
|
try {
|
|
308
|
-
|
|
309
|
-
resolvedCliPath = file.text.trim().getParentFile();
|
|
308
|
+
resolvedCliPath = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir).text.trim()).getParentFile();
|
|
310
309
|
} catch (Throwable ignored) { // Check if it's located in .pnpm
|
|
311
310
|
try {
|
|
312
311
|
def pnpmRefPath = reactRoot.toString() + "/node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"
|
package/ts3.8/dist/js/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Breadcrumb, Request, 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, metricsDefault as metrics, 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, metricsDefault as metrics, lastEventId, } from '@sentry/core';
|
|
3
3
|
export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
4
4
|
export * from './integrations/exports';
|
|
5
5
|
export { SDK_NAME, SDK_VERSION } from './version';
|
|
@@ -198,6 +198,13 @@ export interface BaseReactNativeOptions {
|
|
|
198
198
|
* 1.0 will record all sessions and 0 will record none.
|
|
199
199
|
*/
|
|
200
200
|
replaysOnErrorSampleRate?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Defines the quality of the session replay. The higher the quality, the more accurate the replay
|
|
203
|
+
* will be, but also more data to transfer and more CPU load.
|
|
204
|
+
*
|
|
205
|
+
* @default 'medium'
|
|
206
|
+
*/
|
|
207
|
+
replaysSessionQuality?: SentryReplayQuality;
|
|
201
208
|
/**
|
|
202
209
|
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
203
210
|
*/
|
|
@@ -234,6 +241,7 @@ export interface BaseReactNativeOptions {
|
|
|
234
241
|
*/
|
|
235
242
|
useThreadsForMessageStack?: boolean;
|
|
236
243
|
}
|
|
244
|
+
export type SentryReplayQuality = 'low' | 'medium' | 'high';
|
|
237
245
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
238
246
|
/**
|
|
239
247
|
* @deprecated use `maxQueueSize` in the root of the SDK options.
|