@sentry/react-native 5.26.0 → 5.28.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 (35) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +4 -1
  5. package/dist/js/client.d.ts.map +1 -1
  6. package/dist/js/client.js +15 -12
  7. package/dist/js/client.js.map +1 -1
  8. package/dist/js/options.d.ts +7 -0
  9. package/dist/js/options.d.ts.map +1 -1
  10. package/dist/js/options.js.map +1 -1
  11. package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
  12. package/dist/js/tools/vendor/metro/utils.js +17 -1
  13. package/dist/js/tools/vendor/metro/utils.js.map +1 -1
  14. package/dist/js/tracing/reactnativetracing.d.ts +2 -0
  15. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  16. package/dist/js/tracing/reactnativetracing.js +16 -1
  17. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  18. package/dist/js/utils/rnlibraries.d.ts.map +1 -1
  19. package/dist/js/utils/rnlibraries.js +3 -3
  20. package/dist/js/utils/rnlibraries.js.map +1 -1
  21. package/dist/js/utils/rnlibrariesinterface.d.ts +1 -4
  22. package/dist/js/utils/rnlibrariesinterface.d.ts.map +1 -1
  23. package/dist/js/utils/rnlibrariesinterface.js.map +1 -1
  24. package/dist/js/vendor/react-native/index.d.ts +8 -0
  25. package/dist/js/vendor/react-native/index.d.ts.map +1 -1
  26. package/dist/js/vendor/react-native/index.js.map +1 -1
  27. package/dist/js/version.d.ts +1 -1
  28. package/dist/js/version.js +1 -1
  29. package/dist/js/version.js.map +1 -1
  30. package/package.json +3 -3
  31. package/ts3.8/dist/js/options.d.ts +7 -0
  32. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +2 -0
  33. package/ts3.8/dist/js/utils/rnlibrariesinterface.d.ts +1 -4
  34. package/ts3.8/dist/js/vendor/react-native/index.d.ts +8 -0
  35. package/ts3.8/dist/js/version.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.28.0
