@sentry/react-native 5.16.0-alpha.2 → 5.16.0-alpha.4

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 (67) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/js/integrations/default.d.ts +11 -0
  3. package/dist/js/integrations/default.d.ts.map +1 -0
  4. package/dist/js/integrations/default.js +79 -0
  5. package/dist/js/integrations/default.js.map +1 -0
  6. package/dist/js/integrations/expocontext.d.ts +17 -0
  7. package/dist/js/integrations/expocontext.d.ts.map +1 -0
  8. package/dist/js/integrations/expocontext.js +68 -0
  9. package/dist/js/integrations/expocontext.js.map +1 -0
  10. package/dist/js/integrations/reactnativeinfo.d.ts +2 -0
  11. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  12. package/dist/js/integrations/reactnativeinfo.js +9 -1
  13. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  14. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  15. package/dist/js/integrations/sdkinfo.js +5 -2
  16. package/dist/js/integrations/sdkinfo.js.map +1 -1
  17. package/dist/js/options.d.ts +6 -0
  18. package/dist/js/options.d.ts.map +1 -1
  19. package/dist/js/options.js +23 -1
  20. package/dist/js/options.js.map +1 -1
  21. package/dist/js/sdk.d.ts.map +1 -1
  22. package/dist/js/sdk.js +13 -55
  23. package/dist/js/sdk.js.map +1 -1
  24. package/dist/js/tools/sentryMetroSerializer.d.ts +3 -4
  25. package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
  26. package/dist/js/tools/sentryMetroSerializer.js +25 -18
  27. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  28. package/dist/js/tools/vendor/expo/expoconfig.d.ts +24 -0
  29. package/dist/js/tools/vendor/expo/expoconfig.d.ts.map +1 -0
  30. package/dist/js/tools/vendor/expo/expoconfig.js +3 -0
  31. package/dist/js/tools/vendor/expo/expoconfig.js.map +1 -0
  32. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  33. package/dist/js/tracing/reactnavigation.js +6 -4
  34. package/dist/js/tracing/reactnavigation.js.map +1 -1
  35. package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
  36. package/dist/js/tracing/reactnavigationv4.js +4 -3
  37. package/dist/js/tracing/reactnavigationv4.js.map +1 -1
  38. package/dist/js/utils/environment.d.ts +8 -0
  39. package/dist/js/utils/environment.d.ts.map +1 -1
  40. package/dist/js/utils/environment.js +23 -0
  41. package/dist/js/utils/environment.js.map +1 -1
  42. package/dist/js/utils/expoglobalobject.d.ts +51 -0
  43. package/dist/js/utils/expoglobalobject.d.ts.map +1 -0
  44. package/dist/js/utils/expoglobalobject.js +2 -0
  45. package/dist/js/utils/expoglobalobject.js.map +1 -0
  46. package/dist/js/utils/expomodules.d.ts +10 -0
  47. package/dist/js/utils/expomodules.d.ts.map +1 -0
  48. package/dist/js/utils/expomodules.js +14 -0
  49. package/dist/js/utils/expomodules.js.map +1 -0
  50. package/dist/js/utils/worldwide.d.ts +2 -1
  51. package/dist/js/utils/worldwide.d.ts.map +1 -1
  52. package/dist/js/utils/worldwide.js.map +1 -1
  53. package/dist/js/version.d.ts +1 -1
  54. package/dist/js/version.js +1 -1
  55. package/dist/js/version.js.map +1 -1
  56. package/package.json +8 -4
  57. package/samples/react-native/react-native.config.js +5 -0
  58. package/scripts/expo-upload-sourcemaps.js +160 -0
  59. package/ts3.8/dist/js/integrations/default.d.ts +11 -0
  60. package/ts3.8/dist/js/integrations/expocontext.d.ts +17 -0
  61. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +2 -0
  62. package/ts3.8/dist/js/options.d.ts +6 -0
  63. package/ts3.8/dist/js/utils/environment.d.ts +8 -0
  64. package/ts3.8/dist/js/utils/expoglobalobject.d.ts +51 -0
  65. package/ts3.8/dist/js/utils/expomodules.d.ts +10 -0
  66. package/ts3.8/dist/js/utils/worldwide.d.ts +2 -1
  67. package/ts3.8/dist/js/version.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.16.0-alpha.4
