@sentry/react-native 5.2.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/RNSentry.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +13 -0
  5. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  6. package/dist/js/NativeRNSentry.js.map +1 -1
  7. package/dist/js/breadcrumb.d.ts.map +1 -1
  8. package/dist/js/breadcrumb.js.map +1 -1
  9. package/dist/js/client.d.ts.map +1 -1
  10. package/dist/js/client.js +4 -5
  11. package/dist/js/client.js.map +1 -1
  12. package/dist/js/index.d.ts +1 -2
  13. package/dist/js/index.d.ts.map +1 -1
  14. package/dist/js/index.js +1 -5
  15. package/dist/js/index.js.map +1 -1
  16. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  17. package/dist/js/integrations/debugsymbolicator.js +1 -3
  18. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  19. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  20. package/dist/js/integrations/devicecontext.js +2 -4
  21. package/dist/js/integrations/devicecontext.js.map +1 -1
  22. package/dist/js/integrations/eventorigin.js +1 -1
  23. package/dist/js/integrations/eventorigin.js.map +1 -1
  24. package/dist/js/integrations/factory.d.ts.map +1 -1
  25. package/dist/js/integrations/factory.js +3 -1
  26. package/dist/js/integrations/factory.js.map +1 -1
  27. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  28. package/dist/js/integrations/modulesloader.js.map +1 -1
  29. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  30. package/dist/js/integrations/reactnativeerrorhandlers.js +2 -2
  31. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  32. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  33. package/dist/js/integrations/reactnativeinfo.js +1 -2
  34. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  35. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  36. package/dist/js/integrations/rewriteframes.js +2 -5
  37. package/dist/js/integrations/rewriteframes.js.map +1 -1
  38. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  39. package/dist/js/integrations/screenshot.js +2 -6
  40. package/dist/js/integrations/screenshot.js.map +1 -1
  41. package/dist/js/integrations/sdkinfo.js.map +1 -1
  42. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  43. package/dist/js/measurements.d.ts +2 -3
  44. package/dist/js/measurements.d.ts.map +1 -1
  45. package/dist/js/measurements.js +5 -8
  46. package/dist/js/measurements.js.map +1 -1
  47. package/dist/js/misc.d.ts.map +1 -1
  48. package/dist/js/misc.js +1 -3
  49. package/dist/js/misc.js.map +1 -1
  50. package/dist/js/options.d.ts +14 -6
  51. package/dist/js/options.d.ts.map +1 -1
  52. package/dist/js/options.js.map +1 -1
  53. package/dist/js/scope.d.ts +2 -2
  54. package/dist/js/scope.d.ts.map +1 -1
  55. package/dist/js/scope.js +4 -4
  56. package/dist/js/scope.js.map +1 -1
  57. package/dist/js/sdk.d.ts.map +1 -1
  58. package/dist/js/sdk.js +8 -8
  59. package/dist/js/sdk.js.map +1 -1
  60. package/dist/js/tools/ModulesCollector.d.ts.map +1 -1
  61. package/dist/js/tools/ModulesCollector.js +3 -7
  62. package/dist/js/tools/ModulesCollector.js.map +1 -1
  63. package/dist/js/tools/collectModules.js +1 -3
  64. package/dist/js/tools/collectModules.js.map +1 -1
  65. package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
  66. package/dist/js/tracing/gesturetracing.js +4 -2
  67. package/dist/js/tracing/gesturetracing.js.map +1 -1
  68. package/dist/js/tracing/index.d.ts +3 -3
  69. package/dist/js/tracing/index.d.ts.map +1 -1
  70. package/dist/js/tracing/index.js +2 -2
  71. package/dist/js/tracing/index.js.map +1 -1
  72. package/dist/js/tracing/nativeframes.d.ts +4 -4
  73. package/dist/js/tracing/nativeframes.d.ts.map +1 -1
  74. package/dist/js/tracing/nativeframes.js +15 -15
  75. package/dist/js/tracing/nativeframes.js.map +1 -1
  76. package/dist/js/tracing/ops.d.ts.map +1 -1
  77. package/dist/js/tracing/ops.js.map +1 -1
  78. package/dist/js/tracing/reactnativenavigation.d.ts +13 -2
  79. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  80. package/dist/js/tracing/reactnativenavigation.js +29 -29
  81. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  82. package/dist/js/tracing/reactnativetracing.d.ts +2 -2
  83. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  84. package/dist/js/tracing/reactnativetracing.js +20 -16
  85. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  86. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  87. package/dist/js/tracing/reactnavigation.js.map +1 -1
  88. package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
  89. package/dist/js/tracing/reactnavigationv4.js +1 -2
  90. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  91. package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
  92. package/dist/js/tracing/routingInstrumentation.js.map +1 -1
  93. package/dist/js/tracing/stalltracking.d.ts +1 -1
  94. package/dist/js/tracing/stalltracking.d.ts.map +1 -1
  95. package/dist/js/tracing/stalltracking.js +9 -17
  96. package/dist/js/tracing/stalltracking.js.map +1 -1
  97. package/dist/js/tracing/transaction.d.ts.map +1 -1
  98. package/dist/js/tracing/transaction.js +2 -1
  99. package/dist/js/tracing/transaction.js.map +1 -1
  100. package/dist/js/tracing/types.d.ts.map +1 -1
  101. package/dist/js/tracing/types.js.map +1 -1
  102. package/dist/js/tracing/utils.d.ts +1 -1
  103. package/dist/js/tracing/utils.d.ts.map +1 -1
  104. package/dist/js/tracing/utils.js.map +1 -1
  105. package/dist/js/transports/TextEncoder.d.ts.map +1 -1
  106. package/dist/js/transports/TextEncoder.js.map +1 -1
  107. package/dist/js/transports/native.d.ts +1 -1
  108. package/dist/js/transports/native.d.ts.map +1 -1
  109. package/dist/js/transports/native.js +1 -1
  110. package/dist/js/transports/native.js.map +1 -1
  111. package/dist/js/user.d.ts.map +1 -1
  112. package/dist/js/user.js.map +1 -1
  113. package/dist/js/utils/envelope.d.ts.map +1 -1
  114. package/dist/js/utils/envelope.js +5 -2
  115. package/dist/js/utils/envelope.js.map +1 -1
  116. package/dist/js/utils/outcome.js +1 -1
  117. package/dist/js/utils/outcome.js.map +1 -1
  118. package/dist/js/utils/safe.d.ts.map +1 -1
  119. package/dist/js/utils/safe.js +1 -3
  120. package/dist/js/utils/safe.js.map +1 -1
  121. package/dist/js/vendor/buffer/index.d.ts +1 -1
  122. package/dist/js/vendor/buffer/index.d.ts.map +1 -1
  123. package/dist/js/vendor/buffer/index.js +1 -1
  124. package/dist/js/vendor/buffer/index.js.map +1 -1
  125. package/dist/js/vendor/buffer/utf8ToBytes.d.ts +0 -5
  126. package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -1
  127. package/dist/js/vendor/buffer/utf8ToBytes.js +29 -16
  128. package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
  129. package/dist/js/vendor/index.d.ts +1 -1
  130. package/dist/js/vendor/index.d.ts.map +1 -1
  131. package/dist/js/vendor/index.js +1 -1
  132. package/dist/js/vendor/index.js.map +1 -1
  133. package/dist/js/version.d.ts +1 -1
  134. package/dist/js/version.js +1 -1
  135. package/dist/js/version.js.map +1 -1
  136. package/dist/js/wrapper.d.ts +2 -2
  137. package/dist/js/wrapper.d.ts.map +1 -1
  138. package/dist/js/wrapper.js +8 -18
  139. package/dist/js/wrapper.js.map +1 -1
  140. package/ios/RNSentry.mm +6 -3
  141. package/package.json +19 -14
  142. package/sentry.gradle +12 -7
  143. package/src/js/NativeRNSentry.ts +4 -7
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.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AAK,CAAE,cAAc,EAAE;iBACrC,CAAC;gBACF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAE3D,IAAI,OAAO,EAAE;oBACX,KAAK,CAAC,KAAK,GAAG,OAAwB,CAAC;oBAEvC,qBAAqB,CAAC,KAAK,EAAE;wBAC3B,OAAO,EAAE,KAAK;wBACd,IAAI,EAAE,SAAS;qBAChB,CAAC,CAAC;iBACJ;gBAED,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAErC,IAAI,CAAC,OAAO,EAAE;oBACZ,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC3D,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,gFAAgF;oBAChF,mCAAmC;oBACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;;AApND;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { EventHint, Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, logger } from '@sentry/utils';\n\nimport type { ReactNativeClient } from '../client';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const {\n polyfillGlobal,\n } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n const Promise = require('promise/setimmediate/es6-extensions');\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking: {\n disable: () => void;\n enable: (arg: unknown) => void;\n // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-var-requires\n } = require('promise/setimmediate/rejection-tracking');\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(\n `Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`\n );\n },\n onHandled: (id) => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: Error) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const Promise = require('promise/setimmediate/es6-extensions');\n\n if (Promise !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.'\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.'\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler =\n errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log(\n 'Encountered multiple fatals in a row. The latest:',\n error\n );\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error(\n 'Sentry client is missing, the error event might be lost.',\n error\n );\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const hint: EventHint = {\n originalException: error,\n attachments: scope?.getAttachments(),\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event, hint);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcnD,2CAA2C;AAC3C,MAAM,OAAO,wBAAwB;IAcnC,kBAAkB;IAClB,YAAmB,OAAkD;QATrE;;WAEG;QACI,SAAI,GAAW,wBAAwB,CAAC,EAAE,CAAC;QAOhD,IAAI,CAAC,QAAQ,mBACX,OAAO,EAAE,IAAI,EACb,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,IAAI,IACrB,OAAO,CACX,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,SAAS;QACd,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,EAAE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,CAAC;oBACjC,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,gFAAgF;oBAChF,mCAAmC;oBACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;;AAzMD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { EventHint, Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, logger } from '@sentry/utils';\n\nimport type { ReactNativeClient } from '../client';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const { polyfillGlobal } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n const Promise = require('promise/setimmediate/es6-extensions');\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking: {\n disable: () => void;\n enable: (arg: unknown) => void;\n // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-var-requires\n } = require('promise/setimmediate/rejection-tracking');\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n },\n onHandled: id => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: Error) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const Promise = require('promise/setimmediate/es6-extensions');\n\n if (Promise !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.',\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.',\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const hint: EventHint = {\n originalException: error,\n attachments: scope?.getAttachments(),\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event, hint);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5F,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,WAAW;IACjD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAqB;IAE7C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAsB;IAEzC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAoCpF"}
1
+ {"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5F,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,WAAW;IACjD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAqB;IAE7C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAsB;IAEzC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAkCpF"}
@@ -13,8 +13,7 @@ export class ReactNativeInfo {
13
13
  */
14
14
  setupOnce(addGlobalEventProcessor) {
15
15
  addGlobalEventProcessor((event, hint) => __awaiter(this, void 0, void 0, function* () {
16
- const reactNativeError = (hint === null || hint === void 0 ? void 0 : hint.originalException) ? hint === null || hint === void 0 ? void 0 : hint.originalException
17
- : undefined;
16
+ const reactNativeError = (hint === null || hint === void 0 ? void 0 : hint.originalException) ? hint === null || hint === void 0 ? void 0 : hint.originalException : undefined;
18
17
  const reactNativeContext = {
19
18
  turbo_module: isTurboModuleEnabled(),
20
19
  fabric: isFabricEnabled(),
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAU9F,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;IAyC3C,CAAC;IAvCC;;OAEG;IACI,SAAS,CAAC,uBAA2D;QAC1E,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAgB,EAAE,EAAE;YAC/D,MAAM,gBAAgB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,EAC9C,CAAC,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAqC;gBAC7C,CAAC,CAAC,SAAS,CAAC;YAEd,MAAM,kBAAkB,GAAuB;gBAC7C,YAAY,EAAE,oBAAoB,EAAE;gBACpC,MAAM,EAAE,eAAe,EAAE;aAC1B,CAAC;YAEF,IAAI,eAAe,EAAE,EAAE;gBACrB,kBAAkB,CAAC,SAAS,GAAG,QAAQ,CAAC;aACzC;iBAAM,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,EAAE;gBACrC,kBAAkB,CAAC,SAAS,GAAG,gBAAgB,CAAC,QAAQ,CAAC;aAC1D;YAED,IAAI,kBAAkB,CAAC,SAAS,KAAK,QAAQ,EAAE;gBAC7C,KAAK,CAAC,IAAI,mBACR,MAAM,EAAE,MAAM,IACX,KAAK,CAAC,IAAI,CACd,CAAC;aACH;YAED,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,cAAc,EAAE;gBACpC,kBAAkB,CAAC,eAAe,GAAG,gBAAgB,CAAC,cAAc,CAAC;aACtE;YAED,KAAK,CAAC,QAAQ,mBACZ,oBAAoB,EAAE,kBAAkB,IACrC,KAAK,CAAC,QAAQ,CAClB,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAhDD;;GAEG;AACW,kBAAE,GAAW,iBAAiB,CAAC","sourcesContent":["import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';\n\nimport { isFabricEnabled, isHermesEnabled, isTurboModuleEnabled } from '../utils/environment';\nimport type { ReactNativeError } from './debugsymbolicator';\n\nexport interface ReactNativeContext extends Context {\n js_engine?: string;\n turbo_module: boolean;\n fabric: boolean;\n component_stack?: string;\n}\n\n/** Loads React Native context at runtime */\nexport class ReactNativeInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeInfo.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint?: EventHint) => {\n const reactNativeError = hint?.originalException\n ? hint?.originalException as ReactNativeError\n : undefined;\n\n const reactNativeContext: ReactNativeContext = {\n turbo_module: isTurboModuleEnabled(),\n fabric: isFabricEnabled(),\n };\n\n if (isHermesEnabled()) {\n reactNativeContext.js_engine = 'hermes';\n } else if (reactNativeError?.jsEngine) {\n reactNativeContext.js_engine = reactNativeError.jsEngine;\n }\n\n if (reactNativeContext.js_engine === 'hermes') {\n event.tags = {\n hermes: 'true',\n ...event.tags,\n };\n }\n\n if (reactNativeError?.componentStack) {\n reactNativeContext.component_stack = reactNativeError.componentStack;\n }\n\n event.contexts = {\n react_native_context: reactNativeContext,\n ...event.contexts,\n };\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAU9F,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;IAuC3C,CAAC;IArCC;;OAEG;IACI,SAAS,CAAC,uBAA2D;QAC1E,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAgB,EAAE,EAAE;YAC/D,MAAM,gBAAgB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,EAAC,CAAC,CAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAsC,CAAC,CAAC,CAAC,SAAS,CAAC;YAE7G,MAAM,kBAAkB,GAAuB;gBAC7C,YAAY,EAAE,oBAAoB,EAAE;gBACpC,MAAM,EAAE,eAAe,EAAE;aAC1B,CAAC;YAEF,IAAI,eAAe,EAAE,EAAE;gBACrB,kBAAkB,CAAC,SAAS,GAAG,QAAQ,CAAC;aACzC;iBAAM,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,EAAE;gBACrC,kBAAkB,CAAC,SAAS,GAAG,gBAAgB,CAAC,QAAQ,CAAC;aAC1D;YAED,IAAI,kBAAkB,CAAC,SAAS,KAAK,QAAQ,EAAE;gBAC7C,KAAK,CAAC,IAAI,mBACR,MAAM,EAAE,MAAM,IACX,KAAK,CAAC,IAAI,CACd,CAAC;aACH;YAED,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,cAAc,EAAE;gBACpC,kBAAkB,CAAC,eAAe,GAAG,gBAAgB,CAAC,cAAc,CAAC;aACtE;YAED,KAAK,CAAC,QAAQ,mBACZ,oBAAoB,EAAE,kBAAkB,IACrC,KAAK,CAAC,QAAQ,CAClB,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA9CD;;GAEG;AACW,kBAAE,GAAW,iBAAiB,CAAC","sourcesContent":["import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';\n\nimport { isFabricEnabled, isHermesEnabled, isTurboModuleEnabled } from '../utils/environment';\nimport type { ReactNativeError } from './debugsymbolicator';\n\nexport interface ReactNativeContext extends Context {\n js_engine?: string;\n turbo_module: boolean;\n fabric: boolean;\n component_stack?: string;\n}\n\n/** Loads React Native context at runtime */\nexport class ReactNativeInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeInfo.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint?: EventHint) => {\n const reactNativeError = hint?.originalException ? (hint?.originalException as ReactNativeError) : undefined;\n\n const reactNativeContext: ReactNativeContext = {\n turbo_module: isTurboModuleEnabled(),\n fabric: isFabricEnabled(),\n };\n\n if (isHermesEnabled()) {\n reactNativeContext.js_engine = 'hermes';\n } else if (reactNativeError?.jsEngine) {\n reactNativeContext.js_engine = reactNativeError.jsEngine;\n }\n\n if (reactNativeContext.js_engine === 'hermes') {\n event.tags = {\n hermes: 'true',\n ...event.tags,\n };\n }\n\n if (reactNativeError?.componentStack) {\n reactNativeContext.component_stack = reactNativeError.componentStack;\n }\n\n event.contexts = {\n react_native_context: reactNativeContext,\n ...event.contexts,\n };\n\n return event;\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rewriteframes.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,aAAa,CAyB9D"}
1
+ {"version":3,"file":"rewriteframes.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,aAAa,CAoB9D"}
@@ -12,14 +12,11 @@ export function createReactNativeRewriteFrames() {
12
12
  .replace(/^file:\/\//, '')
13
13
  .replace(/^address at /, '')
14
14
  .replace(/^.*\/[^.]+(\.app|CodePush|.*(?=\/))/, '');
15
- if (frame.filename !== '[native code]' &&
16
- frame.filename !== 'native') {
15
+ if (frame.filename !== '[native code]' && frame.filename !== 'native') {
17
16
  const appPrefix = 'app://';
18
17
  // We always want to have a triple slash
19
18
  frame.filename =
20
- frame.filename.indexOf('/') === 0
21
- ? `${appPrefix}${frame.filename}`
22
- : `${appPrefix}/${frame.filename}`;
19
+ frame.filename.indexOf('/') === 0 ? `${appPrefix}${frame.filename}` : `${appPrefix}/${frame.filename}`;
23
20
  }
24
21
  delete frame.abs_path;
25
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rewriteframes.js","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,IAAI,aAAa,CAAC;QACvB,QAAQ,EAAE,CAAC,KAAiB,EAAE,EAAE;YAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;qBAC5B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;qBACzB,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;qBAC3B,OAAO,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAC;gBAEtD,IACE,KAAK,CAAC,QAAQ,KAAK,eAAe;oBAClC,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAC3B;oBACA,MAAM,SAAS,GAAG,QAAQ,CAAC;oBAC3B,wCAAwC;oBACxC,KAAK,CAAC,QAAQ;wBACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;4BAC/B,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE;4BACjC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;iBACxC;gBACD,OAAO,KAAK,CAAC,QAAQ,CAAC;aACvB;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { RewriteFrames } from '@sentry/integrations';\nimport type { StackFrame } from '@sentry/types';\n\n/**\n * Creates React Native default rewrite frames integration\n * which appends app:// to the beginning of the filename\n * and removes file://, 'address at' prefixes and CodePush postfix.\n */\nexport function createReactNativeRewriteFrames(): RewriteFrames {\n return new RewriteFrames({\n iteratee: (frame: StackFrame) => {\n if (frame.filename) {\n frame.filename = frame.filename\n .replace(/^file:\\/\\//, '')\n .replace(/^address at /, '')\n .replace(/^.*\\/[^.]+(\\.app|CodePush|.*(?=\\/))/, '');\n\n if (\n frame.filename !== '[native code]' &&\n frame.filename !== 'native'\n ) {\n const appPrefix = 'app://';\n // We always want to have a triple slash\n frame.filename =\n frame.filename.indexOf('/') === 0\n ? `${appPrefix}${frame.filename}`\n : `${appPrefix}/${frame.filename}`;\n }\n delete frame.abs_path;\n }\n return frame;\n },\n });\n}\n"]}
1
+ {"version":3,"file":"rewriteframes.js","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,IAAI,aAAa,CAAC;QACvB,QAAQ,EAAE,CAAC,KAAiB,EAAE,EAAE;YAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;qBAC5B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;qBACzB,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;qBAC3B,OAAO,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAC;gBAEtD,IAAI,KAAK,CAAC,QAAQ,KAAK,eAAe,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE;oBACrE,MAAM,SAAS,GAAG,QAAQ,CAAC;oBAC3B,wCAAwC;oBACxC,KAAK,CAAC,QAAQ;wBACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;iBAC1G;gBACD,OAAO,KAAK,CAAC,QAAQ,CAAC;aACvB;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { RewriteFrames } from '@sentry/integrations';\nimport type { StackFrame } from '@sentry/types';\n\n/**\n * Creates React Native default rewrite frames integration\n * which appends app:// to the beginning of the filename\n * and removes file://, 'address at' prefixes and CodePush postfix.\n */\nexport function createReactNativeRewriteFrames(): RewriteFrames {\n return new RewriteFrames({\n iteratee: (frame: StackFrame) => {\n if (frame.filename) {\n frame.filename = frame.filename\n .replace(/^file:\\/\\//, '')\n .replace(/^address at /, '')\n .replace(/^.*\\/[^.]+(\\.app|CodePush|.*(?=\\/))/, '');\n\n if (frame.filename !== '[native code]' && frame.filename !== 'native') {\n const appPrefix = 'app://';\n // We always want to have a triple slash\n frame.filename =\n frame.filename.indexOf('/') === 0 ? `${appPrefix}${frame.filename}` : `${appPrefix}/${frame.filename}`;\n }\n delete frame.abs_path;\n }\n return frame;\n },\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,uCAAuC;AACvC,qBAAa,UAAW,YAAW,WAAW;IAC5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAgB;IAExC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAiB;IAEpC;;OAEG;WACW,2BAA2B,CACvC,IAAI,EAAE,SAAS,EACf,EAAE,gBAAgB,EAAE,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GACnD,WAAW,CAAC,SAAS,CAAC;IAiBzB;;OAEG;IAEI,SAAS,IAAI,IAAI;CACzB"}
1
+ {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,uCAAuC;AACvC,qBAAa,UAAW,YAAW,WAAW;IAC5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAgB;IAExC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAiB;IAEpC;;OAEG;WACW,2BAA2B,CACvC,IAAI,EAAE,SAAS,EACf,EAAE,gBAAgB,EAAE,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GACnD,WAAW,CAAC,SAAS,CAAC;IAazB;;OAEG;IAEI,SAAS,IAAI,IAAI;CACzB"}
@@ -15,13 +15,9 @@ export class Screenshot {
15
15
  if (!attachScreenshot) {
16
16
  return resolvedSyncPromise(hint);
17
17
  }
18
- return NATIVE.captureScreenshot()
19
- .then((screenshots) => {
18
+ return NATIVE.captureScreenshot().then(screenshots => {
20
19
  if (screenshots !== null && screenshots.length > 0) {
21
- hint.attachments = [
22
- ...screenshots,
23
- ...((hint === null || hint === void 0 ? void 0 : hint.attachments) || []),
24
- ];
20
+ hint.attachments = [...screenshots, ...((hint === null || hint === void 0 ? void 0 : hint.attachments) || [])];
25
21
  }
26
22
  return hint;
27
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,OAAO,UAAU;IAAvB;QAME;;WAEG;QACI,SAAI,GAAW,UAAU,CAAC,EAAE,CAAC;IA8BtC,CAAC;IA5BC;;OAEG;IACI,MAAM,CAAC,2BAA2B,CACvC,IAAe,EACf,EAAE,gBAAgB,EAAkC;QAEpD,IAAI,CAAC,gBAAgB,EAAE;YACrB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,MAAM,CAAC,iBAAiB,EAAE;aAC9B,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;YACpB,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;gBAClD,IAAI,CAAC,WAAW,GAAG;oBACjB,GAAG,WAAW;oBACd,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;iBAC7B,CAAC;aACH;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,gEAAgE;IACzD,SAAS,KAAU,CAAC;;AArC3B;;GAEG;AACW,aAAE,GAAW,YAAY,CAAC","sourcesContent":["import type { EventHint, Integration } from '@sentry/types';\nimport { resolvedSyncPromise } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Adds screenshots to error events */\nexport class Screenshot implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Screenshot';\n\n /**\n * @inheritDoc\n */\n public name: string = Screenshot.id;\n\n /**\n * If enabled attaches a screenshot to the event hint.\n */\n public static attachScreenshotToEventHint(\n hint: EventHint,\n { attachScreenshot }: { attachScreenshot?: boolean },\n ): PromiseLike<EventHint> {\n if (!attachScreenshot) {\n return resolvedSyncPromise(hint);\n }\n\n return NATIVE.captureScreenshot()\n .then((screenshots) => {\n if (screenshots !== null && screenshots.length > 0) {\n hint.attachments = [\n ...screenshots,\n ...(hint?.attachments || []),\n ];\n }\n return hint;\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public setupOnce(): void {}\n}\n"]}
1
+ {"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,OAAO,UAAU;IAAvB;QAME;;WAEG;QACI,SAAI,GAAW,UAAU,CAAC,EAAE,CAAC;IA0BtC,CAAC;IAxBC;;OAEG;IACI,MAAM,CAAC,2BAA2B,CACvC,IAAe,EACf,EAAE,gBAAgB,EAAkC;QAEpD,IAAI,CAAC,gBAAgB,EAAE;YACrB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YACnD,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;gBAClD,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC,CAAC,CAAC;aACnE;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,gEAAgE;IACzD,SAAS,KAAU,CAAC;;AAjC3B;;GAEG;AACW,aAAE,GAAW,YAAY,CAAC","sourcesContent":["import type { EventHint, Integration } from '@sentry/types';\nimport { resolvedSyncPromise } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Adds screenshots to error events */\nexport class Screenshot implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Screenshot';\n\n /**\n * @inheritDoc\n */\n public name: string = Screenshot.id;\n\n /**\n * If enabled attaches a screenshot to the event hint.\n */\n public static attachScreenshotToEventHint(\n hint: EventHint,\n { attachScreenshot }: { attachScreenshot?: boolean },\n ): PromiseLike<EventHint> {\n if (!attachScreenshot) {\n return resolvedSyncPromise(hint);\n }\n\n return NATIVE.captureScreenshot().then(screenshots => {\n if (screenshots !== null && screenshots.length > 0) {\n hint.attachments = [...screenshots, ...(hint?.attachments || [])];\n }\n return hint;\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public setupOnce(): void {}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAC,WAAW,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,E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entry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_PACKAGE_NAME,SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkInfo: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event) => {\n // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (NATIVE.platform === 'ios' && this._nativeSdkInfo === null) {\n try {\n this._nativeSdkInfo = await NATIVE.fetchNativeSdkInfo();\n } catch (e) {\n // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.\n logger.warn(\n '[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:'\n );\n logger.warn(e);\n }\n }\n\n event.platform = event.platform || 'javascript';\n event.sdk = {\n ...(event.sdk ?? {}),\n ...defaultSdkInfo,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n ],\n };\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACr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,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA3CD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import type { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkInfo: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async event => {\n // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (NATIVE.platform === 'ios' && this._nativeSdkInfo === null) {\n try {\n this._nativeSdkInfo = await NATIVE.fetchNativeSdkInfo();\n } catch (e) {\n // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.\n logger.warn(\n '[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:',\n );\n logger.warn(e);\n }\n }\n\n event.platform = event.platform || 'javascript';\n event.sdk = {\n ...(event.sdk ?? {}),\n ...defaultSdkInfo,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n ],\n };\n\n return event;\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integr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kB,CAAC;AAC1C,6BAAe,GAAW,sBAAsB,CAAC","sourcesContent":["import type { Event, EventHint, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Adds ViewHierarchy to error events */\nexport class ViewHierarchy implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ViewHierarchy';\n\n private static _fileName: string = 'view-hierarchy.json';\n private static _contentType: string = 'application/json';\n private static _attachmentType: string = 'event.view_hierarchy';\n\n /**\n * @inheritDoc\n */\n public name: string = ViewHierarchy.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy()\n } catch (e) {\n logger.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename: ViewHierarchy._fileName,\n contentType: ViewHierarchy._contentType,\n attachmentType: ViewHierarchy._attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,yCAAyC;AACzC,MAAM,OAAO,aAAa;IAA1B;QAUE;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IAkCzC,CAAC;IAhCC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAe,EAAE,EAAE;YAC9D,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YACpG,IAAI,CAAC,YAAY,EAAE;gBACjB,OAAO,KAAK,CAAC;aACd;YAED,IAAI,aAAa,GAAsB,IAAI,CAAC;YAC5C,IAAI;gBACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;aACnD;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,CAAC;aAC9D;YAED,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,WAAW,GAAG;oBACjB;wBACE,QAAQ,EAAE,aAAa,CAAC,SAAS;wBACjC,WAAW,EAAE,aAAa,CAAC,YAAY;wBACvC,cAAc,EAAE,aAAa,CAAC,eAAe;wBAC7C,IAAI,EAAE,aAAa;qBACpB;oBACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;iBAC7B,CAAC;aACH;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA7CD;;GAEG;AACW,gBAAE,GAAW,eAAe,CAAC;AAE5B,uBAAS,GAAW,qBAAqB,CAAC;AAC1C,0BAAY,GAAW,kBAAkB,CAAC;AAC1C,6BAAe,GAAW,sBAAsB,CAAC","sourcesContent":["import type { Event, EventHint, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Adds ViewHierarchy to error events */\nexport class ViewHierarchy implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ViewHierarchy';\n\n private static _fileName: string = 'view-hierarchy.json';\n private static _contentType: string = 'application/json';\n private static _attachmentType: string = 'event.view_hierarchy';\n\n /**\n * @inheritDoc\n */\n public name: string = ViewHierarchy.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy();\n } catch (e) {\n logger.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename: ViewHierarchy._fileName,\n contentType: ViewHierarchy._contentType,\n attachmentType: ViewHierarchy._attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n });\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
- import type { Hub } from '@sentry/core';
2
- import type { Transaction } from '@sentry/tracing';
1
+ import type { Hub, Transaction } from '@sentry/core';
3
2
  import type { CustomSamplingContext, TransactionContext } from '@sentry/types';
4
3
  export declare const APP_START_WARM = "app_start_warm";
5
4
  export declare const APP_START_COLD = "app_start_cold";
@@ -7,7 +6,7 @@ export declare const STALL_COUNT = "stall_count";
7
6
  export declare const STALL_TOTAL_TIME = "stall_total_time";
8
7
  export declare const STALL_LONGEST_TIME = "stall_longest_time";
9
8
  /**
10
- * Adds React Native's extensions. Needs to be called after @sentry/tracing's extension methods are added
9
+ * Adds React Native's extensions. Needs to be called before any transactions are created.
11
10
  */
12
11
  export declare function _addTracingExtensions(): void;
13
12
  export declare type StartTransactionFunction = (this: Hub, transactionContext: TransactionContext, customSamplingContext?: CustomSamplingContext) => Transaction;
@@ -1 +1 @@
1
- {"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAqB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIlG,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAmB5C;AAED,oBAAY,wBAAwB,GAAG,CACrC,IAAI,EAAE,GAAG,EACT,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,CAAC,EAAE,qBAAqB,KAC1C,WAAW,CAAC"}
1
+ {"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAqB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIlG,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAiB5C;AAED,oBAAY,wBAAwB,GAAG,CACrC,IAAI,EAAE,GAAG,EACT,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,CAAC,EAAE,qBAAqB,KAC1C,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import { getCurrentHub, getMainCarrier } from '@sentry/core';
1
+ import { addTracingExtensions, getCurrentHub, getMainCarrier } from '@sentry/core';
2
2
  import { DEFAULT, ReactNativeTracing } from './tracing';
3
3
  export const APP_START_WARM = 'app_start_warm';
4
4
  export const APP_START_COLD = 'app_start_cold';
@@ -6,15 +6,15 @@ export const STALL_COUNT = 'stall_count';
6
6
  export const STALL_TOTAL_TIME = 'stall_total_time';
7
7
  export const STALL_LONGEST_TIME = 'stall_longest_time';
8
8
  /**
9
- * Adds React Native's extensions. Needs to be called after @sentry/tracing's extension methods are added
9
+ * Adds React Native's extensions. Needs to be called before any transactions are created.
10
10
  */
11
11
  export function _addTracingExtensions() {
12
+ addTracingExtensions();
12
13
  const carrier = getMainCarrier();
13
14
  if (carrier.__SENTRY__) {
14
15
  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
15
16
  if (carrier.__SENTRY__.extensions.startTransaction) {
16
- const originalStartTransaction = carrier.__SENTRY__.extensions
17
- .startTransaction;
17
+ const originalStartTransaction = carrier.__SENTRY__.extensions.startTransaction;
18
18
  /*
19
19
  Overwrites the transaction start and finish to start and finish stall tracking.
20
20
  Preferably instead of overwriting add a callback method for this in the Transaction itself.
@@ -36,10 +36,7 @@ const _patchStartTransaction = (originalStartTransaction) => {
36
36
  if (!transactionContext.op) {
37
37
  transactionContext.op = DEFAULT;
38
38
  }
39
- const transaction = originalStartTransaction.apply(this, [
40
- transactionContext,
41
- customSamplingContext,
42
- ]);
39
+ const transaction = originalStartTransaction.apply(this, [transactionContext, customSamplingContext]);
43
40
  const originalStartChild = transaction.startChild.bind(transaction);
44
41
  transaction.startChild = (spanContext) => {
45
42
  return originalStartChild(Object.assign(Object.assign({}, spanContext), {
@@ -1 +1 @@
1
- {"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI7D,OAAO,EAAE,OAAO,EAAC,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,M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O,IAC9B,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,kBAAkB,GAAG,aAAa,EAAE,CAAC,cAAc,CACvD,kBAAkB,CACnB,CAAC;QAEF,IAAI,kBAAkB,EAAE;YACtB,kBAAkB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAEnD,6DAA6D;YAC7D,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;YAE1C,WAAW,CAAC,MAAM,GAAG,CAAC,YAAgC,EAAE,EAAE;gBACxD,IAAI,kBAAkB,EAAE;oBACtB,kBAAkB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;iBACrD;gBAED,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAC;SACH;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import type { Hub } from '@sentry/core';\nimport { getCurrentHub, getMainCarrier } from '@sentry/core';\nimport type { Transaction } from '@sentry/tracing';\nimport type { CustomSamplingContext, Span, SpanContext, TransactionContext } from '@sentry/types';\n\nimport { DEFAULT,ReactNativeTracing } from './tracing';\n\nexport const APP_START_WARM = 'app_start_warm';\nexport const APP_START_COLD = 'app_start_cold';\n\nexport const STALL_COUNT = 'stall_count';\nexport const STALL_TOTAL_TIME = 'stall_total_time';\nexport const STALL_LONGEST_TIME = 'stall_longest_time';\n\n/**\n * Adds React Native's extensions. Needs to be called after @sentry/tracing's extension methods are added\n */\nexport function _addTracingExtensions(): void {\n const carrier = getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (carrier.__SENTRY__.extensions.startTransaction) {\n const originalStartTransaction = carrier.__SENTRY__.extensions\n .startTransaction as StartTransactionFunction;\n\n /*\n Overwrites the transaction start and finish to start and finish stall tracking.\n Preferably instead of overwriting add a callback method for this in the Transaction itself.\n */\n const _startTransaction = _patchStartTransaction(\n originalStartTransaction\n );\n\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n }\n}\n\nexport type StartTransactionFunction = (\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext\n) => Transaction;\n\n/**\n * Overwrite the startTransaction extension method to start and end stall tracking.\n */\nconst _patchStartTransaction = (\n originalStartTransaction: StartTransactionFunction\n): StartTransactionFunction => {\n /**\n * Method to overwrite with\n */\n function _startTransaction(\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext\n ): Transaction {\n // Native SDKs require op to be set - for JS Relay sets `default`\n if (!transactionContext.op) {\n transactionContext.op = DEFAULT;\n }\n\n const transaction: Transaction = originalStartTransaction.apply(this, [\n transactionContext,\n customSamplingContext,\n ]);\n const originalStartChild: Transaction['startChild'] = transaction.startChild.bind(transaction);\n transaction.startChild = (\n spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n ): Span => {\n return originalStartChild({\n ...spanContext,\n // Native SDKs require op to be set\n op: spanContext?.op || DEFAULT,\n });\n };\n\n const reactNativeTracing = getCurrentHub().getIntegration(\n ReactNativeTracing\n );\n\n if (reactNativeTracing) {\n reactNativeTracing.onTransactionStart(transaction);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalFinish = transaction.finish;\n\n transaction.finish = (endTimestamp: number | undefined) => {\n if (reactNativeTracing) {\n reactNativeTracing.onTransactionFinish(transaction);\n }\n\n return originalFinish.apply(transaction, [endTimestamp]);\n };\n }\n\n return transaction;\n }\n\n return _startTransaction;\n};\n"]}
1
+ {"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CA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AAC;QAC/F,WAAW,CAAC,UAAU,GAAG,CACvB,WAAmG,EAC7F,EAAE;YACR,OAAO,kBAAkB,iCACpB,WAAW;gBACd,mCAAmC;gBACnC,EAAE,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,KAAI,OAAO,IAC9B,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,kBAAkB,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;QAE9E,IAAI,kBAAkB,EAAE;YACtB,kBAAkB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAEnD,6DAA6D;YAC7D,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;YAE1C,WAAW,CAAC,MAAM,GAAG,CAAC,YAAgC,EAAE,EAAE;gBACxD,IAAI,kBAAkB,EAAE;oBACtB,kBAAkB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;iBACrD;gBAED,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAC;SACH;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import type { Hub, Transaction } from '@sentry/core';\nimport { addTracingExtensions, getCurrentHub, getMainCarrier } from '@sentry/core';\nimport type { CustomSamplingContext, Span, SpanContext, TransactionContext } from '@sentry/types';\n\nimport { DEFAULT, ReactNativeTracing } from './tracing';\n\nexport const APP_START_WARM = 'app_start_warm';\nexport const APP_START_COLD = 'app_start_cold';\n\nexport const STALL_COUNT = 'stall_count';\nexport const STALL_TOTAL_TIME = 'stall_total_time';\nexport const STALL_LONGEST_TIME = 'stall_longest_time';\n\n/**\n * Adds React Native's extensions. Needs to be called before any transactions are created.\n */\nexport function _addTracingExtensions(): void {\n addTracingExtensions();\n const carrier = getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (carrier.__SENTRY__.extensions.startTransaction) {\n const originalStartTransaction = carrier.__SENTRY__.extensions.startTransaction as StartTransactionFunction;\n\n /*\n Overwrites the transaction start and finish to start and finish stall tracking.\n Preferably instead of overwriting add a callback method for this in the Transaction itself.\n */\n const _startTransaction = _patchStartTransaction(originalStartTransaction);\n\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n }\n}\n\nexport type StartTransactionFunction = (\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n) => Transaction;\n\n/**\n * Overwrite the startTransaction extension method to start and end stall tracking.\n */\nconst _patchStartTransaction = (originalStartTransaction: StartTransactionFunction): StartTransactionFunction => {\n /**\n * Method to overwrite with\n */\n function _startTransaction(\n this: Hub,\n transactionContext: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n ): Transaction {\n // Native SDKs require op to be set - for JS Relay sets `default`\n if (!transactionContext.op) {\n transactionContext.op = DEFAULT;\n }\n\n const transaction: Transaction = originalStartTransaction.apply(this, [transactionContext, customSamplingContext]);\n const originalStartChild: Transaction['startChild'] = transaction.startChild.bind(transaction);\n transaction.startChild = (\n spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n ): Span => {\n return originalStartChild({\n ...spanContext,\n // Native SDKs require op to be set\n op: spanContext?.op || DEFAULT,\n });\n };\n\n const reactNativeTracing = getCurrentHub().getIntegration(ReactNativeTracing);\n\n if (reactNativeTracing) {\n reactNativeTracing.onTransactionStart(transaction);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalFinish = transaction.finish;\n\n transaction.finish = (endTimestamp: number | undefined) => {\n if (reactNativeTracing) {\n reactNativeTracing.onTransactionFinish(transaction);\n }\n\n return originalFinish.apply(transaction, [endTimestamp]);\n };\n }\n\n return transaction;\n }\n\n return _startTransaction;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,eAAe,CAAC;AAEvB,aAAK,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAUjE"}
1
+ {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,eAAe,CAAC;AAE7D,aAAK,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CASjE"}
package/dist/js/misc.js CHANGED
@@ -4,9 +4,7 @@
4
4
  */
5
5
  export function isHardCrash(payload) {
6
6
  var _a, _b;
7
- const values = typeof payload !== 'string' && 'exception' in payload && ((_a = payload.exception) === null || _a === void 0 ? void 0 : _a.values)
8
- ? payload.exception.values
9
- : [];
7
+ const values = typeof payload !== 'string' && 'exception' in payload && ((_a = payload.exception) === null || _a === void 0 ? void 0 : _a.values) ? payload.exception.values : [];
10
8
  for (const exception of values) {
11
9
  if (!(((_b = exception.mechanism) === null || _b === void 0 ? void 0 : _b.handled) !== false)) {
12
10
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;;IACtD,MAAM,MAAM,GAAgB,OAAO,OAAO,KAAK,QAAQ,IAAI,WAAW,IAAI,OAAO,WAAI,OAAO,CAAC,SAAS,0CAAE,MAAM,CAAA;QAC5G,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM;QAC1B,CAAC,CAAC,EAAE,CAAC;IACP,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,CAAC,CAAC,OAAA,SAAS,CAAC,SAAS,0CAAE,OAAO,MAAK,KAAK,CAAC,EAAE;YAC7C,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type {\n EnvelopeItem,\n Exception,\n} from '@sentry/types';\n\ntype EnvelopeItemPayload = EnvelopeItem[1];\n\n/**\n * Extracts the hard crash information from the event exceptions.\n * No exceptions or undefined handled are not hard crashes.\n */\nexport function isHardCrash(payload: EnvelopeItemPayload): boolean {\n const values: Exception[] = typeof payload !== 'string' && 'exception' in payload && payload.exception?.values\n ? payload.exception.values\n : [];\n for (const exception of values) {\n if (!(exception.mechanism?.handled !== false)) {\n return true;\n }\n }\n return false;\n}\n"]}
1
+ {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;;IACtD,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,QAAQ,IAAI,WAAW,IAAI,OAAO,WAAI,OAAO,CAAC,SAAS,0CAAE,MAAM,CAAA,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,CAAC,CAAC,OAAA,SAAS,CAAC,SAAS,0CAAE,OAAO,MAAK,KAAK,CAAC,EAAE;YAC7C,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { EnvelopeItem, Exception } from '@sentry/types';\n\ntype EnvelopeItemPayload = EnvelopeItem[1];\n\n/**\n * Extracts the hard crash information from the event exceptions.\n * No exceptions or undefined handled are not hard crashes.\n */\nexport function isHardCrash(payload: EnvelopeItemPayload): boolean {\n const values: Exception[] =\n typeof payload !== 'string' && 'exception' in payload && payload.exception?.values ? payload.exception.values : [];\n for (const exception of values) {\n if (!(exception.mechanism?.handled !== false)) {\n return true;\n }\n }\n return false;\n}\n"]}
@@ -5,11 +5,11 @@ import type { CaptureContext } from '@sentry/types/types/scope';
5
5
  import type { TouchEventBoundaryProps } from './touchevents';
6
6
  export interface BaseReactNativeOptions {
7
7
  /**
8
- * Enables native transport + device info + offline caching.
9
- * Be careful, disabling this also breaks automatic release setting.
10
- * This means you have to manage setting the release yourself.
11
- * Defaults to `true`.
12
- */
8
+ * Enables native transport + device info + offline caching.
9
+ * Be careful, disabling this also breaks automatic release setting.
10
+ * This means you have to manage setting the release yourself.
11
+ * Defaults to `true`.
12
+ */
13
13
  enableNative?: boolean;
14
14
  /**
15
15
  * Enables native crashHandling. This only works if `enableNative` is `true`.
@@ -120,11 +120,19 @@ export interface BaseReactNativeOptions {
120
120
  * @default false
121
121
  */
122
122
  attachViewHierarchy?: boolean;
123
+ /**
124
+ * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.
125
+ * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)
126
+ * is needed to capture HTTP Errors on Android.
127
+ *
128
+ * @default false
129
+ */
130
+ enableCaptureFailedRequests?: boolean;
123
131
  }
124
132
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
125
133
  /**
126
134
  * @deprecated use `maxQueueSize` in the root of the SDK options.
127
- */
135
+ */
128
136
  bufferSize?: number;
129
137
  }
130
138
  /**
@@ -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,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,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@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { ClientOptions, Options } from '@sentry/types';\nimport type { CaptureContext } from '@sentry/types/types/scope';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\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 scope sync from Java to NDK on Android */\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\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 extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {\n}\n\nexport interface ReactNativeClientOptions extends ClientOptions<ReactNativeTransportOptions>, BaseReactNativeOptions {\n}\n\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"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { ClientOptions, Options } from '@sentry/types';\nimport type { CaptureContext } from '@sentry/types/types/scope';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\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 scope sync from Java to NDK on Android */\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\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 extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions extends ClientOptions<ReactNativeTransportOptions>, 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"]}
@@ -47,8 +47,8 @@ export declare class ReactNativeScope extends Scope {
47
47
  */
48
48
  addAttachment(attachment: Attachment): this;
49
49
  /**
50
- * @inheritDoc
51
- */
50
+ * @inheritDoc
51
+ */
52
52
  clearAttachments(): this;
53
53
  }
54
54
  //# sourceMappingURL=scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAKlE;;GAEG;AACH,qBAA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,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK/C;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAQrD;;OAEG;IAEI,SAAS,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI;IAOtD;;OAEG;IAEI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAK9C;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAS3E;;OAEG;IACI,gBAAgB,IAAI,IAAI;IAK/B;;OAEG;IAEI,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,GAAG,IAAI;IAK5E;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAIlD;;OAEG;IACI,gBAAgB,IAAI,IAAI;CAGhC"}
package/dist/js/scope.js CHANGED
@@ -24,7 +24,7 @@ export class ReactNativeScope extends Scope {
24
24
  */
25
25
  setTags(tags) {
26
26
  // As native only has setTag, we just loop through each tag key.
27
- Object.keys(tags).forEach((key) => {
27
+ Object.keys(tags).forEach(key => {
28
28
  NATIVE.setTag(key, tags[key]);
29
29
  });
30
30
  return super.setTags(tags);
@@ -34,7 +34,7 @@ export class ReactNativeScope extends Scope {
34
34
  */
35
35
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
36
  setExtras(extras) {
37
- Object.keys(extras).forEach((key) => {
37
+ Object.keys(extras).forEach(key => {
38
38
  NATIVE.setExtra(key, extras[key]);
39
39
  });
40
40
  return super.setExtras(extras);
@@ -77,8 +77,8 @@ export class ReactNativeScope extends Scope {
77
77
  return super.addAttachment(attachment);
78
78
  }
79
79
  /**
80
- * @inheritDoc
81
- */
80
+ * @inheritDoc
81
+ */
82
82
  clearAttachments() {
83
83
  return super.clearAttachments();
84
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACI,OAAO,CAAC,IAAiB;QAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,GAAW,EAAE,KAAa;QACtC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,IAA+B;QAC5C,gEAAgE;QAChE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,SAAS,CAAC,MAA8B;QAC7C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAClC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,gHAAgH;IACzG,QAAQ,CAAC,GAAW,EAAE,KAAU;QACrC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB,EAAE,cAAuB;QAClE,MAAM,gBAAgB,mCACjB,UAAU,KACb,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,wBAAwB,GACpD,CAAC;QACF,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACvC,OAAO,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,UAAU,CAAC,GAAW,EAAE,OAAsC;QACnE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB;QACzC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED;;MAEE;IACK,gBAAgB;QACrB,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;CACF","sourcesContent":["import { Scope } from '@sentry/core';\nimport type { Attachment, Breadcrumb, User } from '@sentry/types';\n\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { NATIVE } from './wrapper';\n\n/**\n * Extends the scope methods to set scope on the Native SDKs\n */\nexport class ReactNativeScope extends Scope {\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n NATIVE.setUser(user);\n return super.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n NATIVE.setTag(key, value);\n return super.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): this {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach((key) => {\n NATIVE.setTag(key, tags[key]);\n });\n return super.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setExtras(extras: { [key: string]: any }): this {\n Object.keys(extras).forEach((key) => {\n NATIVE.setExtra(key, extras[key]);\n });\n return super.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any\n public setExtra(key: string, extra: any): this {\n NATIVE.setExtra(key, extra);\n return super.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const mergedBreadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n };\n NATIVE.addBreadcrumb(mergedBreadcrumb);\n return super.addBreadcrumb(mergedBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n NATIVE.clearBreadcrumbs();\n return super.clearBreadcrumbs();\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(key: string, context: { [key: string]: any } | null): this {\n NATIVE.setContext(key, context);\n return super.setContext(key, context);\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n return super.addAttachment(attachment);\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\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C;IAED;;OAEG;IACH,gHAAgH;IACzG,QAAQ,CAAC,GAAW,EAAE,KAAU;QACrC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB,EAAE,cAAuB;QAClE,MAAM,gBAAgB,mCACjB,UAAU,KACb,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,wBAAwB,GACpD,CAAC;QACF,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACvC,OAAO,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,8DAA8D;IACvD,UAAU,CAAC,GAAW,EAAE,OAAsC;QACnE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB;QACzC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;CACF","sourcesContent":["import { Scope } from '@sentry/core';\nimport type { Attachment, Breadcrumb, User } from '@sentry/types';\n\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { NATIVE } from './wrapper';\n\n/**\n * Extends the scope methods to set scope on the Native SDKs\n */\nexport class ReactNativeScope extends Scope {\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n NATIVE.setUser(user);\n return super.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n NATIVE.setTag(key, value);\n return super.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): this {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, tags[key]);\n });\n return super.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setExtras(extras: { [key: string]: any }): this {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return super.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types,@typescript-eslint/no-explicit-any\n public setExtra(key: string, extra: any): this {\n NATIVE.setExtra(key, extra);\n return super.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const mergedBreadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n };\n NATIVE.addBreadcrumb(mergedBreadcrumb);\n return super.addBreadcrumb(mergedBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n NATIVE.clearBreadcrumbs();\n return super.clearBreadcrumbs();\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(key: string, context: { [key: string]: any } | null): this {\n NATIVE.setContext(key, context);\n return super.setContext(key, context);\n }\n\n /**\n * @inheritDoc\n */\n public addAttachment(attachment: Attachment): this {\n return super.addAttachment(attachment);\n }\n\n /**\n * @inheritDoc\n */\n public clearAttachments(): this {\n return super.clearAttachments();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AAA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AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CASlG"}
package/dist/js/sdk.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
- import { getIntegrationsToSetup, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';
2
+ import { getIntegrationsToSetup, hasTracingEnabled, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';
3
+ import { HttpClient } from '@sentry/integrations';
3
4
  import { defaultIntegrations as reactDefaultIntegrations, defaultStackParser, getCurrentHub, makeFetchTransport, } from '@sentry/react';
4
5
  import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
5
6
  import * as React from 'react';
@@ -32,6 +33,7 @@ const DEFAULT_OPTIONS = {
32
33
  sendClientReports: true,
33
34
  maxQueueSize: DEFAULT_BUFFER_SIZE,
34
35
  attachStacktrace: true,
36
+ enableCaptureFailedRequests: false,
35
37
  };
36
38
  /**
37
39
  * Inits the SDK and returns the final options.
@@ -50,9 +52,6 @@ export function init(passedOptions) {
50
52
  : DEFAULT_OPTIONS.enableNative
51
53
  })
52
54
  || makeFetchTransport, transportOptions: Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS.transportOptions), ((_d = passedOptions.transportOptions) !== null && _d !== void 0 ? _d : {})), { bufferSize: maxQueueSize }), maxQueueSize, integrations: [], stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser), beforeBreadcrumb: safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' }), initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }), tracesSampler: safeTracesSampler(passedOptions.tracesSampler) });
53
- // As long as tracing is opt in with either one of these options, then this is how we determine tracing is enabled.
54
- const tracingEnabled = typeof options.tracesSampler !== 'undefined' ||
55
- typeof options.tracesSampleRate !== 'undefined';
56
55
  const defaultIntegrations = passedOptions.defaultIntegrations || [];
57
56
  if (passedOptions.defaultIntegrations === undefined) {
58
57
  defaultIntegrations.push(new ModulesLoader());
@@ -73,10 +72,8 @@ export function init(passedOptions) {
73
72
  if (options.enableNative) {
74
73
  defaultIntegrations.push(new DeviceContext());
75
74
  }
76
- if (tracingEnabled) {
77
- if (options.enableAutoPerformanceTracing) {
78
- defaultIntegrations.push(new ReactNativeTracing());
79
- }
75
+ if (hasTracingEnabled(options) && options.enableAutoPerformanceTracing) {
76
+ defaultIntegrations.push(new ReactNativeTracing());
80
77
  }
81
78
  if (options.attachScreenshot) {
82
79
  defaultIntegrations.push(new Screenshot());
@@ -84,6 +81,9 @@ export function init(passedOptions) {
84
81
  if (options.attachViewHierarchy) {
85
82
  defaultIntegrations.push(new ViewHierarchy());
86
83
  }
84
+ if (options.enableCaptureFailedRequests) {
85
+ defaultIntegrations.push(new HttpClient());
86
+ }
87
87
  }
88
88
  options.integrations = getIntegrationsToSetup({
89
89
  integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),