@sentry/react-native 5.31.0 → 5.32.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/android/src/main/java/io/sentry/react/RNSentryOnDrawReporterManager.java +18 -1
  3. package/dist/js/client.d.ts.map +1 -1
  4. package/dist/js/client.js +2 -2
  5. package/dist/js/client.js.map +1 -1
  6. package/dist/js/index.d.ts +1 -1
  7. package/dist/js/index.d.ts.map +1 -1
  8. package/dist/js/index.js +1 -3
  9. package/dist/js/index.js.map +1 -1
  10. package/dist/js/integrations/default.d.ts.map +1 -1
  11. package/dist/js/integrations/default.js +2 -1
  12. package/dist/js/integrations/default.js.map +1 -1
  13. package/dist/js/options.d.ts +34 -2
  14. package/dist/js/options.d.ts.map +1 -1
  15. package/dist/js/options.js.map +1 -1
  16. package/dist/js/profiling/integration.d.ts.map +1 -1
  17. package/dist/js/profiling/integration.js +6 -3
  18. package/dist/js/profiling/integration.js.map +1 -1
  19. package/dist/js/tools/metroconfig.d.ts +10 -1
  20. package/dist/js/tools/metroconfig.d.ts.map +1 -1
  21. package/dist/js/tools/metroconfig.js +42 -2
  22. package/dist/js/tools/metroconfig.js.map +1 -1
  23. package/dist/js/tracing/index.d.ts +3 -3
  24. package/dist/js/tracing/index.d.ts.map +1 -1
  25. package/dist/js/tracing/index.js +3 -3
  26. package/dist/js/tracing/index.js.map +1 -1
  27. package/dist/js/tracing/reactnativenavigation.d.ts +6 -0
  28. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  29. package/dist/js/tracing/reactnativenavigation.js +6 -0
  30. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  31. package/dist/js/tracing/reactnativetracing.d.ts +6 -8
  32. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  33. package/dist/js/tracing/reactnativetracing.js +23 -15
  34. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  35. package/dist/js/tracing/reactnavigation.d.ts +4 -0
  36. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  37. package/dist/js/tracing/reactnavigation.js +6 -0
  38. package/dist/js/tracing/reactnavigation.js.map +1 -1
  39. package/dist/js/tracing/reactnavigationv4.d.ts +2 -0
  40. package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
  41. package/dist/js/tracing/reactnavigationv4.js +2 -0
  42. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  43. package/dist/js/tracing/routingInstrumentation.d.ts +8 -2
  44. package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
  45. package/dist/js/tracing/routingInstrumentation.js +3 -2
  46. package/dist/js/tracing/routingInstrumentation.js.map +1 -1
  47. package/dist/js/version.d.ts +1 -1
  48. package/dist/js/version.js +1 -1
  49. package/dist/js/version.js.map +1 -1
  50. package/package.json +2 -2
  51. package/ts3.8/dist/js/index.d.ts +1 -1
  52. package/ts3.8/dist/js/options.d.ts +34 -2
  53. package/ts3.8/dist/js/tracing/index.d.ts +3 -3
  54. package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +6 -0
  55. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +6 -8
  56. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +4 -0
  57. package/ts3.8/dist/js/tracing/reactnavigationv4.d.ts +2 -0
  58. package/ts3.8/dist/js/tracing/routingInstrumentation.d.ts +8 -2
  59. package/ts3.8/dist/js/version.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.32.0
