@sentry/react-native 3.3.5 → 3.4.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 (91) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/js/backend.d.ts +4 -4
  3. package/dist/js/backend.js +10 -10
  4. package/dist/js/backend.js.map +1 -1
  5. package/dist/js/client.d.ts +3 -3
  6. package/dist/js/client.js +3 -3
  7. package/dist/js/client.js.map +1 -1
  8. package/dist/js/definitions.d.ts +2 -2
  9. package/dist/js/definitions.js.map +1 -1
  10. package/dist/js/index.d.ts +12 -12
  11. package/dist/js/index.js +12 -12
  12. package/dist/js/index.js.map +1 -1
  13. package/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  14. package/dist/js/integrations/debugsymbolicator.js +17 -17
  15. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  16. package/dist/js/integrations/devicecontext.d.ts +1 -1
  17. package/dist/js/integrations/devicecontext.js +4 -4
  18. package/dist/js/integrations/devicecontext.js.map +1 -1
  19. package/dist/js/integrations/eventorigin.d.ts +1 -1
  20. package/dist/js/integrations/eventorigin.js +3 -3
  21. package/dist/js/integrations/eventorigin.js.map +1 -1
  22. package/dist/js/integrations/index.d.ts +6 -6
  23. package/dist/js/integrations/index.js +6 -6
  24. package/dist/js/integrations/index.js.map +1 -1
  25. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  26. package/dist/js/integrations/reactnativeerrorhandlers.js +21 -21
  27. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  28. package/dist/js/integrations/release.d.ts +1 -1
  29. package/dist/js/integrations/release.d.ts.map +1 -1
  30. package/dist/js/integrations/release.js +15 -11
  31. package/dist/js/integrations/release.js.map +1 -1
  32. package/dist/js/integrations/sdkinfo.d.ts +1 -1
  33. package/dist/js/integrations/sdkinfo.js +8 -8
  34. package/dist/js/integrations/sdkinfo.js.map +1 -1
  35. package/dist/js/measurements.js +2 -2
  36. package/dist/js/measurements.js.map +1 -1
  37. package/dist/js/options.d.ts +4 -4
  38. package/dist/js/options.js.map +1 -1
  39. package/dist/js/scope.d.ts +2 -2
  40. package/dist/js/scope.js +2 -2
  41. package/dist/js/scope.js.map +1 -1
  42. package/dist/js/sdk.d.ts +2 -2
  43. package/dist/js/sdk.js +28 -28
  44. package/dist/js/sdk.js.map +1 -1
  45. package/dist/js/touchevents.d.ts +2 -2
  46. package/dist/js/touchevents.d.ts.map +1 -1
  47. package/dist/js/touchevents.js +15 -15
  48. package/dist/js/touchevents.js.map +1 -1
  49. package/dist/js/tracing/index.d.ts +7 -7
  50. package/dist/js/tracing/index.js +6 -6
  51. package/dist/js/tracing/index.js.map +1 -1
  52. package/dist/js/tracing/nativeframes.d.ts +2 -2
  53. package/dist/js/tracing/nativeframes.js +6 -6
  54. package/dist/js/tracing/nativeframes.js.map +1 -1
  55. package/dist/js/tracing/reactnativenavigation.d.ts +4 -4
  56. package/dist/js/tracing/reactnativenavigation.js +6 -6
  57. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  58. package/dist/js/tracing/reactnativeprofiler.d.ts +1 -1
  59. package/dist/js/tracing/reactnativeprofiler.js +3 -3
  60. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  61. package/dist/js/tracing/reactnativetracing.d.ts +7 -7
  62. package/dist/js/tracing/reactnativetracing.js +18 -18
  63. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  64. package/dist/js/tracing/reactnavigation.d.ts +3 -3
  65. package/dist/js/tracing/reactnavigation.js +17 -17
  66. package/dist/js/tracing/reactnavigation.js.map +1 -1
  67. package/dist/js/tracing/reactnavigationv4.d.ts +3 -3
  68. package/dist/js/tracing/reactnavigationv4.js +17 -17
  69. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  70. package/dist/js/tracing/routingInstrumentation.d.ts +3 -3
  71. package/dist/js/tracing/routingInstrumentation.js +1 -1
  72. package/dist/js/tracing/routingInstrumentation.js.map +1 -1
  73. package/dist/js/tracing/stalltracking.d.ts +2 -2
  74. package/dist/js/tracing/stalltracking.js +8 -8
  75. package/dist/js/tracing/stalltracking.js.map +1 -1
  76. package/dist/js/tracing/types.d.ts +3 -3
  77. package/dist/js/tracing/types.js.map +1 -1
  78. package/dist/js/tracing/utils.d.ts +2 -2
  79. package/dist/js/tracing/utils.js +6 -6
  80. package/dist/js/tracing/utils.js.map +1 -1
  81. package/dist/js/transports/native.d.ts +2 -2
  82. package/dist/js/transports/native.js +2 -2
  83. package/dist/js/transports/native.js.map +1 -1
  84. package/dist/js/version.d.ts +1 -1
  85. package/dist/js/version.js +2 -2
  86. package/dist/js/version.js.map +1 -1
  87. package/dist/js/wrapper.d.ts +4 -4
  88. package/dist/js/wrapper.js +19 -19
  89. package/dist/js/wrapper.js.map +1 -1
  90. package/package.json +13 -13
  91. package/react-native.config.js +4 -4
