@sentry/react-native 6.13.1 → 6.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +10 -0
  3. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  4. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +5 -0
  5. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +5 -0
  6. package/dist/js/NativeRNSentry.d.ts +1 -0
  7. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  8. package/dist/js/NativeRNSentry.js.map +1 -1
  9. package/dist/js/client.d.ts +12 -0
  10. package/dist/js/client.d.ts.map +1 -1
  11. package/dist/js/client.js +19 -0
  12. package/dist/js/client.js.map +1 -1
  13. package/dist/js/feedback/FeedbackButton.d.ts +23 -0
  14. package/dist/js/feedback/FeedbackButton.d.ts.map +1 -0
  15. package/dist/js/feedback/FeedbackButton.js +51 -0
  16. package/dist/js/feedback/FeedbackButton.js.map +1 -0
  17. package/dist/js/feedback/FeedbackWidget.d.ts +12 -1
  18. package/dist/js/feedback/FeedbackWidget.d.ts.map +1 -1
  19. package/dist/js/feedback/FeedbackWidget.js +78 -13
  20. package/dist/js/feedback/FeedbackWidget.js.map +1 -1
  21. package/dist/js/feedback/FeedbackWidget.styles.d.ts +6 -3
  22. package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +1 -1
  23. package/dist/js/feedback/FeedbackWidget.styles.js +155 -106
  24. package/dist/js/feedback/FeedbackWidget.styles.js.map +1 -1
  25. package/dist/js/feedback/FeedbackWidget.theme.d.ts +37 -0
  26. package/dist/js/feedback/FeedbackWidget.theme.d.ts.map +1 -0
  27. package/dist/js/feedback/FeedbackWidget.theme.js +31 -0
  28. package/dist/js/feedback/FeedbackWidget.theme.js.map +1 -0
  29. package/dist/js/feedback/FeedbackWidget.types.d.ts +71 -2
  30. package/dist/js/feedback/FeedbackWidget.types.d.ts.map +1 -1
  31. package/dist/js/feedback/FeedbackWidget.types.js.map +1 -1
  32. package/dist/js/feedback/FeedbackWidgetManager.d.ts +43 -23
  33. package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +1 -1
  34. package/dist/js/feedback/FeedbackWidgetManager.js +62 -138
  35. package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
  36. package/dist/js/feedback/FeedbackWidgetProvider.d.ts +48 -0
  37. package/dist/js/feedback/FeedbackWidgetProvider.d.ts.map +1 -0
  38. package/dist/js/feedback/FeedbackWidgetProvider.js +177 -0
  39. package/dist/js/feedback/FeedbackWidgetProvider.js.map +1 -0
  40. package/dist/js/feedback/ScreenshotButton.d.ts +25 -0
  41. package/dist/js/feedback/ScreenshotButton.d.ts.map +1 -0
  42. package/dist/js/feedback/ScreenshotButton.js +80 -0
  43. package/dist/js/feedback/ScreenshotButton.js.map +1 -0
  44. package/dist/js/feedback/defaults.d.ts +3 -1
  45. package/dist/js/feedback/defaults.d.ts.map +1 -1
  46. package/dist/js/feedback/defaults.js +15 -0
  47. package/dist/js/feedback/defaults.js.map +1 -1
  48. package/dist/js/feedback/icons.d.ts +30 -0
  49. package/dist/js/feedback/icons.d.ts.map +1 -0
  50. package/dist/js/feedback/icons.js +30 -0
  51. package/dist/js/feedback/icons.js.map +1 -0
  52. package/dist/js/feedback/integration.d.ts +19 -2
  53. package/dist/js/feedback/integration.d.ts.map +1 -1
  54. package/dist/js/feedback/integration.js +58 -3
  55. package/dist/js/feedback/integration.js.map +1 -1
  56. package/dist/js/feedback/lazy.d.ts +10 -0
  57. package/dist/js/feedback/lazy.d.ts.map +1 -1
  58. package/dist/js/feedback/lazy.js +24 -0
  59. package/dist/js/feedback/lazy.js.map +1 -1
  60. package/dist/js/index.d.ts +3 -2
  61. package/dist/js/index.d.ts.map +1 -1
  62. package/dist/js/index.js +2 -1
  63. package/dist/js/index.js.map +1 -1
  64. package/dist/js/integrations/expocontext.d.ts +18 -0
  65. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  66. package/dist/js/integrations/expocontext.js +20 -12
  67. package/dist/js/integrations/expocontext.js.map +1 -1
  68. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  69. package/dist/js/integrations/reactnativeerrorhandlers.js +65 -31
  70. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  71. package/dist/js/replay/mobilereplay.d.ts +14 -1
  72. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  73. package/dist/js/replay/mobilereplay.js +9 -1
  74. package/dist/js/replay/mobilereplay.js.map +1 -1
  75. package/dist/js/sdk.js +1 -1
  76. package/dist/js/sdk.js.map +1 -1
  77. package/dist/js/tracing/reactnativetracing.d.ts +4 -1
  78. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  79. package/dist/js/tracing/reactnativetracing.js +5 -1
  80. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  81. package/dist/js/utils/worldwide.d.ts +7 -0
  82. package/dist/js/utils/worldwide.d.ts.map +1 -1
  83. package/dist/js/utils/worldwide.js.map +1 -1
  84. package/dist/js/version.d.ts +1 -1
  85. package/dist/js/version.js +1 -1
  86. package/dist/js/version.js.map +1 -1
  87. package/dist/js/wrapper.d.ts +1 -0
  88. package/dist/js/wrapper.d.ts.map +1 -1
  89. package/dist/js/wrapper.js +17 -1
  90. package/dist/js/wrapper.js.map +1 -1
  91. package/ios/RNSentry.mm +24 -0
  92. package/ios/RNSentryOnDrawReporter.m +4 -0
  93. package/ios/RNSentryReplay.mm +1 -2
  94. package/ios/RNSentryVersion.m +1 -1
  95. package/package.json +6 -6
  96. package/src/js/NativeRNSentry.ts +1 -0
  97. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
  98. package/ts3.8/dist/js/client.d.ts +12 -0
  99. package/ts3.8/dist/js/feedback/FeedbackButton.d.ts +23 -0
  100. package/ts3.8/dist/js/feedback/FeedbackWidget.d.ts +12 -1
  101. package/ts3.8/dist/js/feedback/FeedbackWidget.styles.d.ts +6 -3
  102. package/ts3.8/dist/js/feedback/FeedbackWidget.theme.d.ts +37 -0
  103. package/ts3.8/dist/js/feedback/FeedbackWidget.types.d.ts +71 -2
  104. package/ts3.8/dist/js/feedback/FeedbackWidgetManager.d.ts +43 -23
  105. package/ts3.8/dist/js/feedback/FeedbackWidgetProvider.d.ts +48 -0
  106. package/ts3.8/dist/js/feedback/ScreenshotButton.d.ts +25 -0
  107. package/ts3.8/dist/js/feedback/defaults.d.ts +3 -1
  108. package/ts3.8/dist/js/feedback/icons.d.ts +30 -0
  109. package/ts3.8/dist/js/feedback/integration.d.ts +19 -2
  110. package/ts3.8/dist/js/feedback/lazy.d.ts +10 -0
  111. package/ts3.8/dist/js/index.d.ts +3 -2
  112. package/ts3.8/dist/js/integrations/expocontext.d.ts +18 -0
  113. package/ts3.8/dist/js/replay/mobilereplay.d.ts +14 -1
  114. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +4 -1
  115. package/ts3.8/dist/js/utils/worldwide.d.ts +7 -0
  116. package/ts3.8/dist/js/version.d.ts +1 -1
  117. package/ts3.8/dist/js/wrapper.d.ts +1 -0