4
+
5
+ ### Features
6
+
7
+ - Exclude Sentry Web Replay by default, reducing the code in 130KB. ([#4006](https://github.com/getsentry/sentry-react-native/pull/4006))
8
+ - You can keep Sentry Web Replay by setting `includeWebReplay` to `true` in your metro config as shown in the snippet:
9
+
10
+ ```js
11
+ // For Expo
12
+ const { getSentryExpoConfig } = require("@sentry/react-native/metro");
13
+ const config = getSentryExpoConfig(__dirname, { includeWebReplay: true });
14
+
15
+ // For RN
16
+ const { getDefaultConfig } = require('@react-native/metro-config');
17
+ const { withSentryConfig } = require('@sentry/react-native/metro');
18
+ module.exports = withSentryConfig(getDefaultConfig(__dirname), { includeWebReplay: true });
19
+ ```
20
+
21
+ ### Changes
22
+
23
+ - Add Android Logger when new frame event is not emitted ([#4081](https://github.com/getsentry/sentry-react-native/pull/4081))
24
+ - React Native Tracing Deprecations ([#4073](https://github.com/getsentry/sentry-react-native/pull/4073))
25
+ - `new ReactNativeTracing` to `reactNativeTracingIntegration()`
26
+ - `new ReactNavigationInstrumentation` to `reactNativeTracingIntegration()`.
27
+ - `new ReactNativeNavigationInstrumentation` to `reactNativeTracingIntegration()`.
28
+ - `ReactNavigationV4Instrumentation` won't be supported in the next major SDK version, upgrade to `react-navigation@5` or newer.
29
+ - `RoutingInstrumentation` and `RoutingInstrumentationInstance` replace by `Integration` interface from `@sentry/types`.
30
+ - `enableAppStartTracking`, `enableNativeFramesTracking`, `enableStallTracking`, `enableUserInteractionTracing` moved to `Sentry.init({})` root options.
31
+
32
+ ### Dependencies
33
+
34
+ - Bump CLI from v2.34.0 to v2.36.1 ([#4055](https://github.com/getsentry/sentry-react-native/pull/4055))
35
+ - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2361)
36
+ - [diff](https://github.com/getsentry/sentry-cli/compare/2.34.0...2.36.1)
37
+
38
+ ## 5.31.1
39
+
40
+ ### Fixes
41
+
42
+ - Sentry CLI passes thru recursive node calls during source maps auto upload from Xcode (([#3843](https://github.com/getsentry/sentry-react-native/pull/3843)))
43
+ - This fixes React Native 0.75 Xcode auto upload failures
44
+
45
+ ### Dependencies
46
+
47
+ - Bump CLI from v2.31.2 to v2.34.0 ([#3843](https://github.com/getsentry/sentry-react-native/pull/3843))
48
+ - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2340)
49
+ - [diff](https://github.com/getsentry/sentry-cli/compare/2.31.2...2.34.0)
50
+
3
51
  ## 5.31.0
4
52
 
5
53
  ### Features
@@ -18,8 +18,10 @@ import org.jetbrains.annotations.Nullable;
18
18
 
19
19
  import java.util.Map;
20
20
 
21
+ import io.sentry.ILogger;
21
22
  import io.sentry.SentryDate;
22
23
  import io.sentry.SentryDateProvider;
24
+ import io.sentry.SentryLevel;
23
25
  import io.sentry.android.core.AndroidLogger;
24
26
  import io.sentry.android.core.BuildInfoProvider;
25
27
  import io.sentry.android.core.SentryAndroidDateProvider;
@@ -68,6 +70,8 @@ public class RNSentryOnDrawReporterManager extends SimpleViewManager<RNSentryOnD
68
70
 
69
71
  public static class RNSentryOnDrawReporterView extends View {
70
72
 
73
+ private static final ILogger logger = new AndroidLogger("RNSentryOnDrawReporterView");
74
+
71
75
  private final @Nullable ReactApplicationContext reactContext;
72
76
  private final @NotNull SentryDateProvider dateProvider = new SentryAndroidDateProvider();
73
77
  private final @Nullable Runnable emitInitialDisplayEvent;
@@ -96,6 +100,7 @@ public class RNSentryOnDrawReporterManager extends SimpleViewManager<RNSentryOnD
96
100
  return;
97
101
  }
98
102
 
103
+ logger.log(SentryLevel.DEBUG, "[TimeToDisplay] Register full display event emitter.");
99
104
  registerForNextDraw(emitFullDisplayEvent);
100
105
  }
101
106
 
@@ -104,16 +109,27 @@ public class RNSentryOnDrawReporterManager extends SimpleViewManager<RNSentryOnD
104
109
  return;
105
110
  }
106
111
 
112
+ logger.log(SentryLevel.DEBUG, "[TimeToDisplay] Register initial display event emitter.");
107
113
  registerForNextDraw(emitInitialDisplayEvent);
108
114
  }
109
115
 
110
116
  private void registerForNextDraw(@Nullable Runnable emitter) {
117
+ if (emitter == null) {
118
+ logger.log(SentryLevel.ERROR, "[TimeToDisplay] Won't emit next frame drawn event, emitter is null.");
119
+ return;
120
+ }
121
+ if (buildInfo == null) {
122
+ logger.log(SentryLevel.ERROR, "[TimeToDisplay] Won't emit next frame drawn event, buildInfo is null.");
123
+ return;
124
+ }
111
125
  if (reactContext == null) {
126
+ logger.log(SentryLevel.ERROR, "[TimeToDisplay] Won't emit next frame drawn event, reactContext is null.");
112
127
  return;
113
128
  }
114
129
 
115
130
  @Nullable Activity activity = reactContext.getCurrentActivity();
116
- if (activity == null || emitter == null || buildInfo == null) {
131
+ if (activity == null) {
132
+ logger.log(SentryLevel.ERROR, "[TimeToDisplay] Won't emit next frame drawn event, reactContext is null.");
117
133
  return;
118
134
  }
119
135
 
@@ -129,6 +145,7 @@ public class RNSentryOnDrawReporterManager extends SimpleViewManager<RNSentryOnD
129
145
  event.putDouble("newFrameTimestampInSeconds", endDate.nanoTimestamp() / 1e9);
130
146
 
131
147
  if (reactContext == null) {
148
+ logger.log(SentryLevel.ERROR, "[TimeToDisplay] Recorded next frame draw but can't emit the event, reactContext is null.");
132
149
  return;
133
150
  }
134
151
  reactContext
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAGV,QAAQ,EACR,KAAK,EACL,SAAS,EAGT,aAAa,EAEb,YAAY,EACb,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAS1D;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IACzE,OAAO,CAAC,eAAe,CAAY;IAEnC;;;OAGG;gBACgB,OAAO,EAAE,wBAAwB;IASpD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,GAAE,SAAc,GAAG,WAAW,CAAC,KAAK,CAAC;IAIvF;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAuBrG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IAC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;IACI,IAAI,IAAI,IAAI;IAKnB;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAcpC;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA+BjD;;OAEG;IACH,OAAO,CAAC,cAAc;IA0BtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAa9B"}
package/dist/js/client.js CHANGED
@@ -93,14 +93,14 @@ export class ReactNativeClient extends BaseClient {
93
93
  * Sets up the integrations
94
94
  */
95
95
  _setupIntegrations() {
96
- var _a;
96
+ var _a, _b;
97
97
  super._setupIntegrations();
98
98
  const tracing = this.getIntegration(ReactNativeTracing);
99
99
  const routingName = (_a = tracing === null || tracing === void 0 ? void 0 : tracing.options.routingInstrumentation) === null || _a === void 0 ? void 0 : _a.name;
100
100
  if (routingName) {
101
101
  this.addIntegration(createIntegration(routingName));
102
102
  }
103
- const enableUserInteractionTracing = tracing === null || tracing === void 0 ? void 0 : tracing.options.enableUserInteractionTracing;
103
+ const enableUserInteractionTracing = (_b = this._options.enableUserInteractionTracing) !== null && _b !== void 0 ? _b : tracing === null || tracing === void 0 ? void 0 : tracing.options.enableUserInteractionTracing;
104
104
  if (enableUserInteractionTracing) {
105
105
  this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));
106
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CA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C;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n if (this._options.useThreadsForMessageStack) {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Sets up the integrations\n */\n protected _setupIntegrations(): void {\n super._setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing = tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEn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qB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n if (this._options.useThreadsForMessageStack) {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Sets up the integrations\n */\n protected _setupIntegrations(): void {\n super._setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing =\n this._options.enableUserInteractionTracing ?? tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
@@ -9,7 +9,7 @@ export type { ReactNativeOptions } from './options';
9
9
  export { ReactNativeClient } from './client';
10
10
  export { init, wrap, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback, withScope, configureScope, crashedLastRun, } from './sdk';
11
11
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
12
- export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
12
+ export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, reactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
13
13
  export type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';
14
14
  export {
15
15
  /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cA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W,CAAC;AAEvF,OAAO;AACL,sIAAsI;AACtI,YAAY,GACb,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAGhB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EAGd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,IAAI,EAEJ,OAAO,EAEP,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,cAAc,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,iCAAiC,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvF,OAAO;AACL,sIAAsI;AACtI,YAAY,GACb,CAAC"}
package/dist/js/index.js CHANGED
@@ -17,9 +17,7 @@ setDist,
17
17
  // eslint-disable-next-line deprecation/deprecation
18
18
  setRelease, nativeCrash, flush, close, captureUserFeedback, withScope, configureScope, crashedLastRun, } from './sdk';
19
19
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
20
- export { ReactNativeTracing, ReactNavigationV4Instrumentation,
21
- // eslint-disable-next-line deprecation/deprecation
22
- ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
20
+ export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, reactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
23
21
  export {
24
22
  /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */
25
23
  Integrations, };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sour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C,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAInB,OAAO;AACL,sIAAsI;AACtI,YAAY,GACb,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startTransaction,\n\n // v8 spans\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n\n // v8 scopes\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metrics,\n} from '@sentry/core';\n\nimport { _addTracingExtensions } from './tracing/addTracingExtensions';\n_addTracingExtensions();\n\nexport {\n Integrations as BrowserIntegrations,\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport { lastEventId } from '@sentry/browser';\n\nimport * as Integrations from './integrations';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport {\n init,\n wrap,\n // eslint-disable-next-line deprecation/deprecation\n setDist,\n // eslint-disable-next-line deprecation/deprecation\n setRelease,\n nativeCrash,\n flush,\n close,\n captureUserFeedback,\n withScope,\n configureScope,\n crashedLastRun,\n} from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n ReactNativeTracing,\n ReactNavigationV4Instrumentation,\n // eslint-disable-next-line deprecation/deprecation\n ReactNavigationV5Instrumentation,\n ReactNavigationInstrumentation,\n ReactNativeNavigationInstrumentation,\n RoutingInstrumentation,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n} from './tracing';\n\nexport type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';\n\nexport {\n /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */\n Integrations,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB;AAEhB,WAAW;AACX,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc;AAEd,YAAY;AACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,qBAAqB,EAAE,CAAC;AAExB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,IAAI;AACJ,mDAAmD;AACnD,OAAO;AACP,mDAAmD;AACnD,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,cAAc,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAInB,OAAO;AACL,sIAAsI;AACtI,YAAY,GACb,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startTransaction,\n\n // v8 spans\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n\n // v8 scopes\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metrics,\n} from '@sentry/core';\n\nimport { _addTracingExtensions } from './tracing/addTracingExtensions';\n_addTracingExtensions();\n\nexport {\n Integrations as BrowserIntegrations,\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport { lastEventId } from '@sentry/browser';\n\nimport * as Integrations from './integrations';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport {\n init,\n wrap,\n // eslint-disable-next-line deprecation/deprecation\n setDist,\n // eslint-disable-next-line deprecation/deprecation\n setRelease,\n nativeCrash,\n flush,\n close,\n captureUserFeedback,\n withScope,\n configureScope,\n crashedLastRun,\n} from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n ReactNativeTracing,\n ReactNavigationV4Instrumentation,\n ReactNavigationV5Instrumentation,\n ReactNavigationInstrumentation,\n ReactNativeNavigationInstrumentation,\n RoutingInstrumentation,\n reactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n} from './tracing';\n\nexport type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';\n\nexport {\n /** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */\n Integrations,\n};\n"]}
@@ -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,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAgC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAoFvF"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAgC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAuFvF"}
@@ -10,6 +10,7 @@ import { createReactNativeRewriteFrames } from './rewriteframes';
10
10
  * Web integrations are only returned when running on web.
11
11
  */
12
12
  export function getDefaultIntegrations(options) {
13
+ var _a;
13
14
  const integrations = [];
14
15
  if (notWeb()) {
15
16
  integrations.push(reactNativeErrorHandlersIntegration({
@@ -46,7 +47,7 @@ export function getDefaultIntegrations(options) {
46
47
  if (options.attachViewHierarchy) {
47
48
  integrations.push(viewHierarchyIntegration());
48
49
  }
49
- if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {
50
+ if ((_a = options.profilesSampleRate) !== null && _a !== void 0 ? _a : (options._experiments && typeof options._experiments.profilesSampleRate === 'number')) {
50
51
  integrations.push(hermesProfilingIntegration());
51
52
  }
52
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;;GAMG;AAC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E,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,EAC3F;QACA,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,MAAM,EAAE,EAAE;YACZ,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;YACpG,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;SACtG;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { BrowserOptions } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n browserReplayIntegration,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n viewHierarchyIntegration,\n} from './exports';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\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\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 if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (options._experiments && typeof options._experiments.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 =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.spotlight || options.enableSpotlight) {\n const sidecarUrl = (typeof options.spotlight === 'string' && options.spotlight) || options.spotlightSidecarUrl;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n if (\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')\n ) {\n integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());\n if (!notWeb()) {\n (options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n (options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n }\n\n return integrations;\n}\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;;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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AwB,KAAK,QAAQ,CAAC,EAC3F;QACA,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,MAAM,EAAE,EAAE;YACZ,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;YACpG,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;SACtG;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { BrowserOptions } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n browserReplayIntegration,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n viewHierarchyIntegration,\n} from './exports';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\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\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 if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (\n options.profilesSampleRate ??\n (options._experiments && typeof options._experiments.profilesSampleRate === 'number')\n ) {\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 =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.spotlight || options.enableSpotlight) {\n const sidecarUrl = (typeof options.spotlight === 'string' && options.spotlight) || options.spotlightSidecarUrl;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n if (\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')\n ) {\n integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());\n if (!notWeb()) {\n (options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n (options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n }\n\n return integrations;\n}\n"]}
@@ -174,14 +174,46 @@ export interface BaseReactNativeOptions {
174
174
  * from the function, no screenshot will be attached.
175
175
  */
176
176
  beforeScreenshot?: (event: Event, hint: EventHint) => boolean;
177
+ /**
178
+ * The sample rate for profiling
179
+ * 1.0 will profile all transactions and 0 will profile none.
180
+ */
181
+ profilesSampleRate?: number;
182
+ /**
183
+ * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation
184
+ * an app start transaction will be started.
185
+ *
186
+ * Requires performance monitoring to be enabled.
187
+ *
188
+ * @default true
189
+ */
190
+ enableAppStartTracking?: boolean;
191
+ /**
192
+ * Track the slow and frozen frames in the application. Enabling this options will add
193
+ * slow and frozen frames measurements to all created root spans (transactions).
194
+ *
195
+ * @default true
196
+ */
197
+ enableNativeFramesTracking?: boolean;
198
+ /**
199
+ * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.
200
+ *
201
+ * @default true
202
+ */
203
+ enableStallTracking?: boolean;
204
+ /**
205
+ * Trace User Interaction events like touch and gestures.
206
+ *
207
+ * @default false
208
+ */
209
+ enableUserInteractionTracing?: boolean;
177
210
  /**
178
211
  * Options which are in beta, or otherwise not guaranteed to be stable.
179
212
  */
180
213
  _experiments?: {
181
214
  [key: string]: unknown;
182
215
  /**
183
- * The sample rate for profiling
184
- * 1.0 will profile all transactions and 0 will profile none.
216
+ * @deprecated Use `profilesSampleRate` in the options root instead.
185
217
  */
186
218
  profilesSampleRate?: number;
187
219
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBA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E,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/types';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\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 * This option will enable forwarding captured Sentry events to Spotlight.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n *\n * @deprecated Use `spotlight` instead.\n */\n enableSpotlight?: boolean;\n\n /**\n * This option changes the default Spotlight Sidecar URL.\n *\n * By default, the SDK expects the Sidecar to be running\n * on the same host as React Native Metro Dev Server.\n *\n * More details: https://spotlightjs.com/\n *\n * @default \"http://localhost:8969/stream\"\n *\n * @deprecated Use `spotlight` instead.\n */\n spotlightSidecarUrl?: string;\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 * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\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 /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA4SvD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/types';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\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 * This option will enable forwarding captured Sentry events to Spotlight.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n *\n * @deprecated Use `spotlight` instead.\n */\n enableSpotlight?: boolean;\n\n /**\n * This option changes the default Spotlight Sidecar URL.\n *\n * By default, the SDK expects the Sidecar to be running\n * on the same host as React Native Metro Dev Server.\n *\n * More details: https://spotlightjs.com/\n *\n * @default \"http://localhost:8969/stream\"\n *\n * @deprecated Use `spotlight` instead.\n */\n spotlightSidecarUrl?: string;\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 * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\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 * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `profilesSampleRate` in the options root instead.\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 /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AASvB,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,kBAAkB,EAAgB,MAAM,SAAS,CAAC;AAYnH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,aA4KxC,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,eAAe,+BAGM,CAAC;AAEnC;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAO9C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,uBAAuB,EAAE,MAAM,GAC9B,oBAAoB,GAAG,2BAA2B,GAAG,IAAI,CAyB3D;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,yBAAyB,EACxC,UAAU,EAAE,MAAM,GACjB,2BAA2B,CAQ7B;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,kBAA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AC,SAAS,CAAC,CAkCjC"}
@@ -72,9 +72,12 @@ export const hermesProfilingIntegration = () => {
72
72
  }
73
73
  const client = getClient();
74
74
  const options = client && client.getOptions();
75
- const profilesSampleRate = options && options._experiments && typeof options._experiments.profilesSampleRate === 'number'
76
- ? options._experiments.profilesSampleRate
77
- : undefined;
75
+ const profilesSampleRate = options &&
76
+ ((typeof options.profilesSampleRate === 'number' && options.profilesSampleRate) ||
77
+ (options._experiments &&
78
+ typeof options._experiments.profilesSampleRate === 'number' &&
79
+ options._experiments.profilesSampleRate) ||
80
+ undefined);
78
81
  if (profilesSampleRate === undefined) {
79
82
  logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');
80
83
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU3G,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,MAAM,QAAQ,GAAW,GAAG,CAAC;AAE7B;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,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AI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;KACpF,CAAC;IACF,MAAM,CAAC,OAAO,GAAG;QACf,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACzB,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;aACtB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,KAAK,uBAAuB,CAAC;aAC9D,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,iCACV,MAAM,KACT,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,QAAQ,IACxC,CAAC;KACN,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport { convertIntegrationFnToClass, getActiveTransaction, getClient, getCurrentHub } from '@sentry/core';\nimport type {\n Envelope,\n Event,\n Integration,\n IntegrationClass,\n IntegrationFn,\n ThreadCpuProfile,\n Transaction,\n} from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\nimport { Platform } from 'react-native';\n\nimport { isHermesEnabled } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { PROFILE_QUEUE } from './cache';\nimport { MAX_PROFILE_DURATION_MS } from './constants';\nimport { convertToSentryProfile } from './convertHermesProfile';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './nativeTypes';\nimport type { AndroidCombinedProfileEvent, CombinedProfileEvent, HermesProfileEvent, ProfileEvent } from './types';\nimport {\n addProfilesToEnvelope,\n createHermesProfilingEvent,\n enrichCombinedProfileWithEventContext,\n findProfiledTransactionsFromEnvelope,\n} from './utils';\n\nconst INTEGRATION_NAME = 'HermesProfiling';\n\nconst MS_TO_NS: number = 1e6;\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @experimental\n */\nexport const hermesProfilingIntegration: IntegrationFn = () => {\n let _currentProfile:\n | {\n profile_id: string;\n startTimestampNs: number;\n }\n | undefined;\n let _currentProfileTimeout: number | undefined;\n\n const setupOnce = (): void => {\n if (!isHermesEnabled()) {\n logger.log('[Profiling] Hermes is not enabled, not adding profiling integration.');\n return;\n }\n\n const client = getClient();\n\n if (!client || typeof client.on !== 'function') {\n return;\n }\n\n _startCurrentProfileForActiveTransaction();\n client.on('startTransaction', _startCurrentProfile);\n\n client.on('finishTransaction', _finishCurrentProfile);\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (!PROFILE_QUEUE.size()) {\n return;\n }\n\n const profiledTransactions = findProfiledTransactionsFromEnvelope(envelope);\n if (!profiledTransactions.length) {\n logger.log('[Profiling] no profiled transactions found in envelope');\n return;\n }\n\n const profilesToAddToEnvelope: ProfileEvent[] = [];\n for (const profiledTransaction of profiledTransactions) {\n const profile = _createProfileEventFor(profiledTransaction);\n if (profile) {\n profilesToAddToEnvelope.push(profile);\n }\n }\n addProfilesToEnvelope(envelope, profilesToAddToEnvelope);\n });\n };\n\n const _startCurrentProfileForActiveTransaction = (): void => {\n if (_currentProfile) {\n return;\n }\n const transaction = getActiveTransaction(getCurrentHub());\n transaction && _startCurrentProfile(transaction);\n };\n\n const _startCurrentProfile = (transaction: Transaction): void => {\n _finishCurrentProfile();\n\n const shouldStartProfiling = _shouldStartProfiling(transaction);\n if (!shouldStartProfiling) {\n return;\n }\n\n _currentProfileTimeout = setTimeout(_finishCurrentProfile, MAX_PROFILE_DURATION_MS);\n _startNewProfile(transaction);\n };\n\n const _shouldStartProfiling = (transaction: Transaction): boolean => {\n if (!transaction.sampled) {\n logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n return false;\n }\n\n const client = getClient();\n const options = client && client.getOptions();\n\n const profilesSampleRate =\n options && options._experiments && typeof options._experiments.profilesSampleRate === 'number'\n ? options._experiments.profilesSampleRate\n : undefined;\n if (profilesSampleRate === undefined) {\n logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');\n return false;\n }\n\n // Check if we should sample this profile\n if (Math.random() > profilesSampleRate) {\n logger.log('[Profiling] Skip profiling transaction due to sampling.');\n return false;\n }\n\n return true;\n };\n\n /**\n * Starts a new profile and links it to the transaction.\n */\n const _startNewProfile = (transaction: Transaction): void => {\n const profileStartTimestampNs = startProfiling();\n if (!profileStartTimestampNs) {\n return;\n }\n\n _currentProfile = {\n profile_id: uuid4(),\n startTimestampNs: profileStartTimestampNs,\n };\n transaction.setContext('profile', { profile_id: _currentProfile.profile_id });\n // @ts-expect-error profile_id is not part of the metadata type\n transaction.setMetadata({ profile_id: _currentProfile.profile_id });\n logger.log('[Profiling] started profiling: ', _currentProfile.profile_id);\n };\n\n /**\n * Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.\n */\n const _finishCurrentProfile = (): void => {\n _clearCurrentProfileTimeout();\n if (_currentProfile === undefined) {\n return;\n }\n\n const profile = stopProfiling(_currentProfile.startTimestampNs);\n if (!profile) {\n logger.warn('[Profiling] Stop failed. Cleaning up...');\n _currentProfile = undefined;\n return;\n }\n\n PROFILE_QUEUE.add(_currentProfile.profile_id, profile);\n\n logger.log('[Profiling] finished profiling: ', _currentProfile.profile_id);\n _currentProfile = undefined;\n };\n\n const _createProfileEventFor = (profiledTransaction: Event): ProfileEvent | null => {\n const profile_id = profiledTransaction?.contexts?.['profile']?.['profile_id'];\n\n if (typeof profile_id !== 'string') {\n logger.log('[Profiling] cannot find profile for a transaction without a profile context');\n return null;\n }\n\n // Remove the profile from the transaction context before sending, relay will take care of the rest.\n if (profiledTransaction?.contexts?.['.profile']) {\n delete profiledTransaction.contexts.profile;\n }\n\n const profile = PROFILE_QUEUE.get(profile_id);\n PROFILE_QUEUE.delete(profile_id);\n\n if (!profile) {\n logger.log(`[Profiling] cannot find profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n return null;\n }\n\n const profileWithEvent = enrichCombinedProfileWithEventContext(profile_id, profile, profiledTransaction);\n logger.log(`[Profiling] Created profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n\n return profileWithEvent;\n };\n\n const _clearCurrentProfileTimeout = (): void => {\n _currentProfileTimeout !== undefined && clearTimeout(_currentProfileTimeout);\n _currentProfileTimeout = undefined;\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce,\n };\n};\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @deprecated Use `hermesProfilingIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const HermesProfiling = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n hermesProfilingIntegration,\n) as IntegrationClass<Integration>;\n\n/**\n * Starts Profilers and returns the timestamp when profiling started in nanoseconds.\n */\nexport function startProfiling(): number | null {\n const started = NATIVE.startProfiling();\n if (!started) {\n return null;\n }\n\n return Date.now() * MS_TO_NS;\n}\n\n/**\n * Stops Profilers and returns collected combined profile.\n */\nexport function stopProfiling(\n profileStartTimestampNs: number,\n): CombinedProfileEvent | AndroidCombinedProfileEvent | null {\n const collectedProfiles = NATIVE.stopProfiling();\n if (!collectedProfiles) {\n return null;\n }\n const profileEndTimestampNs = Date.now() * MS_TO_NS;\n\n const hermesProfile = convertToSentryProfile(collectedProfiles.hermesProfile);\n if (!hermesProfile) {\n return null;\n }\n\n const hermesProfileEvent = createHermesProfilingEvent(hermesProfile);\n if (!hermesProfileEvent) {\n return null;\n }\n\n if (collectedProfiles.androidProfile) {\n const durationNs = profileEndTimestampNs - profileStartTimestampNs;\n return createAndroidWithHermesProfile(hermesProfileEvent, collectedProfiles.androidProfile, durationNs);\n } else if (collectedProfiles.nativeProfile) {\n return addNativeProfileToHermesProfile(hermesProfileEvent, collectedProfiles.nativeProfile);\n }\n\n return hermesProfileEvent;\n}\n\n/**\n * Creates Android profile event with attached javascript profile.\n */\nexport function createAndroidWithHermesProfile(\n hermes: HermesProfileEvent,\n nativeAndroid: NativeAndroidProfileEvent,\n durationNs: number,\n): AndroidCombinedProfileEvent {\n return {\n ...nativeAndroid,\n platform: 'android',\n js_profile: hermes.profile,\n duration_ns: durationNs.toString(10),\n active_thread_id: hermes.transaction.active_thread_id,\n };\n}\n\n/**\n * Merges Hermes and Native profile events into one.\n */\nexport function addNativeProfileToHermesProfile(\n hermes: HermesProfileEvent,\n native: NativeProfileEvent,\n): CombinedProfileEvent {\n return {\n ...hermes,\n profile: addNativeThreadCpuProfileToHermes(hermes.profile, native.profile, hermes.transaction.active_thread_id),\n debug_meta: {\n images: native.debug_meta.images,\n },\n measurements: native.measurements,\n };\n}\n\n/**\n * Merges Hermes And Native profiles into one.\n */\nexport function addNativeThreadCpuProfileToHermes(\n hermes: ThreadCpuProfile,\n native: ThreadCpuProfile,\n hermes_active_thread_id: string | undefined,\n): CombinedProfileEvent['profile'] {\n // assumes thread ids are unique\n hermes.thread_metadata = { ...native.thread_metadata, ...hermes.thread_metadata };\n // assumes queue ids are unique\n hermes.queue_metadata = { ...native.queue_metadata, ...hermes.queue_metadata };\n\n // recalculate frames and stacks using offset\n const framesOffset = hermes.frames.length;\n const stacksOffset = hermes.stacks.length;\n\n if (native.frames) {\n for (const frame of native.frames) {\n hermes.frames.push({\n function: frame.function,\n instruction_addr: frame.instruction_addr,\n platform: Platform.OS === 'ios' ? 'cocoa' : undefined,\n });\n }\n }\n hermes.stacks = [\n ...(hermes.stacks || []),\n ...(native.stacks || []).map(stack => stack.map(frameId => frameId + framesOffset)),\n ];\n hermes.samples = [\n ...(hermes.samples || []),\n ...(native.samples || [])\n .filter(sample => sample.thread_id !== hermes_active_thread_id)\n .map(sample => ({\n ...sample,\n stack_id: stacksOffset + sample.stack_id,\n })),\n ];\n\n return hermes;\n}\n"]}
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU3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ertIntegrationFnToClass, getActiveTransaction, getClient, getCurrentHub } from '@sentry/core';\nimport type {\n Envelope,\n Event,\n Integration,\n IntegrationClass,\n IntegrationFn,\n ThreadCpuProfile,\n Transaction,\n} from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\nimport { Platform } from 'react-native';\n\nimport type { ReactNativeClient } from '../client';\nimport { isHermesEnabled } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { PROFILE_QUEUE } from './cache';\nimport { MAX_PROFILE_DURATION_MS } from './constants';\nimport { convertToSentryProfile } from './convertHermesProfile';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './nativeTypes';\nimport type { AndroidCombinedProfileEvent, CombinedProfileEvent, HermesProfileEvent, ProfileEvent } from './types';\nimport {\n addProfilesToEnvelope,\n createHermesProfilingEvent,\n enrichCombinedProfileWithEventContext,\n findProfiledTransactionsFromEnvelope,\n} from './utils';\n\nconst INTEGRATION_NAME = 'HermesProfiling';\n\nconst MS_TO_NS: number = 1e6;\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @experimental\n */\nexport const hermesProfilingIntegration: IntegrationFn = () => {\n let _currentProfile:\n | {\n profile_id: string;\n startTimestampNs: number;\n }\n | undefined;\n let _currentProfileTimeout: number | undefined;\n\n const setupOnce = (): void => {\n if (!isHermesEnabled()) {\n logger.log('[Profiling] Hermes is not enabled, not adding profiling integration.');\n return;\n }\n\n const client = getClient();\n\n if (!client || typeof client.on !== 'function') {\n return;\n }\n\n _startCurrentProfileForActiveTransaction();\n client.on('startTransaction', _startCurrentProfile);\n\n client.on('finishTransaction', _finishCurrentProfile);\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (!PROFILE_QUEUE.size()) {\n return;\n }\n\n const profiledTransactions = findProfiledTransactionsFromEnvelope(envelope);\n if (!profiledTransactions.length) {\n logger.log('[Profiling] no profiled transactions found in envelope');\n return;\n }\n\n const profilesToAddToEnvelope: ProfileEvent[] = [];\n for (const profiledTransaction of profiledTransactions) {\n const profile = _createProfileEventFor(profiledTransaction);\n if (profile) {\n profilesToAddToEnvelope.push(profile);\n }\n }\n addProfilesToEnvelope(envelope, profilesToAddToEnvelope);\n });\n };\n\n const _startCurrentProfileForActiveTransaction = (): void => {\n if (_currentProfile) {\n return;\n }\n const transaction = getActiveTransaction(getCurrentHub());\n transaction && _startCurrentProfile(transaction);\n };\n\n const _startCurrentProfile = (transaction: Transaction): void => {\n _finishCurrentProfile();\n\n const shouldStartProfiling = _shouldStartProfiling(transaction);\n if (!shouldStartProfiling) {\n return;\n }\n\n _currentProfileTimeout = setTimeout(_finishCurrentProfile, MAX_PROFILE_DURATION_MS);\n _startNewProfile(transaction);\n };\n\n const _shouldStartProfiling = (transaction: Transaction): boolean => {\n if (!transaction.sampled) {\n logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n return false;\n }\n\n const client = getClient<ReactNativeClient>();\n const options = client && client.getOptions();\n\n const profilesSampleRate =\n options &&\n ((typeof options.profilesSampleRate === 'number' && options.profilesSampleRate) ||\n (options._experiments &&\n typeof options._experiments.profilesSampleRate === 'number' &&\n options._experiments.profilesSampleRate) ||\n undefined);\n if (profilesSampleRate === undefined) {\n logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');\n return false;\n }\n\n // Check if we should sample this profile\n if (Math.random() > profilesSampleRate) {\n logger.log('[Profiling] Skip profiling transaction due to sampling.');\n return false;\n }\n\n return true;\n };\n\n /**\n * Starts a new profile and links it to the transaction.\n */\n const _startNewProfile = (transaction: Transaction): void => {\n const profileStartTimestampNs = startProfiling();\n if (!profileStartTimestampNs) {\n return;\n }\n\n _currentProfile = {\n profile_id: uuid4(),\n startTimestampNs: profileStartTimestampNs,\n };\n transaction.setContext('profile', { profile_id: _currentProfile.profile_id });\n // @ts-expect-error profile_id is not part of the metadata type\n transaction.setMetadata({ profile_id: _currentProfile.profile_id });\n logger.log('[Profiling] started profiling: ', _currentProfile.profile_id);\n };\n\n /**\n * Stops profiling and adds the profile to the queue to be processed on beforeEnvelope.\n */\n const _finishCurrentProfile = (): void => {\n _clearCurrentProfileTimeout();\n if (_currentProfile === undefined) {\n return;\n }\n\n const profile = stopProfiling(_currentProfile.startTimestampNs);\n if (!profile) {\n logger.warn('[Profiling] Stop failed. Cleaning up...');\n _currentProfile = undefined;\n return;\n }\n\n PROFILE_QUEUE.add(_currentProfile.profile_id, profile);\n\n logger.log('[Profiling] finished profiling: ', _currentProfile.profile_id);\n _currentProfile = undefined;\n };\n\n const _createProfileEventFor = (profiledTransaction: Event): ProfileEvent | null => {\n const profile_id = profiledTransaction?.contexts?.['profile']?.['profile_id'];\n\n if (typeof profile_id !== 'string') {\n logger.log('[Profiling] cannot find profile for a transaction without a profile context');\n return null;\n }\n\n // Remove the profile from the transaction context before sending, relay will take care of the rest.\n if (profiledTransaction?.contexts?.['.profile']) {\n delete profiledTransaction.contexts.profile;\n }\n\n const profile = PROFILE_QUEUE.get(profile_id);\n PROFILE_QUEUE.delete(profile_id);\n\n if (!profile) {\n logger.log(`[Profiling] cannot find profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n return null;\n }\n\n const profileWithEvent = enrichCombinedProfileWithEventContext(profile_id, profile, profiledTransaction);\n logger.log(`[Profiling] Created profile ${profile_id} for transaction ${profiledTransaction.event_id}`);\n\n return profileWithEvent;\n };\n\n const _clearCurrentProfileTimeout = (): void => {\n _currentProfileTimeout !== undefined && clearTimeout(_currentProfileTimeout);\n _currentProfileTimeout = undefined;\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce,\n };\n};\n\n/**\n * Profiling integration creates a profile for each transaction and adds it to the event envelope.\n *\n * @deprecated Use `hermesProfilingIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const HermesProfiling = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n hermesProfilingIntegration,\n) as IntegrationClass<Integration>;\n\n/**\n * Starts Profilers and returns the timestamp when profiling started in nanoseconds.\n */\nexport function startProfiling(): number | null {\n const started = NATIVE.startProfiling();\n if (!started) {\n return null;\n }\n\n return Date.now() * MS_TO_NS;\n}\n\n/**\n * Stops Profilers and returns collected combined profile.\n */\nexport function stopProfiling(\n profileStartTimestampNs: number,\n): CombinedProfileEvent | AndroidCombinedProfileEvent | null {\n const collectedProfiles = NATIVE.stopProfiling();\n if (!collectedProfiles) {\n return null;\n }\n const profileEndTimestampNs = Date.now() * MS_TO_NS;\n\n const hermesProfile = convertToSentryProfile(collectedProfiles.hermesProfile);\n if (!hermesProfile) {\n return null;\n }\n\n const hermesProfileEvent = createHermesProfilingEvent(hermesProfile);\n if (!hermesProfileEvent) {\n return null;\n }\n\n if (collectedProfiles.androidProfile) {\n const durationNs = profileEndTimestampNs - profileStartTimestampNs;\n return createAndroidWithHermesProfile(hermesProfileEvent, collectedProfiles.androidProfile, durationNs);\n } else if (collectedProfiles.nativeProfile) {\n return addNativeProfileToHermesProfile(hermesProfileEvent, collectedProfiles.nativeProfile);\n }\n\n return hermesProfileEvent;\n}\n\n/**\n * Creates Android profile event with attached javascript profile.\n */\nexport function createAndroidWithHermesProfile(\n hermes: HermesProfileEvent,\n nativeAndroid: NativeAndroidProfileEvent,\n durationNs: number,\n): AndroidCombinedProfileEvent {\n return {\n ...nativeAndroid,\n platform: 'android',\n js_profile: hermes.profile,\n duration_ns: durationNs.toString(10),\n active_thread_id: hermes.transaction.active_thread_id,\n };\n}\n\n/**\n * Merges Hermes and Native profile events into one.\n */\nexport function addNativeProfileToHermesProfile(\n hermes: HermesProfileEvent,\n native: NativeProfileEvent,\n): CombinedProfileEvent {\n return {\n ...hermes,\n profile: addNativeThreadCpuProfileToHermes(hermes.profile, native.profile, hermes.transaction.active_thread_id),\n debug_meta: {\n images: native.debug_meta.images,\n },\n measurements: native.measurements,\n };\n}\n\n/**\n * Merges Hermes And Native profiles into one.\n */\nexport function addNativeThreadCpuProfileToHermes(\n hermes: ThreadCpuProfile,\n native: ThreadCpuProfile,\n hermes_active_thread_id: string | undefined,\n): CombinedProfileEvent['profile'] {\n // assumes thread ids are unique\n hermes.thread_metadata = { ...native.thread_metadata, ...hermes.thread_metadata };\n // assumes queue ids are unique\n hermes.queue_metadata = { ...native.queue_metadata, ...hermes.queue_metadata };\n\n // recalculate frames and stacks using offset\n const framesOffset = hermes.frames.length;\n const stacksOffset = hermes.stacks.length;\n\n if (native.frames) {\n for (const frame of native.frames) {\n hermes.frames.push({\n function: frame.function,\n instruction_addr: frame.instruction_addr,\n platform: Platform.OS === 'ios' ? 'cocoa' : undefined,\n });\n }\n }\n hermes.stacks = [\n ...(hermes.stacks || []),\n ...(native.stacks || []).map(stack => stack.map(frameId => frameId + framesOffset)),\n ];\n hermes.samples = [\n ...(hermes.samples || []),\n ...(native.samples || [])\n .filter(sample => sample.thread_id !== hermes_active_thread_id)\n .map(sample => ({\n ...sample,\n stack_id: stacksOffset + sample.stack_id,\n })),\n ];\n\n return hermes;\n}\n"]}
@@ -7,6 +7,11 @@ export interface SentryMetroConfigOptions {
7
7
  * @default false
8
8
  */
9
9
  annotateReactComponents?: boolean;
10
+ /**
11
+ * Adds the Sentry replay package for web.
12
+ * @default true
13
+ */
14
+ includeWebReplay?: boolean;
10
15
  }
11
16
  export interface SentryExpoConfigOptions {
12
17
  /**
@@ -20,7 +25,7 @@ export interface SentryExpoConfigOptions {
20
25
  * Adds Debug ID to the output bundle and source maps.
21
26
  * Collapses Sentry frames from the stack trace view in LogBox.
22
27
  */
23
- export declare function withSentryConfig(config: MetroConfig, { annotateReactComponents }?: SentryMetroConfigOptions): MetroConfig;
28
+ export declare function withSentryConfig(config: MetroConfig, { annotateReactComponents, includeWebReplay }?: SentryMetroConfigOptions): MetroConfig;
24
29
  /**
25
30
  * This function returns Default Expo configuration with Sentry plugins.
26
31
  */
@@ -29,6 +34,10 @@ export declare function getSentryExpoConfig(projectRoot: string, options?: Defau
29
34
  * Adds Sentry Babel transformer to the Metro config.
30
35
  */
31
36
  export declare function withSentryBabelTransformer(config: MetroConfig): MetroConfig;
37
+ /**
38
+ * Includes `@sentry/replay` packages based on the `includeWebReplay` flag and current bundle `platform`.
39
+ */
40
+ export declare function withSentryResolver(config: MetroConfig, includeWebReplay: boolean | undefined): MetroConfig;
32
41
  /**
33
42
  * Collapses Sentry internal frames from the stack trace view in LogBox.
34
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"metroconfig.d.ts","sourceRoot":"","sources":["../../../src/js/tools/metroconfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAsC,MAAM,OAAO,CAAC;AAO7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,cAAc,yBAAyB,CAAC;AAIxC,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,mBAAmB,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,EAAE,uBAA+B,EAAE,GAAE,wBAA6B,GACjE,WAAW,CAYb;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,oBAAoB,GAAG,uBAAuB,GAAG,wBAA6B,GACtF,WAAW,CAkBb;AAsBD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CA2B3E;AA0BD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAiC1E"}
1
+ {"version":3,"file":"metroconfig.d.ts","sourceRoot":"","sources":["../../../src/js/tools/metroconfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAsC,MAAM,OAAO,CAAC;AAQ7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,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