@sentry/react-native 7.3.0 → 7.4.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 CHANGED
@@ -46,7 +46,7 @@ Pod::Spec.new do |s|
46
46
 
47
47
  s.compiler_flags = other_cflags
48
48
 
49
- s.dependency 'Sentry/HybridSDK', '8.56.2'
49
+ s.dependency 'Sentry/HybridSDK', '8.57.0'
50
50
 
51
51
  if defined? install_modules_dependencies
52
52
  # Default React Native dependencies for 0.71 and above (new and legacy architecture)
Binary file
@@ -2,7 +2,7 @@ package io.sentry.react;
2
2
 
3
3
  class RNSentryVersion {
4
4
  static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
5
- static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.3.0";
5
+ static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.4.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";
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAuC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAkHvF"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAuC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAmHvF"}
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable complexity */
2
- import { browserSessionIntegration } from '@sentry/browser';
2
+ import { browserSessionIntegration, consoleLoggingIntegration } from '@sentry/browser';
3
3
  import { reactNativeTracingIntegration } from '../tracing';
4
4
  import { notWeb } from '../utils/environment';
5
5
  import { appRegistryIntegration, appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, createNativeFramesIntegrations, createReactNativeRewriteFrames, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, logEnricherIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, primitiveTagIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, timeToDisplayIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
@@ -44,6 +44,7 @@ export function getDefaultIntegrations(options) {
44
44
  integrations.push(modulesLoaderIntegration());
45
45
  if (options.enableLogs) {
46
46
  integrations.push(logEnricherIntegration());
47
+ integrations.push(consoleLoggingIntegration());
47
48
  }
48
49
  if (options.attachScreenshot) {
49
50
  integrations.push(screenshotIntegration());
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAG5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC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BAAwB,KAAK,QAAQ,CAAC;IAC/G,MAAM,2BAA2B,GAC/B,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,CAAC;IAE9F,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,EAAE;QACpD,wCAAwC;QACxC,OAAO,CAAC,wBAAwB,GAAG,MAAA,OAAO,CAAC,YAAY,0CAAE,wBAAwB,CAAC;QAClF,OAAO,CAAC,wBAAwB,GAAG,MAAA,OAAO,CAAC,YAAY,0CAAE,wBAAwB,CAAC;KACnF;IAED,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,CAAC,IAAI,MAAM,EAAE,EAAE;QACjE,0FAA0F;QAC1F,yFAAyF;QACzF,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,EAAE;QACvB,YAAY,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,CAAC;KACnD;IAED,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAE7C,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport { browserSessionIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { notWeb } from '../utils/environment';\nimport {\n appRegistryIntegration,\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n createNativeFramesIntegrations,\n createReactNativeRewriteFrames,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n logEnricherIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n primitiveTagIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n timeToDisplayIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n\n if (options.enableAutoSessionTracking) {\n integrations.push(browserSessionIntegration());\n }\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.enableLogs) {\n integrations.push(logEnricherIntegration());\n }\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (typeof options.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking && options.enableNative) {\n integrations.push(appStartIntegration());\n }\n const nativeFramesIntegrationInstance = createNativeFramesIntegrations(\n hasTracingEnabled && options.enableNativeFramesTracking && options.enableNative,\n );\n if (nativeFramesIntegrationInstance) {\n integrations.push(nativeFramesIntegrationInstance);\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(appRegistryIntegration());\n integrations.push(reactNativeTracingIntegration());\n }\n if (hasTracingEnabled) {\n integrations.push(timeToDisplayIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n integrations.push(expoContextIntegration());\n\n if (options.spotlight) {\n const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n const hasReplayOptions =\n typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';\n const hasExperimentsReplayOptions =\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');\n\n if (!hasReplayOptions && hasExperimentsReplayOptions) {\n // Remove in the next major version (v7)\n options.replaysOnErrorSampleRate = options._experiments?.replaysOnErrorSampleRate;\n options.replaysSessionSampleRate = options._experiments?.replaysSessionSampleRate;\n }\n\n if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {\n // We can't create and add browserReplayIntegration as it overrides the users supplied one\n // The browser replay integration works differently than the rest of default integrations\n integrations.push(mobileReplayIntegration());\n }\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(primitiveTagIntegration());\n\n return integrations;\n}\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAGvF,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,uBAAuB,EACvB,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAEnB;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAiC;;IACtE,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,IAAI,MAAM,EAAE,EAAE;QACZ,YAAY,CAAC,IAAI,CACf,mCAAmC,CAAC;YAClC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;SAC/C,CAAC,CACH,CAAC;QACF,YAAY,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,CAAC;KACpD;SAAM;QACL,YAAY,CAAC,IAAI,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AC,CAAC;KACnD;IAED,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAE7C,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport { browserSessionIntegration, consoleLoggingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { notWeb } from '../utils/environment';\nimport {\n appRegistryIntegration,\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n createNativeFramesIntegrations,\n createReactNativeRewriteFrames,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n logEnricherIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n primitiveTagIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n timeToDisplayIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n\n if (options.enableAutoSessionTracking) {\n integrations.push(browserSessionIntegration());\n }\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.enableLogs) {\n integrations.push(logEnricherIntegration());\n integrations.push(consoleLoggingIntegration());\n }\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (typeof options.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking && options.enableNative) {\n integrations.push(appStartIntegration());\n }\n const nativeFramesIntegrationInstance = createNativeFramesIntegrations(\n hasTracingEnabled && options.enableNativeFramesTracking && options.enableNative,\n );\n if (nativeFramesIntegrationInstance) {\n integrations.push(nativeFramesIntegrationInstance);\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(appRegistryIntegration());\n integrations.push(reactNativeTracingIntegration());\n }\n if (hasTracingEnabled) {\n integrations.push(timeToDisplayIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n integrations.push(expoContextIntegration());\n\n if (options.spotlight) {\n const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n const hasReplayOptions =\n typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';\n const hasExperimentsReplayOptions =\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');\n\n if (!hasReplayOptions && hasExperimentsReplayOptions) {\n // Remove in the next major version (v7)\n options.replaysOnErrorSampleRate = options._experiments?.replaysOnErrorSampleRate;\n options.replaysSessionSampleRate = options._experiments?.replaysSessionSampleRate;\n }\n\n if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {\n // We can't create and add browserReplayIntegration as it overrides the users supplied one\n // The browser replay integration works differently than the rest of default integrations\n integrations.push(mobileReplayIntegration());\n }\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(primitiveTagIntegration());\n\n return integrations;\n}\n"]}
@@ -249,6 +249,19 @@ export interface BaseReactNativeOptions {
249
249
  * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.
250
250
  */
251
251
  useThreadsForMessageStack?: boolean;
252
+ /**
253
+ * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,
254
+ * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}
255
+ * option to control to which outgoing requests the header will be attached.
256
+ *
257
+ * **Important:** If you set this option to `true`, make sure that you configured your servers'
258
+ * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.
259
+ *
260
+ * @see https://www.w3.org/TR/trace-context/
261
+ *
262
+ * @default false
263
+ */
264
+ propagateTraceparent?: boolean;
252
265
  }
253
266
  export type SentryReplayQuality = 'low' | 'medium' | 'high';
254
267
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
@@ -1 +1 @@
1
- {"version":3,"file":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1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA+T/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { BrowserOptions, Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { isExpoGo } from './utils/environment';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\ntype BrowserExperiments = NonNullable<BrowserOptions['_experiments']>;\ntype SharedExperimentsSubset = BrowserExperiments;\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Defines the quality of the session replay. The higher the quality, the more accurate the replay\n * will be, but also more data to transfer and more CPU load.\n *\n * @default 'medium'\n */\n replaysSessionQuality?: SentryReplayQuality;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: SharedExperimentsSubset & {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.\n *\n * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app’s runtime, regardless of the number of C++ modules or how they’re linked. It helps in obtaining accurate stack traces.\n *\n * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.\n *\n * @default false\n */\n enableUnhandledCPPExceptionsV2?: boolean;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport type SentryReplayQuality = 'low' | 'medium' | 'high';\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n if (isExpoGo()) {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA6U/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { BrowserOptions, Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { isExpoGo } from './utils/environment';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\ntype BrowserExperiments = NonNullable<BrowserOptions['_experiments']>;\ntype SharedExperimentsSubset = BrowserExperiments;\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Defines the quality of the session replay. The higher the quality, the more accurate the replay\n * will be, but also more data to transfer and more CPU load.\n *\n * @default 'medium'\n */\n replaysSessionQuality?: SentryReplayQuality;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: SharedExperimentsSubset & {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.\n *\n * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app’s runtime, regardless of the number of C++ modules or how they’re linked. It helps in obtaining accurate stack traces.\n *\n * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.\n *\n * @default false\n */\n enableUnhandledCPPExceptionsV2?: boolean;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n}\n\nexport type SentryReplayQuality = 'low' | 'medium' | 'high';\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n if (isExpoGo()) {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,KAAK,EAAE,MAAM,cAAc,CAAC;AAanF,OAAO,KAAK,KAAK,MAAM,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,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,OAAO,CAAC,EAAE,yBAAyB,GAClC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAsBxB;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAe9C;AAED;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAUzE;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAE9D"}
package/dist/js/sdk.js CHANGED
@@ -40,6 +40,7 @@ const DEFAULT_OPTIONS = {
40
40
  enableNativeFramesTracking: true,
41
41
  enableStallTracking: true,
42
42
  enableUserInteractionTracing: false,
43
+ propagateTraceparent: false,
43
44
  };
44
45
  /**
45
46
  * Inits the SDK and returns the final options.
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EACL,KAAK,EACL,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,iCAAiC,EACjC,SAAS,IAAI,aAAa,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAA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6B;IACxD,MAAM,YAAY,GAAG,CAAC,KAAY,EAAiB,EAAE;QACnD,IAAI;YACF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;YACzD,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,CAAC;IACF,OAAO,aAAa,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,cAAc;;QAClC,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;CAAA","sourcesContent":["/* eslint-disable complexity */\nimport type { Breadcrumb, BreadcrumbHint, Integration, Scope } from '@sentry/core';\nimport {\n debug,\n getClient,\n getGlobalScope,\n getIntegrationsToSetup,\n getIsolationScope,\n initAndBind,\n makeDsn,\n stackParserFromStackParserOptions,\n withScope as coreWithScope,\n} from '@sentry/core';\nimport { defaultStackParser, makeFetchTransport, Profiler } from '@sentry/react';\nimport * as React from 'react';\nimport { ReactNativeClient } from './client';\nimport { FeedbackWidgetProvider } from './feedback/FeedbackWidgetProvider';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { getDefaultIntegrations } from './integrations/default';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { shouldEnableNativeNagger } from './options';\nimport { enableSyncToNative } from './scopeSync';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler } from './tracing';\nimport { useEncodePolyfill } from './transports/encodePolyfill';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer, isWeb } from './utils/environment';\nimport { getDefaultRelease } from './utils/release';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n enableNdk: true,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n if (isRunningInMetroDevServer()) {\n return;\n }\n\n const maxQueueSize = passedOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? passedOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n\n useEncodePolyfill();\n if (enableNative) {\n enableSyncToNative(getGlobalScope());\n enableSyncToNative(getIsolationScope());\n }\n\n const getURLFromDSN = (dsn: string | undefined): string | undefined => {\n if (!dsn) {\n return undefined;\n }\n const dsnComponents = makeDsn(dsn);\n if (!dsnComponents) {\n debug.error('Failed to extract url from DSN: ', dsn);\n return undefined;\n }\n const port = dsnComponents.port ? `:${dsnComponents.port}` : '';\n return `${dsnComponents.protocol}://${dsnComponents.host}${port}`;\n };\n\n const userBeforeBreadcrumb = safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' });\n\n // Exclude Dev Server and Sentry Dsn request from Breadcrumbs\n const devServerUrl = getDevServer()?.url;\n const dsn = getURLFromDSN(passedOptions.dsn);\n const defaultBeforeBreadcrumb = (breadcrumb: Breadcrumb, _hint?: BreadcrumbHint): Breadcrumb | null => {\n const type = breadcrumb.type || '';\n const url = typeof breadcrumb.data?.url === 'string' ? breadcrumb.data.url : '';\n if (type === 'http' && ((devServerUrl && url.startsWith(devServerUrl)) || (dsn && url.startsWith(dsn)))) {\n return null;\n }\n return breadcrumb;\n };\n\n const chainedBeforeBreadcrumb = (breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null => {\n let modifiedBreadcrumb = breadcrumb;\n if (userBeforeBreadcrumb) {\n const result = userBeforeBreadcrumb(breadcrumb, hint);\n if (result === null) {\n return null;\n }\n modifiedBreadcrumb = result;\n }\n return defaultBeforeBreadcrumb(modifiedBreadcrumb, hint);\n };\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n release: passedOptions.release ?? getDefaultRelease(),\n enableNative,\n enableNativeNagger: shouldEnableNativeNagger(passedOptions.enableNativeNagger),\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: chainedBeforeBreadcrumb,\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n };\n if ('tracesSampler' in options) {\n options.tracesSampler = safeTracesSampler(options.tracesSampler);\n }\n\n if (!('environment' in options)) {\n options.environment = getDefaultEnvironment();\n }\n\n const defaultIntegrations: false | Integration[] = passedOptions.defaultIntegrations === undefined\n ? getDefaultIntegrations(options)\n : passedOptions.defaultIntegrations;\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n if (isExpoGo()) {\n debug.log('Offline caching, native errors features are not available in Expo Go.');\n debug.log('Use EAS Build / Native Release Build to test these features.');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends Record<string, unknown>>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const profilerProps = {\n ...(options?.profilerProps),\n name: RootComponent.displayName ?? 'Root',\n updateProps: {}\n };\n\n const ProfilerComponent = isWeb() ? Profiler : ReactNativeProfiler;\n\n const RootApp: React.FC<P> = appProps => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ProfilerComponent {...profilerProps}>\n <FeedbackWidgetProvider>\n <RootComponent {...appProps} />\n </FeedbackWidgetProvider>\n </ProfilerComponent>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n NATIVE.nativeCrash();\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getClient();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n debug.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getClient();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n debug.error('Failed to close the SDK');\n }\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T | undefined {\n const safeCallback = (scope: Scope): T | undefined => {\n try {\n return callback(scope);\n } catch (e) {\n debug.error('Error while running withScope callback', e);\n return undefined;\n }\n };\n return coreWithScope(safeCallback);\n}\n\n/**\n * Returns if the app crashed in the last run.\n */\nexport async function crashedLastRun(): Promise<boolean | null> {\n return NATIVE.crashedLastRun();\n}\n"]}
1
+ {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../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MAAM,CAAC;aACf;YACD,oCAAoC;SACrC;QAAC,OAAO,CAAC,EAAE,GAAG;QAEf,KAAK,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAEhD,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,UAAgB,KAAK;;QACzB,IAAI;YACF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAE3B,IAAI,MAAM,EAAE;gBACV,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;aACtB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;SACxC;IACH,CAAC;CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAI,QAA6B;IACxD,MAAM,YAAY,GAAG,CAAC,KAAY,EAAiB,EAAE;QACnD,IAAI;YACF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;YACzD,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,CAAC;IACF,OAAO,aAAa,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,cAAc;;QAClC,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;CAAA","sourcesContent":["/* eslint-disable complexity */\nimport type { Breadcrumb, BreadcrumbHint, Integration, Scope } from '@sentry/core';\nimport {\n debug,\n getClient,\n getGlobalScope,\n getIntegrationsToSetup,\n getIsolationScope,\n initAndBind,\n makeDsn,\n stackParserFromStackParserOptions,\n withScope as coreWithScope,\n} from '@sentry/core';\nimport { defaultStackParser, makeFetchTransport, Profiler } from '@sentry/react';\nimport * as React from 'react';\nimport { ReactNativeClient } from './client';\nimport { FeedbackWidgetProvider } from './feedback/FeedbackWidgetProvider';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { getDefaultIntegrations } from './integrations/default';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { shouldEnableNativeNagger } from './options';\nimport { enableSyncToNative } from './scopeSync';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler } from './tracing';\nimport { useEncodePolyfill } from './transports/encodePolyfill';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer, isWeb } from './utils/environment';\nimport { getDefaultRelease } from './utils/release';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n enableNdk: true,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n propagateTraceparent: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n if (isRunningInMetroDevServer()) {\n return;\n }\n\n const maxQueueSize = passedOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? passedOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n\n useEncodePolyfill();\n if (enableNative) {\n enableSyncToNative(getGlobalScope());\n enableSyncToNative(getIsolationScope());\n }\n\n const getURLFromDSN = (dsn: string | undefined): string | undefined => {\n if (!dsn) {\n return undefined;\n }\n const dsnComponents = makeDsn(dsn);\n if (!dsnComponents) {\n debug.error('Failed to extract url from DSN: ', dsn);\n return undefined;\n }\n const port = dsnComponents.port ? `:${dsnComponents.port}` : '';\n return `${dsnComponents.protocol}://${dsnComponents.host}${port}`;\n };\n\n const userBeforeBreadcrumb = safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' });\n\n // Exclude Dev Server and Sentry Dsn request from Breadcrumbs\n const devServerUrl = getDevServer()?.url;\n const dsn = getURLFromDSN(passedOptions.dsn);\n const defaultBeforeBreadcrumb = (breadcrumb: Breadcrumb, _hint?: BreadcrumbHint): Breadcrumb | null => {\n const type = breadcrumb.type || '';\n const url = typeof breadcrumb.data?.url === 'string' ? breadcrumb.data.url : '';\n if (type === 'http' && ((devServerUrl && url.startsWith(devServerUrl)) || (dsn && url.startsWith(dsn)))) {\n return null;\n }\n return breadcrumb;\n };\n\n const chainedBeforeBreadcrumb = (breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null => {\n let modifiedBreadcrumb = breadcrumb;\n if (userBeforeBreadcrumb) {\n const result = userBeforeBreadcrumb(breadcrumb, hint);\n if (result === null) {\n return null;\n }\n modifiedBreadcrumb = result;\n }\n return defaultBeforeBreadcrumb(modifiedBreadcrumb, hint);\n };\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n release: passedOptions.release ?? getDefaultRelease(),\n enableNative,\n enableNativeNagger: shouldEnableNativeNagger(passedOptions.enableNativeNagger),\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: chainedBeforeBreadcrumb,\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n };\n if ('tracesSampler' in options) {\n options.tracesSampler = safeTracesSampler(options.tracesSampler);\n }\n\n if (!('environment' in options)) {\n options.environment = getDefaultEnvironment();\n }\n\n const defaultIntegrations: false | Integration[] = passedOptions.defaultIntegrations === undefined\n ? getDefaultIntegrations(options)\n : passedOptions.defaultIntegrations;\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n if (isExpoGo()) {\n debug.log('Offline caching, native errors features are not available in Expo Go.');\n debug.log('Use EAS Build / Native Release Build to test these features.');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends Record<string, unknown>>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const profilerProps = {\n ...(options?.profilerProps),\n name: RootComponent.displayName ?? 'Root',\n updateProps: {}\n };\n\n const ProfilerComponent = isWeb() ? Profiler : ReactNativeProfiler;\n\n const RootApp: React.FC<P> = appProps => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ProfilerComponent {...profilerProps}>\n <FeedbackWidgetProvider>\n <RootComponent {...appProps} />\n </FeedbackWidgetProvider>\n </ProfilerComponent>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n NATIVE.nativeCrash();\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getClient();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n debug.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getClient();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n debug.error('Failed to close the SDK');\n }\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T | undefined {\n const safeCallback = (scope: Scope): T | undefined => {\n try {\n return callback(scope);\n } catch (e) {\n debug.error('Error while running withScope callback', e);\n return undefined;\n }\n };\n return coreWithScope(safeCallback);\n}\n\n/**\n * Returns if the app crashed in the last run.\n */\nexport async function crashedLastRun(): Promise<boolean | null> {\n return NATIVE.crashedLastRun();\n}\n"]}
@@ -92,7 +92,7 @@ Please check the version of Metro you are using and report the issue at http://w
92
92
  // Always generate source maps, can't use Sentry without source maps
93
93
  const map = sourceMapStringFunction([...preModules, ...(0, exports.getSortedModules)(graph, options)], {
94
94
  processModuleFilter: options.processModuleFilter,
95
- shouldAddToIgnoreList: options.shouldAddToIgnoreList,
95
+ shouldAddToIgnoreList: options.shouldAddToIgnoreList || (() => false),
96
96
  });
97
97
  return { code, map };
98
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;;AAiC3C,IAAI,kBAAuB,CAAC;AAC5B,IAAI;IACF,kBAAkB,GAAG,OAAO,CAAC,qDAAqD,CAAC,CAAC;CACrF;AAAC,WAAM;IACN,kBAAkB,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAC;CACjF;AAED,MAAM,YAAY,GAChB,OAAO,kBAAkB,KAAK,UAAU;IACtC,CAAC,CAAC,kBAAkB;IACpB,CAAC,CAAC,sEAAsE;QACtE,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,YAAY,mCAAI,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB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@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';\nimport type { MetroSerializer } from '../../utils';\n\nlet baseJSBundleModule: any;\ntry {\n baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');\n} catch {\n baseJSBundleModule = require('metro/src/DeltaBundler/Serializers/baseJSBundle');\n}\n\nconst baseJSBundle: typeof baseJSBundleType =\n typeof baseJSBundleModule === 'function'\n ? baseJSBundleModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n baseJSBundleModule?.baseJSBundle ?? baseJSBundleModule?.default;\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 bundleToStringModule: any;\ntry {\n bundleToStringModule = require('metro/private/lib/bundleToString');\n} catch {\n bundleToStringModule = require('metro/src/lib/bundleToString');\n}\n\nconst bundleToString: typeof bundleToStringType =\n typeof bundleToStringModule === 'function'\n ? bundleToStringModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n bundleToStringModule?.bundleToString ?? bundleToStringModule?.default;\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
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;;AAiC3C,IAAI,kBAAuB,CAAC;AAC5B,IAAI;IACF,kBAAkB,GAAG,OAAO,CAAC,qDAAqD,CAAC,CAAC;CACrF;AAAC,WAAM;IACN,kBAAkB,GAAG,OA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AAC,CAAC,EAAE;YACxF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SACtE,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';\nimport type { MetroSerializer } from '../../utils';\n\nlet baseJSBundleModule: any;\ntry {\n baseJSBundleModule = require('metro/private/DeltaBundler/Serializers/baseJSBundle');\n} catch {\n baseJSBundleModule = require('metro/src/DeltaBundler/Serializers/baseJSBundle');\n}\n\nconst baseJSBundle: typeof baseJSBundleType =\n typeof baseJSBundleModule === 'function'\n ? baseJSBundleModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n baseJSBundleModule?.baseJSBundle ?? baseJSBundleModule?.default;\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 bundleToStringModule: any;\ntry {\n bundleToStringModule = require('metro/private/lib/bundleToString');\n} catch {\n bundleToStringModule = require('metro/src/lib/bundleToString');\n}\n\nconst bundleToString: typeof bundleToStringType =\n typeof bundleToStringModule === 'function'\n ? bundleToStringModule\n : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n bundleToStringModule?.bundleToString ?? bundleToStringModule?.default;\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 || (() => false),\n });\n return { code, map };\n };\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "7.3.0";
3
+ export declare const SDK_VERSION = "7.4.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '7.3.0';
3
+ export const SDK_VERSION = '7.4.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -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,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.3.0';\n"]}
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,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.4.0';\n"]}
package/ios/RNSentry.mm CHANGED
@@ -234,7 +234,10 @@ RCT_EXPORT_METHOD(initNativeSdk : (NSDictionary *_Nonnull)options resolve : (
234
234
  [mutableOptions removeObjectForKey:@"enableTracing"];
235
235
 
236
236
  #if SENTRY_TARGET_REPLAY_SUPPORTED
237
- [RNSentryReplay updateOptions:mutableOptions];
237
+ BOOL isSessionReplayEnabled = [RNSentryReplay updateOptions:mutableOptions];
238
+ #else
239
+ // Defaulting to false for unsupported targets
240
+ BOOL isSessionReplayEnabled = NO;
238
241
  #endif
239
242
 
240
243
  SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions
@@ -315,6 +318,11 @@ RCT_EXPORT_METHOD(initNativeSdk : (NSDictionary *_Nonnull)options resolve : (
315
318
  sentryOptions:sentryOptions];
316
319
  }
317
320
 
321
+ if (isSessionReplayEnabled) {
322
+ [RNSentryExperimentalOptions setEnableSessionReplayInUnreliableEnvironment:YES
323
+ sentryOptions:sentryOptions];
324
+ }
325
+
318
326
  return sentryOptions;
319
327
  }
320
328
 
@@ -28,6 +28,15 @@ NS_ASSUME_NONNULL_BEGIN
28
28
  */
29
29
  + (void)setEnableLogs:(BOOL)enabled sentryOptions:(SentryOptions *)sentryOptions;
30
30
 
31
+ /**
32
+ * Sets the enableSessionReplayInUnreliableEnvironment experimental option on SentryOptions
33
+ * @param sentryOptions The SentryOptions instance to configure
34
+ * @param enabled Whether enableSessionReplayInUnreliableEnvironment from sentry Cocoa should be
35
+ * enabled
36
+ */
37
+ + (void)setEnableSessionReplayInUnreliableEnvironment:(BOOL)enabled
38
+ sentryOptions:(SentryOptions *)sentryOptions;
39
+
31
40
  @end
32
41
 
33
42
  NS_ASSUME_NONNULL_END
@@ -27,4 +27,13 @@
27
27
  sentryOptions.experimental.enableLogs = enabled;
28
28
  }
29
29
 
30
+ + (void)setEnableSessionReplayInUnreliableEnvironment:(BOOL)enabled
31
+ sentryOptions:(SentryOptions *)sentryOptions
32
+ {
33
+ if (sentryOptions == nil) {
34
+ return;
35
+ }
36
+ sentryOptions.experimental.enableSessionReplayInUnreliableEnvironment = enabled;
37
+ }
38
+
30
39
  @end
@@ -1,7 +1,11 @@
1
1
 
2
2
  @interface RNSentryReplay : NSObject
3
3
 
4
- + (void)updateOptions:(NSMutableDictionary *)options;
4
+ /**
5
+ * Updates the session replay options
6
+ * @return true when session replay is enabled
7
+ */
8
+ + (BOOL)updateOptions:(NSMutableDictionary *)options;
5
9
 
6
10
  + (void)postInit;
7
11
 
@@ -12,12 +12,14 @@
12
12
  @implementation RNSentryReplay {
13
13
  }
14
14
 
15
- + (void)updateOptions:(NSMutableDictionary *)options
15
+ + (BOOL)updateOptions:(NSMutableDictionary *)options
16
16
  {
17
- if (options[@"replaysSessionSampleRate"] == nil
18
- && options[@"replaysOnErrorSampleRate"] == nil) {
17
+ NSNumber *sessionSampleRate = options[@"replaysSessionSampleRate"];
18
+ NSNumber *errorSampleRate = options[@"replaysOnErrorSampleRate"];
19
+
20
+ if (sessionSampleRate == nil && errorSampleRate == nil) {
19
21
  NSLog(@"Session replay disabled via configuration");
20
- return;
22
+ return NO;
21
23
  }
22
24
 
23
25
  NSLog(@"Setting up session replay");
@@ -26,8 +28,8 @@
26
28
  NSString *qualityString = options[@"replaysSessionQuality"];
27
29
 
28
30
  [options setValue:@{
29
- @"sessionSampleRate" : options[@"replaysSessionSampleRate"] ?: [NSNull null],
30
- @"errorSampleRate" : options[@"replaysOnErrorSampleRate"] ?: [NSNull null],
31
+ @"sessionSampleRate" : sessionSampleRate ?: [NSNull null],
32
+ @"errorSampleRate" : errorSampleRate ?: [NSNull null],
31
33
  @"quality" : @([RNSentryReplayQuality parseReplayQuality:qualityString]),
32
34
  @"maskAllImages" : replayOptions[@"maskAllImages"] ?: [NSNull null],
33
35
  @"maskAllText" : replayOptions[@"maskAllText"] ?: [NSNull null],
@@ -38,6 +40,8 @@
38
40
  @ { @"name" : REACT_NATIVE_SDK_NAME, @"version" : REACT_NATIVE_SDK_PACKAGE_VERSION }
39
41
  }
40
42
  forKey:@"sessionReplay"];
43
+ return (errorSampleRate != nil && [errorSampleRate doubleValue] > 0)
44
+ || (sessionSampleRate != nil && [sessionSampleRate doubleValue] > 0);
41
45
  }
42
46
 
43
47
  + (NSArray *_Nonnull)getReplayRNRedactClasses:(NSDictionary *_Nullable)replayOptions
@@ -3,4 +3,4 @@
3
3
  NSString *const NATIVE_SDK_NAME = @"sentry.cocoa.react-native";
4
4
  NSString *const REACT_NATIVE_SDK_NAME = @"sentry.javascript.react-native";
5
5
  NSString *const REACT_NATIVE_SDK_PACKAGE_NAME = @"npm:@sentry/react-native";
6
- NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.3.0";
6
+ NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.4.0";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "7.3.0",
5
+ "version": "7.4.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",
@@ -68,22 +68,22 @@
68
68
  "react-native": ">=0.65.0"
69
69
  },
70
70
  "dependencies": {
71
- "@sentry/babel-plugin-component-annotate": "4.3.0",
72
- "@sentry/browser": "10.18.0",
73
- "@sentry/cli": "2.56.0",
74
- "@sentry/core": "10.18.0",
75
- "@sentry/react": "10.18.0",
76
- "@sentry/types": "10.18.0"
71
+ "@sentry/babel-plugin-component-annotate": "4.4.0",
72
+ "@sentry/browser": "10.20.0",
73
+ "@sentry/cli": "2.56.1",
74
+ "@sentry/core": "10.20.0",
75
+ "@sentry/react": "10.20.0",
76
+ "@sentry/types": "10.20.0"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@babel/core": "^7.25.2",
80
80
  "@expo/metro-config": "~0.20.0",
81
81
  "@mswjs/interceptors": "^0.25.15",
82
82
  "@react-native/babel-preset": "0.77.1",
83
- "@sentry-internal/eslint-config-sdk": "10.18.0",
84
- "@sentry-internal/eslint-plugin-sdk": "10.18.0",
85
- "@sentry-internal/typescript": "10.18.0",
86
- "@sentry/wizard": "6.5.0",
83
+ "@sentry-internal/eslint-config-sdk": "10.20.0",
84
+ "@sentry-internal/eslint-plugin-sdk": "10.20.0",
85
+ "@sentry-internal/typescript": "10.20.0",
86
+ "@sentry/wizard": "6.6.0",
87
87
  "@testing-library/react-native": "^12.7.2",
88
88
  "@types/jest": "^29.5.13",
89
89
  "@types/node": "^20.9.3",
package/sentry.gradle CHANGED
@@ -22,11 +22,262 @@ interface InjectedExecOps {
22
22
 
23
23
  def config = project.hasProperty("sentryCli") ? project.sentryCli : [];
24
24
 
25
+ plugins.withId('com.android.application') {
26
+ def androidComponents = extensions.getByName("androidComponents")
27
+
28
+ androidComponents.onVariants(androidComponents.selector().all()) { v ->
29
+ if (!v.name.toLowerCase().contains("debug")) {
30
+ // separately we then hook into the bundle task of react native to inject
31
+ // sourcemap generation parameters. In case for whatever reason no release
32
+ // was found for the asset folder we just bail.
33
+ def bundleTasks = tasks.findAll { task -> (task.name.startsWith("createBundle") || task.name.startsWith("bundle")) && task.name.endsWith("JsAndAssets") && !task.name.contains("Debug") && task.enabled }
34
+ bundleTasks.each { bundleTask ->
35
+ def shouldCleanUp
36
+ def sourcemapOutput
37
+ def bundleOutput
38
+ def packagerSourcemapOutput
39
+ def bundleCommand
40
+ def props = bundleTask.getProperties()
41
+ def reactRoot = props.get("workingDir")
42
+ if (reactRoot == null) {
43
+ reactRoot = props.get("root").get() // RN 0.71 and above
44
+ }
45
+ def modulesOutput = "$reactRoot/android/app/src/main/assets/modules.json"
46
+ def modulesTask = null
47
+
48
+ (shouldCleanUp, bundleOutput, sourcemapOutput, packagerSourcemapOutput, bundleCommand) = forceSourceMapOutputFromBundleTask(bundleTask)
49
+
50
+ // Lets leave this here if we need to debug
51
+ // println bundleTask.properties
52
+ // .sort{it.key}
53
+ // .collect{it}
54
+ // .findAll{!['class', 'active'].contains(it.key)}
55
+ // .join('\n')
56
+
57
+ def currentVariants = extractCurrentVariants(bundleTask, v)
58
+ if (currentVariants == null) return
59
+
60
+ def previousCliTask = null
61
+ def applicationVariant = null
62
+
63
+ def nameCleanup = "${bundleTask.name}_SentryUploadCleanUp"
64
+ def nameModulesCleanup = "${bundleTask.name}_SentryCollectModulesCleanUp"
65
+ // Upload the source map several times if necessary: once for each release and versionCode.
66
+ currentVariants.each { key, currentVariant ->
67
+ def variant = currentVariant[0]
68
+ def releaseName = currentVariant[1]
69
+ def versionCode = currentVariant[2]
70
+ applicationVariant = currentVariant[3]
71
+
72
+ try {
73
+ if (versionCode instanceof String) {
74
+ versionCode = Integer.parseInt(versionCode)
75
+ versionCode = Math.abs(versionCode)
76
+ }
77
+ } catch (NumberFormatException e) {
78
+ project.logger.info("versionCode: '$versionCode' isn't an Integer, using the plain value.")
79
+ }
80
+
81
+ // The Sentry server distinguishes source maps by release (`--release` in the command
82
+ // below) and distribution identifier (`--dist` below). Give the task a unique name
83
+ // based on where we're uploading to.
84
+ def nameCliTask = "${bundleTask.name}_SentryUpload_${releaseName}_${versionCode}"
85
+ def nameModulesTask = "${bundleTask.name}_SentryCollectModules_${releaseName}_${versionCode}"
86
+
87
+ // If several outputs have the same releaseName and versionCode, we'd do the exact same
88
+ // upload for each of them. No need to repeat.
89
+ try { tasks.named(nameCliTask); return } catch (Exception e) {}
90
+
91
+ /** Upload source map file to the sentry server via CLI call. */
92
+ def cliTask = tasks.register(nameCliTask) {
93
+ onlyIf { shouldSentryAutoUploadGeneral() }
94
+ description = "upload debug symbols to sentry"
95
+ group = 'sentry.io'
96
+
97
+ def extraArgs = []
98
+
99
+ def sentryPackage = resolveSentryReactNativeSDKPath(reactRoot)
100
+ def copyDebugIdScript = config.copyDebugIdScript
101
+ ? file(config.copyDebugIdScript).getAbsolutePath()
102
+ : "$sentryPackage/scripts/copy-debugid.js"
103
+ def hasSourceMapDebugIdScript = config.hasSourceMapDebugIdScript
104
+ ? file(config.hasSourceMapDebugIdScript).getAbsolutePath()
105
+ : "$sentryPackage/scripts/has-sourcemap-debugid.js"
106
+
107
+ def injected = project.objects.newInstance(InjectedExecOps)
108
+ doFirst {
109
+ // Copy Debug ID from packager source map to Hermes composed source map
110
+ injected.execOps.exec {
111
+ def args = ["node",
112
+ copyDebugIdScript,
113
+ packagerSourcemapOutput,
114
+ sourcemapOutput]
115
+ def osCompatibilityCopyCommand = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c'] : []
116
+ commandLine(*osCompatibilityCopyCommand, *args)
117
+ }
118
+
119
+ // Add release and dist for backward compatibility if no Debug ID detected in output soruce map
120
+ def process = ["node", hasSourceMapDebugIdScript, sourcemapOutput].execute(null, new File("$reactRoot"))
121
+ def exitValue = process.waitFor()
122
+ project.logger.lifecycle("Check generated source map for Debug ID: ${process.text}")
123
+
124
+ project.logger.lifecycle("Sentry Source Maps upload will include the release name and dist.")
125
+ extraArgs.addAll([
126
+ "--release", releaseName,
127
+ "--dist", versionCode
128
+ ])
129
+ }
130
+
131
+ doLast {
132
+ injected.execOps.exec {
133
+ workingDir reactRoot
134
+
135
+ def propertiesFile = config.sentryProperties
136
+ ? config.sentryProperties
137
+ : "$reactRoot/android/sentry.properties"
138
+
139
+ if (config.flavorAware) {
140
+ propertiesFile = "$reactRoot/android/sentry-${variant}.properties"
141
+ project.logger.info("For $variant using: $propertiesFile")
142
+ } else {
143
+ environment("SENTRY_PROPERTIES", propertiesFile)
144
+ }
145
+
146
+ Properties sentryProps = new Properties()
147
+ try {
148
+ sentryProps.load(new FileInputStream(propertiesFile))
149
+ } catch (FileNotFoundException e) {
150
+ project.logger.info("file not found '$propertiesFile' for '$variant'")
151
+ }
152
+
153
+ def cliPackage = resolveSentryCliPackagePath(reactRoot)
154
+ def cliExecutable = sentryProps.get("cli.executable", "$cliPackage/bin/sentry-cli")
155
+
156
+ // fix path separator for Windows
157
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
158
+ cliExecutable = cliExecutable.replaceAll("/", "\\\\")
159
+ }
160
+
161
+ //
162
+ // based on:
163
+ // https://github.com/getsentry/sentry-cli/blob/master/src/commands/react_native_gradle.rs
164
+ //
165
+ def args = [cliExecutable]
166
+
167
+ args.addAll(!config.logLevel ? [] : [
168
+ "--log-level", config.logLevel // control verbosity of the output
169
+ ])
170
+ args.addAll(!config.flavorAware ? [] : [
171
+ "--url", sentryProps.get("defaults.url"),
172
+ "--auth-token", sentryProps.get("auth.token") ?: System.getenv("SENTRY_AUTH_TOKEN")
173
+ ])
174
+ args.addAll(["react-native", "gradle",
175
+ "--bundle", bundleOutput, // The path to a bundle that should be uploaded.
176
+ "--sourcemap", sourcemapOutput // The path to a sourcemap that should be uploaded.
177
+ ])
178
+ args.addAll(!config.flavorAware ? [] : [
179
+ "--org", sentryProps.get("defaults.org"),
180
+ "--project", sentryProps.get("defaults.project")
181
+ ])
182
+
183
+ args.addAll(extraArgs)
184
+
185
+ project.logger.lifecycle("Sentry-CLI arguments: ${args}")
186
+ def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c', 'node'] : []
187
+ if (!System.getenv('SENTRY_DOTENV_PATH') && file("$reactRoot/.env.sentry-build-plugin").exists()) {
188
+ environment('SENTRY_DOTENV_PATH', "$reactRoot/.env.sentry-build-plugin")
189
+ }
190
+ commandLine(*osCompatibility, *args)
191
+ }
192
+ }
193
+
194
+ enabled true
195
+ }
196
+
197
+ modulesTask = tasks.register(nameModulesTask, Exec) {
198
+ description = "collect javascript modules from bundle source map"
199
+ group = 'sentry.io'
200
+
201
+ workingDir reactRoot
202
+
203
+ def sentryPackage = resolveSentryReactNativeSDKPath(reactRoot)
204
+
205
+ def collectModulesScript = config.collectModulesScript
206
+ ? file(config.collectModulesScript).getAbsolutePath()
207
+ : "$sentryPackage/dist/js/tools/collectModules.js"
208
+ def modulesPaths = config.modulesPaths
209
+ ? config.modulesPaths.join(',')
210
+ : "$reactRoot/node_modules"
211
+ def args = ["node",
212
+ collectModulesScript,
213
+ sourcemapOutput,
214
+ modulesOutput,
215
+ modulesPaths
216
+ ]
217
+
218
+ if ((new File(collectModulesScript)).exists()) {
219
+ project.logger.info("Sentry-CollectModules arguments: ${args}")
220
+ commandLine(*args)
221
+
222
+ def skip = config.skipCollectModules
223
+ ? config.skipCollectModules == true
224
+ : false
225
+ enabled !skip
226
+ } else {
227
+ project.logger.info("collectModulesScript not found: $collectModulesScript")
228
+ enabled false
229
+ }
230
+ }
231
+
232
+ // chain the upload tasks so they run sequentially in order to run
233
+ // the cliCleanUpTask after the final upload task is run
234
+ if (previousCliTask != null) {
235
+ previousCliTask.configure { finalizedBy cliTask }
236
+ } else {
237
+ bundleTask.configure { finalizedBy cliTask }
238
+ }
239
+ previousCliTask = cliTask
240
+ cliTask.configure { finalizedBy modulesTask }
241
+ }
242
+
243
+ def modulesCleanUpTask = tasks.register(nameModulesCleanup, Delete) {
244
+ description = "clean up collected modules generated file"
245
+ group = 'sentry.io'
246
+
247
+ delete modulesOutput
248
+ }
249
+
250
+ /** Delete sourcemap files */
251
+ def cliCleanUpTask = tasks.register(nameCleanup, Delete) {
252
+ description = "clean up extra sourcemap"
253
+ group = 'sentry.io'
254
+
255
+ delete sourcemapOutput
256
+ delete "$buildDir/intermediates/assets/release/index.android.bundle.map"
257
+ // react native default bundle dir
258
+ }
259
+
260
+ // register clean task extension
261
+ cliCleanUpTask.configure { onlyIf { shouldCleanUp } }
262
+ // due to chaining the last value of previousCliTask will be the final
263
+ // upload task, after which the cleanup can be done
264
+ previousCliTask.configure { finalizedBy cliCleanUpTask }
265
+
266
+ def packageTasks = tasks.matching {
267
+ task -> ("package${applicationVariant}".equalsIgnoreCase(task.name) || "package${applicationVariant}Bundle".equalsIgnoreCase(task.name)) && task.enabled
268
+ }
269
+ packageTasks.configureEach { packageTask ->
270
+ packageTask.dependsOn modulesTask
271
+ packageTask.finalizedBy modulesCleanUpTask
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+
25
278
  // gradle.projectsEvaluated doesn't work with --configure-on-demand
26
279
  // the task are create too late and not executed
27
280
  project.afterEvaluate {
28
- def releases = extractReleasesInfo()
29
-
30
281
  if (config.flavorAware && config.sentryProperties) {
31
282
  throw new GradleException("Incompatible sentry configuration. " +
32
283
  "You cannot use both `flavorAware` and `sentryProperties`. " +
@@ -49,254 +300,6 @@ project.afterEvaluate {
49
300
  println "* Flavor aware sentry properties *"
50
301
  println "**********************************"
51
302
  }
52
-
53
- // separately we then hook into the bundle task of react native to inject
54
- // sourcemap generation parameters. In case for whatever reason no release
55
- // was found for the asset folder we just bail.
56
- def bundleTasks = tasks.findAll { task -> (task.name.startsWith("createBundle") || task.name.startsWith("bundle")) && task.name.endsWith("JsAndAssets") && !task.name.contains("Debug") && task.enabled }
57
- bundleTasks.each { bundleTask ->
58
- def shouldCleanUp
59
- def sourcemapOutput
60
- def bundleOutput
61
- def packagerSourcemapOutput
62
- def bundleCommand
63
- def props = bundleTask.getProperties()
64
- def reactRoot = props.get("workingDir")
65
- if (reactRoot == null) {
66
- reactRoot = props.get("root").get() // RN 0.71 and above
67
- }
68
- def modulesOutput = "$reactRoot/android/app/src/main/assets/modules.json"
69
- def modulesTask = null
70
-
71
- (shouldCleanUp, bundleOutput, sourcemapOutput, packagerSourcemapOutput, bundleCommand) = forceSourceMapOutputFromBundleTask(bundleTask)
72
-
73
- // Lets leave this here if we need to debug
74
- // println bundleTask.properties
75
- // .sort{it.key}
76
- // .collect{it}
77
- // .findAll{!['class', 'active'].contains(it.key)}
78
- // .join('\n')
79
-
80
- def currentVariants = extractCurrentVariants(bundleTask, releases)
81
- if (currentVariants == null) return
82
-
83
- def previousCliTask = null
84
- def applicationVariant = null
85
-
86
- def nameCleanup = "${bundleTask.name}_SentryUploadCleanUp"
87
- def nameModulesCleanup = "${bundleTask.name}_SentryCollectModulesCleanUp"
88
- // Upload the source map several times if necessary: once for each release and versionCode.
89
- currentVariants.each { key, currentVariant ->
90
- def variant = currentVariant[0]
91
- def releaseName = currentVariant[1]
92
- def versionCode = currentVariant[2]
93
- applicationVariant = currentVariant[3]
94
-
95
- try {
96
- if (versionCode instanceof String) {
97
- versionCode = Integer.parseInt(versionCode)
98
- versionCode = Math.abs(versionCode)
99
- }
100
- } catch (NumberFormatException e) {
101
- project.logger.info("versionCode: '$versionCode' isn't an Integer, using the plain value.")
102
- }
103
-
104
- // The Sentry server distinguishes source maps by release (`--release` in the command
105
- // below) and distribution identifier (`--dist` below). Give the task a unique name
106
- // based on where we're uploading to.
107
- def nameCliTask = "${bundleTask.name}_SentryUpload_${releaseName}_${versionCode}"
108
- def nameModulesTask = "${bundleTask.name}_SentryCollectModules_${releaseName}_${versionCode}"
109
-
110
- // If several outputs have the same releaseName and versionCode, we'd do the exact same
111
- // upload for each of them. No need to repeat.
112
- try { tasks.named(nameCliTask); return } catch (Exception e) {}
113
-
114
- /** Upload source map file to the sentry server via CLI call. */
115
- def cliTask = tasks.create(nameCliTask) {
116
- onlyIf { shouldSentryAutoUploadGeneral() }
117
- description = "upload debug symbols to sentry"
118
- group = 'sentry.io'
119
-
120
- def extraArgs = []
121
-
122
- def sentryPackage = resolveSentryReactNativeSDKPath(reactRoot)
123
- def copyDebugIdScript = config.copyDebugIdScript
124
- ? file(config.copyDebugIdScript).getAbsolutePath()
125
- : "$sentryPackage/scripts/copy-debugid.js"
126
- def hasSourceMapDebugIdScript = config.hasSourceMapDebugIdScript
127
- ? file(config.hasSourceMapDebugIdScript).getAbsolutePath()
128
- : "$sentryPackage/scripts/has-sourcemap-debugid.js"
129
-
130
- def injected = project.objects.newInstance(InjectedExecOps)
131
- doFirst {
132
- // Copy Debug ID from packager source map to Hermes composed source map
133
- injected.execOps.exec {
134
- def args = ["node",
135
- copyDebugIdScript,
136
- packagerSourcemapOutput,
137
- sourcemapOutput]
138
- def osCompatibilityCopyCommand = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c'] : []
139
- commandLine(*osCompatibilityCopyCommand, *args)
140
- }
141
-
142
- // Add release and dist for backward compatibility if no Debug ID detected in output soruce map
143
- def process = ["node", hasSourceMapDebugIdScript, sourcemapOutput].execute(null, new File("$reactRoot"))
144
- def exitValue = process.waitFor()
145
- project.logger.lifecycle("Check generated source map for Debug ID: ${process.text}")
146
-
147
- project.logger.lifecycle("Sentry Source Maps upload will include the release name and dist.")
148
- extraArgs.addAll([
149
- "--release", releaseName,
150
- "--dist", versionCode
151
- ])
152
- }
153
-
154
- doLast {
155
- injected.execOps.exec {
156
- workingDir reactRoot
157
-
158
- def propertiesFile = config.sentryProperties
159
- ? config.sentryProperties
160
- : "$reactRoot/android/sentry.properties"
161
-
162
- if (config.flavorAware) {
163
- propertiesFile = "$reactRoot/android/sentry-${variant}.properties"
164
- project.logger.info("For $variant using: $propertiesFile")
165
- } else {
166
- environment("SENTRY_PROPERTIES", propertiesFile)
167
- }
168
-
169
- Properties sentryProps = new Properties()
170
- try {
171
- sentryProps.load(new FileInputStream(propertiesFile))
172
- } catch (FileNotFoundException e) {
173
- project.logger.info("file not found '$propertiesFile' for '$variant'")
174
- }
175
-
176
- def cliPackage = resolveSentryCliPackagePath(reactRoot)
177
- def cliExecutable = sentryProps.get("cli.executable", "$cliPackage/bin/sentry-cli")
178
-
179
- // fix path separator for Windows
180
- if (Os.isFamily(Os.FAMILY_WINDOWS)) {
181
- cliExecutable = cliExecutable.replaceAll("/", "\\\\")
182
- }
183
-
184
- //
185
- // based on:
186
- // https://github.com/getsentry/sentry-cli/blob/master/src/commands/react_native_gradle.rs
187
- //
188
- def args = [cliExecutable]
189
-
190
- args.addAll(!config.logLevel ? [] : [
191
- "--log-level", config.logLevel // control verbosity of the output
192
- ])
193
- args.addAll(!config.flavorAware ? [] : [
194
- "--url", sentryProps.get("defaults.url"),
195
- "--auth-token", sentryProps.get("auth.token") ?: System.getenv("SENTRY_AUTH_TOKEN")
196
- ])
197
- args.addAll(["react-native", "gradle",
198
- "--bundle", bundleOutput, // The path to a bundle that should be uploaded.
199
- "--sourcemap", sourcemapOutput // The path to a sourcemap that should be uploaded.
200
- ])
201
- args.addAll(!config.flavorAware ? [] : [
202
- "--org", sentryProps.get("defaults.org"),
203
- "--project", sentryProps.get("defaults.project")
204
- ])
205
-
206
- args.addAll(extraArgs)
207
-
208
- project.logger.lifecycle("Sentry-CLI arguments: ${args}")
209
- def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c', 'node'] : []
210
- if (!System.getenv('SENTRY_DOTENV_PATH') && file("$reactRoot/.env.sentry-build-plugin").exists()) {
211
- environment('SENTRY_DOTENV_PATH', "$reactRoot/.env.sentry-build-plugin")
212
- }
213
- commandLine(*osCompatibility, *args)
214
- }
215
- }
216
-
217
- enabled true
218
- }
219
-
220
- modulesTask = tasks.create(nameModulesTask, Exec) {
221
- description = "collect javascript modules from bundle source map"
222
- group = 'sentry.io'
223
-
224
- workingDir reactRoot
225
-
226
- def sentryPackage = resolveSentryReactNativeSDKPath(reactRoot)
227
-
228
- def collectModulesScript = config.collectModulesScript
229
- ? file(config.collectModulesScript).getAbsolutePath()
230
- : "$sentryPackage/dist/js/tools/collectModules.js"
231
- def modulesPaths = config.modulesPaths
232
- ? config.modulesPaths.join(',')
233
- : "$reactRoot/node_modules"
234
- def args = ["node",
235
- collectModulesScript,
236
- sourcemapOutput,
237
- modulesOutput,
238
- modulesPaths
239
- ]
240
-
241
- if ((new File(collectModulesScript)).exists()) {
242
- project.logger.info("Sentry-CollectModules arguments: ${args}")
243
- commandLine(*args)
244
-
245
- def skip = config.skipCollectModules
246
- ? config.skipCollectModules == true
247
- : false
248
- enabled !skip
249
- } else {
250
- project.logger.info("collectModulesScript not found: $collectModulesScript")
251
- enabled false
252
- }
253
- }
254
-
255
- // chain the upload tasks so they run sequentially in order to run
256
- // the cliCleanUpTask after the final upload task is run
257
- if (previousCliTask != null) {
258
- previousCliTask.finalizedBy cliTask
259
- } else {
260
- bundleTask.finalizedBy cliTask
261
- }
262
- previousCliTask = cliTask
263
- cliTask.finalizedBy modulesTask
264
- }
265
-
266
- def modulesCleanUpTask = tasks.create(name: nameModulesCleanup, type: Delete) {
267
- description = "clean up collected modules generated file"
268
- group = 'sentry.io'
269
-
270
- delete modulesOutput
271
- }
272
-
273
- def packageTasks = tasks.findAll {
274
- task -> (
275
- "package${applicationVariant}".equalsIgnoreCase(task.name)
276
- || "package${applicationVariant}Bundle".equalsIgnoreCase(task.name)
277
- ) && task.enabled
278
- }
279
- packageTasks.each { packageTask ->
280
- packageTask.dependsOn modulesTask
281
- packageTask.finalizedBy modulesCleanUpTask
282
- }
283
-
284
- /** Delete sourcemap files */
285
- def cliCleanUpTask = tasks.create(name: nameCleanup, type: Delete) {
286
- description = "clean up extra sourcemap"
287
- group = 'sentry.io'
288
-
289
- delete sourcemapOutput
290
- delete "$buildDir/intermediates/assets/release/index.android.bundle.map"
291
- // react native default bundle dir
292
- }
293
-
294
- // register clean task extension
295
- cliCleanUpTask.onlyIf { shouldCleanUp }
296
- // due to chaining the last value of previousCliTask will be the final
297
- // upload task, after which the cleanup can be done
298
- previousCliTask.finalizedBy cliCleanUpTask
299
- }
300
303
  }
301
304
 
302
305
  def resolveSentryReactNativeSDKPath(reactRoot) {
@@ -333,29 +336,6 @@ def resolveSentryCliPackagePath(reactRoot) {
333
336
  return cliPackage
334
337
  }
335
338
 
336
- /** Compose lookup map of build variants - to - outputs. */
337
- def extractReleasesInfo() {
338
- def releases = [:]
339
-
340
- android.applicationVariants.each { variant ->
341
-
342
- variant.outputs.each { output ->
343
- def defaultVersionCode = output.getVersionCode()
344
- def versionCode = System.getenv("SENTRY_DIST") ?: defaultVersionCode
345
- def defaultReleaseName = "${variant.getApplicationId()}@${variant.getVersionName()}+${versionCode}"
346
- def releaseName = System.getenv("SENTRY_RELEASE") ?: defaultReleaseName
347
- def variantName = variant.getName()
348
- def outputName = output.getName()
349
- if (releases[variantName] == null) {
350
- releases[variantName] = [:]
351
- }
352
- releases[variantName][outputName] = [outputName, releaseName, versionCode, variantName]
353
- }
354
- }
355
-
356
- return releases
357
- }
358
-
359
339
  /** Extract from arguments collection bundle and sourcemap files output names. */
360
340
  static extractBundleTaskArgumentsLegacy(cmdArgs, Project project) {
361
341
  def bundleOutput = null
@@ -467,7 +447,7 @@ def forceSourceMapOutputFromBundleTask(bundleTask) {
467
447
  }
468
448
 
469
449
  /** compose array with one item - current build flavor name */
470
- static extractCurrentVariants(bundleTask, releases) {
450
+ static extractCurrentVariants(bundleTask, variant) {
471
451
  // examples: bundleLocalReleaseJsAndAssets, createBundleYellowDebugJsAndAssets
472
452
  def pattern = Pattern.compile("(?:create)?(?:B|b)undle([A-Z][A-Za-z0-9_]+)JsAndAssets")
473
453
 
@@ -480,9 +460,21 @@ static extractCurrentVariants(bundleTask, releases) {
480
460
  }
481
461
 
482
462
  def currentVariants = null
483
- releases.each { key, release ->
484
- if (key.equalsIgnoreCase(currentRelease)) {
485
- currentVariants = release
463
+ if (variant.name.equalsIgnoreCase(currentRelease)) {
464
+ currentVariants = [:]
465
+ def variantName = variant.name
466
+ variant.outputs.each { output ->
467
+ def defaultVersionCode = output.versionCode.getOrElse(0)
468
+ def versionCode = System.getenv('SENTRY_DIST') ?: defaultVersionCode
469
+ def appId = variant.applicationId.get()
470
+ def versionName = output.versionName.getOrElse('') // may be empty if not set
471
+ def defaultReleaseName = "${appId}@${versionName}+${versionCode}"
472
+ def releaseName = System.getenv('SENTRY_RELEASE') ?: defaultReleaseName
473
+
474
+ def outputName = output.baseName
475
+
476
+ if (currentVariants[outputName] == null) currentVariants[outputName] = []
477
+ currentVariants[outputName] = [outputName, releaseName, versionCode, variantName]
486
478
  }
487
479
  }
488
480
 
@@ -249,6 +249,19 @@ export interface BaseReactNativeOptions {
249
249
  * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.
250
250
  */
251
251
  useThreadsForMessageStack?: boolean;
252
+ /**
253
+ * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,
254
+ * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}
255
+ * option to control to which outgoing requests the header will be attached.
256
+ *
257
+ * **Important:** If you set this option to `true`, make sure that you configured your servers'
258
+ * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.
259
+ *
260
+ * @see https://www.w3.org/TR/trace-context/
261
+ *
262
+ * @default false
263
+ */
264
+ propagateTraceparent?: boolean;
252
265
  }
253
266
  export type SentryReplayQuality = 'low' | 'medium' | 'high';
254
267
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "7.3.0";
3
+ export declare const SDK_VERSION = "7.4.0";
4
4
  //# sourceMappingURL=version.d.ts.map