@@ -1,10 +1,27 @@
1
1
  import { type Integration } from '@sentry/core';
2
- import type { FeedbackWidgetProps } from './FeedbackWidget.types';
2
+ import type { FeedbackWidgetTheme } from './FeedbackWidget.theme';
3
+ import type { FeedbackButtonProps, FeedbackWidgetProps, ScreenshotButtonProps } from './FeedbackWidget.types';
3
4
  export declare const MOBILE_FEEDBACK_INTEGRATION_NAME = "MobileFeedback";
4
5
  type FeedbackIntegration = Integration & {
5
6
  options: Partial<FeedbackWidgetProps>;
7
+ buttonOptions: Partial<FeedbackButtonProps>;
8
+ screenshotButtonOptions: Partial<ScreenshotButtonProps>;
9
+ colorScheme?: 'system' | 'light' | 'dark';
10
+ themeLight: Partial<FeedbackWidgetTheme>;
11
+ themeDark: Partial<FeedbackWidgetTheme>;
6
12
  };
7
- export declare const feedbackIntegration: (initOptions?: FeedbackWidgetProps) => FeedbackIntegration;
13
+ export declare const feedbackIntegration: (initOptions?: FeedbackWidgetProps & {
14
+ buttonOptions?: FeedbackButtonProps;
15
+ screenshotButtonOptions?: ScreenshotButtonProps;
16
+ colorScheme?: 'system' | 'light' | 'dark';
17
+ themeLight?: Partial<FeedbackWidgetTheme>;
18
+ themeDark?: Partial<FeedbackWidgetTheme>;
19
+ }) => FeedbackIntegration;
8
20
  export declare const getFeedbackOptions: () => Partial<FeedbackWidgetProps>;
21
+ export declare const getFeedbackButtonOptions: () => Partial<FeedbackButtonProps>;
22
+ export declare const getScreenshotButtonOptions: () => Partial<ScreenshotButtonProps>;
23
+ export declare const getColorScheme: () => 'system' | 'light' | 'dark';
24
+ export declare const getFeedbackLightTheme: () => Partial<FeedbackWidgetTheme>;
25
+ export declare const getFeedbackDarkTheme: () => Partial<FeedbackWidgetTheme>;
9
26
  export {};
10
27
  //# sourceMappingURL=integration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,gCAAgC,mBAAmB,CAAC;AAEjE,KAAK,mBAAmB,GAAG,WAAW,GAAG;IACvC,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,mBAAmB,iBAAiB,mBAAmB,KAAQ,mBAK3E,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,QAAQ,mBAAmB,CAShE,CAAC"}
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EA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AC"}
@@ -1,17 +1,72 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { getClient } from '@sentry/core';
2
13
  export const MOBILE_FEEDBACK_INTEGRATION_NAME = 'MobileFeedback';
3
14
  export const feedbackIntegration = (initOptions = {}) => {
15
+ const { buttonOptions, screenshotButtonOptions, colorScheme, themeLight: lightTheme, themeDark: darkTheme } = initOptions, widgetOptions = __rest(initOptions, ["buttonOptions", "screenshotButtonOptions", "colorScheme", "themeLight", "themeDark"]);
4
16
  return {
5
17
  name: MOBILE_FEEDBACK_INTEGRATION_NAME,
6
- options: initOptions,
18
+ options: widgetOptions,
19
+ buttonOptions: buttonOptions || {},
20
+ screenshotButtonOptions: screenshotButtonOptions || {},
21
+ colorScheme: colorScheme || 'system',
22
+ themeLight: lightTheme || {},
23
+ themeDark: darkTheme || {},
7
24
  };
8
25
  };