4
+
5
+ ### Fixes
6
+
7
+ - Support `metro@0.80.10` new `sourceMapString` export ([#4004](https://github.com/getsentry/sentry-react-native/pull/4004))
8
+ - `Sentry.captureMessage` stack trace is in `event.exception` (moved from `event.threads`) ([#3635](https://github.com/getsentry/sentry-react-native/pull/3635), [#3988](https://github.com/getsentry/sentry-react-native/pull/3988))
9
+ - To revert to the old behavior (causing the stack to be unsymbolicated) use `useThreadsForMessageStack` option
10
+
11
+ ### Dependencies
12
+
13
+ - Bump Cocoa SDK from v8.32.0 to v8.33.0 ([#4007](https://github.com/getsentry/sentry-react-native/pull/4007))
14
+ - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8330)
15
+ - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.32.0...8.33.0)
16
+
17
+ ## 5.27.0
18
+
19
+ ### Fixes
20
+
21
+ - Pass `sampleRate` option to the Android SDK ([#3979](https://github.com/getsentry/sentry-react-native/pull/3979))
22
+ - Drop app start data older than one minute ([#3974](https://github.com/getsentry/sentry-react-native/pull/3974))
23
+ - Use `Platform.constants.reactNativeVersion` instead of `react-native` internal export ([#3949](https://github.com/getsentry/sentry-react-native/pull/3949))
24
+
25
+ ### Dependencies
26
+
27
+ - Bump Android SDK from v7.12.0 to v7.13.0 ([#3970](https://github.com/getsentry/sentry-react-native/pull/3970), [#3984](https://github.com/getsentry/sentry-react-native/pull/3984))
28
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7130)
29
+ - [diff](https://github.com/getsentry/sentry-java/compare/7.12.0...7.13.0)
30
+ - Bump Cocoa SDK from v8.31.1 to v8.32.0 ([#3969](https://github.com/getsentry/sentry-react-native/pull/3969))
31
+ - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8320)
32
+ - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.31.1...8.32.0)
33
+
3
34
  ## 5.26.0
4
35
 
5
36
  ### Features
@@ -275,7 +306,7 @@ Access to Mobile Replay is limited to early access orgs on Sentry. If you're int
275
306
  replaysSessionSampleRate: 1.0,
276
307
  replaysOnErrorSampleRate: 1.0,
277
308
  },
278
- integration: [
309
+ integrations: [
279
310
  Sentry.mobileReplayIntegration({
280
311
  maskAllText: true,
281
312
  maskAllImages: true,
package/RNSentry.podspec CHANGED
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
33
33
  s.preserve_paths = '*.js'
34
34
 
35
35
  s.dependency 'React-Core'
36
- s.dependency 'Sentry/HybridSDK', '8.31.1'
36
+ s.dependency 'Sentry/HybridSDK', '8.33.0'
37
37
 
38
38
  s.source_files = 'ios/**/*.{h,m,mm}'
39
39
  s.public_header_files = 'ios/RNSentry.h'
@@ -54,5 +54,5 @@ android {
54
54
 
55
55
  dependencies {
56
56
  implementation 'com.facebook.react:react-native:+'
57
- api 'io.sentry:sentry-android:7.12.0'
57
+ api 'io.sentry:sentry-android:7.13.0'
58
58
  }
@@ -203,6 +203,9 @@ public class RNSentryModuleImpl {
203
203
  // SentryAndroid needs an empty string fallback for the dsn.
204
204
  options.setDsn("");
205
205
  }
206
+ if (rnOptions.hasKey("sampleRate")) {
207
+ options.setSampleRate(rnOptions.getDouble("sampleRate"));
208
+ }
206
209
  if (rnOptions.hasKey("sendClientReports")) {
207
210
  options.setSendClientReports(rnOptions.getBoolean("sendClientReports"));
208
211
  }
@@ -438,7 +441,7 @@ public class RNSentryModuleImpl {
438
441
  }
439
442
 
440
443
  public void captureReplay(boolean isHardCrash, Promise promise) {
441
- Sentry.getCurrentHub().getOptions().getReplayController().sendReplay(isHardCrash, null, null);
444
+ Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash);
442
445
  promise.resolve(getCurrentReplayId());
443
446
  }
444
447
 
@@ -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;IAmBrG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IASxD;;OAEG;IACI,IAAI,IAAI,IAAI;IAKnB;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAapC;;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"}
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;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IASxD;;OAEG;IACI,IAAI,IAAI,IAAI;IAKnB;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAapC;;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
@@ -38,19 +38,22 @@ export class ReactNativeClient extends BaseClient {
38
38
  * @inheritDoc
39
39
  */
40
40
  eventFromMessage(message, level, hint) {
41
- return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then((event) => {
42
- var _a;
43
- // TMP! Remove this function once JS SDK uses threads for messages
44
- if (!((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || event.exception.values.length <= 0) {
41
+ if (this._options.useThreadsForMessageStack) {
42
+ return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then((event) => {
43
+ var _a;
44
+ // TMP! Remove this function once JS SDK uses threads for messages
45
+ if (!((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || event.exception.values.length <= 0) {
46
+ return event;
47
+ }
48
+ const values = event.exception.values.map((exception) => ({
49
+ stacktrace: exception.stacktrace,
50
+ }));
51
+ event.threads = { values };
52
+ delete event.exception;
45
53
  return event;
46
- }
47
- const values = event.exception.values.map((exception) => ({
48
- stacktrace: exception.stacktrace,
49
- }));
50
- event.threads = { values };
51
- delete event.exception;
52
- return event;
53
- });
54
+ });
55
+ }
56
+ return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
54
57
  }
55
58
  /**
56
59
  * If native client is available it will trigger a native crash.
@@ -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,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,O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,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 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 /**\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,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f,CAAC,CACF;aACA,IAAI,CAAC,CAAC,iBAA0B,EAAE,EAAE;;YACnC,MAAA,MAAA,IAAI,CAAC,QAAQ,EAAC,OAAO,mDAAG,EAAE,iBAAiB,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC;aACD,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,6NAA6N,CAC9N,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { 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"]}
@@ -181,6 +181,13 @@ export interface BaseReactNativeOptions {
181
181
  */
182
182
  replaysOnErrorSampleRate?: number;
183
183
  };
184
+ /**
185
+ * This options changes the placement of the attached stacktrace of `captureMessage` in the event.
186
+ *
187
+ * @default false
188
+ * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.
189
+ */
190
+ useThreadsForMessageStack?: boolean;
184
191
  }
185
192
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
186
193
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAA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W,wBACf,SAAQ,IAAI,CAAC,aAAa,CAAC,2BAA2B,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC,EACjF,sBAAsB;CAAG;AAE7B,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAkBtE"}
@@ -1 +1 @@
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;AA+OvD;;;;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 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 spotlightSidecarUrl?: 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\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;AAuPvD;;;;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 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 spotlightSidecarUrl?: 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 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UACpB,aAAa;2BAIK,MAAM,KAAK,MAAM;MAEzC,SAAS,MAAM,EAMjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,QAAO,eAoB/C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAe,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAOnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UACpB,aAAa;2BAIK,MAAM,KAAK,MAAM;MAEzC,SAAS,MAAM,EAMjB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,QAAO,eAqC/C,CAAC"}
@@ -38,8 +38,24 @@ const createDefaultMetroSerializer = () => {
38
38
  // Hot means running in dev server, sourcemaps are generated on demand
39
39
  return code;
40
40
  }
41
+ let sourceMapStringFunction;
42
+ if (typeof sourceMapString === 'function') {
43
+ sourceMapStringFunction = sourceMapString;
44
+ }
45
+ else if (typeof sourceMapString === 'object' &&
46
+ sourceMapString != null &&
47
+ 'sourceMapString' in sourceMapString &&
48
+ typeof sourceMapString['sourceMapString'] === 'function') {
49
+ sourceMapStringFunction = sourceMapString.sourceMapString;
50
+ }
51
+ else {
52
+ throw new Error(`
53
+ [@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.
54
+ Please check the version of Metro you are using and report the issue at http://www.github.com/getsentry/sentry-react-native/issues
55
+ `);
56
+ }
41
57
  // Always generate source maps, can't use Sentry without source maps
42
- const map = sourceMapString([...preModules, ...(0, exports.getSortedModules)(graph, options)], {
58
+ const map = sourceMapStringFunction([...preModules, ...(0, exports.getSortedModules)(graph, options)], {
43
59
  processModuleFilter: options.processModuleFilter,
44
60
  shouldAddToIgnoreList: options.shouldAddToIgnoreList,
45
61
  });
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AAAA,2CAA2C;;;AA2B3C,gFAAgF;AAChF,sFAAsF;AACtF,+DAA+D;AAI/D;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAC9B,KAAoB,EACpB,EACE,cAAc,GAGf,EACkB,EAAE;IACrB,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,cAAc;IACd,OAAO,OAAO,CAAC,IAAI,CACjB,CAAC,CAAsB,EAAE,CAAsB,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CACpG,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,gBAAgB,oBAa3B;AAEF;;;;;;;;;GASG;AACI,MAAM,4BAA4B,GAAG,GAAoB,EAAE;IAChE,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChD,4DAA4D;QAC5D,IAAI,MAAM,GAAG,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAClE,IAAI,OAAO,CAAC,oBAAoB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAC/D,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;SAC/C;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAC9B,sEAAsE;YACtE,OAAO,IAAI,CAAC;SACb;QAED,oEAAoE;QACpE,MAAM,GAAG,GAAG,eAAe,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,IAAA,wBAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;YAChF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;SACrD,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC","sourcesContent":["// Vendored / modified from @facebook/metro\n\n// https://github.com/facebook/metro/commit/9b85f83c9cc837d8cd897aa7723be7da5b296067\n\n// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport * as baseJSBundle from 'metro/src/DeltaBundler/Serializers/baseJSBundle';\nimport * as sourceMapString from 'metro/src/DeltaBundler/Serializers/sourceMapString';\nimport * as bundleToString from 'metro/src/lib/bundleToString';\n\nimport type { MetroSerializer } from '../../utils';\n\n/**\n * This function ensures that modules in source maps are sorted in the same\n * order as in a plain JS bundle.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984\n */\nexport const getSortedModules = (\n graph: ReadOnlyGraph,\n {\n createModuleId,\n }: {\n createModuleId: (file: string) => number;\n },\n): readonly Module[] => {\n const modules = [...graph.dependencies.values()];\n // Sort by IDs\n return modules.sort(\n (a: Module<MixedOutput>, b: Module<MixedOutput>) => createModuleId(a.path) - createModuleId(b.path),\n );\n};\n\n/**\n * Creates the default Metro plain bundle serializer.\n * Because Metro exports only the intermediate serializer functions, we need to\n * assemble the final serializer ourselves. We have to work with the modules the same as Metro does\n * to avoid unexpected changes in the final bundle.\n *\n * This is used when the user does not provide a custom serializer.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277\n */\nexport const createDefaultMetroSerializer = (): MetroSerializer => {\n return (entryPoint, preModules, graph, options) => {\n // baseJSBundle assigns IDs to modules in a consistent order\n let bundle = baseJSBundle(entryPoint, preModules, graph, options);\n if (options.sentryBundleCallback && !graph.transformOptions.hot) {\n bundle = options.sentryBundleCallback(bundle);\n }\n const { code } = bundleToString(bundle);\n if (graph.transformOptions.hot) {\n // Hot means running in dev server, sourcemaps are generated on demand\n return code;\n }\n\n // Always generate source maps, can't use Sentry without source maps\n const map = sourceMapString([...preModules, ...getSortedModules(graph, options)], {\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList,\n });\n return { code, map };\n };\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/js/tools/vendor/metro/utils.ts"],"names":[],"mappings":"AAAA,2CAA2C;;;AA2B3C,gFAAgF;AAChF,sFAAsF;AACtF,+DAA+D;AAS/D;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAC9B,KAAoB,EACpB,EACE,cAAc,GAGf,EACkB,EAAE;IACrB,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,cAAc;IACd,OAAO,OAAO,CAAC,IAAI,CACjB,CAAC,CAAsB,EAAE,CAAsB,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CACpG,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,gBAAgB,oBAa3B;AAEF;;;;;;;;;GASG;AACI,MAAM,4BAA4B,GAAG,GAAoB,EAAE;IAChE,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChD,4DAA4D;QAC5D,IAAI,MAAM,GAAG,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAClE,IAAI,OAAO,CAAC,oBAAoB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAC/D,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;SAC/C;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE;YAC9B,sEAAsE;YACtE,OAAO,IAAI,CAAC;SACb;QAED,IAAI,uBAA2D,CAAC;QAChE,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;YACzC,uBAAuB,GAAG,eAAe,CAAC;SAC3C;aAAM,IACL,OAAO,eAAe,KAAK,QAAQ;YACnC,eAAe,IAAI,IAAI;YACvB,iBAAiB,IAAI,eAAe;YACpC,OAAO,eAAe,CAAC,iBAAiB,CAAC,KAAK,UAAU,EACxD;YACA,uBAAuB,GAAI,eAA4C,CAAC,eAAe,CAAC;SACzF;aAAM;YACL,MAAM,IAAI,KAAK,CAAC;;;CAGrB,CAAC,CAAC;SACE;QAED,oEAAoE;QACpE,MAAM,GAAG,GAAG,uBAAuB,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,IAAA,wBAAgB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;YACxF,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;SACrD,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,4BAA4B,gCAqCvC","sourcesContent":["// Vendored / modified from @facebook/metro\n\n// https://github.com/facebook/metro/commit/9b85f83c9cc837d8cd897aa7723be7da5b296067\n\n// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { MixedOutput, Module, ReadOnlyGraph } from 'metro';\nimport * as baseJSBundle from 'metro/src/DeltaBundler/Serializers/baseJSBundle';\nimport * as sourceMapString from 'metro/src/DeltaBundler/Serializers/sourceMapString';\nimport * as bundleToString from 'metro/src/lib/bundleToString';\n\nimport type { MetroSerializer } from '../../utils';\n\ntype NewSourceMapStringExport = {\n // Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28\n sourceMapString: typeof sourceMapString;\n};\n\n/**\n * This function ensures that modules in source maps are sorted in the same\n * order as in a plain JS bundle.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984\n */\nexport const getSortedModules = (\n graph: ReadOnlyGraph,\n {\n createModuleId,\n }: {\n createModuleId: (file: string) => number;\n },\n): readonly Module[] => {\n const modules = [...graph.dependencies.values()];\n // Sort by IDs\n return modules.sort(\n (a: Module<MixedOutput>, b: Module<MixedOutput>) => createModuleId(a.path) - createModuleId(b.path),\n );\n};\n\n/**\n * Creates the default Metro plain bundle serializer.\n * Because Metro exports only the intermediate serializer functions, we need to\n * assemble the final serializer ourselves. We have to work with the modules the same as Metro does\n * to avoid unexpected changes in the final bundle.\n *\n * This is used when the user does not provide a custom serializer.\n *\n * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277\n */\nexport const createDefaultMetroSerializer = (): MetroSerializer => {\n return (entryPoint, preModules, graph, options) => {\n // baseJSBundle assigns IDs to modules in a consistent order\n let bundle = baseJSBundle(entryPoint, preModules, graph, options);\n if (options.sentryBundleCallback && !graph.transformOptions.hot) {\n bundle = options.sentryBundleCallback(bundle);\n }\n const { code } = bundleToString(bundle);\n if (graph.transformOptions.hot) {\n // Hot means running in dev server, sourcemaps are generated on demand\n return code;\n }\n\n let sourceMapStringFunction: typeof sourceMapString | undefined;\n if (typeof sourceMapString === 'function') {\n sourceMapStringFunction = sourceMapString;\n } else if (\n typeof sourceMapString === 'object' &&\n sourceMapString != null &&\n 'sourceMapString' in sourceMapString &&\n typeof sourceMapString['sourceMapString'] === 'function'\n ) {\n sourceMapStringFunction = (sourceMapString as NewSourceMapStringExport).sourceMapString;\n } else {\n throw new Error(`\n[@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.\nPlease check the version of Metro you are using and report the issue at http://www.github.com/getsentry/sentry-react-native/issues\n`);\n }\n\n // Always generate source maps, can't use Sentry without source maps\n const map = sourceMapStringFunction([...preModules, ...getSortedModules(graph, options)], {\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList,\n });\n return { code, map };\n };\n};\n"]}
@@ -82,6 +82,8 @@ export declare class ReactNativeTracing implements Integration {
82
82
  static id: string;
83
83
  /** We filter out App starts more than 60s */
84
84
  private static _maxAppStart;
85
+ /** We filter out App starts which timestamp is 60s and more before the transaction start */
86
+ private static _maxAppStartBeforeTransactionMs;
85
87
  /**
86
88
  * @inheritDoc
87
89
  */
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,KAAK,EAAE,GAAG,EAAmB,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,KAAK,EAEV,cAAc,EACd,WAAW,EAEX,WAAW,IAAI,eAAe,EAE/B,MAAM,eAAe,CAAC;AAK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,MAAM,GAAG,IAAI;IAI/E;;;OAGG;IACI,+BAA+B,CAAC,iBAAiB,EAAE;QACxD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,eAAe,GAAG,SAAS;IAsD/B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA+BnC;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAOrC;;;OAGG;IACH,OAAO,CAAC,gCAAgC;IAOxC;;;OAGG;YACW,mBAAmB;IAoCjC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA2DxB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAyBjC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAezB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAuBxB,6FAA6F;IAC7F,OAAO,CAAC,kBAAkB;IAI1B;;OAEG;IACH,OAAO,CAAC,eAAe;IA4BvB,uCAAuC;IACvC,OAAO,CAAC,uBAAuB;IAqE/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAO9B"}
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from '@sentry/browser';
3
- import { getActiveTransaction, getCurrentHub, startIdleTransaction } from '@sentry/core';
3
+ import { getActiveTransaction, getCurrentHub, spanToJSON, startIdleTransaction } from '@sentry/core';
4
4
  import { logger } from '@sentry/utils';
5
5
  import { APP_START_COLD, APP_START_WARM } from '../measurements';
6
6
  import { NATIVE } from '../wrapper';
@@ -271,6 +271,12 @@ export class ReactNativeTracing {
271
271
  logger.warn('App start timestamp could not be loaded from the native layer.');
272
272
  return;
273
273
  }
274
+ const isAppStartWithinBounds = appStartTimestampMs >=
275
+ getTransactionStartTimestampMs(transaction) - ReactNativeTracing._maxAppStartBeforeTransactionMs;
276
+ if (!__DEV__ && !isAppStartWithinBounds) {
277
+ logger.warn('[ReactNativeTracing] App start timestamp is too far in the past to be used for app start span.');
278
+ return;
279
+ }
274
280
  const appStartDurationMilliseconds = this._getAppStartDurationMilliseconds(appStartTimestampMs);
275
281
  if (!appStartDurationMilliseconds) {
276
282
  logger.warn('[ReactNativeTracing] App start end has not been recorded, not adding app start span.');
@@ -472,4 +478,13 @@ export class ReactNativeTracing {
472
478
  ReactNativeTracing.id = 'ReactNativeTracing';
473
479
  /** We filter out App starts more than 60s */
474
480
  ReactNativeTracing._maxAppStart = 60000;
481
+ /** We filter out App starts which timestamp is 60s and more before the transaction start */
482
+ ReactNativeTracing._maxAppStartBeforeTransactionMs = 60000;
483
+ /**
484
+ * Returns transaction start timestamp in milliseconds.
485
+ * If start timestamp is not available, returns 0.
486
+ */
487
+ function getTransactionStartTimestampMs(transaction) {
488
+ return (spanToJSON(transaction).start_timestamp || 0) * 1000;
489
+ }
475
490
  //# sourceMappingURL=reactnativetracing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oCAAoC,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASzF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,cAAc,IAAI,iBAAiB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1G,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,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I,CAAC,cAAc,oDAAI,KAAI,aAAa,EAAE,CAAC;QACvD,MAAM,EAAE,GAAG,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QACnF,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;;AArkBD;;GAEG;AACW,qBAAE,GAAW,oBAAoB,CAAC;AAChD,6CAA6C;AAC9B,+BAAY,GAAW,KAAK,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type { RequestInstrumentationOptions } from '@sentry/browser';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from '@sentry/browser';\nimport type { Hub, IdleTransaction, Transaction } from '@sentry/core';\nimport { getActiveTransaction, getCurrentHub, startIdleTransaction } from '@sentry/core';\nimport type {\n Event,\n EventProcessor,\n Integration,\n Span,\n Transaction as TransactionType,\n TransactionContext,\n} from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { APP_START_COLD, APP_START_WARM } from '../measurements';\nimport type { NativeAppStartResponse } from '../NativeRNSentry';\nimport type { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';\nimport { NATIVE } from '../wrapper';\nimport { NativeFramesInstrumentation } from './nativeframes';\nimport { APP_START_COLD as APP_START_COLD_OP, APP_START_WARM as APP_START_WARM_OP, UI_LOAD } from './ops';\nimport { StallTrackingInstrumentation } from './stalltracking';\nimport { cancelInBackground, onlySampleIfChildSpans } from './transaction';\nimport type { BeforeNavigate, RouteChangeContextData } from './types';\nimport {\n adjustTransactionDuration,\n getBundleStartTimestampMs,\n getTimeOriginMilliseconds,\n isNearToNow,\n setSpanDurationAsMeasurement,\n} from './utils';\n\nexport interface ReactNativeTracingOptions extends RequestInstrumentationOptions {\n /**\n * @deprecated Replaced by idleTimeoutMs\n */\n idleTimeout: number;\n\n /**\n * @deprecated Replaced by maxTransactionDurationMs\n */\n maxTransactionDuration: number;\n\n /**\n * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of\n * the last finished span as the endtime for the transaction.\n * Time is in ms.\n *\n * Default: 1000\n */\n idleTimeoutMs: number;\n\n /**\n * The maximum duration (transaction duration + idle timeout) of a transaction\n * before it will be marked as \"deadline_exceeded\".\n * If you never want to mark a transaction set it to 0.\n * Time is in ms.\n *\n * Default: 600000\n */\n finalTimeoutMs: number;\n\n /**\n * The routing instrumentation to be used with the tracing integration.\n * There is no routing instrumentation if nothing is passed.\n */\n routingInstrumentation?: RoutingInstrumentationInstance;\n\n /**\n * Does not sample transactions that are from routes that have been seen any more and don't have any spans.\n * This removes a lot of the clutter as most back navigation transactions are now ignored.\n *\n * Default: true\n */\n ignoreEmptyBackNavigationTransactions: boolean;\n\n /**\n * beforeNavigate is called before a navigation transaction is created and allows users to modify transaction\n * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n *\n * @param context: The context data which will be passed to `startTransaction` by default\n *\n * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n */\n beforeNavigate: BeforeNavigate;\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 * Default: true\n */\n enableAppStartTracking: boolean;\n\n /**\n * Track slow/frozen frames from the native layer and adds them as measurements to all transactions.\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 enableStallTracking: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n */\n enableUserInteractionTracing: boolean;\n}\n\nconst DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\nconst defaultReactNativeTracingOptions: ReactNativeTracingOptions = {\n ...defaultRequestInstrumentationOptions,\n idleTimeout: 1000,\n maxTransactionDuration: 600,\n idleTimeoutMs: 1000,\n finalTimeoutMs: 600000,\n ignoreEmptyBackNavigationTransactions: true,\n beforeNavigate: context => context,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n};\n\n/**\n * Tracing integration for React Native.\n */\nexport class ReactNativeTracing implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeTracing';\n /** We filter out App starts more than 60s */\n private static _maxAppStart: number = 60000;\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeTracing.id;\n\n /** ReactNativeTracing options */\n public options: ReactNativeTracingOptions;\n\n public nativeFramesInstrumentation?: NativeFramesInstrumentation;\n public stallTrackingInstrumentation?: StallTrackingInstrumentation;\n public useAppStartWithProfiler: boolean = false;\n\n private _inflightInteractionTransaction?: IdleTransaction;\n private _getCurrentHub?: () => Hub;\n private _awaitingAppStartData?: NativeAppStartResponse;\n private _appStartFinishTimestamp?: number;\n private _currentRoute?: string;\n private _hasSetTracePropagationTargets: boolean;\n private _hasSetTracingOrigins: boolean;\n private _currentViewName: string | undefined;\n private _firstConstructorCallTimestampMs: number | undefined;\n\n public constructor(options: Partial<ReactNativeTracingOptions> = {}) {\n this._hasSetTracePropagationTargets = !!(\n options &&\n // eslint-disable-next-line deprecation/deprecation\n options.tracePropagationTargets\n );\n this._hasSetTracingOrigins = !!(\n options &&\n // eslint-disable-next-line deprecation/deprecation\n options.tracingOrigins\n );\n\n this.options = {\n ...defaultReactNativeTracingOptions,\n ...options,\n finalTimeoutMs:\n options.finalTimeoutMs ??\n // eslint-disable-next-line deprecation/deprecation\n (typeof options.maxTransactionDuration === 'number'\n ? // eslint-disable-next-line deprecation/deprecation\n options.maxTransactionDuration * 1000\n : undefined) ??\n defaultReactNativeTracingOptions.finalTimeoutMs,\n idleTimeoutMs:\n options.idleTimeoutMs ??\n // eslint-disable-next-line deprecation/deprecation\n options.idleTimeout ??\n defaultReactNativeTracingOptions.idleTimeoutMs,\n };\n }\n\n /**\n * Registers routing and request instrumentation.\n */\n public async setupOnce(\n addGlobalEventProcessor: (callback: EventProcessor) => void,\n getCurrentHub: () => Hub,\n ): Promise<void> {\n const hub = getCurrentHub();\n const client = hub.getClient();\n const clientOptions = client && client.getOptions();\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const {\n traceFetch,\n traceXHR,\n // eslint-disable-next-line deprecation/deprecation\n tracingOrigins,\n shouldCreateSpanForRequest,\n // eslint-disable-next-line deprecation/deprecation\n tracePropagationTargets: thisOptionsTracePropagationTargets,\n routingInstrumentation,\n enableAppStartTracking,\n enableStallTracking,\n } = this.options;\n\n this._getCurrentHub = getCurrentHub;\n\n const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n // There are three ways to configure tracePropagationTargets:\n // 1. via top level client option `tracePropagationTargets`\n // 2. via ReactNativeTracing option `tracePropagationTargets`\n // 3. via ReactNativeTracing option `tracingOrigins` (deprecated)\n //\n // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n // ReactNativeTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n //\n // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n const tracePropagationTargets =\n clientOptionsTracePropagationTargets ||\n (this._hasSetTracePropagationTargets && thisOptionsTracePropagationTargets) ||\n (this._hasSetTracingOrigins && tracingOrigins) ||\n DEFAULT_TRACE_PROPAGATION_TARGETS;\n if (\n __DEV__ &&\n (this._hasSetTracePropagationTargets || this._hasSetTracingOrigins) &&\n clientOptionsTracePropagationTargets\n ) {\n logger.warn(\n '[ReactNativeTracing] The `tracePropagationTargets` option was set in the ReactNativeTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n );\n }\n\n if (enableAppStartTracking) {\n this._instrumentAppStart().then(undefined, (reason: unknown) => {\n logger.error(`[ReactNativeTracing] Error while instrumenting app start:`, reason);\n });\n }\n\n this._enableNativeFramesTracking(addGlobalEventProcessor);\n\n if (enableStallTracking) {\n this.stallTrackingInstrumentation = new StallTrackingInstrumentation();\n }\n\n if (routingInstrumentation) {\n routingInstrumentation.registerRoutingInstrumentation(\n this._onRouteWillChange.bind(this),\n this.options.beforeNavigate,\n this._onConfirmRoute.bind(this),\n );\n } else {\n logger.log('[ReactNativeTracing] Not instrumenting route changes as routingInstrumentation has not been set.');\n }\n\n addGlobalEventProcessor(this._getCurrentViewEventProcessor.bind(this));\n\n instrumentOutgoingRequests({\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n });\n }\n\n /**\n * To be called on a transaction start. Can have async methods\n */\n public onTransactionStart(transaction: Transaction): void {\n if (isNearToNow(transaction.startTimestamp)) {\n // Only if this method is called at or within margin of error to the start timestamp.\n this.nativeFramesInstrumentation?.onTransactionStart(transaction);\n this.stallTrackingInstrumentation?.onTransactionStart(transaction);\n } else {\n logger.warn(\n `[ReactNativeTracing] onTransactionStart called with delay (larger than margin of error) for transaction ${\n transaction.description\n } (${transaction.spanContext().spanId}). Not fetching native frames or tracking stalls.`,\n );\n }\n }\n\n /**\n * To be called on a transaction finish. Cannot have async methods.\n */\n public onTransactionFinish(transaction: Transaction, endTimestamp?: number): void {\n this.nativeFramesInstrumentation?.onTransactionFinish(transaction);\n this.stallTrackingInstrumentation?.onTransactionFinish(transaction, endTimestamp);\n }\n\n /**\n * Called by the ReactNativeProfiler component on first component mount.\n */\n public onAppStartFinish(endTimestamp: number): void {\n this._appStartFinishTimestamp = endTimestamp;\n }\n\n /**\n * Sets the root component first constructor call timestamp.\n */\n public setRootComponentFirstConstructorCallTimestampMs(timestamp: number): void {\n this._firstConstructorCallTimestampMs = timestamp;\n }\n\n /**\n * Starts a new transaction for a user interaction.\n * @param userInteractionId Consists of `op` representation UI Event and `elementId` unique element identifier on current screen.\n */\n public startUserInteractionTransaction(userInteractionId: {\n elementId: string | undefined;\n op: string;\n }): TransactionType | undefined {\n const { elementId, op } = userInteractionId;\n if (!this.options.enableUserInteractionTracing) {\n logger.log('[ReactNativeTracing] User Interaction Tracing is disabled.');\n return;\n }\n if (!this.options.routingInstrumentation) {\n logger.error(\n '[ReactNativeTracing] User Interaction Tracing is not working because no routing instrumentation is set.',\n );\n return;\n }\n if (!elementId) {\n logger.log('[ReactNativeTracing] User Interaction Tracing can not create transaction with undefined elementId.');\n return;\n }\n if (!this._currentRoute) {\n logger.log('[ReactNativeTracing] User Interaction Tracing can not create transaction without a current route.');\n return;\n }\n\n const hub = this._getCurrentHub?.() || getCurrentHub();\n const activeTransaction = getActiveTransaction(hub);\n const activeTransactionIsNotInteraction =\n activeTransaction?.spanId !== this._inflightInteractionTransaction?.spanId;\n if (activeTransaction && activeTransactionIsNotInteraction) {\n logger.warn(\n `[ReactNativeTracing] Did not create ${op} transaction because active transaction ${activeTransaction.name} exists on the scope.`,\n );\n return;\n }\n\n if (this._inflightInteractionTransaction) {\n this._inflightInteractionTransaction.cancelIdleTimeout(undefined, { restartOnChildSpanChange: false });\n this._inflightInteractionTransaction = undefined;\n }\n\n const name = `${this._currentRoute}.${elementId}`;\n const context: TransactionContext = {\n name,\n op,\n trimEnd: true,\n };\n this._inflightInteractionTransaction = this._startIdleTransaction(context);\n this._inflightInteractionTransaction.registerBeforeFinishCallback((transaction: IdleTransaction) => {\n this._inflightInteractionTransaction = undefined;\n this.onTransactionFinish(transaction);\n });\n this._inflightInteractionTransaction.registerBeforeFinishCallback(onlySampleIfChildSpans);\n this.onTransactionStart(this._inflightInteractionTransaction);\n logger.log(`[ReactNativeTracing] User Interaction Tracing Created ${op} transaction ${name}.`);\n return this._inflightInteractionTransaction;\n }\n\n /**\n * Enables or disables native frames tracking based on the `enableNativeFramesTracking` option.\n */\n private _enableNativeFramesTracking(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n if (this.options.enableNativeFramesTracking && !NATIVE.enableNative) {\n // Do not enable native frames tracking if native is not available.\n logger.warn(\n '[ReactNativeTracing] NativeFramesTracking is not available on the Web, Expo Go and other platforms without native modules.',\n );\n return;\n }\n\n if (!this.options.enableNativeFramesTracking && NATIVE.enableNative) {\n // Disable native frames tracking when native available and option is false.\n NATIVE.disableNativeFramesTracking();\n return;\n }\n\n if (!this.options.enableNativeFramesTracking) {\n return;\n }\n\n NATIVE.enableNativeFramesTracking();\n this.nativeFramesInstrumentation = new NativeFramesInstrumentation(addGlobalEventProcessor, () => {\n const self = getCurrentHub().getIntegration(ReactNativeTracing);\n\n if (self) {\n return !!self.nativeFramesInstrumentation;\n }\n\n return false;\n });\n }\n\n /**\n * Sets the current view name into the app context.\n * @param event Le event.\n */\n private _getCurrentViewEventProcessor(event: Event): Event {\n if (event.contexts && this._currentViewName) {\n event.contexts.app = { view_names: [this._currentViewName], ...event.contexts.app };\n }\n return event;\n }\n\n /**\n * Returns the App Start Duration in Milliseconds. Also returns undefined if not able do\n * define the duration.\n */\n private _getAppStartDurationMilliseconds(appStartTimestampMs: number): number | undefined {\n if (!this._appStartFinishTimestamp) {\n return undefined;\n }\n return this._appStartFinishTimestamp * 1000 - appStartTimestampMs;\n }\n\n /**\n * Instruments the app start measurements on the first route transaction.\n * Starts a route transaction if there isn't routing instrumentation.\n */\n private async _instrumentAppStart(): Promise<void> {\n if (!this.options.enableAppStartTracking || !NATIVE.enableNative) {\n return;\n }\n\n const appStart = await NATIVE.fetchNativeAppStart();\n\n if (!appStart) {\n logger.warn('[ReactNativeTracing] Not instrumenting App Start because native returned null.');\n return;\n }\n\n if (appStart.has_fetched) {\n logger.warn('[ReactNativeTracing] Not instrumenting App Start because this start was already reported.');\n return;\n }\n\n if (!this.useAppStartWithProfiler) {\n logger.warn('[ReactNativeTracing] `Sentry.wrap` not detected, using JS context init as app start end.');\n this._appStartFinishTimestamp = getTimeOriginMilliseconds() / 1000;\n }\n\n if (this.options.routingInstrumentation) {\n this._awaitingAppStartData = appStart;\n } else {\n const idleTransaction = this._createRouteTransaction({\n name: 'App Start',\n op: UI_LOAD,\n });\n\n if (idleTransaction) {\n this._addAppStartData(idleTransaction, appStart);\n }\n }\n }\n\n /**\n * Adds app start measurements and starts a child span on a transaction.\n */\n private _addAppStartData(transaction: IdleTransaction, appStart: NativeAppStartResponse): void {\n const appStartTimestampMs = appStart.app_start_timestamp_ms;\n if (!appStartTimestampMs) {\n logger.warn('App start timestamp could not be loaded from the native layer.');\n return;\n }\n\n const appStartDurationMilliseconds = this._getAppStartDurationMilliseconds(appStartTimestampMs);\n if (!appStartDurationMilliseconds) {\n logger.warn('[ReactNativeTracing] App start end has not been recorded, not adding app start span.');\n return;\n }\n\n // we filter out app start more than 60s.\n // this could be due to many different reasons.\n // we've seen app starts with hours, days and even months.\n if (appStartDurationMilliseconds >= ReactNativeTracing._maxAppStart) {\n logger.warn('[ReactNativeTracing] App start duration is over a minute long, not adding app start span.');\n return;\n }\n\n const appStartTimeSeconds = appStartTimestampMs / 1000;\n\n transaction.startTimestamp = appStartTimeSeconds;\n\n const maybeTtidSpan = transaction.spanRecorder?.spans.find(span => span.op === 'ui.load.initial_display');\n if (maybeTtidSpan) {\n maybeTtidSpan.startTimestamp = appStartTimeSeconds;\n setSpanDurationAsMeasurement('time_to_initial_display', maybeTtidSpan);\n }\n\n const maybeTtfdSpan = transaction.spanRecorder?.spans.find(span => span.op === 'ui.load.full_display');\n if (maybeTtfdSpan) {\n maybeTtfdSpan.startTimestamp = appStartTimeSeconds;\n setSpanDurationAsMeasurement('time_to_full_display', maybeTtfdSpan);\n }\n\n const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;\n const appStartSpan = transaction.startChild({\n description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start',\n op,\n startTimestamp: appStartTimeSeconds,\n endTimestamp: this._appStartFinishTimestamp,\n });\n this._addJSExecutionBeforeRoot(appStartSpan);\n this._addNativeSpansTo(appStartSpan, appStart.spans);\n\n const measurement = appStart.type === 'cold' ? APP_START_COLD : APP_START_WARM;\n transaction.setMeasurement(measurement, appStartDurationMilliseconds, 'millisecond');\n }\n\n /**\n * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.\n */\n private _addJSExecutionBeforeRoot(appStartSpan: Span): void {\n const bundleStartTimestampMs = getBundleStartTimestampMs();\n if (!bundleStartTimestampMs) {\n return;\n }\n\n if (!this._firstConstructorCallTimestampMs) {\n logger.warn('Missing the root component first constructor call timestamp.');\n appStartSpan.startChild({\n description: 'JS Bundle Execution Start',\n op: appStartSpan.op,\n startTimestamp: bundleStartTimestampMs / 1000,\n endTimestamp: bundleStartTimestampMs / 1000,\n });\n return;\n }\n\n appStartSpan.startChild({\n description: 'JS Bundle Execution Before React Root',\n op: appStartSpan.op,\n startTimestamp: bundleStartTimestampMs / 1000,\n endTimestamp: this._firstConstructorCallTimestampMs / 1000,\n });\n }\n\n /**\n * Adds native spans to the app start span.\n */\n private _addNativeSpansTo(appStartSpan: Span, nativeSpans: NativeAppStartResponse['spans']): void {\n nativeSpans.forEach(span => {\n if (span.description === 'UIKit init') {\n return this._createUIKitSpan(appStartSpan, span);\n }\n\n appStartSpan.startChild({\n op: appStartSpan.op,\n description: span.description,\n startTimestamp: span.start_timestamp_ms / 1000,\n endTimestamp: span.end_timestamp_ms / 1000,\n });\n });\n }\n\n /**\n * UIKit init is measured by the native layers till the native SDK start\n * RN initializes the native SDK later, the end timestamp would be wrong\n */\n private _createUIKitSpan(parentSpan: Span, nativeUIKitSpan: NativeAppStartResponse['spans'][number]): void {\n const bundleStart = getBundleStartTimestampMs();\n\n // If UIKit init ends after the bundle start, the native SDK was auto-initialized\n // and so the end timestamp is incorrect.\n // The timestamps can't equal, as RN initializes after UIKit.\n if (bundleStart && bundleStart < nativeUIKitSpan.end_timestamp_ms) {\n parentSpan.startChild({\n op: parentSpan.op,\n description: 'UIKit Init to JS Exec Start',\n startTimestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n endTimestamp: bundleStart / 1000,\n });\n } else {\n parentSpan.startChild({\n op: parentSpan.op,\n description: 'UIKit Init',\n startTimestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n endTimestamp: nativeUIKitSpan.end_timestamp_ms / 1000,\n });\n }\n }\n\n /** To be called when the route changes, but BEFORE the components of the new route mount. */\n private _onRouteWillChange(context: TransactionContext): TransactionType | undefined {\n return this._createRouteTransaction(context);\n }\n\n /**\n * Creates a breadcrumb and sets the current route as a tag.\n */\n private _onConfirmRoute(context: TransactionContext): void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n this._currentRoute = context.data?.route?.name;\n\n this._getCurrentHub?.().configureScope(scope => {\n if (context.data) {\n const contextData = context.data as RouteChangeContextData;\n\n scope.addBreadcrumb({\n category: 'navigation',\n type: 'navigation',\n // We assume that context.name is the name of the route.\n message: `Navigation to ${context.name}`,\n data: {\n from: contextData.previousRoute?.name,\n to: contextData.route.name,\n },\n });\n }\n\n this._currentViewName = context.name;\n /**\n * @deprecated tag routing.route.name will be removed in the future.\n */\n scope.setTag('routing.route.name', context.name);\n });\n }\n\n /** Create routing idle transaction. */\n private _createRouteTransaction(context: TransactionContext): IdleTransaction | undefined {\n if (!this._getCurrentHub) {\n logger.warn(`[ReactNativeTracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n if (this._inflightInteractionTransaction) {\n logger.log(\n `[ReactNativeTracing] Canceling ${this._inflightInteractionTransaction.op} transaction because navigation ${context.op}.`,\n );\n this._inflightInteractionTransaction.setStatus('cancelled');\n this._inflightInteractionTransaction.finish();\n }\n\n const { finalTimeoutMs } = this.options;\n\n const expandedContext = {\n ...context,\n trimEnd: true,\n };\n\n const idleTransaction = this._startIdleTransaction(expandedContext);\n\n this.onTransactionStart(idleTransaction);\n\n logger.log(`[ReactNativeTracing] Starting ${context.op} transaction \"${context.name}\" on scope`);\n\n idleTransaction.registerBeforeFinishCallback((transaction, endTimestamp) => {\n this.onTransactionFinish(transaction, endTimestamp);\n });\n\n idleTransaction.registerBeforeFinishCallback(transaction => {\n if (this.options.enableAppStartTracking && this._awaitingAppStartData) {\n transaction.op = UI_LOAD;\n this._addAppStartData(transaction, this._awaitingAppStartData);\n\n this._awaitingAppStartData = undefined;\n }\n });\n\n idleTransaction.registerBeforeFinishCallback((transaction, endTimestamp) => {\n adjustTransactionDuration(finalTimeoutMs, transaction, endTimestamp);\n });\n\n if (this.options.ignoreEmptyBackNavigationTransactions) {\n idleTransaction.registerBeforeFinishCallback(transaction => {\n if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n transaction.data?.route?.hasBeenSeen &&\n (!transaction.spanRecorder ||\n transaction.spanRecorder.spans.filter(\n span =>\n span.spanId !== transaction.spanId &&\n span.op !== 'ui.load.initial_display' &&\n span.op !== 'navigation.processing',\n ).length === 0)\n ) {\n logger.log(\n '[ReactNativeTracing] Not sampling transaction as route has been seen before. Pass ignoreEmptyBackNavigationTransactions = false to disable this feature.',\n );\n // Route has been seen before and has no child spans.\n transaction.sampled = false;\n }\n });\n }\n\n return idleTransaction;\n }\n\n /**\n * Start app state aware idle transaction on the scope.\n */\n private _startIdleTransaction(context: TransactionContext): IdleTransaction {\n const { idleTimeoutMs, finalTimeoutMs } = this.options;\n const hub = this._getCurrentHub?.() || getCurrentHub();\n const tx = startIdleTransaction(hub, context, idleTimeoutMs, finalTimeoutMs, true);\n cancelInBackground(tx);\n return tx;\n }\n}\n"]}
1
+ {"version":3,"file":"reactnativetracing.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oCAAoC,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASrG,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,cAAc,IAAI,iBAAiB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1G,OAAO,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jB;oBACA,MAAM,CAAC,GAAG,CACR,0JAA0J,CAC3J,CAAC;oBACF,qDAAqD;oBACrD,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;iBAC7B;YACH,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,OAA2B;;QACvD,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACvD,MAAM,GAAG,GAAG,CAAA,MAAA,IAAI,CAAC,cAAc,oDAAI,KAAI,aAAa,EAAE,CAAC;QACvD,MAAM,EAAE,GAAG,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QACnF,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;;AA/kBD;;GAEG;AACW,qBAAE,GAAW,oBAAoB,CAAC;AAChD,6CAA6C;AAC9B,+BAAY,GAAW,KAAK,CAAC;AAC5C,4FAA4F;AAC7E,kDAA+B,GAAW,KAAK,CAAC;AA2kBjE;;;GAGG;AACH,SAAS,8BAA8B,CAAC,WAAwB;IAC9D,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AAC/D,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type { RequestInstrumentationOptions } from '@sentry/browser';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from '@sentry/browser';\nimport type { Hub, IdleTransaction, Transaction } from '@sentry/core';\nimport { getActiveTransaction, getCurrentHub, spanToJSON, startIdleTransaction } from '@sentry/core';\nimport type {\n Event,\n EventProcessor,\n Integration,\n Span,\n Transaction as TransactionType,\n TransactionContext,\n} from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { APP_START_COLD, APP_START_WARM } from '../measurements';\nimport type { NativeAppStartResponse } from '../NativeRNSentry';\nimport type { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';\nimport { NATIVE } from '../wrapper';\nimport { NativeFramesInstrumentation } from './nativeframes';\nimport { APP_START_COLD as APP_START_COLD_OP, APP_START_WARM as APP_START_WARM_OP, UI_LOAD } from './ops';\nimport { StallTrackingInstrumentation } from './stalltracking';\nimport { cancelInBackground, onlySampleIfChildSpans } from './transaction';\nimport type { BeforeNavigate, RouteChangeContextData } from './types';\nimport {\n adjustTransactionDuration,\n getBundleStartTimestampMs,\n getTimeOriginMilliseconds,\n isNearToNow,\n setSpanDurationAsMeasurement,\n} from './utils';\n\nexport interface ReactNativeTracingOptions extends RequestInstrumentationOptions {\n /**\n * @deprecated Replaced by idleTimeoutMs\n */\n idleTimeout: number;\n\n /**\n * @deprecated Replaced by maxTransactionDurationMs\n */\n maxTransactionDuration: number;\n\n /**\n * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of\n * the last finished span as the endtime for the transaction.\n * Time is in ms.\n *\n * Default: 1000\n */\n idleTimeoutMs: number;\n\n /**\n * The maximum duration (transaction duration + idle timeout) of a transaction\n * before it will be marked as \"deadline_exceeded\".\n * If you never want to mark a transaction set it to 0.\n * Time is in ms.\n *\n * Default: 600000\n */\n finalTimeoutMs: number;\n\n /**\n * The routing instrumentation to be used with the tracing integration.\n * There is no routing instrumentation if nothing is passed.\n */\n routingInstrumentation?: RoutingInstrumentationInstance;\n\n /**\n * Does not sample transactions that are from routes that have been seen any more and don't have any spans.\n * This removes a lot of the clutter as most back navigation transactions are now ignored.\n *\n * Default: true\n */\n ignoreEmptyBackNavigationTransactions: boolean;\n\n /**\n * beforeNavigate is called before a navigation transaction is created and allows users to modify transaction\n * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n *\n * @param context: The context data which will be passed to `startTransaction` by default\n *\n * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n */\n beforeNavigate: BeforeNavigate;\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 * Default: true\n */\n enableAppStartTracking: boolean;\n\n /**\n * Track slow/frozen frames from the native layer and adds them as measurements to all transactions.\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 enableStallTracking: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n */\n enableUserInteractionTracing: boolean;\n}\n\nconst DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\nconst defaultReactNativeTracingOptions: ReactNativeTracingOptions = {\n ...defaultRequestInstrumentationOptions,\n idleTimeout: 1000,\n maxTransactionDuration: 600,\n idleTimeoutMs: 1000,\n finalTimeoutMs: 600000,\n ignoreEmptyBackNavigationTransactions: true,\n beforeNavigate: context => context,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n};\n\n/**\n * Tracing integration for React Native.\n */\nexport class ReactNativeTracing implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeTracing';\n /** We filter out App starts more than 60s */\n private static _maxAppStart: number = 60000;\n /** We filter out App starts which timestamp is 60s and more before the transaction start */\n private static _maxAppStartBeforeTransactionMs: number = 60000;\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeTracing.id;\n\n /** ReactNativeTracing options */\n public options: ReactNativeTracingOptions;\n\n public nativeFramesInstrumentation?: NativeFramesInstrumentation;\n public stallTrackingInstrumentation?: StallTrackingInstrumentation;\n public useAppStartWithProfiler: boolean = false;\n\n private _inflightInteractionTransaction?: IdleTransaction;\n private _getCurrentHub?: () => Hub;\n private _awaitingAppStartData?: NativeAppStartResponse;\n private _appStartFinishTimestamp?: number;\n private _currentRoute?: string;\n private _hasSetTracePropagationTargets: boolean;\n private _hasSetTracingOrigins: boolean;\n private _currentViewName: string | undefined;\n private _firstConstructorCallTimestampMs: number | undefined;\n\n public constructor(options: Partial<ReactNativeTracingOptions> = {}) {\n this._hasSetTracePropagationTargets = !!(\n options &&\n // eslint-disable-next-line deprecation/deprecation\n options.tracePropagationTargets\n );\n this._hasSetTracingOrigins = !!(\n options &&\n // eslint-disable-next-line deprecation/deprecation\n options.tracingOrigins\n );\n\n this.options = {\n ...defaultReactNativeTracingOptions,\n ...options,\n finalTimeoutMs:\n options.finalTimeoutMs ??\n // eslint-disable-next-line deprecation/deprecation\n (typeof options.maxTransactionDuration === 'number'\n ? // eslint-disable-next-line deprecation/deprecation\n options.maxTransactionDuration * 1000\n : undefined) ??\n defaultReactNativeTracingOptions.finalTimeoutMs,\n idleTimeoutMs:\n options.idleTimeoutMs ??\n // eslint-disable-next-line deprecation/deprecation\n options.idleTimeout ??\n defaultReactNativeTracingOptions.idleTimeoutMs,\n };\n }\n\n /**\n * Registers routing and request instrumentation.\n */\n public async setupOnce(\n addGlobalEventProcessor: (callback: EventProcessor) => void,\n getCurrentHub: () => Hub,\n ): Promise<void> {\n const hub = getCurrentHub();\n const client = hub.getClient();\n const clientOptions = client && client.getOptions();\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const {\n traceFetch,\n traceXHR,\n // eslint-disable-next-line deprecation/deprecation\n tracingOrigins,\n shouldCreateSpanForRequest,\n // eslint-disable-next-line deprecation/deprecation\n tracePropagationTargets: thisOptionsTracePropagationTargets,\n routingInstrumentation,\n enableAppStartTracking,\n enableStallTracking,\n } = this.options;\n\n this._getCurrentHub = getCurrentHub;\n\n const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n // There are three ways to configure tracePropagationTargets:\n // 1. via top level client option `tracePropagationTargets`\n // 2. via ReactNativeTracing option `tracePropagationTargets`\n // 3. via ReactNativeTracing option `tracingOrigins` (deprecated)\n //\n // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n // ReactNativeTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n //\n // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n const tracePropagationTargets =\n clientOptionsTracePropagationTargets ||\n (this._hasSetTracePropagationTargets && thisOptionsTracePropagationTargets) ||\n (this._hasSetTracingOrigins && tracingOrigins) ||\n DEFAULT_TRACE_PROPAGATION_TARGETS;\n if (\n __DEV__ &&\n (this._hasSetTracePropagationTargets || this._hasSetTracingOrigins) &&\n clientOptionsTracePropagationTargets\n ) {\n logger.warn(\n '[ReactNativeTracing] The `tracePropagationTargets` option was set in the ReactNativeTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n );\n }\n\n if (enableAppStartTracking) {\n this._instrumentAppStart().then(undefined, (reason: unknown) => {\n logger.error(`[ReactNativeTracing] Error while instrumenting app start:`, reason);\n });\n }\n\n this._enableNativeFramesTracking(addGlobalEventProcessor);\n\n if (enableStallTracking) {\n this.stallTrackingInstrumentation = new StallTrackingInstrumentation();\n }\n\n if (routingInstrumentation) {\n routingInstrumentation.registerRoutingInstrumentation(\n this._onRouteWillChange.bind(this),\n this.options.beforeNavigate,\n this._onConfirmRoute.bind(this),\n );\n } else {\n logger.log('[ReactNativeTracing] Not instrumenting route changes as routingInstrumentation has not been set.');\n }\n\n addGlobalEventProcessor(this._getCurrentViewEventProcessor.bind(this));\n\n instrumentOutgoingRequests({\n traceFetch,\n traceXHR,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n });\n }\n\n /**\n * To be called on a transaction start. Can have async methods\n */\n public onTransactionStart(transaction: Transaction): void {\n if (isNearToNow(transaction.startTimestamp)) {\n // Only if this method is called at or within margin of error to the start timestamp.\n this.nativeFramesInstrumentation?.onTransactionStart(transaction);\n this.stallTrackingInstrumentation?.onTransactionStart(transaction);\n } else {\n logger.warn(\n `[ReactNativeTracing] onTransactionStart called with delay (larger than margin of error) for transaction ${\n transaction.description\n } (${transaction.spanContext().spanId}). Not fetching native frames or tracking stalls.`,\n );\n }\n }\n\n /**\n * To be called on a transaction finish. Cannot have async methods.\n */\n public onTransactionFinish(transaction: Transaction, endTimestamp?: number): void {\n this.nativeFramesInstrumentation?.onTransactionFinish(transaction);\n this.stallTrackingInstrumentation?.onTransactionFinish(transaction, endTimestamp);\n }\n\n /**\n * Called by the ReactNativeProfiler component on first component mount.\n */\n public onAppStartFinish(endTimestamp: number): void {\n this._appStartFinishTimestamp = endTimestamp;\n }\n\n /**\n * Sets the root component first constructor call timestamp.\n */\n public setRootComponentFirstConstructorCallTimestampMs(timestamp: number): void {\n this._firstConstructorCallTimestampMs = timestamp;\n }\n\n /**\n * Starts a new transaction for a user interaction.\n * @param userInteractionId Consists of `op` representation UI Event and `elementId` unique element identifier on current screen.\n */\n public startUserInteractionTransaction(userInteractionId: {\n elementId: string | undefined;\n op: string;\n }): TransactionType | undefined {\n const { elementId, op } = userInteractionId;\n if (!this.options.enableUserInteractionTracing) {\n logger.log('[ReactNativeTracing] User Interaction Tracing is disabled.');\n return;\n }\n if (!this.options.routingInstrumentation) {\n logger.error(\n '[ReactNativeTracing] User Interaction Tracing is not working because no routing instrumentation is set.',\n );\n return;\n }\n if (!elementId) {\n logger.log('[ReactNativeTracing] User Interaction Tracing can not create transaction with undefined elementId.');\n return;\n }\n if (!this._currentRoute) {\n logger.log('[ReactNativeTracing] User Interaction Tracing can not create transaction without a current route.');\n return;\n }\n\n const hub = this._getCurrentHub?.() || getCurrentHub();\n const activeTransaction = getActiveTransaction(hub);\n const activeTransactionIsNotInteraction =\n activeTransaction?.spanId !== this._inflightInteractionTransaction?.spanId;\n if (activeTransaction && activeTransactionIsNotInteraction) {\n logger.warn(\n `[ReactNativeTracing] Did not create ${op} transaction because active transaction ${activeTransaction.name} exists on the scope.`,\n );\n return;\n }\n\n if (this._inflightInteractionTransaction) {\n this._inflightInteractionTransaction.cancelIdleTimeout(undefined, { restartOnChildSpanChange: false });\n this._inflightInteractionTransaction = undefined;\n }\n\n const name = `${this._currentRoute}.${elementId}`;\n const context: TransactionContext = {\n name,\n op,\n trimEnd: true,\n };\n this._inflightInteractionTransaction = this._startIdleTransaction(context);\n this._inflightInteractionTransaction.registerBeforeFinishCallback((transaction: IdleTransaction) => {\n this._inflightInteractionTransaction = undefined;\n this.onTransactionFinish(transaction);\n });\n this._inflightInteractionTransaction.registerBeforeFinishCallback(onlySampleIfChildSpans);\n this.onTransactionStart(this._inflightInteractionTransaction);\n logger.log(`[ReactNativeTracing] User Interaction Tracing Created ${op} transaction ${name}.`);\n return this._inflightInteractionTransaction;\n }\n\n /**\n * Enables or disables native frames tracking based on the `enableNativeFramesTracking` option.\n */\n private _enableNativeFramesTracking(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n if (this.options.enableNativeFramesTracking && !NATIVE.enableNative) {\n // Do not enable native frames tracking if native is not available.\n logger.warn(\n '[ReactNativeTracing] NativeFramesTracking is not available on the Web, Expo Go and other platforms without native modules.',\n );\n return;\n }\n\n if (!this.options.enableNativeFramesTracking && NATIVE.enableNative) {\n // Disable native frames tracking when native available and option is false.\n NATIVE.disableNativeFramesTracking();\n return;\n }\n\n if (!this.options.enableNativeFramesTracking) {\n return;\n }\n\n NATIVE.enableNativeFramesTracking();\n this.nativeFramesInstrumentation = new NativeFramesInstrumentation(addGlobalEventProcessor, () => {\n const self = getCurrentHub().getIntegration(ReactNativeTracing);\n\n if (self) {\n return !!self.nativeFramesInstrumentation;\n }\n\n return false;\n });\n }\n\n /**\n * Sets the current view name into the app context.\n * @param event Le event.\n */\n private _getCurrentViewEventProcessor(event: Event): Event {\n if (event.contexts && this._currentViewName) {\n event.contexts.app = { view_names: [this._currentViewName], ...event.contexts.app };\n }\n return event;\n }\n\n /**\n * Returns the App Start Duration in Milliseconds. Also returns undefined if not able do\n * define the duration.\n */\n private _getAppStartDurationMilliseconds(appStartTimestampMs: number): number | undefined {\n if (!this._appStartFinishTimestamp) {\n return undefined;\n }\n return this._appStartFinishTimestamp * 1000 - appStartTimestampMs;\n }\n\n /**\n * Instruments the app start measurements on the first route transaction.\n * Starts a route transaction if there isn't routing instrumentation.\n */\n private async _instrumentAppStart(): Promise<void> {\n if (!this.options.enableAppStartTracking || !NATIVE.enableNative) {\n return;\n }\n\n const appStart = await NATIVE.fetchNativeAppStart();\n\n if (!appStart) {\n logger.warn('[ReactNativeTracing] Not instrumenting App Start because native returned null.');\n return;\n }\n\n if (appStart.has_fetched) {\n logger.warn('[ReactNativeTracing] Not instrumenting App Start because this start was already reported.');\n return;\n }\n\n if (!this.useAppStartWithProfiler) {\n logger.warn('[ReactNativeTracing] `Sentry.wrap` not detected, using JS context init as app start end.');\n this._appStartFinishTimestamp = getTimeOriginMilliseconds() / 1000;\n }\n\n if (this.options.routingInstrumentation) {\n this._awaitingAppStartData = appStart;\n } else {\n const idleTransaction = this._createRouteTransaction({\n name: 'App Start',\n op: UI_LOAD,\n });\n\n if (idleTransaction) {\n this._addAppStartData(idleTransaction, appStart);\n }\n }\n }\n\n /**\n * Adds app start measurements and starts a child span on a transaction.\n */\n private _addAppStartData(transaction: IdleTransaction, appStart: NativeAppStartResponse): void {\n const appStartTimestampMs = appStart.app_start_timestamp_ms;\n if (!appStartTimestampMs) {\n logger.warn('App start timestamp could not be loaded from the native layer.');\n return;\n }\n\n const isAppStartWithinBounds =\n appStartTimestampMs >=\n getTransactionStartTimestampMs(transaction) - ReactNativeTracing._maxAppStartBeforeTransactionMs;\n if (!__DEV__ && !isAppStartWithinBounds) {\n logger.warn('[ReactNativeTracing] App start timestamp is too far in the past to be used for app start span.');\n return;\n }\n\n const appStartDurationMilliseconds = this._getAppStartDurationMilliseconds(appStartTimestampMs);\n if (!appStartDurationMilliseconds) {\n logger.warn('[ReactNativeTracing] App start end has not been recorded, not adding app start span.');\n return;\n }\n\n // we filter out app start more than 60s.\n // this could be due to many different reasons.\n // we've seen app starts with hours, days and even months.\n if (appStartDurationMilliseconds >= ReactNativeTracing._maxAppStart) {\n logger.warn('[ReactNativeTracing] App start duration is over a minute long, not adding app start span.');\n return;\n }\n\n const appStartTimeSeconds = appStartTimestampMs / 1000;\n\n transaction.startTimestamp = appStartTimeSeconds;\n\n const maybeTtidSpan = transaction.spanRecorder?.spans.find(span => span.op === 'ui.load.initial_display');\n if (maybeTtidSpan) {\n maybeTtidSpan.startTimestamp = appStartTimeSeconds;\n setSpanDurationAsMeasurement('time_to_initial_display', maybeTtidSpan);\n }\n\n const maybeTtfdSpan = transaction.spanRecorder?.spans.find(span => span.op === 'ui.load.full_display');\n if (maybeTtfdSpan) {\n maybeTtfdSpan.startTimestamp = appStartTimeSeconds;\n setSpanDurationAsMeasurement('time_to_full_display', maybeTtfdSpan);\n }\n\n const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP;\n const appStartSpan = transaction.startChild({\n description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start',\n op,\n startTimestamp: appStartTimeSeconds,\n endTimestamp: this._appStartFinishTimestamp,\n });\n this._addJSExecutionBeforeRoot(appStartSpan);\n this._addNativeSpansTo(appStartSpan, appStart.spans);\n\n const measurement = appStart.type === 'cold' ? APP_START_COLD : APP_START_WARM;\n transaction.setMeasurement(measurement, appStartDurationMilliseconds, 'millisecond');\n }\n\n /**\n * Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.\n */\n private _addJSExecutionBeforeRoot(appStartSpan: Span): void {\n const bundleStartTimestampMs = getBundleStartTimestampMs();\n if (!bundleStartTimestampMs) {\n return;\n }\n\n if (!this._firstConstructorCallTimestampMs) {\n logger.warn('Missing the root component first constructor call timestamp.');\n appStartSpan.startChild({\n description: 'JS Bundle Execution Start',\n op: appStartSpan.op,\n startTimestamp: bundleStartTimestampMs / 1000,\n endTimestamp: bundleStartTimestampMs / 1000,\n });\n return;\n }\n\n appStartSpan.startChild({\n description: 'JS Bundle Execution Before React Root',\n op: appStartSpan.op,\n startTimestamp: bundleStartTimestampMs / 1000,\n endTimestamp: this._firstConstructorCallTimestampMs / 1000,\n });\n }\n\n /**\n * Adds native spans to the app start span.\n */\n private _addNativeSpansTo(appStartSpan: Span, nativeSpans: NativeAppStartResponse['spans']): void {\n nativeSpans.forEach(span => {\n if (span.description === 'UIKit init') {\n return this._createUIKitSpan(appStartSpan, span);\n }\n\n appStartSpan.startChild({\n op: appStartSpan.op,\n description: span.description,\n startTimestamp: span.start_timestamp_ms / 1000,\n endTimestamp: span.end_timestamp_ms / 1000,\n });\n });\n }\n\n /**\n * UIKit init is measured by the native layers till the native SDK start\n * RN initializes the native SDK later, the end timestamp would be wrong\n */\n private _createUIKitSpan(parentSpan: Span, nativeUIKitSpan: NativeAppStartResponse['spans'][number]): void {\n const bundleStart = getBundleStartTimestampMs();\n\n // If UIKit init ends after the bundle start, the native SDK was auto-initialized\n // and so the end timestamp is incorrect.\n // The timestamps can't equal, as RN initializes after UIKit.\n if (bundleStart && bundleStart < nativeUIKitSpan.end_timestamp_ms) {\n parentSpan.startChild({\n op: parentSpan.op,\n description: 'UIKit Init to JS Exec Start',\n startTimestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n endTimestamp: bundleStart / 1000,\n });\n } else {\n parentSpan.startChild({\n op: parentSpan.op,\n description: 'UIKit Init',\n startTimestamp: nativeUIKitSpan.start_timestamp_ms / 1000,\n endTimestamp: nativeUIKitSpan.end_timestamp_ms / 1000,\n });\n }\n }\n\n /** To be called when the route changes, but BEFORE the components of the new route mount. */\n private _onRouteWillChange(context: TransactionContext): TransactionType | undefined {\n return this._createRouteTransaction(context);\n }\n\n /**\n * Creates a breadcrumb and sets the current route as a tag.\n */\n private _onConfirmRoute(context: TransactionContext): void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n this._currentRoute = context.data?.route?.name;\n\n this._getCurrentHub?.().configureScope(scope => {\n if (context.data) {\n const contextData = context.data as RouteChangeContextData;\n\n scope.addBreadcrumb({\n category: 'navigation',\n type: 'navigation',\n // We assume that context.name is the name of the route.\n message: `Navigation to ${context.name}`,\n data: {\n from: contextData.previousRoute?.name,\n to: contextData.route.name,\n },\n });\n }\n\n this._currentViewName = context.name;\n /**\n * @deprecated tag routing.route.name will be removed in the future.\n */\n scope.setTag('routing.route.name', context.name);\n });\n }\n\n /** Create routing idle transaction. */\n private _createRouteTransaction(context: TransactionContext): IdleTransaction | undefined {\n if (!this._getCurrentHub) {\n logger.warn(`[ReactNativeTracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n return undefined;\n }\n\n if (this._inflightInteractionTransaction) {\n logger.log(\n `[ReactNativeTracing] Canceling ${this._inflightInteractionTransaction.op} transaction because navigation ${context.op}.`,\n );\n this._inflightInteractionTransaction.setStatus('cancelled');\n this._inflightInteractionTransaction.finish();\n }\n\n const { finalTimeoutMs } = this.options;\n\n const expandedContext = {\n ...context,\n trimEnd: true,\n };\n\n const idleTransaction = this._startIdleTransaction(expandedContext);\n\n this.onTransactionStart(idleTransaction);\n\n logger.log(`[ReactNativeTracing] Starting ${context.op} transaction \"${context.name}\" on scope`);\n\n idleTransaction.registerBeforeFinishCallback((transaction, endTimestamp) => {\n this.onTransactionFinish(transaction, endTimestamp);\n });\n\n idleTransaction.registerBeforeFinishCallback(transaction => {\n if (this.options.enableAppStartTracking && this._awaitingAppStartData) {\n transaction.op = UI_LOAD;\n this._addAppStartData(transaction, this._awaitingAppStartData);\n\n this._awaitingAppStartData = undefined;\n }\n });\n\n idleTransaction.registerBeforeFinishCallback((transaction, endTimestamp) => {\n adjustTransactionDuration(finalTimeoutMs, transaction, endTimestamp);\n });\n\n if (this.options.ignoreEmptyBackNavigationTransactions) {\n idleTransaction.registerBeforeFinishCallback(transaction => {\n if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n transaction.data?.route?.hasBeenSeen &&\n (!transaction.spanRecorder ||\n transaction.spanRecorder.spans.filter(\n span =>\n span.spanId !== transaction.spanId &&\n span.op !== 'ui.load.initial_display' &&\n span.op !== 'navigation.processing',\n ).length === 0)\n ) {\n logger.log(\n '[ReactNativeTracing] Not sampling transaction as route has been seen before. Pass ignoreEmptyBackNavigationTransactions = false to disable this feature.',\n );\n // Route has been seen before and has no child spans.\n transaction.sampled = false;\n }\n });\n }\n\n return idleTransaction;\n }\n\n /**\n * Start app state aware idle transaction on the scope.\n */\n private _startIdleTransaction(context: TransactionContext): IdleTransaction {\n const { idleTimeoutMs, finalTimeoutMs } = this.options;\n const hub = this._getCurrentHub?.() || getCurrentHub();\n const tx = startIdleTransaction(hub, context, idleTimeoutMs, finalTimeoutMs, true);\n cancelInBackground(tx);\n return tx;\n }\n}\n\n/**\n * Returns transaction start timestamp in milliseconds.\n * If start timestamp is not available, returns 0.\n */\nfunction getTransactionStartTimestampMs(transaction: Transaction): number {\n return (spanToJSON(transaction).start_timestamp || 0) * 1000;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rnlibraries.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAE5E,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,6BAA6B,CA6BxE,CAAC"}
1
+ {"version":3,"file":"rnlibraries.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAE5E,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,6BAA6B,CA6BxE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-var-requires */
2
- import { TurboModuleRegistry } from 'react-native';
3
- import { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
2
+ var _a;
3
+ import { Platform, TurboModuleRegistry } from 'react-native';
4
4
  export const ReactNativeLibraries = {
5
5
  Devtools: {
6
6
  parseErrorStack: (errorStack) => {
@@ -24,7 +24,7 @@ export const ReactNativeLibraries = {
24
24
  },
25
25
  },
26
26
  ReactNativeVersion: {
27
- version: RNV,
27
+ version: (_a = Platform.constants) === null || _a === void 0 ? void 0 : _a.reactNativeVersion,
28
28
  },
29
29
  TurboModuleRegistry,
30
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rnlibraries.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAKhF,MAAM,CAAC,MAAM,oBAAoB,GAA4C;IAC3E,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,UAAkB,EAAiC,EAAE;YACrE,MAAM,eAAe,GAAG,OAAO,CAAC,sDAAsD,CAAC,CAAC;YACxF,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,qBAAqB,EAAE,CACrB,KAAoC,EACpC,SAAmC,EACU,EAAE;YAC/C,MAAM,qBAAqB,GAAG,OAAO,CAAC,4DAA4D,CAAC,CAAC;YACpG,OAAO,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACjD,CAAC;QACD,YAAY,EAAE,GAA8B,EAAE;YAC5C,MAAM,YAAY,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;YAClF,OAAO,YAAY,EAAE,CAAC;QACxB,CAAC;KACF;IACD,OAAO,EAAE,OAAO,CAAC,gCAAgC,CAAC;IAClD,SAAS,EAAE;QACT,cAAc,EAAE,CAAI,IAAY,EAAE,QAAiB,EAAQ,EAAE;YAC3D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;YACzF,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,CAAC;KACF;IACD,kBAAkB,EAAE;QAClB,OAAO,EAAE,GAAG;KACb;IACD,mBAAmB;CACpB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\n\nimport { TurboModuleRegistry } from 'react-native';\nimport { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';\n\nimport type * as ReactNative from '../vendor/react-native';\nimport type { ReactNativeLibrariesInterface } from './rnlibrariesinterface';\n\nexport const ReactNativeLibraries: Required<ReactNativeLibrariesInterface> = {\n Devtools: {\n parseErrorStack: (errorStack: string): Array<ReactNative.StackFrame> => {\n const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');\n return parseErrorStack(errorStack);\n },\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ): Promise<ReactNative.SymbolicatedStackTrace> => {\n const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');\n return symbolicateStackTrace(stack, extraData);\n },\n getDevServer: (): ReactNative.DevServerInfo => {\n const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');\n return getDevServer();\n },\n },\n Promise: require('react-native/Libraries/Promise'),\n Utilities: {\n polyfillGlobal: <T>(name: string, getValue: () => T): void => {\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n polyfillGlobal(name, getValue);\n },\n },\n ReactNativeVersion: {\n version: RNV,\n },\n TurboModuleRegistry,\n};\n"]}
1
+ {"version":3,"file":"rnlibraries.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibraries.ts"],"names":[],"mappings":"AAAA,uDAAuD;;AAEvD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,CAAC,MAAM,oBAAoB,GAA4C;IAC3E,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,UAAkB,EAAiC,EAAE;YACrE,MAAM,eAAe,GAAG,OAAO,CAAC,sDAAsD,CAAC,CAAC;YACxF,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,qBAAqB,EAAE,CACrB,KAAoC,EACpC,SAAmC,EACU,EAAE;YAC/C,MAAM,qBAAqB,GAAG,OAAO,CAAC,4DAA4D,CAAC,CAAC;YACpG,OAAO,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACjD,CAAC;QACD,YAAY,EAAE,GAA8B,EAAE;YAC5C,MAAM,YAAY,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;YAClF,OAAO,YAAY,EAAE,CAAC;QACxB,CAAC;KACF;IACD,OAAO,EAAE,OAAO,CAAC,gCAAgC,CAAC;IAClD,SAAS,EAAE;QACT,cAAc,EAAE,CAAI,IAAY,EAAE,QAAiB,EAAQ,EAAE;YAC3D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,oDAAoD,CAAC,CAAC;YACzF,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,CAAC;KACF;IACD,kBAAkB,EAAE;QAClB,OAAO,EAAE,MAAA,QAAQ,CAAC,SAAS,0CAAE,kBAAkB;KAChD;IACD,mBAAmB;CACpB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\n\nimport { Platform, TurboModuleRegistry } from 'react-native';\n\nimport type * as ReactNative from '../vendor/react-native';\nimport type { ReactNativeLibrariesInterface } from './rnlibrariesinterface';\n\nexport const ReactNativeLibraries: Required<ReactNativeLibrariesInterface> = {\n Devtools: {\n parseErrorStack: (errorStack: string): Array<ReactNative.StackFrame> => {\n const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');\n return parseErrorStack(errorStack);\n },\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ): Promise<ReactNative.SymbolicatedStackTrace> => {\n const symbolicateStackTrace = require('react-native/Libraries/Core/Devtools/symbolicateStackTrace');\n return symbolicateStackTrace(stack, extraData);\n },\n getDevServer: (): ReactNative.DevServerInfo => {\n const getDevServer = require('react-native/Libraries/Core/Devtools/getDevServer');\n return getDevServer();\n },\n },\n Promise: require('react-native/Libraries/Promise'),\n Utilities: {\n polyfillGlobal: <T>(name: string, getValue: () => T): void => {\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n polyfillGlobal(name, getValue);\n },\n },\n ReactNativeVersion: {\n version: Platform.constants?.reactNativeVersion,\n },\n TurboModuleRegistry,\n};\n"]}
@@ -1,4 +1,3 @@
1
- import type { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
2
1
  import type * as ReactNative from '../vendor/react-native';
3
2
  export type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
4
3
  export type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';
@@ -12,9 +11,7 @@ export interface ReactNativeLibrariesInterface {
12
11
  polyfillGlobal: <T>(name: string, getValue: () => T) => void;
13
12
  };
14
13
  Promise?: typeof Promise;
15
- ReactNativeVersion?: {
16
- version: typeof RNV;
17
- };
14
+ ReactNativeVersion?: ReactNative.ReactNativeVersion;
18
15
  TurboModuleRegistry?: ReactNative.TurboModuleRegistry;
19
16
  }
20
17
  //# sourceMappingURL=rnlibrariesinterface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rnlibrariesinterface.d.ts","sourceRoot":"","sources":["../../../src/js/utils/rnlibrariesinterface.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAErF,OAAO,KAAK,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAE3D,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAE9F,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE;QACT,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACvE,qBAAqB,EAAE,CACrB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;QACjD,YAAY,EAAE,MAAM,W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AAmB,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"rnlibrariesinterface.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibrariesinterface.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,yFAAyF;AACzF,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,EAAE","sourcesContent":["//\n// This interface contains all of react-native internals Libraries used in Sentry RN SDK.\n//\n// Containing the internals in one place enables us to handle platforms\n// that don't have all the internals available. For example react-native-web.\n//\n\nimport type { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';\n\nimport type * as ReactNative from '../vendor/react-native';\n\nexport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\nexport type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';\n\nexport interface ReactNativeLibrariesInterface {\n Devtools?: {\n parseErrorStack: (errorStack: string) => Array<ReactNative.StackFrame>;\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ) => Promise<ReactNative.SymbolicatedStackTrace>;\n getDevServer: () => ReactNative.DevServerInfo;\n };\n Utilities?: {\n polyfillGlobal: <T>(name: string, getValue: () => T) => void;\n };\n Promise?: typeof Promise;\n ReactNativeVersion?: {\n version: typeof RNV;\n };\n TurboModuleRegistry?: ReactNative.TurboModuleRegistry;\n}\n"]}
1
+ {"version":3,"file":"rnlibrariesinterface.js","sourceRoot":"","sources":["../../../src/js/utils/rnlibrariesinterface.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,yFAAyF;AACzF,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,EAAE","sourcesContent":["//\n// This interface contains all of react-native internals Libraries used in Sentry RN SDK.\n//\n// Containing the internals in one place enables us to handle platforms\n// that don't have all the internals available. For example react-native-web.\n//\n\nimport type * as ReactNative from '../vendor/react-native';\n\nexport type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';\nexport type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';\n\nexport interface ReactNativeLibrariesInterface {\n Devtools?: {\n parseErrorStack: (errorStack: string) => Array<ReactNative.StackFrame>;\n symbolicateStackTrace: (\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n ) => Promise<ReactNative.SymbolicatedStackTrace>;\n getDevServer: () => ReactNative.DevServerInfo;\n };\n Utilities?: {\n polyfillGlobal: <T>(name: string, getValue: () => T) => void;\n };\n Promise?: typeof Promise;\n ReactNativeVersion?: ReactNative.ReactNativeVersion;\n TurboModuleRegistry?: ReactNative.TurboModuleRegistry;\n}\n"]}
@@ -31,5 +31,13 @@ export type TurboModuleRegistry = {
31
31
  get<T extends TurboModule>(name: string): T | null;
32
32
  getEnforcing<T extends TurboModule>(name: string): T;
33
33
  };
34
+ export type ReactNativeVersion = {
35
+ version: {
36
+ major: number;
37
+ minor: number;
38
+ patch: number;
39
+ prerelease?: number | null | undefined;
40
+ };
41
+ };
34
42
  export {};
35
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,C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AG,QAAQ,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;CACjC,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,YAAY,CAAC,IAAI,MAAM,CAAC;CACzB,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;IACnD,YAAY,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC;CACtD,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;KACxC,CAAC;CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L17\nexport type StackFrame = {\n column?: number;\n file?: string;\n lineNumber?: number;\n methodName: string;\n collapse?: boolean;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L17\nexport type CodeFrame = Readonly<{\n content: string;\n location?: {\n [key: string]: unknown;\n row: number;\n column: number;\n };\n fileName: string;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L27\nexport type SymbolicatedStackTrace = Readonly<{\n stack: Array<StackFrame>;\n codeFrame?: CodeFrame;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/getDevServer.js#L17\nexport type DevServerInfo = {\n [key: string]: unknown;\n url: string;\n fullBundleUrl?: string;\n bundleLoadedFromServer: boolean;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/TurboModule/RCTExport.d.ts#L10\ntype TurboModule = {\n getConstants?(): object;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/TurboModule/TurboModuleRegistry.d.ts#L12\nexport type TurboModuleRegistry = {\n get<T extends TurboModule>(name: string): T | null;\n getEnforcing<T extends TurboModule>(name: string): T;\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/react-native/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["// MIT License\n\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L17\nexport type StackFrame = {\n column?: number;\n file?: string;\n lineNumber?: number;\n methodName: string;\n collapse?: boolean;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L17\nexport type CodeFrame = Readonly<{\n content: string;\n location?: {\n [key: string]: unknown;\n row: number;\n column: number;\n };\n fileName: string;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L27\nexport type SymbolicatedStackTrace = Readonly<{\n stack: Array<StackFrame>;\n codeFrame?: CodeFrame;\n}>;\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/Core/Devtools/getDevServer.js#L17\nexport type DevServerInfo = {\n [key: string]: unknown;\n url: string;\n fullBundleUrl?: string;\n bundleLoadedFromServer: boolean;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/TurboModule/RCTExport.d.ts#L10\ntype TurboModule = {\n getConstants?(): object;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/Libraries/TurboModule/TurboModuleRegistry.d.ts#L12\nexport type TurboModuleRegistry = {\n get<T extends TurboModule>(name: string): T | null;\n getEnforcing<T extends TurboModule>(name: string): T;\n};\n\n// Adapted from https://github.com/facebook/react-native/blob/575ab7862553d7ad7bc753951ed19dcd50d59b95/packages/react-native/Libraries/Utilities/Platform.d.ts#L23-L28\nexport type ReactNativeVersion = {\n version: {\n major: number;\n minor: number;\n patch: number;\n prerelease?: number | null | undefined;\n };\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "5.26.0";
3
+ export declare const SDK_VERSION = "5.28.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '5.26.0';
3
+ export const SDK_VERSION = '5.28.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.26.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.28.0';\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "5.26.0",
5
+ "version": "5.28.0",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",
@@ -104,10 +104,10 @@
104
104
  "jest-environment-jsdom": "^29.6.2",
105
105
  "jest-extended": "^4.0.2",
106
106
  "madge": "^6.1.0",
107
- "metro": "0.76",
107
+ "metro": "0.80.10",
108
108
  "prettier": "^2.0.5",
109
109
  "react": "18.2.0",
110
- "react-native": "0.73.2",
110
+ "react-native": "0.73.9",
111
111
  "react-native-version": "^4.0.0",
112
112
  "react-test-renderer": "^18.2.0",
113
113
  "replace-in-file": "^7.0.1",
@@ -181,6 +181,13 @@ export interface BaseReactNativeOptions {
181
181
  */
182
182
  replaysOnErrorSampleRate?: number;
183
183
  };
184
+ /**
185
+ * This options changes the placement of the attached stacktrace of `captureMessage` in the event.
186
+ *
187
+ * @default false
188
+ * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.
189
+ */
190
+ useThreadsForMessageStack?: boolean;
184
191
  }
185
192
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
186
193
  /**
@@ -82,6 +82,8 @@ export declare class ReactNativeTracing implements Integration {
82
82
  static id: string;
83
83
  /** We filter out App starts more than 60s */
84
84
  private static _maxAppStart;
85
+ /** We filter out App starts which timestamp is 60s and more before the transaction start */
86
+ private static _maxAppStartBeforeTransactionMs;
85
87
  /**
86
88
  * @inheritDoc
87
89
  */
@@ -1,4 +1,3 @@
1
- import type { version as RNV } from 'react-native/Libraries/Core/ReactNativeVersion';
2
1
  import type * as ReactNative from '../vendor/react-native';
3
2
  export type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
4
3
  export type { EmitterSubscription } from 'react-native/Libraries/vendor/emitter/EventEmitter';
@@ -12,9 +11,7 @@ export interface ReactNativeLibrariesInterface {
12
11
  polyfillGlobal: <T>(name: string, getValue: () => T) => void;
13
12
  };
14
13
  Promise?: typeof Promise;
15
- ReactNativeVersion?: {
16
- version: typeof RNV;
17
- };
14
+ ReactNativeVersion?: ReactNative.ReactNativeVersion;
18
15
  TurboModuleRegistry?: ReactNative.TurboModuleRegistry;
19
16
  }
20
17
  //# sourceMappingURL=rnlibrariesinterface.d.ts.map
@@ -31,5 +31,13 @@ export type TurboModuleRegistry = {
31
31
  get<T extends TurboModule>(name: string): T | null;
32
32
  getEnforcing<T extends TurboModule>(name: string): T;
33
33
  };
34
+ export type ReactNativeVersion = {
35
+ version: {
36
+ major: number;
37
+ minor: number;
38
+ patch: number;
39
+ prerelease?: number | null | undefined;
40
+ };
41
+ };
34
42
  export {};
35
43
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "5.26.0";
3
+ export declare const SDK_VERSION = "5.28.0";
4
4
  //# sourceMappingURL=version.d.ts.map