@@ -1,8 +1,8 @@
1
1
  import { __awaiter } from "tslib";
2
- import { eventFromException } from "@sentry/browser";
3
- import { getCurrentHub } from "@sentry/core";
4
- import { Severity } from "@sentry/types";
5
- import { addExceptionMechanism, getGlobalObject, logger } from "@sentry/utils";
2
+ import { eventFromException } from '@sentry/browser';
3
+ import { getCurrentHub } from '@sentry/core';
4
+ import { Severity } from '@sentry/types';
5
+ import { addExceptionMechanism, getGlobalObject, logger } from '@sentry/utils';
6
6
  /** ReactNativeErrorHandlers Integration */
7
7
  export class ReactNativeErrorHandlers {
8
8
  /** Constructor */
@@ -43,20 +43,20 @@ export class ReactNativeErrorHandlers {
43
43
  */
44
44
  _polyfillPromise() {
45
45
  /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */
46
- const { polyfillGlobal, } = require("react-native/Libraries/Utilities/PolyfillFunctions");
46
+ const { polyfillGlobal, } = require('react-native/Libraries/Utilities/PolyfillFunctions');
47
47
  // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.
48
- const Promise = require("promise/setimmediate/es6-extensions");
48
+ const Promise = require('promise/setimmediate/es6-extensions');
49
49
  // As of RN 0.67 only done and finally are used
50
- require("promise/setimmediate/done");
51
- require("promise/setimmediate/finally");
52
- polyfillGlobal("Promise", () => Promise);
50
+ require('promise/setimmediate/done');
51
+ require('promise/setimmediate/finally');
52
+ polyfillGlobal('Promise', () => Promise);
53
53
  /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */
54
54
  }
55
55
  /**
56
56
  * Attach the unhandled rejection handler
57
57
  */
58
58
  _attachUnhandledRejectionHandler() {
59
- const tracking = require("promise/setimmediate/rejection-tracking");
59
+ const tracking = require('promise/setimmediate/rejection-tracking');
60
60
  const promiseRejectionTrackingOptions = {
61
61
  onUnhandled: (id, rejection = {}) => {
62
62
  // eslint-disable-next-line no-console
@@ -65,7 +65,7 @@ export class ReactNativeErrorHandlers {
65
65
  onHandled: (id) => {
66
66
  // eslint-disable-next-line no-console
67
67
  console.warn(`Promise Rejection Handled (id: ${id})\n` +
68
- "This means you can ignore any previous messages of the form " +
68
+ 'This means you can ignore any previous messages of the form ' +
69
69
  `"Possible Unhandled Promise Rejection (id: ${id}):"`);
70
70
  },
71
71
  };
@@ -91,18 +91,18 @@ export class ReactNativeErrorHandlers {
91
91
  _checkPromiseAndWarn() {
92
92
  try {
93
93
  // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
94
- const Promise = require("promise/setimmediate/es6-extensions");
94
+ const Promise = require('promise/setimmediate/es6-extensions');
95
95
  const _global = getGlobalObject();
96
96
  if (Promise !== _global.Promise) {
97
- logger.warn("Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.");
97
+ logger.warn('Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.');
98
98
  }
99
99
  else {
100
- logger.log("Unhandled promise rejections will be caught by Sentry.");
100
+ logger.log('Unhandled promise rejections will be caught by Sentry.');
101
101
  }
102
102
  }
103
103
  catch (e) {
104
104
  // Do Nothing
105
- logger.warn("Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.");
105
+ logger.warn('Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.');
106
106
  }
107
107
  }
108
108
  /**
@@ -118,7 +118,7 @@ export class ReactNativeErrorHandlers {
118
118
  const shouldHandleFatal = isFatal && !__DEV__;
119
119
  if (shouldHandleFatal) {
120
120
  if (handlingFatal) {
121
- logger.log("Encountered multiple fatals in a row. The latest:", error);
121
+ logger.log('Encountered multiple fatals in a row. The latest:', error);
122
122
  return;
123
123
  }
124
124
  handlingFatal = true;
@@ -126,20 +126,20 @@ export class ReactNativeErrorHandlers {
126
126
  const currentHub = getCurrentHub();
127
127
  const client = currentHub.getClient();
128
128
  if (!client) {
129
- logger.error("Sentry client is missing, the error event might be lost.", error);
129
+ logger.error('Sentry client is missing, the error event might be lost.', error);
130
130
  // If there is no client something is fishy, anyway we call the default handler
131
131
  defaultHandler(error, isFatal);
132
132
  return;
133
133
  }
134
134
  const options = client.getOptions();
135
- const event = yield eventFromException(options, error, {
135
+ const event = yield eventFromException(error, {
136
136
  originalException: error,
137
- });
137
+ }, options.attachStacktrace);
138
138
  if (isFatal) {
139
139
  event.level = Severity.Fatal;
140
140
  addExceptionMechanism(event, {
141
141
  handled: false,
142
- type: "onerror",
142
+ type: 'onerror',
143
143
  });
144
144
  }
145
145
  currentHub.captureEvent(event);
@@ -160,5 +160,5 @@ export class ReactNativeErrorHandlers {
160
160
  /**
161
161
  * @inheritDoc
162
162
  */
163
- ReactNativeErrorHandlers.id = "ReactNativeErrorHandlers";
163
+ ReactNativeErrorHandlers.id = 'ReactNativeErrorHandlers';
164
164
  //# sourceMappingURL=reactnativeerrorhandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAA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ACJ;gBAED,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAE/B,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;;AA7MD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { eventFromException } from \"@sentry/browser\";\nimport { getCurrentHub } from \"@sentry/core\";\nimport { Integration, Severity } from \"@sentry/types\";\nimport { addExceptionMechanism, getGlobalObject, logger } from \"@sentry/utils\";\n\nimport { ReactNativeClient } from \"../client\";\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// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const global: any;\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 const _global = getGlobalObject<{ Promise: typeof Promise }>();\n\n if (Promise !== _global.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 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\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 event = await eventFromException(options, error, {\n originalException: error,\n });\n\n if (isFatal) {\n event.level = Severity.Fatal;\n\n addExceptionMechanism(event, {\n handled: false,\n type: \"onerror\",\n });\n }\n\n currentHub.captureEvent(event);\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,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAmB/E,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,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE;YACtC,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;gBACpC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aACzB;YAED,IAAI,CAAC,gCAAgC,EAAE,CAAC;YACxC,IAAI,CAAC,oBAAoB,EAAE,CAAC;SAC7B;IACH,CAAC;IACD;;;;;;;;OAQ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BAC/E,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAE/B,OAAO;iBACR;gBAED,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;gBAEpC,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE;oBAC5C,iBAAiB,EAAE,KAAK;iBACzB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;gBAE7B,IAAI,OAAO,EAAE;oBACX,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;oBAE7B,qBAAqB,CAAC,KAAK,EAAE;wBAC3B,OAAO,EAAE,KAAK;wBACd,IAAI,EAAE,SAAS;qBAChB,CAAC,CAAC;iBACJ;gBAED,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAE/B,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;;AA7MD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { eventFromException } from '@sentry/browser';\nimport { getCurrentHub } from '@sentry/core';\nimport { Integration, Severity } from '@sentry/types';\nimport { addExceptionMechanism, getGlobalObject, logger } from '@sentry/utils';\n\nimport { ReactNativeClient } from '../client';\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// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const global: any;\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 const _global = getGlobalObject<{ Promise: typeof Promise }>();\n\n if (Promise !== _global.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 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\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 event = await eventFromException(error, {\n originalException: error,\n }, options.attachStacktrace);\n\n if (isFatal) {\n event.level = Severity.Fatal;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event);\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,4 +1,4 @@
1
- import { Integration } from "@sentry/types";
1
+ import { Integration } from '@sentry/types';
2
2
  /** Release integration responsible to load release from file. */
3
3
  export declare class Release implements Integration {
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAInD,iEAAiE;AACjE,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IACrC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACI,SAAS,IAAI,IAAI;CA0CzB"}
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAInD,iEAAiE;AACjE,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IACrC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACI,SAAS,IAAI,IAAI;CA8CzB"}
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
- import { addGlobalEventProcessor, getCurrentHub } from "@sentry/core";
3
- import { NATIVE } from "../wrapper";
2
+ import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
3
+ import { NATIVE } from '../wrapper';
4
4
  /** Release integration responsible to load release from file. */
5
5
  export class Release {
6
6
  constructor() {
@@ -24,26 +24,30 @@ export class Release {
24
24
  __sentry_release and __sentry_dist is set by the user with setRelease and setDist. If this is used then this is the strongest.
25
25
  Otherwise we check for the release and dist in the options passed on init, as this is stronger than the release/dist from the native build.
26
26
  */
27
- if (typeof ((_b = event.extra) === null || _b === void 0 ? void 0 : _b.__sentry_release) === "string") {
27
+ if (typeof ((_b = event.extra) === null || _b === void 0 ? void 0 : _b.__sentry_release) === 'string') {
28
28
  event.release = `${event.extra.__sentry_release}`;
29
29
  }
30
- else if (typeof (options === null || options === void 0 ? void 0 : options.release) === "string") {
30
+ else if (typeof (options === null || options === void 0 ? void 0 : options.release) === 'string') {
31
31
  event.release = options.release;
32
32
  }
33
- if (typeof ((_c = event.extra) === null || _c === void 0 ? void 0 : _c.__sentry_dist) === "string") {
33
+ if (typeof ((_c = event.extra) === null || _c === void 0 ? void 0 : _c.__sentry_dist) === 'string') {
34
34
  event.dist = `${event.extra.__sentry_dist}`;
35
35
  }
36
- else if (typeof (options === null || options === void 0 ? void 0 : options.dist) === "string") {
36
+ else if (typeof (options === null || options === void 0 ? void 0 : options.dist) === 'string') {
37
37
  event.dist = options.dist;
38
38
  }
39
39
  if (event.release && event.dist) {
40
40
  return event;
41
41
  }
42
42
  try {
43
- const release = yield NATIVE.fetchNativeRelease();
44
- if (release) {
45
- event.release = `${release.id}@${release.version}+${release.build}`;
46
- event.dist = `${release.build}`;
43
+ const nativeRelease = yield NATIVE.fetchNativeRelease();
44
+ if (nativeRelease) {
45
+ if (!event.release) {
46
+ event.release = `${nativeRelease.id}@${nativeRelease.version}+${nativeRelease.build}`;
47
+ }
48
+ if (!event.dist) {
49
+ event.dist = `${nativeRelease.build}`;
50
+ }
47
51
  }
48
52
  }
49
53
  catch (_Oo) {
@@ -56,5 +60,5 @@ export class Release {
56
60
  /**
57
61
  * @inheritDoc
58
62
  */
59
- Release.id = "Release";
63
+ Release.id = 'Release';
60
64
  //# sourceMappingURL=release.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,iEAAiE;AACjE,MAAM,OAAO,OAAO;IAApB;QAKE;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;IA+CnC,CAAC;IA7CC;;OAEG;IACI,SAAS;QACd,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;;YAC7C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;YAED,MAAM,OAAO,SAAG,aAAa,EAAE,CAAC,SAAS,EAAE,0CAAE,UAAU,EAAE,CAAC;YAE1D;;;cAGE;YACF,IAAI,cAAO,KAAK,CAAC,KAAK,0CAAE,gBAAgB,CAAA,KAAK,QAAQ,EAAE;gBACrD,KAAK,CAAC,OAAO,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;aACnD;iBAAM,IAAI,QAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;gBAC/C,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;aACjC;YAED,IAAI,cAAO,KAAK,CAAC,KAAK,0CAAE,aAAa,CAAA,KAAK,QAAQ,EAAE;gBAClD,KAAK,CAAC,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;aAC7C;iBAAM,IAAI,QAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,KAAK,QAAQ,EAAE;gBAC5C,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;aAC3B;YAED,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;gBAC/B,OAAO,KAAK,CAAC;aACd;YAED,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAClD,IAAI,OAAO,EAAE;oBACX,KAAK,CAAC,OAAO,GAAG,GAAG,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;oBACpE,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;iBACjC;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,yCAAyC;aAC1C;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AArDD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from \"@sentry/core\";\nimport { Event, Integration } from \"@sentry/types\";\n\nimport { NATIVE } from \"../wrapper\";\n\n/** Release integration responsible to load release from file. */\nexport class Release implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = \"Release\";\n /**\n * @inheritDoc\n */\n public name: string = Release.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor(async (event: Event) => {\n const self = getCurrentHub().getIntegration(Release);\n if (!self) {\n return event;\n }\n\n const options = getCurrentHub().getClient()?.getOptions();\n\n /*\n __sentry_release and __sentry_dist is set by the user with setRelease and setDist. If this is used then this is the strongest.\n Otherwise we check for the release and dist in the options passed on init, as this is stronger than the release/dist from the native build.\n */\n if (typeof event.extra?.__sentry_release === \"string\") {\n event.release = `${event.extra.__sentry_release}`;\n } else if (typeof options?.release === \"string\") {\n event.release = options.release;\n }\n\n if (typeof event.extra?.__sentry_dist === \"string\") {\n event.dist = `${event.extra.__sentry_dist}`;\n } else if (typeof options?.dist === \"string\") {\n event.dist = options.dist;\n }\n\n if (event.release && event.dist) {\n return event;\n }\n\n try {\n const release = await NATIVE.fetchNativeRelease();\n if (release) {\n event.release = `${release.id}@${release.version}+${release.build}`;\n event.dist = `${release.build}`;\n }\n } catch (_Oo) {\n // Something went wrong, we just continue\n }\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,iEAAiE;AACjE,MAAM,OAAO,OAAO;IAApB;QAKE;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;IAmDnC,CAAC;IAjDC;;OAEG;IACI,SAAS;QACd,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;;YAC7C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;YAED,MAAM,OAAO,SAAG,aAAa,EAAE,CAAC,SAAS,EAAE,0CAAE,UAAU,EAAE,CAAC;YAE1D;;;cAGE;YACF,IAAI,cAAO,KAAK,CAAC,KAAK,0CAAE,gBAAgB,CAAA,KAAK,QAAQ,EAAE;gBACrD,KAAK,CAAC,OAAO,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;aACnD;iBAAM,IAAI,QAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;gBAC/C,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;aACjC;YAED,IAAI,cAAO,KAAK,CAAC,KAAK,0CAAE,aAAa,CAAA,KAAK,QAAQ,EAAE;gBAClD,KAAK,CAAC,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;aAC7C;iBAAM,IAAI,QAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,KAAK,QAAQ,EAAE;gBAC5C,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;aAC3B;YAED,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;gBAC/B,OAAO,KAAK,CAAC;aACd;YAED,IAAI;gBACF,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBACxD,IAAI,aAAa,EAAE;oBACjB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;wBAClB,KAAK,CAAC,OAAO,GAAG,GAAG,aAAa,CAAC,EAAE,IAAI,aAAa,CAAC,OAAO,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;qBACvF;oBACD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;wBACf,KAAK,CAAC,IAAI,GAAG,GAAG,aAAa,CAAC,KAAK,EAAE,CAAC;qBACvC;iBACF;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,yCAAyC;aAC1C;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAzDD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, Integration } from '@sentry/types';\n\nimport { NATIVE } from '../wrapper';\n\n/** Release integration responsible to load release from file. */\nexport class Release implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Release';\n /**\n * @inheritDoc\n */\n public name: string = Release.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor(async (event: Event) => {\n const self = getCurrentHub().getIntegration(Release);\n if (!self) {\n return event;\n }\n\n const options = getCurrentHub().getClient()?.getOptions();\n\n /*\n __sentry_release and __sentry_dist is set by the user with setRelease and setDist. If this is used then this is the strongest.\n Otherwise we check for the release and dist in the options passed on init, as this is stronger than the release/dist from the native build.\n */\n if (typeof event.extra?.__sentry_release === 'string') {\n event.release = `${event.extra.__sentry_release}`;\n } else if (typeof options?.release === 'string') {\n event.release = options.release;\n }\n\n if (typeof event.extra?.__sentry_dist === 'string') {\n event.dist = `${event.extra.__sentry_dist}`;\n } else if (typeof options?.dist === 'string') {\n event.dist = options.dist;\n }\n\n if (event.release && event.dist) {\n return event;\n }\n\n try {\n const nativeRelease = await NATIVE.fetchNativeRelease();\n if (nativeRelease) {\n if (!event.release) {\n event.release = `${nativeRelease.id}@${nativeRelease.version}+${nativeRelease.build}`;\n }\n if (!event.dist) {\n event.dist = `${nativeRelease.build}`;\n }\n }\n } catch (_Oo) {\n // Something went wrong, we just continue\n }\n\n return event;\n });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { EventProcessor, Integration } from "@sentry/types";
1
+ import { EventProcessor, Integration } from '@sentry/types';
2
2
  /** Default SdkInfo instrumentation */
3
3
  export declare class SdkInfo implements Integration {
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { __awaiter } from "tslib";
2
- import { logger } from "@sentry/utils";
3
- import { SDK_NAME, SDK_VERSION } from "../version";
4
- import { NATIVE } from "../wrapper";
2
+ import { logger } from '@sentry/utils';
3
+ import { SDK_NAME, SDK_VERSION } from '../version';
4
+ import { NATIVE } from '../wrapper';
5
5
  /** Default SdkInfo instrumentation */
6
6
  export class SdkInfo {
7
7
  constructor() {
@@ -19,22 +19,22 @@ export class SdkInfo {
19
19
  var _a;
20
20
  // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.
21
21
  // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.
22
- if (NATIVE.platform === "ios" && this._nativeSdkInfo === null) {
22
+ if (NATIVE.platform === 'ios' && this._nativeSdkInfo === null) {
23
23
  try {
24
24
  this._nativeSdkInfo = yield NATIVE.fetchNativeSdkInfo();
25
25
  }
26
26
  catch (e) {
27
27
  // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.
28
- logger.warn("[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:");
28
+ logger.warn('[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:');
29
29
  logger.warn(e);
30
30
  }
31
31
  }
32
- event.platform = event.platform || "javascript";
32
+ event.platform = event.platform || 'javascript';
33
33
  event.sdk = Object.assign(Object.assign({}, ((_a = event.sdk) !== null && _a !== void 0 ? _a : {})), { name: SDK_NAME, packages: [
34
34
  ...((event.sdk && event.sdk.packages) || []),
35
35
  ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),
36
36
  {
37
- name: "npm:@sentry/react-native",
37
+ name: 'npm:@sentry/react-native',
38
38
  version: SDK_VERSION,
39
39
  },
40
40
  ], version: SDK_VERSION });
@@ -45,5 +45,5 @@ export class SdkInfo {
45
45
  /**
46
46
  * @inheritDoc
47
47
  */
48
- SdkInfo.id = "SdkInfo";
48
+ SdkInfo.id = 'SdkInfo';
49
49
  //# sourceMappingURL=sdkinfo.js.map
@@ -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,WAAW,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAA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} from \"@sentry/types\";\nimport { logger } from \"@sentry/utils\";\n\nimport { SDK_NAME, SDK_VERSION } from \"../version\";\nimport { NATIVE } from \"../wrapper\";\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 name: SDK_NAME,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n {\n name: \"npm:@sentry/react-native\",\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\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,WAAW,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,sCAAsC;AACtC,MAAM,OAAO,OAAO;IAApB;QAME;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;QAEzB,mBAAc,GAAmB,IAAI,CAAC;IAuChD,CAAC;IArCC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAO,KAAK,EAAE,EAAE;;YACtC,2GAA2G;YAC3G,+FAA+F;YAC/F,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE;gBAC7D,IAAI;oBACF,IAAI,CAAC,cAAc,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;iBACzD;gBAAC,OAAO,CAAC,EAAE;oBACV,qGAAqG;oBACrG,MAAM,CAAC,IAAI,CACT,sGAAsG,CACvG,CAAC;oBACF,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAChB;aACF;YAED,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,YAAY,CAAC;YAChD,KAAK,CAAC,GAAG,mCACJ,OAAC,KAAK,CAAC,GAAG,mCAAI,EAAE,CAAC,KACpB,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE;oBACR,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC5C,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;oBACzD;wBACE,IAAI,EAAE,0BAA0B;wBAChC,OAAO,EAAE,WAAW;qBACrB;iBACF,EACD,OAAO,EAAE,WAAW,GACrB,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAhDD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import { EventProcessor, Integration, Package } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\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 name: SDK_NAME,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n {\n name: 'npm:@sentry/react-native',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n return event;\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { getCurrentHub, getMainCarrier } from "@sentry/hub";
2
- import { ReactNativeTracing } from "./tracing";
1
+ import { getCurrentHub, getMainCarrier } from '@sentry/hub';
2
+ import { ReactNativeTracing } from './tracing';
3
3
  /**
4
4
  * Adds React Native's extensions. Needs to be called after @sentry/tracing's extension methods are added
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../src/js/measurements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAO,MAAM,aAAa,CAAC;AAIjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,qBAAqB;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AO,iBAAiB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { getCurrentHub, getMainCarrier, Hub } from \"@sentry/hub\";\nimport { Transaction } from \"@sentry/tracing\";\nimport { CustomSamplingContext, TransactionContext } from \"@sentry/types\";\n\nimport { ReactNativeTracing } from \"./tracing\";\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\ntype 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 const transaction: Transaction = originalStartTransaction.apply(this, [\n transactionContext,\n customSamplingContext,\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":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAO,MAAM,aAAa,CAAC;AAIjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,OAAO,CAAC,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;QACpE,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,gBAAgB,EAAE;YAClD,MAAM,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU;iBAC3D,gBAA4C,CAAC;YAEhD;;;cAGE;YACF,MAAM,iBAAiB,GAAG,sBAAsB,CAC9C,wBAAwB,CACzB,CAAC;YAEF,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;SACpE;KACF;AACH,CAAC;AAQD;;GAEG;AACH,MAAM,sBAAsB,GAAG,CAC7B,wBAAkD,EACxB,EAAE;IAC5B;;OAEG;IACH,SAAS,iBAAiB,CAExB,kBAAsC,EACtC,qBAA6C;QAE7C,MAAM,WAAW,GAAgB,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE;YACpE,kBAAkB;YAClB,qBAAqB;SACtB,CAAC,CAAC;QAEH,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 { getCurrentHub, getMainCarrier, Hub } from '@sentry/hub';\nimport { Transaction } from '@sentry/tracing';\nimport { CustomSamplingContext, TransactionContext } from '@sentry/types';\n\nimport { ReactNativeTracing } from './tracing';\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\ntype 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 const transaction: Transaction = originalStartTransaction.apply(this, [\n transactionContext,\n customSamplingContext,\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,7 +1,7 @@
1
- import { BrowserOptions } from "@sentry/react";
2
- import { ProfilerProps } from "@sentry/react/dist/profiler";
3
- import { CaptureContext } from "@sentry/types/dist/scope";
4
- import { TouchEventBoundaryProps } from "./touchevents";
1
+ import { BrowserOptions } from '@sentry/react';
2
+ import { ProfilerProps } from '@sentry/react/dist/profiler';
3
+ import { CaptureContext } from '@sentry/types/dist/scope';
4
+ import { TouchEventBoundaryProps } from './touchevents';
5
5
  /**
6
6
  * Configuration options for the Sentry ReactNative SDK.
7
7
  * @see ReactNativeFrontend for more information.
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import { BrowserOptions } from \"@sentry/react\";\nimport { ProfilerProps } from \"@sentry/react/dist/profiler\";\nimport { CaptureContext } from \"@sentry/types/dist/scope\";\n\nimport { TouchEventBoundaryProps } from \"./touchevents\";\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions extends BrowserOptions {\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. */\n enableAutoPerformanceTracking?: 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 * @default true\n * */\n enableOutOfMemoryTracking?: 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 * @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\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 { BrowserOptions } from '@sentry/react';\nimport { ProfilerProps } from '@sentry/react/dist/profiler';\nimport { CaptureContext } from '@sentry/types/dist/scope';\n\nimport { TouchEventBoundaryProps } from './touchevents';\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions extends BrowserOptions {\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. */\n enableAutoPerformanceTracking?: 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 * @default true\n * */\n enableOutOfMemoryTracking?: 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 * @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\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,5 +1,5 @@
1
- import { Scope } from "@sentry/hub";
2
- import { Breadcrumb, User } from "@sentry/types";
1
+ import { Scope } from '@sentry/hub';
2
+ import { Breadcrumb, User } from '@sentry/types';
3
3
  /**
4
4
  * Extends the scope methods to set scope on the Native SDKs
5
5
  */
package/dist/js/scope.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Scope } from "@sentry/hub";
2
- import { NATIVE } from "./wrapper";
1
+ import { Scope } from '@sentry/hub';
2
+ import { NATIVE } from './wrapper';
3
3
  /**
4
4
  * Extends the scope methods to set scope on the Native SDKs
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAA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,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,UAAsB,EAAE,cAAuB;QAClE,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,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;CACF","sourcesContent":["import { Scope } from \"@sentry/hub\";\nimport { Breadcrumb, User } from \"@sentry/types\";\n\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 NATIVE.addBreadcrumb(breadcrumb);\n return super.addBreadcrumb(breadcrumb, 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"]}
1
+ {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/js/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,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,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,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;CACF","sourcesContent":["import { Scope } from '@sentry/hub';\nimport { Breadcrumb, User } from '@sentry/types';\n\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 NATIVE.addBreadcrumb(breadcrumb);\n return super.addBreadcrumb(breadcrumb, 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"]}
package/dist/js/sdk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import { ReactNativeOptions, ReactNativeWrapperOptions } from "./options";
1
+ import * as React from 'react';
2
+ import { ReactNativeOptions, ReactNativeWrapperOptions } from './options';
3
3
  /**
4
4
  * Inits the SDK and returns the final options.
5
5
  */
package/dist/js/sdk.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { __awaiter } from "tslib";
2
- import { initAndBind, setExtra } from "@sentry/core";
3
- import { Hub, makeMain } from "@sentry/hub";
4
- import { RewriteFrames } from "@sentry/integrations";
5
- import { defaultIntegrations, getCurrentHub } from "@sentry/react";
6
- import { getGlobalObject, logger } from "@sentry/utils";
7
- import * as React from "react";
8
- import { ReactNativeClient } from "./client";
9
- import { DebugSymbolicator, DeviceContext, EventOrigin, ReactNativeErrorHandlers, Release, SdkInfo, } from "./integrations";
10
- import { ReactNativeScope } from "./scope";
11
- import { TouchEventBoundary } from "./touchevents";
12
- import { ReactNativeProfiler, ReactNativeTracing } from "./tracing";
2
+ import { initAndBind, setExtra } from '@sentry/core';
3
+ import { Hub, makeMain } from '@sentry/hub';
4
+ import { RewriteFrames } from '@sentry/integrations';
5
+ import { defaultIntegrations, getCurrentHub } from '@sentry/react';
6
+ import { getGlobalObject, logger } from '@sentry/utils';
7
+ import * as React from 'react';
8
+ import { ReactNativeClient } from './client';
9
+ import { DebugSymbolicator, DeviceContext, EventOrigin, ReactNativeErrorHandlers, Release, SdkInfo, } from './integrations';
10
+ import { ReactNativeScope } from './scope';
11
+ import { TouchEventBoundary } from './touchevents';
12
+ import { ReactNativeProfiler, ReactNativeTracing } from './tracing';
13
13
  const IGNORED_DEFAULT_INTEGRATIONS = [
14
- "GlobalHandlers",
15
- "TryCatch",
14
+ 'GlobalHandlers',
15
+ 'TryCatch',
16
16
  ];
17
17
  const DEFAULT_OPTIONS = {
18
18
  enableNative: true,
@@ -31,8 +31,8 @@ export function init(passedOptions) {
31
31
  makeMain(reactNativeHub);
32
32
  const options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), passedOptions);
33
33
  // As long as tracing is opt in with either one of these options, then this is how we determine tracing is enabled.
34
- const tracingEnabled = typeof options.tracesSampler !== "undefined" ||
35
- typeof options.tracesSampleRate !== "undefined";
34
+ const tracingEnabled = typeof options.tracesSampler !== 'undefined' ||
35
+ typeof options.tracesSampleRate !== 'undefined';
36
36
  if (options.defaultIntegrations === undefined) {
37
37
  options.defaultIntegrations = [
38
38
  new ReactNativeErrorHandlers({
@@ -50,15 +50,15 @@ export function init(passedOptions) {
50
50
  iteratee: (frame) => {
51
51
  if (frame.filename) {
52
52
  frame.filename = frame.filename
53
- .replace(/^file:\/\//, "")
54
- .replace(/^address at /, "")
55
- .replace(/^.*\/[^.]+(\.app|CodePush|.*(?=\/))/, "");
56
- if (frame.filename !== "[native code]" &&
57
- frame.filename !== "native") {
58
- const appPrefix = "app://";
53
+ .replace(/^file:\/\//, '')
54
+ .replace(/^address at /, '')
55
+ .replace(/^.*\/[^.]+(\.app|CodePush|.*(?=\/))/, '');
56
+ if (frame.filename !== '[native code]' &&
57
+ frame.filename !== 'native') {
58
+ const appPrefix = 'app://';
59
59
  // We always want to have a triple slash
60
60
  frame.filename =
61
- frame.filename.indexOf("/") === 0
61
+ frame.filename.indexOf('/') === 0
62
62
  ? `${appPrefix}${frame.filename}`
63
63
  : `${appPrefix}/${frame.filename}`;
64
64
  }
@@ -78,7 +78,7 @@ export function init(passedOptions) {
78
78
  initAndBind(ReactNativeClient, options);
79
79
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any
80
80
  if (getGlobalObject().HermesInternal) {
81
- getCurrentHub().setTag("hermes", "true");
81
+ getCurrentHub().setTag('hermes', 'true');
82
82
  }
83
83
  }
84
84
  /**
@@ -90,7 +90,7 @@ export function wrap(RootComponent, options) {
90
90
  if (tracingIntegration) {
91
91
  tracingIntegration.useAppStartWithProfiler = true;
92
92
  }
93
- const profilerProps = Object.assign(Object.assign({}, ((_a = options === null || options === void 0 ? void 0 : options.profilerProps) !== null && _a !== void 0 ? _a : {})), { name: (_b = RootComponent.displayName) !== null && _b !== void 0 ? _b : "Root" });
93
+ const profilerProps = Object.assign(Object.assign({}, ((_a = options === null || options === void 0 ? void 0 : options.profilerProps) !== null && _a !== void 0 ? _a : {})), { name: (_b = RootComponent.displayName) !== null && _b !== void 0 ? _b : 'Root' });
94
94
  const RootApp = (appProps) => {
95
95
  var _a;
96
96
  return (<TouchEventBoundary {...((_a = options === null || options === void 0 ? void 0 : options.touchEventBoundaryProps) !== null && _a !== void 0 ? _a : {})}>
@@ -107,7 +107,7 @@ export function wrap(RootComponent, options) {
107
107
  * @deprecated
108
108
  */
109
109
  export function setRelease(release) {
110
- setExtra("__sentry_release", release);
110
+ setExtra('__sentry_release', release);
111
111
  }
112
112
  /**
113
113
  * Deprecated. Sets the dist on the event.
@@ -115,7 +115,7 @@ export function setRelease(release) {
115
115
  * @deprecated
116
116
  */
117
117
  export function setDist(dist) {
118
- setExtra("__sentry_dist", dist);
118
+ setExtra('__sentry_dist', dist);
119
119
  }
120
120
  /**
121
121
  * If native client is available it will trigger a native crash.
@@ -142,7 +142,7 @@ export function flush() {
142
142
  // eslint-disable-next-line no-empty
143
143
  }
144
144
  catch (_) { }
145
- logger.error("Failed to flush the event queue.");
145
+ logger.error('Failed to flush the event queue.');
146
146
  return false;
147
147
  });
148
148
  }
@@ -158,7 +158,7 @@ export function close() {
158
158
  }
159
159
  }
160
160
  catch (e) {
161
- logger.error("Failed to close the SDK");
161
+ logger.error('Failed to close the SDK');
162
162
  }
163
163
  });
164
164
  }