9
- export const getFeedbackOptions = () => {
26
+ const _getClientIntegration = () => {
10
27
  var _a;
11
- const integration = (_a = getClient()) === null || _a === void 0 ? void 0 : _a.getIntegrationByName(MOBILE_FEEDBACK_INTEGRATION_NAME);
28
+ return (_a = getClient()) === null || _a === void 0 ? void 0 : _a.getIntegrationByName(MOBILE_FEEDBACK_INTEGRATION_NAME);
29
+ };
30
+ export const getFeedbackOptions = () => {
31
+ const integration = _getClientIntegration();
12
32
  if (!integration) {
13
33
  return {};
14
34
  }
15
35
  return integration.options;
16
36
  };
37
+ export const getFeedbackButtonOptions = () => {
38
+ const integration = _getClientIntegration();
39
+ if (!integration) {
40
+ return {};
41
+ }
42
+ return integration.buttonOptions;
43
+ };
44
+ export const getScreenshotButtonOptions = () => {
45
+ const integration = _getClientIntegration();
46
+ if (!integration) {
47
+ return {};
48
+ }
49
+ return integration.screenshotButtonOptions;
50
+ };
51
+ export const getColorScheme = () => {
52
+ const integration = _getClientIntegration();
53
+ if (!integration) {
54
+ return 'system';
55
+ }
56
+ return integration.colorScheme;
57
+ };
58
+ export const getFeedbackLightTheme = () => {
59
+ const integration = _getClientIntegration();
60
+ if (!integration) {
61
+ return {};
62
+ }
63
+ return integration.themeLight;
64
+ };
65
+ export const getFeedbackDarkTheme = () => {
66
+ const integration = _getClientIntegration();
67
+ if (!integration) {
68
+ return {};
69
+ }
70
+ return integration.themeDark;
71
+ };
17
72
  //# sourceMappingURL=integration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/feedback/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAI3D,MAAM,CAAC,MAAM,gCAAgC,GAAG,gBAAgB,CAAC;AAMjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,cAAmC,EAAE,EAAuB,EAAE;IAChG,OAAO;QACL,IAAI,EAAE,gCAAgC;QACtC,OAAO,EAAE,WAAW;KACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAiC,EAAE;;IACnE,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CACnD,gCAAgC,CACjC,CAAC;IACF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["import { type Integration, getClient } from '@sentry/core';\n\nimport type { FeedbackWidgetProps } from './FeedbackWidget.types';\n\nexport const MOBILE_FEEDBACK_INTEGRATION_NAME = 'MobileFeedback';\n\ntype FeedbackIntegration = Integration & {\n options: Partial<FeedbackWidgetProps>;\n};\n\nexport const feedbackIntegration = (initOptions: FeedbackWidgetProps = {}): FeedbackIntegration => {\n return {\n name: MOBILE_FEEDBACK_INTEGRATION_NAME,\n options: initOptions,\n };\n};\n\nexport const getFeedbackOptions = (): Partial<FeedbackWidgetProps> => {\n const integration = getClient()?.getIntegrationByName<ReturnType<typeof feedbackIntegration>>(\n MOBILE_FEEDBACK_INTEGRATION_NAME,\n );\n if (!integration) {\n return {};\n }\n\n return integration.options;\n};\n"]}
1
+ {"version":3,"file":"integration.js","sourceRoot":"","sources":["../../../src/js/feedback/integration.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAK3D,MAAM,CAAC,MAAM,gCAAgC,GAAG,gBAAgB,CAAC;AAWjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,cAMI,EAAE,EACe,EAAE;IACvB,MAAM,EACJ,aAAa,EACb,uBAAuB,EACvB,WAAW,EACX,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,KAElB,WAAW,EADV,aAAa,UACd,WAAW,EAPT,sFAOL,CAAc,CAAC;IAEhB,OAAO;QACL,IAAI,EAAE,gCAAgC;QACtC,OAAO,EAAE,aAAa;QACtB,aAAa,EAAE,aAAa,IAAI,EAAE;QAClC,uBAAuB,EAAE,uBAAuB,IAAI,EAAE;QACtD,WAAW,EAAE,WAAW,IAAI,QAAQ;QACpC,UAAU,EAAE,UAAU,IAAI,EAAE;QAC5B,SAAS,EAAE,SAAS,IAAI,EAAE;KAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,GAAwB,EAAE;;IACtD,OAAO,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAyC,gCAAgC,CAAC,CAAC;AACrH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAiC,EAAE;IACnE,MAAM,WAAW,GAAG,qB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edbackWidgetTheme } from './FeedbackWidget.theme';\nimport type { FeedbackButtonProps, FeedbackWidgetProps, ScreenshotButtonProps } from './FeedbackWidget.types';\n\nexport const MOBILE_FEEDBACK_INTEGRATION_NAME = 'MobileFeedback';\n\ntype FeedbackIntegration = Integration & {\n options: Partial<FeedbackWidgetProps>;\n buttonOptions: Partial<FeedbackButtonProps>;\n screenshotButtonOptions: Partial<ScreenshotButtonProps>;\n colorScheme?: 'system' | 'light' | 'dark';\n themeLight: Partial<FeedbackWidgetTheme>;\n themeDark: Partial<FeedbackWidgetTheme>;\n};\n\nexport const feedbackIntegration = (\n initOptions: FeedbackWidgetProps & {\n buttonOptions?: FeedbackButtonProps;\n screenshotButtonOptions?: ScreenshotButtonProps;\n colorScheme?: 'system' | 'light' | 'dark';\n themeLight?: Partial<FeedbackWidgetTheme>;\n themeDark?: Partial<FeedbackWidgetTheme>;\n } = {},\n): FeedbackIntegration => {\n const {\n buttonOptions,\n screenshotButtonOptions,\n colorScheme,\n themeLight: lightTheme,\n themeDark: darkTheme,\n ...widgetOptions\n } = initOptions;\n\n return {\n name: MOBILE_FEEDBACK_INTEGRATION_NAME,\n options: widgetOptions,\n buttonOptions: buttonOptions || {},\n screenshotButtonOptions: screenshotButtonOptions || {},\n colorScheme: colorScheme || 'system',\n themeLight: lightTheme || {},\n themeDark: darkTheme || {},\n };\n};\n\nconst _getClientIntegration = (): FeedbackIntegration => {\n return getClient()?.getIntegrationByName<ReturnType<typeof feedbackIntegration>>(MOBILE_FEEDBACK_INTEGRATION_NAME);\n};\n\nexport const getFeedbackOptions = (): Partial<FeedbackWidgetProps> => {\n const integration = _getClientIntegration();\n if (!integration) {\n return {};\n }\n\n return integration.options;\n};\n\nexport const getFeedbackButtonOptions = (): Partial<FeedbackButtonProps> => {\n const integration = _getClientIntegration();\n if (!integration) {\n return {};\n }\n\n return integration.buttonOptions;\n};\n\nexport const getScreenshotButtonOptions = (): Partial<ScreenshotButtonProps> => {\n const integration = _getClientIntegration();\n if (!integration) {\n return {};\n }\n\n return integration.screenshotButtonOptions;\n};\n\nexport const getColorScheme = (): 'system' | 'light' | 'dark' => {\n const integration = _getClientIntegration();\n if (!integration) {\n return 'system';\n }\n\n return integration.colorScheme;\n};\n\nexport const getFeedbackLightTheme = (): Partial<FeedbackWidgetTheme> => {\n const integration = _getClientIntegration();\n if (!integration) {\n return {};\n }\n\n return integration.themeLight;\n};\n\nexport const getFeedbackDarkTheme = (): Partial<FeedbackWidgetTheme> => {\n const integration = _getClientIntegration();\n if (!integration) {\n return {};\n }\n\n return integration.themeDark;\n};\n"]}
@@ -7,4 +7,14 @@ export declare const AUTO_INJECT_FEEDBACK_INTEGRATION_NAME = "AutoInjectMobileFe
7
7
  * Lazy loads the auto inject feedback integration if it is not already loaded.
8
8
  */
9
9
  export declare function lazyLoadAutoInjectFeedbackIntegration(): void;
10
+ export declare const AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME = "AutoInjectMobileFeedbackButton";
11
+ /**
12
+ * Lazy loads the auto inject feedback button integration if it is not already loaded.
13
+ */
14
+ export declare function lazyLoadAutoInjectFeedbackButtonIntegration(): void;
15
+ export declare const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = "AutoInjectMobileScreenshotButton";
16
+ /**
17
+ * Lazy loads the auto inject screenshot button integration if it is not already loaded.
18
+ */
19
+ export declare function lazyLoadAutoInjectScreenshotButtonIntegration(): void;
10
20
  //# sourceMappingURL=lazy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/lazy.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAMlD;AAED,eAAO,MAAM,qCAAqC,6BAA6B,CAAC;AAEhF;;GAEG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAM5D"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/js/feedback/lazy.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAMlD;AAED,eAAO,MAAM,qCAAqC,6BAA6B,CAAC;AAEhF;;GAEG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAM5D;AAED,eAAO,MAAM,4CAA4C,mCAAmC,CAAC;AAE7F;;GAEG;AACH,wBAAgB,2CAA2C,IAAI,IAAI,CAMlE;AAED,eAAO,MAAM,8CAA8C,qCAAqC,CAAC;AAEjG;;GAEG;AACH,wBAAgB,6CAA6C,IAAI,IAAI,CAMpE"}
@@ -23,4 +23,28 @@ export function lazyLoadAutoInjectFeedbackIntegration() {
23
23
  (_b = getClient()) === null || _b === void 0 ? void 0 : _b.addIntegration({ name: AUTO_INJECT_FEEDBACK_INTEGRATION_NAME });
24
24
  }
25
25
  }