4
+
5
+ ### Fixes
6
+
7
+ - Make `getSentryExpoConfig` options parameter optional ([#3514](https://github.com/getsentry/sentry-react-native/pull/3514))
8
+ - Use `@sentry/react-native/expo` as plugin name in `expo-upload-sourcemaps.js` ([#3515](https://github.com/getsentry/sentry-react-native/pull/3515))
9
+
10
+ ## 5.16.0-alpha.3
11
+
12
+ This release is compatible with `expo@50.0.0-preview.6` and newer.
13
+
14
+ ### Features
15
+
16
+ - `withSentryExpoSerializers` changes to `getSentryExpoConfig` ([#3501](https://github.com/getsentry/sentry-react-native/pull/3501))
17
+ - `getSentryExpoConfig` accepts the same parameters as `getDefaultConfig` from `expo/metro-config` and returns Metro configuration
18
+ - This also works for EAS Updates (and expo export). Debug ID is generated by `expo/metro-config` and used by Sentry.
19
+
20
+ ```js
21
+ const { getSentryExpoConfig } = require("@sentry/react-native/metro");
22
+ const config = getSentryExpoConfig(config, {});
23
+ ```
24
+
25
+ - Add `npx sentry-expo-upload-sourcemaps` for simple EAS Update (expo export) source maps upload to Sentry ([#3491](https://github.com/getsentry/sentry-react-native/pull/3491), [#3510](https://github.com/getsentry/sentry-react-native/pull/3510))
26
+
27
+ ```bash
28
+ SENTRY_PROJECT=project-slug \
29
+ SENTRY_ORG=org-slug \
30
+ SENTRY_AUTH_TOKEN=super-secret-token \
31
+ npx sentry-expo-upload-sourcemaps dist
32
+ ```
33
+
34
+ - Sentry CLI binary path in `scripts/expo-upload-sourcemaps.js` is resolved dynamically ([#3507](https://github.com/getsentry/sentry-react-native/pull/3507))
35
+ - Or can be overwritten by `SENTRY_CLI_EXECUTABLE` env
36
+
37
+ - Resolve Default Integrations based on current platform ([#3465](https://github.com/getsentry/sentry-react-native/pull/3465))
38
+ - Native Integrations are only added if Native Module is available
39
+ - Web Integrations only for React Native Web builds
40
+ - Remove Native Modules warning from platform where the absence is expected ([#3466](https://github.com/getsentry/sentry-react-native/pull/3466))
41
+ - Add Expo Context information using Expo Native Modules ([#3466](https://github.com/getsentry/sentry-react-native/pull/3466))
42
+
43
+ ### Fixes
44
+
45
+ - Includes fixes from version 5.15.2
46
+
47
+ ## 5.15.2
48
+
49
+ ### Fixes
50
+
51
+ - Stop sending navigation route params for auto-generated transactions, as they may contain PII or other sensitive data ([#3487](https://github.com/getsentry/sentry-react-native/pull/3487))
52
+ - Further details and other strategies to mitigate this issue can be found on our [trouble shooting guide page](https://docs.sentry.io/platforms/react-native/troubleshooting/#routing-transaction-data-contains-sensitive-information)
53
+
3
54
  ## 5.16.0-alpha.2
4
55
 
5
56
  ### Features
@@ -0,0 +1,11 @@
1
+ import type { Integration } from '@sentry/types';
2
+ import type { ReactNativeClientOptions } from '../options';
3
+ /**
4
+ * Returns the default ReactNative integrations based on the current environment.
5
+ *
6
+ * Native integrations are only returned when native is enabled.
7
+ *
8
+ * Web integrations are only returned when running on web.
9
+ */
10
+ export declare function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[];
11
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAkB3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CA6DvF"}
@@ -0,0 +1,79 @@
1
+ import { hasTracingEnabled } from '@sentry/core';
2
+ import { HttpClient } from '@sentry/integrations';
3
+ import { Integrations as BrowserReactIntegrations } from '@sentry/react';
4
+ import { HermesProfiling } from '../profiling/integration';
5
+ import { ReactNativeTracing } from '../tracing';
6
+ import { isExpoGo, notWeb } from '../utils/environment';
7
+ import { DebugSymbolicator } from './debugsymbolicator';
8
+ import { DeviceContext } from './devicecontext';
9
+ import { EventOrigin } from './eventorigin';
10
+ import { ExpoContext } from './expocontext';
11
+ import { ModulesLoader } from './modulesloader';
12
+ import { NativeLinkedErrors } from './nativelinkederrors';
13
+ import { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';
14
+ import { ReactNativeInfo } from './reactnativeinfo';
15
+ import { Release } from './release';
16
+ import { createReactNativeRewriteFrames } from './rewriteframes';
17
+ import { Screenshot } from './screenshot';
18
+ import { SdkInfo } from './sdkinfo';
19
+ import { ViewHierarchy } from './viewhierarchy';
20
+ /**
21
+ * Returns the default ReactNative integrations based on the current environment.
22
+ *
23
+ * Native integrations are only returned when native is enabled.
24
+ *
25
+ * Web integrations are only returned when running on web.
26
+ */
27
+ export function getDefaultIntegrations(options) {
28
+ const integrations = [];
29
+ if (notWeb()) {
30
+ integrations.push(new ReactNativeErrorHandlers({
31
+ patchGlobalPromise: options.patchGlobalPromise,
32
+ }));
33
+ integrations.push(new NativeLinkedErrors());
34
+ }
35
+ else {
36
+ integrations.push(new BrowserReactIntegrations.TryCatch());
37
+ integrations.push(new BrowserReactIntegrations.GlobalHandlers());
38
+ integrations.push(new BrowserReactIntegrations.LinkedErrors());
39
+ }
40
+ // @sentry/react default integrations
41
+ integrations.push(new BrowserReactIntegrations.InboundFilters());
42
+ integrations.push(new BrowserReactIntegrations.FunctionToString());
43
+ integrations.push(new BrowserReactIntegrations.Breadcrumbs());
44
+ integrations.push(new BrowserReactIntegrations.Dedupe());
45
+ integrations.push(new BrowserReactIntegrations.HttpContext());
46
+ // end @sentry/react-native default integrations
47
+ integrations.push(new Release());
48
+ integrations.push(new EventOrigin());
49
+ integrations.push(new SdkInfo());
50
+ integrations.push(new ReactNativeInfo());
51
+ if (__DEV__ && notWeb()) {
52
+ integrations.push(new DebugSymbolicator());
53
+ }
54
+ integrations.push(createReactNativeRewriteFrames());
55
+ if (options.enableNative) {
56
+ integrations.push(new DeviceContext());
57
+ integrations.push(new ModulesLoader());
58
+ if (options.attachScreenshot) {
59
+ integrations.push(new Screenshot());
60
+ }
61
+ if (options.attachViewHierarchy) {
62
+ integrations.push(new ViewHierarchy());
63
+ }
64
+ if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {
65
+ integrations.push(new HermesProfiling());
66
+ }
67
+ }
68
+ if (hasTracingEnabled(options) && options.enableAutoPerformanceTracing) {
69
+ integrations.push(new ReactNativeTracing());
70
+ }
71
+ if (options.enableCaptureFailedRequests) {
72
+ integrations.push(new HttpClient());
73
+ }
74
+ if (isExpoGo()) {
75
+ integrations.push(new ExpoContext());
76
+ }
77
+ return integrations;
78
+ }
79
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAIzE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,O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CAAC;KACtC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import { hasTracingEnabled } from '@sentry/core';\nimport { HttpClient } from '@sentry/integrations';\nimport { Integrations as BrowserReactIntegrations } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { HermesProfiling } from '../profiling/integration';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport { DebugSymbolicator } from './debugsymbolicator';\nimport { DeviceContext } from './devicecontext';\nimport { EventOrigin } from './eventorigin';\nimport { ExpoContext } from './expocontext';\nimport { ModulesLoader } from './modulesloader';\nimport { NativeLinkedErrors } from './nativelinkederrors';\nimport { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';\nimport { ReactNativeInfo } from './reactnativeinfo';\nimport { Release } from './release';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\nimport { Screenshot } from './screenshot';\nimport { SdkInfo } from './sdkinfo';\nimport { ViewHierarchy } from './viewhierarchy';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n new ReactNativeErrorHandlers({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(new NativeLinkedErrors());\n } else {\n integrations.push(new BrowserReactIntegrations.TryCatch());\n integrations.push(new BrowserReactIntegrations.GlobalHandlers());\n integrations.push(new BrowserReactIntegrations.LinkedErrors());\n }\n\n // @sentry/react default integrations\n integrations.push(new BrowserReactIntegrations.InboundFilters());\n integrations.push(new BrowserReactIntegrations.FunctionToString());\n integrations.push(new BrowserReactIntegrations.Breadcrumbs());\n integrations.push(new BrowserReactIntegrations.Dedupe());\n integrations.push(new BrowserReactIntegrations.HttpContext());\n // end @sentry/react-native default integrations\n\n integrations.push(new Release());\n integrations.push(new EventOrigin());\n integrations.push(new SdkInfo());\n integrations.push(new ReactNativeInfo());\n\n if (__DEV__ && notWeb()) {\n integrations.push(new DebugSymbolicator());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(new DeviceContext());\n integrations.push(new ModulesLoader());\n if (options.attachScreenshot) {\n integrations.push(new Screenshot());\n }\n if (options.attachViewHierarchy) {\n integrations.push(new ViewHierarchy());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n integrations.push(new HermesProfiling());\n }\n }\n\n if (hasTracingEnabled(options) && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(new HttpClient());\n }\n\n if (isExpoGo()) {\n integrations.push(new ExpoContext());\n }\n\n return integrations;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import type { EventProcessor, Hub, Integration } from '@sentry/types';
2
+ /** Load device context from expo modules. */
3
+ export declare class ExpoContext implements Integration {
4
+ /**
5
+ * @inheritDoc
6
+ */
7
+ static id: string;
8
+ /**
9
+ * @inheritDoc
10
+ */
11
+ name: string;
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
16
+ }
17
+ //# sourceMappingURL=expocontext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,cAAc,EAAE,GAAG,EAAE,WAAW,EAAa,MAAM,eAAe,CAAC;AAIvG,6CAA6C;AAC7C,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAsB9G"}
@@ -0,0 +1,68 @@
1
+ import { __awaiter } from "tslib";
2
+ import { getExpoDevice } from '../utils/expomodules';
3
+ /** Load device context from expo modules. */
4
+ export class ExpoContext {
5
+ constructor() {
6
+ /**
7
+ * @inheritDoc
8
+ */
9
+ this.name = ExpoContext.id;
10
+ }
11
+ /**
12
+ * @inheritDoc
13
+ */
14
+ setupOnce(addGlobalEventProcessor, getCurrentHub) {
15
+ addGlobalEventProcessor((event) => __awaiter(this, void 0, void 0, function* () {
16
+ const self = getCurrentHub().getIntegration(ExpoContext);
17
+ if (!self) {
18
+ return event;
19
+ }
20
+ const expoDeviceContext = getExpoDeviceContext();
21
+ if (expoDeviceContext) {
22
+ event.contexts = event.contexts || {};
23
+ event.contexts.device = Object.assign(Object.assign({}, expoDeviceContext), event.contexts.device);
24
+ }
25
+ const expoOsContext = getExpoOsContext();
26
+ if (expoOsContext) {
27
+ event.contexts = event.contexts || {};
28
+ event.contexts.os = Object.assign(Object.assign({}, expoOsContext), event.contexts.os);
29
+ }
30
+ return event;
31
+ }));
32
+ }
33
+ }
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ ExpoContext.id = 'ExpoContext';
38
+ /**
39
+ * Returns the Expo Device context if present
40
+ */
41
+ function getExpoDeviceContext() {
42
+ const expoDevice = getExpoDevice();
43
+ if (!expoDevice) {
44
+ return undefined;
45
+ }
46
+ return {
47
+ name: expoDevice.deviceName,
48
+ simulator: !(expoDevice === null || expoDevice === void 0 ? void 0 : expoDevice.isDevice),
49
+ model: expoDevice.modelName,
50
+ manufacturer: expoDevice.manufacturer,
51
+ memory_size: expoDevice.totalMemory,
52
+ };
53
+ }
54
+ /**
55
+ * Returns the Expo OS context if present
56
+ */
57
+ function getExpoOsContext() {
58
+ const expoDevice = getExpoDevice();
59
+ if (!expoDevice) {
60
+ return undefined;
61
+ }
62
+ return {
63
+ build: expoDevice.osBuildId,
64
+ version: expoDevice.osVersion,
65
+ name: expoDevice.osName,
66
+ };
67
+ }
68
+ //# sourceMappingURL=expocontext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,6CAA6C;AAC7C,MAAM,OAAO,WAAW;IAAxB;QAME;;WAEG;QACI,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IA2BvC,CAAC;IAzBC;;OAEG;IACI,SAAS,CAAC,uBAA2D,EAAE,aAAwB;QACpG,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;YAC7C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACzD,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;YAED,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;YACjD,IAAI,iBAAiB,EAAE;gBACrB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;gBACtC,KAAK,CAAC,QAAQ,CAAC,MAAM,mCAAQ,iBAAiB,GAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAE,CAAC;aAC5E;YAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;YACzC,IAAI,aAAa,EAAE;gBACjB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;gBACtC,KAAK,CAAC,QAAQ,CAAC,EAAE,mCAAQ,aAAa,GAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAE,CAAC;aAChE;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAlCD;;GAEG;AACW,cAAE,GAAW,aAAa,CAAC;AAkC3C;;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, Event, EventProcessor, Hub, Integration, OsContext } from '@sentry/types';\n\nimport { getExpoDevice } from '../utils/expomodules';\n\n/** Load device context from expo modules. */\nexport class ExpoContext implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ExpoContext';\n\n /**\n * @inheritDoc\n */\n public name: string = ExpoContext.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n addGlobalEventProcessor(async (event: Event) => {\n const self = getCurrentHub().getIntegration(ExpoContext);\n if (!self) {\n return event;\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 return event;\n });\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"]}
@@ -8,6 +8,8 @@ export interface ReactNativeContext extends Context {
8
8
  react_native_version?: string;
9
9
  component_stack?: string;
10
10
  hermes_debug_info?: boolean;
11
+ expo_go_version?: string;
12
+ expo_sdk_version?: string;
11
13
  }
12
14
  /** Loads React Native context at runtime */
13
15
  export declare class ReactNativeInfo implements Integration {
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5F,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,WAAW;IACjD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAqB;IAE7C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAsB;IAEzC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAyCpF"}
1
+ {"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAc5F,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,WAAW;IACjD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAqB;IAE7C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAsB;IAEzC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAmDpF"}
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
- import { getHermesVersion, getReactNativeVersion, isExpo, isFabricEnabled, isHermesEnabled, isTurboModuleEnabled, } from '../utils/environment';
2
+ import { getExpoGoVersion, getExpoSdkVersion, getHermesVersion, getReactNativeVersion, isExpo, isFabricEnabled, isHermesEnabled, isTurboModuleEnabled, } from '../utils/environment';
3
3
  /** Loads React Native context at runtime */
4
4
  export class ReactNativeInfo {
5
5
  constructor() {
@@ -37,6 +37,14 @@ export class ReactNativeInfo {
37
37
  if (reactNativeError === null || reactNativeError === void 0 ? void 0 : reactNativeError.componentStack) {
38
38
  reactNativeContext.component_stack = reactNativeError.componentStack;
39
39
  }
40
+ const expoGoVersion = getExpoGoVersion();
41
+ if (expoGoVersion) {
42
+ reactNativeContext.expo_go_version = expoGoVersion;
43
+ }
44
+ const expoSdkVersion = getExpoSdkVersion();
45
+ if (expoSdkVersion) {
46
+ reactNativeContext.expo_sdk_version = expoSdkVersion;
47
+ }
40
48
  event.contexts = Object.assign({ react_native_context: reactNativeContext }, event.contexts);
41
49
  return event;
42
50
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,EACN,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAc9B,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;IA8C3C,CAAC;IA5CC;;OAEG;IACI,SAAS,CAAC,uBAA2D;QAC1E,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAgB,EAAE,EAAE;YAC/D,MAAM,gBAAgB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,EAAC,CAAC,CAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAsC,CAAC,CAAC,CAAC,SAAS,CAAC;YAE7G,MAAM,kBAAkB,GAAuB;gBAC7C,YAAY,EAAE,oBAAoB,EAAE;gBACpC,MAAM,EAAE,eAAe,EAAE;gBACzB,oBAAoB,EAAE,qBAAqB,EAAE;gBAC7C,IAAI,EAAE,MAAM,EAAE;aACf,CAAC;YAEF,IAAI,eAAe,EAAE,EAAE;gBACrB,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CAAC,MAAM,KAAK,CAAC,EAAE;gBACtD,OAAO,IAAI,CAAC;aACb;SACF;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';\n\nimport {\n getHermesVersion,\n getReactNativeVersion,\n isExpo,\n isFabricEnabled,\n isHermesEnabled,\n isTurboModuleEnabled,\n} from '../utils/environment';\nimport type { ReactNativeError } from './debugsymbolicator';\n\nexport interface ReactNativeContext extends Context {\n js_engine?: string;\n turbo_module: boolean;\n fabric: boolean;\n expo: boolean;\n hermes_version?: string;\n react_native_version?: string;\n component_stack?: string;\n hermes_debug_info?: boolean;\n}\n\n/** Loads React Native context at runtime */\nexport class ReactNativeInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeInfo.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint?: EventHint) => {\n const reactNativeError = hint?.originalException ? (hint?.originalException as ReactNativeError) : undefined;\n\n const reactNativeContext: ReactNativeContext = {\n turbo_module: isTurboModuleEnabled(),\n fabric: isFabricEnabled(),\n react_native_version: getReactNativeVersion(),\n expo: isExpo(),\n };\n\n if (isHermesEnabled()) {\n reactNativeContext.js_engine = 'hermes';\n const hermesVersion = getHermesVersion();\n if (hermesVersion) {\n reactNativeContext.hermes_version = hermesVersion;\n }\n reactNativeContext.hermes_debug_info = !isEventWithHermesBytecodeFrames(event);\n } else if (reactNativeError?.jsEngine) {\n reactNativeContext.js_engine = reactNativeError.jsEngine;\n }\n\n if (reactNativeContext.js_engine === 'hermes') {\n event.tags = {\n hermes: 'true',\n ...event.tags,\n };\n }\n\n if (reactNativeError?.componentStack) {\n reactNativeContext.component_stack = reactNativeError.componentStack;\n }\n\n event.contexts = {\n react_native_context: reactNativeContext,\n ...event.contexts,\n };\n\n return event;\n });\n }\n}\n\n/**\n * Guess if the event contains frames with Hermes bytecode\n * (thus Hermes bundle doesn't contain debug info)\n * based on the event exception/threads frames.\n *\n * This function can be relied on only if Hermes is enabled!\n *\n * Hermes bytecode position is always line 1 and column 0-based number.\n * If Hermes bundle has debug info, the bytecode frames pos are calculated\n * back to the plain bundle source code positions and line will be > 1.\n *\n * Line 1 contains start time var, it's safe to assume it won't crash.\n * The above only applies when Hermes is enabled.\n *\n * Javascript/Hermes bytecode frames have platform === undefined.\n * Native (Java, ObjC, C++) frames have platform === 'android'/'ios'/'native'.\n */\nfunction isEventWithHermesBytecodeFrames(event: Event): boolean {\n for (const value of event.exception?.values || event.threads?.values || []) {\n for (const frame of value.stacktrace?.frames || []) {\n // platform === undefined we assume it's javascript (only native frames use the platform attribute)\n if (frame.platform === undefined && frame.lineno === 1) {\n return true;\n }\n }\n }\n return false;\n}\n"]}
1
+ {"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,EACN,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAgB9B,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAA5B;QAME;;WAEG;QACI,SAAI,GAAW,eAAe,CAAC,EAAE,CAAC;IAwD3C,CAAC;IAtDC;;OAEG;IACI,SAAS,CAAC,uBAA2D;QAC1E,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAgB,EAAE,EAAE;YAC/D,MAAM,gBAAgB,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,EAAC,CAAC,CAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAsC,CAAC,CAAC,CAAC,SAAS,CAAC;YAE7G,MAAM,kBAAkB,GAAuB;gBAC7C,YAAY,EAAE,oBA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AACW,kBAAE,GAAW,iBAAiB,CAAC;AA+D/C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,+BAA+B,CAAC,KAAY;;IACnD,KAAK,MAAM,KAAK,IAAI,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,MAAI,MAAA,KAAK,CAAC,OAAO,0CAAE,MAAM,CAAA,IAAI,EAAE,EAAE;QAC1E,KAAK,MAAM,KAAK,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,KAAI,EAAE,EAAE;YAClD,mGAAmG;YACnG,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtD,OAAO,IAAI,CAAC;aACb;SACF;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';\n\nimport {\n getExpoGoVersion,\n getExpoSdkVersion,\n getHermesVersion,\n getReactNativeVersion,\n isExpo,\n isFabricEnabled,\n isHermesEnabled,\n isTurboModuleEnabled,\n} from '../utils/environment';\nimport type { ReactNativeError } from './debugsymbolicator';\n\nexport interface ReactNativeContext extends Context {\n js_engine?: string;\n turbo_module: boolean;\n fabric: boolean;\n expo: boolean;\n hermes_version?: string;\n react_native_version?: string;\n component_stack?: string;\n hermes_debug_info?: boolean;\n expo_go_version?: string;\n expo_sdk_version?: string;\n}\n\n/** Loads React Native context at runtime */\nexport class ReactNativeInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeInfo.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event: Event, hint?: EventHint) => {\n const reactNativeError = hint?.originalException ? (hint?.originalException as ReactNativeError) : undefined;\n\n const reactNativeContext: ReactNativeContext = {\n turbo_module: isTurboModuleEnabled(),\n fabric: isFabricEnabled(),\n react_native_version: getReactNativeVersion(),\n expo: isExpo(),\n };\n\n if (isHermesEnabled()) {\n reactNativeContext.js_engine = 'hermes';\n const hermesVersion = getHermesVersion();\n if (hermesVersion) {\n reactNativeContext.hermes_version = hermesVersion;\n }\n reactNativeContext.hermes_debug_info = !isEventWithHermesBytecodeFrames(event);\n } else if (reactNativeError?.jsEngine) {\n reactNativeContext.js_engine = reactNativeError.jsEngine;\n }\n\n if (reactNativeContext.js_engine === 'hermes') {\n event.tags = {\n hermes: 'true',\n ...event.tags,\n };\n }\n\n if (reactNativeError?.componentStack) {\n reactNativeContext.component_stack = reactNativeError.componentStack;\n }\n\n const expoGoVersion = getExpoGoVersion();\n if (expoGoVersion) {\n reactNativeContext.expo_go_version = expoGoVersion;\n }\n\n const expoSdkVersion = getExpoSdkVersion();\n if (expoSdkVersion) {\n reactNativeContext.expo_sdk_version = expoSdkVersion;\n }\n\n event.contexts = {\n react_native_context: reactNativeContext,\n ...event.contexts,\n };\n\n return event;\n });\n }\n}\n\n/**\n * Guess if the event contains frames with Hermes bytecode\n * (thus Hermes bundle doesn't contain debug info)\n * based on the event exception/threads frames.\n *\n * This function can be relied on only if Hermes is enabled!\n *\n * Hermes bytecode position is always line 1 and column 0-based number.\n * If Hermes bundle has debug info, the bytecode frames pos are calculated\n * back to the plain bundle source code positions and line will be > 1.\n *\n * Line 1 contains start time var, it's safe to assume it won't crash.\n * The above only applies when Hermes is enabled.\n *\n * Javascript/Hermes bytecode frames have platform === undefined.\n * Native (Java, ObjC, C++) frames have platform === 'android'/'ios'/'native'.\n */\nfunction isEventWithHermesBytecodeFrames(event: Event): boolean {\n for (const value of event.exception?.values || event.threads?.values || []) {\n for (const frame of value.stacktrace?.frames || []) {\n // platform === undefined we assume it's javascript (only native frames use the platform attribute)\n if (frame.platform === undefined && frame.lineno === 1) {\n return true;\n }\n }\n }\n return false;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAW,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAMlG,KAAK,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAEnF,eAAO,MAAM,cAAc,EAAE,cAS5B,CAAC;AAEF,sCAAsC;AACtC,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC,OAAO,CAAC,iBAAiB,CAAwB;IAEjD;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CA4B7E"}
1
+ {"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAW,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAOlG,KAAK,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAEnF,eAAO,MAAM,cAAc,EAAE,cAS5B,CAAC;AAEF,sCAAsC;AACtC,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC,OAAO,CAAC,iBAAiB,CAAwB;IAEjD;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CA8B7E"}
@@ -1,5 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { logger } from '@sentry/utils';
3
+ import { isExpoGo, notWeb } from '../utils/environment';
3
4
  import { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';
4
5
  import { NATIVE } from '../wrapper';
5
6
  export const defaultSdkInfo = {
@@ -33,8 +34,10 @@ export class SdkInfo {
33
34
  }
34
35
  catch (e) {
35
36
  // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.
36
- logger.warn('[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:');
37
- logger.warn(e);
37
+ if (notWeb() && !isExpoGo()) {
38
+ logger.warn('[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:');
39
+ logger.warn(e);
40
+ }
38
41
  }
39
42
  }
40
43
  event.platform = event.platform || 'javascript';
@@ -1 +1 @@
1
- {"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,WAAW;SACrB;KACF;IACD,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,sCAAsC;AACtC,MAAM,OAAO,OAAO;IAApB;QAME;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;QAEzB,sBAAiB,GAAmB,IAAI,CAAC;IAiCnD,CAAC;IA/BC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAM,KAAK,EAAC,EAAE;YACpC,+FAA+F;YAC/F,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,EAAE;gBACnC,IAAI;oBACF,IAAI,CAAC,iBAAiB,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;iBAC5D;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,GAAG,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;YAC5B,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC;YACvD,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC;YAChE,KAAK,CAAC,GAAG,CAAC,QAAQ,GAAG;gBACnB,wEAAwE;gBACxE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;gBAC7B,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;aAChE,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA1CD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import type { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkPackage: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async event => {\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (this._nativeSdkPackage === null) {\n try {\n this._nativeSdkPackage = 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 = event.sdk || {};\n event.sdk.name = event.sdk.name || defaultSdkInfo.name;\n event.sdk.version = event.sdk.version || defaultSdkInfo.version;\n event.sdk.packages = [\n // default packages are added by baseclient and should not be added here\n ...(event.sdk.packages || []),\n ...((this._nativeSdkPackage && [this._nativeSdkPackage]) || []),\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,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,WAAW;SACrB;KAC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EF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA5CD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import type { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkPackage: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async event => {\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (this._nativeSdkPackage === null) {\n try {\n this._nativeSdkPackage = 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 if (notWeb() && !isExpoGo()) {\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\n event.platform = event.platform || 'javascript';\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || defaultSdkInfo.name;\n event.sdk.version = event.sdk.version || defaultSdkInfo.version;\n event.sdk.packages = [\n // default packages are added by baseclient and should not be added here\n ...(event.sdk.packages || []),\n ...((this._nativeSdkPackage && [this._nativeSdkPackage]) || []),\n ];\n\n return event;\n });\n }\n}\n"]}
@@ -155,4 +155,10 @@ export interface ReactNativeWrapperOptions {
155
155
  /** Props for the root touch event boundary */
156
156
  touchEventBoundaryProps?: TouchEventBoundaryProps;
157
157
  }
158
+ /**
159
+ * If the user has not explicitly set `enableNativeNagger`
160
+ * the function enables native nagging based on the current
161
+ * environment.
162
+ */
163
+ export declare function shouldEnableNativeNagger(userOptions: unknown): boolean;
158
164
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,0DAA0D;IAC1D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC,uEAAuE;IACvE,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAEvC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,+FAA+F;IAC/F,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE;QACnB,yEAAyE;Q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,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,2BAA4B,SAAQ,uBAAuB;IAC1E;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AAEH,MAAM,WAAW,kBAAmB,SAAQ,OAAO,CAAC,2BAA2B,CAAC,EAAE,sBAAsB;CAAG;AAE3G,MAAM,WAAW,wBAAyB,SAAQ,aAAa,CAAC,2BAA2B,CAAC,EAAE,sBAAsB;CAAG;AAEvH,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAkBtE"}
@@ -1,2 +1,24 @@
1
- export {};
1
+ import { Platform } from 'react-native';
2
+ import { getExpoConstants } from './utils/expomodules';
3
+ /**
4
+ * If the user has not explicitly set `enableNativeNagger`
5
+ * the function enables native nagging based on the current
6
+ * environment.
7
+ */
8
+ export function shouldEnableNativeNagger(userOptions) {
9
+ if (typeof userOptions === 'boolean') {
10
+ // User can override the default behavior
11
+ return userOptions;
12
+ }
13
+ if (Platform.OS === 'web' || Platform.OS === 'windows') {
14
+ // We don't want to nag on known platforms that don't support native
15
+ return false;
16
+ }
17
+ const expoConstants = getExpoConstants();
18
+ if (expoConstants && expoConstants.appOwnership === 'expo') {
19
+ // If the app is running in Expo Go, we don't want to nag
20
+ return false;
21
+ }
22
+ return true;
23
+ }
2
24
  //# sourceMappingURL=options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { CaptureContext, ClientOptions, Options } from '@sentry/types';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions extends ClientOptions<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAqLvD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { CaptureContext, ClientOptions, Options } from '@sentry/types';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions extends ClientOptions<ReactNativeTransportOptions>, BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAA6C,GAAG,EAAmC,MAAM,cAAc,CAAC;AAQ/G,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,KAAK,EAA4B,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAgCzG;;GAEG;AACH,wBAAgB,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAwF5D;A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O,KAAK,EAA4B,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AA4BzG;;GAEG;AACH,wBAAgB,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAqD5D;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpD,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,OAAO,CAAC,EAAE,yBAAyB,GAClC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAsBxB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC;AAED;;;GAGG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAe9C;AAED;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAEhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CASxF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CASlG"}
package/dist/js/sdk.js CHANGED
@@ -1,29 +1,19 @@
1
1
  import { __awaiter } from "tslib";
2
- import { getIntegrationsToSetup, hasTracingEnabled, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';
3
- import { HttpClient } from '@sentry/integrations';
4
- import { defaultIntegrations as reactDefaultIntegrations, defaultStackParser, getCurrentHub, makeFetchTransport, } from '@sentry/react';
2
+ import { getIntegrationsToSetup, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';
3
+ import { defaultStackParser, getCurrentHub, makeFetchTransport, } from '@sentry/react';
5
4
  import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
6
5
  import * as React from 'react';
7
- import { Platform } from 'react-native';
8
6
  import { ReactNativeClient } from './client';
9
- import { DebugSymbolicator, DeviceContext, EventOrigin, HermesProfiling, ModulesLoader, ReactNativeErrorHandlers, ReactNativeInfo, Release, SdkInfo, } from './integrations';
10
- import { NativeLinkedErrors } from './integrations/nativelinkederrors';
11
- import { createReactNativeRewriteFrames } from './integrations/rewriteframes';
12
- import { Screenshot } from './integrations/screenshot';
13
- import { ViewHierarchy } from './integrations/viewhierarchy';
7
+ import { getDefaultIntegrations } from './integrations/default';
8
+ import { shouldEnableNativeNagger } from './options';
14
9
  import { ReactNativeScope } from './scope';
15
10
  import { TouchEventBoundary } from './touchevents';
16
11
  import { ReactNativeProfiler, ReactNativeTracing } from './tracing';
17
12
  import { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';
18
13
  import { makeUtf8TextEncoder } from './transports/TextEncoder';
19
- import { getDefaultEnvironment } from './utils/environment';
14
+ import { getDefaultEnvironment, isExpoGo } from './utils/environment';
20
15
  import { safeFactory, safeTracesSampler } from './utils/safe';
21
16
  import { NATIVE } from './wrapper';
22
- const IGNORED_DEFAULT_INTEGRATIONS = [
23
- 'GlobalHandlers',
24
- 'TryCatch',
25
- 'LinkedErrors', // We replace this with `NativeLinkedError`
26
- ];
27
17
  const DEFAULT_OPTIONS = {
28
18
  enableNativeCrashHandling: true,
29
19
  enableNativeNagger: true,
@@ -51,7 +41,7 @@ export function init(passedOptions) {
51
41
  const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative
52
42
  ? NATIVE.isNativeAvailable()
53
43
  : false;
54
- const options = Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), passedOptions), { enableNative,
44
+ const options = Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), passedOptions), { enableNative, enableNativeNagger: shouldEnableNativeNagger(passedOptions.enableNativeNagger),
55
45
  // If custom transport factory fails the SDK won't initialize
56
46
  transport: passedOptions.transport
57
47
  || makeNativeTransportFactory({
@@ -61,50 +51,18 @@ export function init(passedOptions) {
61
51
  if (!('environment' in options)) {
62
52
  options.environment = getDefaultEnvironment();
63
53
  }
64
- const defaultIntegrations = passedOptions.defaultIntegrations || [];
65
- if (passedOptions.defaultIntegrations === undefined) {
66
- defaultIntegrations.push(new ModulesLoader());
67
- if (Platform.OS !== 'web') {
68
- defaultIntegrations.push(new ReactNativeErrorHandlers({
69
- patchGlobalPromise: options.patchGlobalPromise,
70
- }));
71
- }
72
- defaultIntegrations.push(new Release());
73
- defaultIntegrations.push(...[
74
- ...reactDefaultIntegrations.filter((i) => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name)),
75
- ]);
76
- defaultIntegrations.push(new NativeLinkedErrors());
77
- defaultIntegrations.push(new EventOrigin());
78
- defaultIntegrations.push(new SdkInfo());
79
- defaultIntegrations.push(new ReactNativeInfo());
80
- if (__DEV__) {
81
- defaultIntegrations.push(new DebugSymbolicator());
82
- }
83
- defaultIntegrations.push(createReactNativeRewriteFrames());
84
- if (options.enableNative) {
85
- defaultIntegrations.push(new DeviceContext());
86
- }
87
- if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {
88
- defaultIntegrations.push(new HermesProfiling());
89
- }
90
- if (hasTracingEnabled(options) && options.enableAutoPerformanceTracing) {
91
- defaultIntegrations.push(new ReactNativeTracing());
92
- }
93
- if (options.attachScreenshot) {
94
- defaultIntegrations.push(new Screenshot());
95
- }
96
- if (options.attachViewHierarchy) {
97
- defaultIntegrations.push(new ViewHierarchy());
98
- }
99
- if (options.enableCaptureFailedRequests) {
100
- defaultIntegrations.push(new HttpClient());
101
- }
102
- }
54
+ const defaultIntegrations = passedOptions.defaultIntegrations === undefined
55
+ ? getDefaultIntegrations(options)
56
+ : passedOptions.defaultIntegrations;
103
57
  options.integrations = getIntegrationsToSetup({
104
58
  integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),
105
59
  defaultIntegrations,
106
60
  });
107
61
  initAndBind(ReactNativeClient, options);
62
+ if (isExpoGo()) {
63
+ logger.info('Offline caching, native errors features are not available in Expo Go.');
64
+ logger.info('Use EAS Build / Native Release Build to test these features.');
65
+ }
108
66
  }
109
67
  /**
110
68
  * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.