26
+ export const AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileFeedbackButton';
27
+ /**
28
+ * Lazy loads the auto inject feedback button integration if it is not already loaded.
29
+ */
30
+ export function lazyLoadAutoInjectFeedbackButtonIntegration() {
31
+ var _a, _b;
32
+ const integration = (_a = getClient()) === null || _a === void 0 ? void 0 : _a.getIntegrationByName(AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME);
33
+ if (!integration) {
34
+ // Lazy load the integration to track usage
35
+ (_b = getClient()) === null || _b === void 0 ? void 0 : _b.addIntegration({ name: AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME });
36
+ }
37
+ }
38
+ export const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileScreenshotButton';
39
+ /**
40
+ * Lazy loads the auto inject screenshot button integration if it is not already loaded.
41
+ */
42
+ export function lazyLoadAutoInjectScreenshotButtonIntegration() {
43
+ var _a, _b;
44
+ const integration = (_a = getClient()) === null || _a === void 0 ? void 0 : _a.getIntegrationByName(AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME);
45
+ if (!integration) {
46
+ // Lazy load the integration to track usage
47
+ (_b = getClient()) === null || _b === void 0 ? void 0 : _b.addIntegration({ name: AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME });
48
+ }
49
+ }
26
50
  //# sourceMappingURL=lazy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.js","sourceRoot":"","sources":["../../../src/js/feedback/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAEtF;;GAEG;AACH,MAAM,UAAU,2BAA2B;;IACzC,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;IACxF,IAAI,CAAC,WAAW,EAAE;QAChB,2CAA2C;QAC3C,MAAA,SAAS,EAAE,0CAAE,cAAc,CAAC,mBAAmB,EAAE,CAAC,CAAC;KACpD;AACH,CAAC;AAED,MAAM,CAAC,MAAM,qCAAqC,GAAG,0BAA0B,CAAC;AAEhF;;GAEG;AACH,MAAM,UAAU,qCAAqC;;IACnD,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAC,qCAAqC,CAAC,CAAC;IAC7F,IAAI,CAAC,WAAW,EAAE;QAChB,2CAA2C;QAC3C,MAAA,SAAS,EAAE,0CAAE,cAAc,CAAC,EAAE,IAAI,EAAE,qCAAqC,EAAE,CAAC,CAAC;KAC9E;AACH,CAAC","sourcesContent":["import { getClient } from '@sentry/core';\n\nimport { feedbackIntegration, MOBILE_FEEDBACK_INTEGRATION_NAME } from './integration';\n\n/**\n * Lazy loads the feedback integration if it is not already loaded.\n */\nexport function lazyLoadFeedbackIntegration(): void {\n const integration = getClient()?.getIntegrationByName(MOBILE_FEEDBACK_INTEGRATION_NAME);\n if (!integration) {\n // Lazy load the integration to track usage\n getClient()?.addIntegration(feedbackIntegration());\n }\n}\n\nexport const AUTO_INJECT_FEEDBACK_INTEGRATION_NAME = 'AutoInjectMobileFeedback';\n\n/**\n * Lazy loads the auto inject feedback integration if it is not already loaded.\n */\nexport function lazyLoadAutoInjectFeedbackIntegration(): void {\n const integration = getClient()?.getIntegrationByName(AUTO_INJECT_FEEDBACK_INTEGRATION_NAME);\n if (!integration) {\n // Lazy load the integration to track usage\n getClient()?.addIntegration({ name: AUTO_INJECT_FEEDBACK_INTEGRATION_NAME });\n }\n}\n"]}
1
+ {"version":3,"file":"lazy.js","sourceRoot":"","sources":["../../../src/js/feedback/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAEtF;;GAEG;AACH,MAAM,UAAU,2BAA2B;;IACzC,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;IACxF,IAAI,CAAC,WAAW,EAAE;QAChB,2CAA2C;QAC3C,MAAA,SAAS,EAAE,0CAAE,cAAc,CAAC,mBAAmB,EAAE,CAAC,CAAC;KACpD;AACH,CAAC;AAED,MAAM,CAAC,MAAM,qCAAqC,GAAG,0BAA0B,CAAC;AAEhF;;GAEG;AACH,MAAM,UAAU,qCAAqC;;IACnD,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAC,qCAAqC,CAAC,CAAC;IAC7F,IAAI,CAAC,WAAW,EAAE;QAChB,2CAA2C;QAC3C,MAAA,SAAS,EAAE,0CAAE,cAAc,CAAC,EAAE,IAAI,EAAE,qCAAqC,EAAE,CAAC,CAAC;KAC9E;AACH,CAAC;AAED,MAAM,CAAC,MAAM,4CAA4C,GAAG,gCAAgC,CAAC;AAE7F;;GAEG;AACH,MAAM,UAAU,2CAA2C;;IACzD,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAC,4CAA4C,CAAC,CAAC;IACpG,IAAI,CAAC,WAAW,EAAE;QAChB,2CAA2C;QAC3C,MAAA,SAAS,EAAE,0CAAE,cAAc,CAAC,EAAE,IAAI,EAAE,4CAA4C,EAAE,CAAC,CAAC;KACrF;AACH,CAAC;AAED,MAAM,CAAC,MAAM,8CAA8C,GAAG,kCAAkC,CAAC;AAEjG;;GAEG;AACH,MAAM,UAAU,6CAA6C;;IAC3D,MAAM,WAAW,GAAG,MAAA,SAAS,EAAE,0CAAE,oBAAoB,CAAC,8CAA8C,CAAC,CAAC;IACtG,IAAI,CAAC,WAAW,EAAE;QAChB,2CAA2C;QAC3C,MAAA,SAAS,EAAE,0CAAE,cAAc,CAAC,EAAE,IAAI,EAAE,8CAA8C,EAAE,CAAC,CAAC;KACvF;AACH,CAAC","sourcesContent":["import { getClient } from '@sentry/core';\n\nimport { feedbackIntegration, MOBILE_FEEDBACK_INTEGRATION_NAME } from './integration';\n\n/**\n * Lazy loads the feedback integration if it is not already loaded.\n */\nexport function lazyLoadFeedbackIntegration(): void {\n const integration = getClient()?.getIntegrationByName(MOBILE_FEEDBACK_INTEGRATION_NAME);\n if (!integration) {\n // Lazy load the integration to track usage\n getClient()?.addIntegration(feedbackIntegration());\n }\n}\n\nexport const AUTO_INJECT_FEEDBACK_INTEGRATION_NAME = 'AutoInjectMobileFeedback';\n\n/**\n * Lazy loads the auto inject feedback integration if it is not already loaded.\n */\nexport function lazyLoadAutoInjectFeedbackIntegration(): void {\n const integration = getClient()?.getIntegrationByName(AUTO_INJECT_FEEDBACK_INTEGRATION_NAME);\n if (!integration) {\n // Lazy load the integration to track usage\n getClient()?.addIntegration({ name: AUTO_INJECT_FEEDBACK_INTEGRATION_NAME });\n }\n}\n\nexport const AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileFeedbackButton';\n\n/**\n * Lazy loads the auto inject feedback button integration if it is not already loaded.\n */\nexport function lazyLoadAutoInjectFeedbackButtonIntegration(): void {\n const integration = getClient()?.getIntegrationByName(AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME);\n if (!integration) {\n // Lazy load the integration to track usage\n getClient()?.addIntegration({ name: AUTO_INJECT_FEEDBACK_BUTTON_INTEGRATION_NAME });\n }\n}\n\nexport const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileScreenshotButton';\n\n/**\n * Lazy loads the auto inject screenshot button integration if it is not already loaded.\n */\nexport function lazyLoadAutoInjectScreenshotButtonIntegration(): void {\n const integration = getClient()?.getIntegrationByName(AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME);\n if (!integration) {\n // Lazy load the integration to track usage\n getClient()?.addIntegration({ name: AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- export type { Breadcrumb, Request, SdkInfo, Event, Exception, SendFeedbackParams, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/core';
1
+ export type { Breadcrumb, Request, SdkInfo, Event, Exception, SendFeedbackParams, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, UserFeedback, ErrorEvent, TransactionEvent, } from '@sentry/core';
2
2
  export { addBreadcrumb, captureException, captureEvent, captureFeedback, captureMessage, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, getRootSpan, withActiveSpan, suppressTracing, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metricsDefault as metrics, lastEventId, } from '@sentry/core';
3
3
  export { ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
4
4
  export * from './integrations/exports';
@@ -10,7 +10,8 @@ export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
10
10
  export { reactNativeTracingIntegration, getCurrentReactNativeTracingIntegration, getReactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, startIdleNavigationSpan, startIdleSpan, getDefaultIdleNavigationSpanOptions, createTimeToFullDisplay, createTimeToInitialDisplay, } from './tracing';
11
11
  export type { TimeToDisplayProps } from './tracing';
12
12
  export { Mask, Unmask } from './replay/CustomMask';
13
+ export { FeedbackButton } from './feedback/FeedbackButton';
13
14
  export { FeedbackWidget } from './feedback/FeedbackWidget';
14
- export { showFeedbackWidget } from './feedback/FeedbackWidgetManager';
15
+ export { showFeedbackWidget, showFeedbackButton, hideFeedbackButton } from './feedback/FeedbackWidgetManager';
15
16
  export { getDataFromUri } from './wrapper';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,IAAI,OAAO,EACzB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW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EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
package/dist/js/index.js CHANGED
@@ -7,7 +7,8 @@ export { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope,
7
7
  export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
8
8
  export { reactNativeTracingIntegration, getCurrentReactNativeTracingIntegration, getReactNativeTracingIntegration, reactNavigationIntegration, reactNativeNavigationIntegration, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, startIdleNavigationSpan, startIdleSpan, getDefaultIdleNavigationSpanOptions, createTimeToFullDisplay, createTimeToInitialDisplay, } from './tracing';
9
9
  export { Mask, Unmask } from './replay/CustomMask';
10
+ export { FeedbackButton } from './feedback/FeedbackButton';
10
11
  export { FeedbackWidget } from './feedback/FeedbackWidget';
11
- export { showFeedbackWidget } from './feedback/FeedbackWidgetManager';
12
+ export { showFeedbackWidget, showFeedbackButton, hideFeedbackButton } from './feedback/FeedbackWidgetManager';
12
13
  export { getDataFromUri } from './wrapper';
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,IAAI,OAAO,EACzB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,uCAAuC,EACvC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mCAAmC,EACnC,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n SendFeedbackParams,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/core';\n\nexport {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureFeedback,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n getRootSpan,\n withActiveSpan,\n suppressTracing,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metricsDefault as metrics,\n lastEventId,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope, crashedLastRun } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n createTimeToFullDisplay,\n createTimeToInitialDisplay,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n\nexport { Mask, Unmask } from './replay/CustomMask';\n\nexport { FeedbackWidget } from './feedback/FeedbackWidget';\nexport { showFeedbackWidget } from './feedback/FeedbackWidgetManager';\n\nexport { getDataFromUri } from './wrapper';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,E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AAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export type {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n SendFeedbackParams,\n SeverityLevel,\n Span,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n ErrorEvent,\n TransactionEvent,\n} from '@sentry/core';\n\nexport {\n addBreadcrumb,\n captureException,\n captureEvent,\n captureFeedback,\n captureMessage,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startInactiveSpan,\n startSpan,\n startSpanManual,\n getActiveSpan,\n getRootSpan,\n withActiveSpan,\n suppressTracing,\n spanToJSON,\n spanIsSampled,\n setMeasurement,\n getCurrentScope,\n getGlobalScope,\n getIsolationScope,\n getClient,\n setCurrentClient,\n addEventProcessor,\n metricsDefault as metrics,\n lastEventId,\n} from '@sentry/core';\n\nexport {\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nexport * from './integrations/exports';\n\nexport { SDK_NAME, SDK_VERSION } from './version';\nexport type { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport { init, wrap, nativeCrash, flush, close, captureUserFeedback, withScope, crashedLastRun } from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n reactNativeTracingIntegration,\n getCurrentReactNativeTracingIntegration,\n getReactNativeTracingIntegration,\n reactNavigationIntegration,\n reactNativeNavigationIntegration,\n sentryTraceGesture,\n TimeToInitialDisplay,\n TimeToFullDisplay,\n startTimeToInitialDisplaySpan,\n startTimeToFullDisplaySpan,\n startIdleNavigationSpan,\n startIdleSpan,\n getDefaultIdleNavigationSpanOptions,\n createTimeToFullDisplay,\n createTimeToInitialDisplay,\n} from './tracing';\n\nexport type { TimeToDisplayProps } from './tracing';\n\nexport { Mask, Unmask } from './replay/CustomMask';\n\nexport { FeedbackButton } from './feedback/FeedbackButton';\nexport { FeedbackWidget } from './feedback/FeedbackWidget';\nexport { showFeedbackWidget, showFeedbackButton, hideFeedbackButton } from './feedback/FeedbackWidgetManager';\n\nexport { getDataFromUri } from './wrapper';\n"]}
@@ -2,4 +2,22 @@ import { type Integration } from '@sentry/core';
2
2
  export declare const OTA_UPDATES_CONTEXT_KEY = "ota_updates";
3
3
  /** Load device context from expo modules. */
4
4
  export declare const expoContextIntegration: () => Integration;
5
+ /**
6
+ * @internal Exposed for testing purposes
7
+ */
8
+ export declare function getExpoUpdatesContext(): ExpoUpdatesContext;
9
+ type ExpoUpdatesContext = Partial<{
10
+ is_enabled: boolean;
11
+ is_embedded_launch: boolean;
12
+ is_emergency_launch: boolean;
13
+ is_using_embedded_assets: boolean;
14
+ update_id: string;
15
+ channel: string;
16
+ runtime_version: string;
17
+ check_automatically: string;
18
+ emergency_launch_reason: string;
19
+ launch_duration: number;
20
+ created_at: string;
21
+ }>;
22
+ export {};
5
23
  //# sourceMappingURL=expocontext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,WAAW,EAA0B,MAAM,cAAc,CAAC;AAQxG,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,QAAO,WAoDzC,CAAC"}
1
+ {"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,WAAW,EAA0B,MAAM,cAAc,CAAC;AASxG,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,QAAO,WA0DzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAqC1D;AAwDD,KAAK,kBAAkB,GAAG,OAAO,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC"}
@@ -7,8 +7,13 @@ export const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';
7
7
  /** Load device context from expo modules. */
8
8
  export const expoContextIntegration = () => {
9
9
  let _expoUpdatesContextCached;
10
- function setup() {
11
- setExpoUpdatesNativeContext();
10
+ function setup(client) {
11
+ client.on('afterInit', () => {
12
+ if (!client.getOptions().enableNative) {
13
+ return;
14
+ }
15
+ setExpoUpdatesNativeContext();
16
+ });
12
17
  }
13
18
  function setExpoUpdatesNativeContext() {
14
19
  if (!isExpo() || isExpoGo()) {
@@ -47,7 +52,10 @@ export const expoContextIntegration = () => {
47
52
  processEvent,
48
53
  };
49
54
  };
50
- function getExpoUpdatesContext() {
55
+ /**
56
+ * @internal Exposed for testing purposes
57
+ */
58
+ export function getExpoUpdatesContext() {
51
59
  const expoUpdates = getExpoUpdates();
52
60
  if (!expoUpdates) {
53
61
  return {
@@ -60,19 +68,19 @@ function getExpoUpdatesContext() {
60
68
  is_emergency_launch: !!expoUpdates.isEmergencyLaunch,
61
69
  is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,
62
70
  };
63
- if (typeof expoUpdates.updateId === 'string') {
64
- updatesContext.update_id = expoUpdates.updateId;
71
+ if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {
72
+ updatesContext.update_id = expoUpdates.updateId.toLowerCase();
65
73
  }
66
- if (typeof expoUpdates.channel === 'string') {
67
- updatesContext.channel = expoUpdates.channel;
74
+ if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {
75
+ updatesContext.channel = expoUpdates.channel.toLowerCase();
68
76
  }
69
- if (typeof expoUpdates.runtimeVersion === 'string') {
70
- updatesContext.runtime_version = expoUpdates.runtimeVersion;
77
+ if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {
78
+ updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();
71
79
  }
72
- if (typeof expoUpdates.checkAutomatically === 'string') {
73
- updatesContext.check_automatically = expoUpdates.checkAutomatically;
80
+ if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {
81
+ updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();
74
82
  }
75
- if (typeof expoUpdates.emergencyLaunchReason === 'string') {
83
+ if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {
76
84
  updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;
77
85
  }
78
86
  if (typeof expoUpdates.launchDuration === 'number') {
@@ -1 +1 @@
1
- {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,MAAM,EAAE,MAAM,cAAc,CAAC;AAExG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAErD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,IAAI,yBAAyD,CAAC;IAE9D,SAAS,KAAK;QACZ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AQ,IAAI,EAAE,CAAC;QACtC,KAAK,CAAC,QAAQ,CAAC,MAAM,mCAAQ,iBAAiB,GAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAE,CAAC;KAC5E;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,EAAE;QACjB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QACtC,KAAK,CAAC,QAAQ,CAAC,EAAE,mCAAQ,aAAa,GAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAE,CAAC;KAChE;AACH,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,UAAU;QAC3B,SAAS,EAAE,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAA;QAChC,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { type DeviceContext, type Event, type Integration, type OsContext, logger } from '@sentry/core';\n\nimport { isExpo, isExpoGo } from '../utils/environment';\nimport { getExpoDevice, getExpoUpdates } from '../utils/expomodules';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\nexport const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): Integration => {\n let _expoUpdatesContextCached: ExpoUpdatesContext | undefined;\n\n function setup(): void {\n setExpoUpdatesNativeContext();\n }\n\n function setExpoUpdatesNativeContext(): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesContextCached();\n\n try {\n // Ensures native errors and crashes have the same context as JS errors\n NATIVE.setContext(OTA_UPDATES_CONTEXT_KEY, expoUpdates);\n } catch (error) {\n logger.error('Error setting Expo updates context:', error);\n }\n }\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n addExpoGoContext(event);\n addExpoUpdatesContext(event);\n return event;\n }\n\n function addExpoUpdatesContext(event: Event): void {\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...getExpoUpdatesContextCached(),\n };\n }\n\n function getExpoUpdatesContextCached(): ExpoUpdatesContext {\n if (_expoUpdatesContextCached) {\n return _expoUpdatesContextCached;\n }\n\n return (_expoUpdatesContextCached = getExpoUpdatesContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n };\n};\n\nfunction getExpoUpdatesContext(): ExpoUpdatesContext {\n const expoUpdates = getExpoUpdates();\n if (!expoUpdates) {\n return {\n is_enabled: false,\n };\n }\n\n const updatesContext: ExpoUpdatesContext = {\n is_enabled: !!expoUpdates.isEnabled,\n is_embedded_launch: !!expoUpdates.isEmbeddedLaunch,\n is_emergency_launch: !!expoUpdates.isEmergencyLaunch,\n is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,\n };\n\n if (typeof expoUpdates.updateId === 'string') {\n updatesContext.update_id = expoUpdates.updateId;\n }\n if (typeof expoUpdates.channel === 'string') {\n updatesContext.channel = expoUpdates.channel;\n }\n if (typeof expoUpdates.runtimeVersion === 'string') {\n updatesContext.runtime_version = expoUpdates.runtimeVersion;\n }\n if (typeof expoUpdates.checkAutomatically === 'string') {\n updatesContext.check_automatically = expoUpdates.checkAutomatically;\n }\n if (typeof expoUpdates.emergencyLaunchReason === 'string') {\n updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;\n }\n if (typeof expoUpdates.launchDuration === 'number') {\n updatesContext.launch_duration = expoUpdates.launchDuration;\n }\n if (expoUpdates.createdAt instanceof Date) {\n updatesContext.created_at = expoUpdates.createdAt.toISOString();\n }\n return updatesContext;\n}\n\nfunction addExpoGoContext(event: Event): void {\n if (!isExpoGo()) {\n return;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n\ntype ExpoUpdatesContext = Partial<{\n is_enabled: boolean;\n is_embedded_launch: boolean;\n is_emergency_launch: boolean;\n is_using_embedded_assets: boolean;\n update_id: string;\n channel: string;\n runtime_version: string;\n check_automatically: string;\n emergency_launch_reason: string;\n launch_duration: number;\n created_at: string;\n}>;\n"]}
1
+ {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext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AEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,UAAU;QAC3B,SAAS,EAAE,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAA;QAChC,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { type DeviceContext, type Event, type Integration, type OsContext, logger } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\nimport { isExpo, isExpoGo } from '../utils/environment';\nimport { getExpoDevice, getExpoUpdates } from '../utils/expomodules';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\nexport const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): Integration => {\n let _expoUpdatesContextCached: ExpoUpdatesContext | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!client.getOptions().enableNative) {\n return;\n }\n\n setExpoUpdatesNativeContext();\n });\n }\n\n function setExpoUpdatesNativeContext(): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesContextCached();\n\n try {\n // Ensures native errors and crashes have the same context as JS errors\n NATIVE.setContext(OTA_UPDATES_CONTEXT_KEY, expoUpdates);\n } catch (error) {\n logger.error('Error setting Expo updates context:', error);\n }\n }\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n addExpoGoContext(event);\n addExpoUpdatesContext(event);\n return event;\n }\n\n function addExpoUpdatesContext(event: Event): void {\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...getExpoUpdatesContextCached(),\n };\n }\n\n function getExpoUpdatesContextCached(): ExpoUpdatesContext {\n if (_expoUpdatesContextCached) {\n return _expoUpdatesContextCached;\n }\n\n return (_expoUpdatesContextCached = getExpoUpdatesContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoUpdatesContext(): ExpoUpdatesContext {\n const expoUpdates = getExpoUpdates();\n if (!expoUpdates) {\n return {\n is_enabled: false,\n };\n }\n\n const updatesContext: ExpoUpdatesContext = {\n is_enabled: !!expoUpdates.isEnabled,\n is_embedded_launch: !!expoUpdates.isEmbeddedLaunch,\n is_emergency_launch: !!expoUpdates.isEmergencyLaunch,\n is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,\n };\n\n if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {\n updatesContext.update_id = expoUpdates.updateId.toLowerCase();\n }\n if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {\n updatesContext.channel = expoUpdates.channel.toLowerCase();\n }\n if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {\n updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();\n }\n if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {\n updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();\n }\n if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {\n updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;\n }\n if (typeof expoUpdates.launchDuration === 'number') {\n updatesContext.launch_duration = expoUpdates.launchDuration;\n }\n if (expoUpdates.createdAt instanceof Date) {\n updatesContext.created_at = expoUpdates.createdAt.toISOString();\n }\n return updatesContext;\n}\n\nfunction addExpoGoContext(event: Event): void {\n if (!isExpoGo()) {\n return;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n\ntype ExpoUpdatesContext = Partial<{\n is_enabled: boolean;\n is_embedded_launch: boolean;\n is_emergency_launch: boolean;\n is_using_embedded_assets: boolean;\n update_id: string;\n channel: string;\n runtime_version: string;\n check_automatically: string;\n emergency_launch_reason: string;\n launch_duration: number;\n created_at: string;\n}>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlers.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAiB,MAAM,cAAc,CAAC;AAS1E,uCAAuC;AACvC,UAAU,+BAA+B;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAOD,2CAA2C;AAC3C,eAAO,MAAM,mCAAmC,aACrC,QAAQ,+BAA+B,CAAC,KAChD,WAWF,CAAC"}
1
+ {"version":3,"file":"reactnativeerrorhandlers.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAiB,MAAM,cAAc,CAAC;AAiB1E,uCAAuC;AACvC,UAAU,+BAA+B;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAOD,2CAA2C;AAC3C,eAAO,MAAM,mCAAmC,aACrC,QAAQ,+BAA+B,CAAC,KAChD,WAWF,CAAC"}
@@ -7,7 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { addExceptionMechanism, captureException, getClient, getCurrentScope, logger } from '@sentry/core';
10
+ import { addExceptionMechanism, addGlobalUnhandledRejectionInstrumentationHandler, captureException, getClient, getCurrentScope, logger, } from '@sentry/core';
11
+ import { isHermesEnabled, isWeb } from '../utils/environment';
11
12
  import { createSyntheticError, isErrorLike } from '../utils/error';
12
13
  import { RN_GLOBAL_OBJ } from '../utils/worldwide';
13
14
  import { checkPromiseAndWarn, polyfillPromise, requireRejectionTracking } from './reactnativeerrorhandlersutils';
@@ -27,42 +28,75 @@ function setup(options) {
27
28
  * Setup unhandled promise rejection tracking
28
29
  */
29
30
  function setupUnhandledRejectionsTracking(patchGlobalPromise) {
30
- if (patchGlobalPromise) {
31
- polyfillPromise();
31
+ var _a, _b, _c;
32
+ try {
33
+ if (isHermesEnabled() &&
34
+ ((_a = RN_GLOBAL_OBJ.HermesInternal) === null || _a === void 0 ? void 0 : _a.enablePromiseRejectionTracker) &&
35
+ ((_c = (_b = RN_GLOBAL_OBJ === null || RN_GLOBAL_OBJ === void 0 ? void 0 : RN_GLOBAL_OBJ.HermesInternal) === null || _b === void 0 ? void 0 : _b.hasPromise) === null || _c === void 0 ? void 0 : _c.call(_b))) {
36
+ logger.log('Using Hermes native promise rejection tracking');
37
+ RN_GLOBAL_OBJ.HermesInternal.enablePromiseRejectionTracker({
38
+ allRejections: true,
39
+ onUnhandled: promiseRejectionTrackingOptions.onUnhandled,
40
+ onHandled: promiseRejectionTrackingOptions.onHandled,
41
+ });
42
+ logger.log('Unhandled promise rejections will be caught by Sentry.');
43
+ }
44
+ else if (isWeb()) {
45
+ logger.log('Using Browser JS promise rejection tracking for React Native Web');
46
+ // Use Sentry's built-in global unhandled rejection handler
47
+ addGlobalUnhandledRejectionInstrumentationHandler((error) => {
48
+ captureException(error, {
49
+ originalException: error,
50
+ syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),
51
+ mechanism: { handled: false, type: 'onunhandledrejection' },
52
+ });
53
+ });
54
+ }
55
+ else if (patchGlobalPromise) {
56
+ // For JSC and other environments, use the existing approach
57
+ polyfillPromise();
58
+ attachUnhandledRejectionHandler();
59
+ checkPromiseAndWarn();
60
+ }
61
+ else {
62
+ // For JSC and other environments, patching was disabled by user configuration
63
+ logger.log('Unhandled promise rejections will not be caught by Sentry.');
64
+ }
65
+ }
66
+ catch (e) {
67
+ logger.warn('Failed to set up promise rejection tracking. ' +
68
+ 'Unhandled promise rejections will not be caught by Sentry.' +
69
+ 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.');
32
70
  }
33
- attachUnhandledRejectionHandler();
34
- checkPromiseAndWarn();
35
71
  }
36
- function attachUnhandledRejectionHandler() {
37
- const tracking = requireRejectionTracking();
38
- const promiseRejectionTrackingOptions = {
39
- onUnhandled: (id, rejection = {}) => {
40
- // eslint-disable-next-line no-console
41
- console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\n${rejection}`);
42
- },
43
- onHandled: id => {
44
- // eslint-disable-next-line no-console
45
- console.warn(`Promise Rejection Handled (id: ${id})\n` +
72
+ const promiseRejectionTrackingOptions = {
73
+ onUnhandled: (id, error, rejection = {}) => {
74
+ if (__DEV__) {
75
+ logger.warn(`Possible Unhandled Promise Rejection (id: ${id}):\n${rejection}`);
76
+ }
77
+ // Marking the rejection as handled to avoid breaking crash rate calculations.
78
+ // See: https://github.com/getsentry/sentry-react-native/issues/4141
79
+ captureException(error, {
80
+ data: { id },
81
+ originalException: error,
82
+ syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),
83
+ mechanism: { handled: true, type: 'onunhandledrejection' },
84
+ });
85
+ },
86
+ onHandled: id => {
87
+ if (__DEV__) {
88
+ logger.warn(`Promise Rejection Handled (id: ${id})\n` +
46
89
  'This means you can ignore any previous messages of the form ' +
47
90
  `"Possible Unhandled Promise Rejection (id: ${id}):"`);
48
- },
49
- };
91
+ }
92
+ },
93
+ };
94
+ function attachUnhandledRejectionHandler() {
95
+ const tracking = requireRejectionTracking();
50
96
  tracking.enable({
51
97
  allRejections: true,
52
- onUnhandled: (id, error) => {
53
- if (__DEV__) {
54
- promiseRejectionTrackingOptions.onUnhandled(id, error);
55
- }
56
- captureException(error, {
57
- data: { id },
58
- originalException: error,
59
- syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),
60
- mechanism: { handled: true, type: 'onunhandledrejection' },
61
- });
62
- },
63
- onHandled: (id) => {
64
- promiseRejectionTrackingOptions.onHandled(id);
65
- },
98
+ onUnhandled: promiseRejectionTrackingOptions.onUnhandled,
99
+ onHandled: promiseRejectionTrackingOptions.onHandled,
66
100
  });
67
101
  }
68
102
  function setupErrorUtilsGlobalHandler() {
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,qBAAqB,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,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,MAAM,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAChH,CAAC,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { EventHint, Integration, SeverityLevel } from '@sentry/core';\nimport { addExceptionMechanism, captureException, getClient, getCurrentScope, logger } from '@sentry/core';\n\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { checkPromiseAndWarn, polyfillPromise, requireRejectionTracking } from './reactnativeerrorhandlersutils';\n\nconst INTEGRATION_NAME = 'ReactNativeErrorHandlers';\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 const reactNativeErrorHandlersIntegration = (\n options: Partial<ReactNativeErrorHandlersOptions> = {},\n): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () =>\n setup({\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n }),\n };\n};\n\nfunction setup(options: ReactNativeErrorHandlersOptions): void {\n options.onunhandledrejection && setupUnhandledRejectionsTracking(options.patchGlobalPromise);\n options.onerror && setupErrorUtilsGlobalHandler();\n}\n\n/**\n * Setup unhandled promise rejection tracking\n */\nfunction setupUnhandledRejectionsTracking(patchGlobalPromise: boolean): void {\n if (patchGlobalPromise) {\n polyfillPromise();\n }\n\n attachUnhandledRejectionHandler();\n checkPromiseAndWarn();\n}\n\nfunction attachUnhandledRejectionHandler(): void {\n const tracking = requireRejectionTracking();\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: unknown) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: true, type: 'onunhandledrejection' },\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n}\n\nfunction setupErrorUtilsGlobalHandler(): void {\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 client = getClient();\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 hint: EventHint = {\n originalException: error,\n attachments: getCurrentScope().getScopeData().attachments,\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 } else {\n event.level = 'error';\n\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n }\n\n client.captureEvent(event, hint);\n\n if (__DEV__) {\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 return;\n }\n\n void client.flush(client.getOptions().shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n logger.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);\n },\n );\n });\n}\n"]}
1
+ {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,qBAAqB,EACrB,iDAAiD,EACjD,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEjH,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAcpD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mCAAmC,GAAG,CACjD,UAAoD,EAAE,EACzC,EAAE;IACf,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE,CACd,KAAK,iBACH,OAAO,EAAE,IAAI,EACb,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,IAAI,IACrB,OAAO,EACV;KACL,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,KAAK,CAAC,OAAwC;IACrD,OAAO,CAAC,oBAAoB,IAAI,gCAAgC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;I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AAC,CAAC;QAEjC,IAAI,OAAO,EAAE;YACX,gFAAgF;YAChF,mCAAmC;YACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO;SACR;QAED,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CACjE,GAAG,EAAE;YACH,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,MAAM,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAChH,CAAC,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { EventHint, Integration, SeverityLevel } from '@sentry/core';\nimport {\n addExceptionMechanism,\n addGlobalUnhandledRejectionInstrumentationHandler,\n captureException,\n getClient,\n getCurrentScope,\n logger,\n} from '@sentry/core';\n\nimport { isHermesEnabled, isWeb } from '../utils/environment';\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { checkPromiseAndWarn, polyfillPromise, requireRejectionTracking } from './reactnativeerrorhandlersutils';\n\nconst INTEGRATION_NAME = 'ReactNativeErrorHandlers';\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 const reactNativeErrorHandlersIntegration = (\n options: Partial<ReactNativeErrorHandlersOptions> = {},\n): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () =>\n setup({\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n }),\n };\n};\n\nfunction setup(options: ReactNativeErrorHandlersOptions): void {\n options.onunhandledrejection && setupUnhandledRejectionsTracking(options.patchGlobalPromise);\n options.onerror && setupErrorUtilsGlobalHandler();\n}\n\n/**\n * Setup unhandled promise rejection tracking\n */\nfunction setupUnhandledRejectionsTracking(patchGlobalPromise: boolean): void {\n try {\n if (\n isHermesEnabled() &&\n RN_GLOBAL_OBJ.HermesInternal?.enablePromiseRejectionTracker &&\n RN_GLOBAL_OBJ?.HermesInternal?.hasPromise?.()\n ) {\n logger.log('Using Hermes native promise rejection tracking');\n\n RN_GLOBAL_OBJ.HermesInternal.enablePromiseRejectionTracker({\n allRejections: true,\n onUnhandled: promiseRejectionTrackingOptions.onUnhandled,\n onHandled: promiseRejectionTrackingOptions.onHandled,\n });\n\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n } else if (isWeb()) {\n logger.log('Using Browser JS promise rejection tracking for React Native Web');\n\n // Use Sentry's built-in global unhandled rejection handler\n addGlobalUnhandledRejectionInstrumentationHandler((error: unknown) => {\n captureException(error, {\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: false, type: 'onunhandledrejection' },\n });\n });\n } else if (patchGlobalPromise) {\n // For JSC and other environments, use the existing approach\n polyfillPromise();\n attachUnhandledRejectionHandler();\n checkPromiseAndWarn();\n } else {\n // For JSC and other environments, patching was disabled by user configuration\n logger.log('Unhandled promise rejections will not be caught by Sentry.');\n }\n } catch (e) {\n logger.warn(\n 'Failed to set up promise rejection tracking. ' +\n 'Unhandled promise rejections will not be caught by Sentry.' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n}\n\nconst promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, error: unknown, rejection = {}) => {\n if (__DEV__) {\n logger.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n }\n\n // Marking the rejection as handled to avoid breaking crash rate calculations.\n // See: https://github.com/getsentry/sentry-react-native/issues/4141\n captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: true, type: 'onunhandledrejection' },\n });\n },\n onHandled: id => {\n if (__DEV__) {\n logger.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\nfunction attachUnhandledRejectionHandler(): void {\n const tracking = requireRejectionTracking();\n\n tracking.enable({\n allRejections: true,\n onUnhandled: promiseRejectionTrackingOptions.onUnhandled,\n onHandled: promiseRejectionTrackingOptions.onHandled,\n });\n}\n\nfunction setupErrorUtilsGlobalHandler(): void {\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 client = getClient();\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 hint: EventHint = {\n originalException: error,\n attachments: getCurrentScope().getScopeData().attachments,\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 } else {\n event.level = 'error';\n\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n }\n\n client.captureEvent(event, hint);\n\n if (__DEV__) {\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 return;\n }\n\n void client.flush(client.getOptions().shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n logger.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);\n },\n );\n });\n}\n"]}
@@ -28,9 +28,22 @@ export interface MobileReplayOptions {
28
28
  *
29
29
  * - Experiment: This is an experimental feature and is therefore disabled by default.
30
30
  *
31
- * @default false
31
+ * @deprecated Use `enableViewRendererV2` instead.
32
32
  */
33
33
  enableExperimentalViewRenderer?: boolean;
34
+ /**
35
+ * Enables up to 5x faster new view renderer used by the Session Replay integration on iOS.
36
+ *
37
+ * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing
38
+ * interruptions and visual lag. [Our benchmarks](https://github.com/getsentry/sentry-cocoa/pull/4940) have shown a significant improvement of
39
+ * **up to 4-5x faster rendering** (reducing `~160ms` to `~36ms` per frame) on older devices.
40
+ *
41
+ * - Experiment: In case you are noticing issues with the new view renderer, please report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).
42
+ * Eventually, we will remove this feature flag and use the new view renderer by default.
43
+ *
44
+ * @default true
45
+ */
46
+ enableViewRendererV2?: boolean;
34
47
  /**
35
48
  * Enables up to 5x faster but incomplete view rendering used by the Session Replay integration on iOS.
36
49
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,WAAW,EAAE,MAAM,cAAc,CAAC;AASvF,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAE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