@sentry/react-native 8.5.0 → 8.7.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.
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/expo-handler/build.gradle +20 -0
- package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryExpoPackage.java +22 -0
- package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryReactNativeHostHandler.java +48 -0
- package/android/expo-stubs/README.md +7 -0
- package/android/expo-stubs/build.gradle +23 -0
- package/android/expo-stubs/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/expo-stubs/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/expo-stubs/gradlew +251 -0
- package/android/expo-stubs/gradlew.bat +94 -0
- package/android/expo-stubs/settings.gradle +1 -0
- package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/Package.java +11 -0
- package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +7 -0
- package/android/libs/expo-stubs.jar +0 -0
- package/android/libs/replay-stubs.jar +0 -0
- package/android/replay-stubs/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryFrameDelayCollector.java +128 -0
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +63 -11
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +6 -0
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +6 -0
- package/dist/js/NativeLogListener.d.ts.map +1 -1
- package/dist/js/NativeLogListener.js.map +1 -1
- package/dist/js/NativeRNSentry.d.ts +1 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/RNSentryReplayMaskNativeComponent.d.ts.map +1 -1
- package/dist/js/RNSentryReplayMaskNativeComponent.js +1 -2
- package/dist/js/RNSentryReplayMaskNativeComponent.js.map +1 -1
- package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts.map +1 -1
- package/dist/js/RNSentryReplayUnmaskNativeComponent.js +1 -2
- package/dist/js/RNSentryReplayUnmaskNativeComponent.js.map +1 -1
- package/dist/js/breadcrumb.d.ts.map +1 -1
- package/dist/js/breadcrumb.js.map +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +1 -1
- package/dist/js/client.js.map +1 -1
- package/dist/js/feedback/FeedbackButton.d.ts +2 -1
- package/dist/js/feedback/FeedbackButton.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackButton.js +5 -4
- package/dist/js/feedback/FeedbackButton.js.map +1 -1
- package/dist/js/feedback/{FeedbackWidget.d.ts → FeedbackForm.d.ts} +5 -5
- package/dist/js/feedback/FeedbackForm.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.js → FeedbackForm.js} +32 -30
- package/dist/js/feedback/FeedbackForm.js.map +1 -0
- package/dist/js/feedback/FeedbackForm.styles.d.ts +11 -0
- package/dist/js/feedback/FeedbackForm.styles.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.styles.js → FeedbackForm.styles.js} +1 -1
- package/dist/js/feedback/FeedbackForm.styles.js.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.theme.d.ts → FeedbackForm.theme.d.ts} +7 -5
- package/dist/js/feedback/FeedbackForm.theme.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidget.theme.js → FeedbackForm.theme.js} +1 -1
- package/dist/js/feedback/FeedbackForm.theme.js.map +1 -0
- package/{ts3.8/dist/js/feedback/FeedbackWidget.types.d.ts → dist/js/feedback/FeedbackForm.types.d.ts} +305 -299
- package/dist/js/feedback/FeedbackForm.types.d.ts.map +1 -0
- package/dist/js/feedback/FeedbackForm.types.js +2 -0
- package/dist/js/feedback/FeedbackForm.types.js.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetManager.d.ts → FeedbackFormManager.d.ts} +12 -4
- package/dist/js/feedback/FeedbackFormManager.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetManager.js → FeedbackFormManager.js} +22 -13
- package/dist/js/feedback/FeedbackFormManager.js.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetProvider.d.ts → FeedbackFormProvider.d.ts} +10 -10
- package/dist/js/feedback/FeedbackFormProvider.d.ts.map +1 -0
- package/dist/js/feedback/{FeedbackWidgetProvider.js → FeedbackFormProvider.js} +18 -15
- package/dist/js/feedback/FeedbackFormProvider.js.map +1 -0
- package/dist/js/feedback/ScreenshotButton.d.ts +2 -2
- package/dist/js/feedback/ScreenshotButton.d.ts.map +1 -1
- package/dist/js/feedback/ScreenshotButton.js +6 -5
- package/dist/js/feedback/ScreenshotButton.js.map +1 -1
- package/dist/js/feedback/ShakeToReportBug.d.ts.map +1 -1
- package/dist/js/feedback/ShakeToReportBug.js.map +1 -1
- package/dist/js/feedback/defaults.d.ts +2 -2
- package/dist/js/feedback/defaults.d.ts.map +1 -1
- package/dist/js/feedback/defaults.js.map +1 -1
- package/dist/js/feedback/integration.d.ts +13 -13
- package/dist/js/feedback/integration.d.ts.map +1 -1
- package/dist/js/feedback/integration.js.map +1 -1
- package/dist/js/feedback/lazy.d.ts +5 -0
- package/dist/js/feedback/lazy.d.ts.map +1 -1
- package/dist/js/feedback/lazy.js +12 -0
- package/dist/js/feedback/lazy.js.map +1 -1
- package/dist/js/feedback/utils.d.ts.map +1 -1
- package/dist/js/feedback/utils.js +1 -0
- package/dist/js/feedback/utils.js.map +1 -1
- package/dist/js/index.d.ts +12 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +12 -3
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/appRegistry.d.ts.map +1 -1
- package/dist/js/integrations/appRegistry.js.map +1 -1
- package/dist/js/integrations/breadcrumbs.d.ts.map +1 -1
- package/dist/js/integrations/breadcrumbs.js +1 -1
- package/dist/js/integrations/breadcrumbs.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +4 -5
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +1 -2
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +1 -1
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/expoconstants.d.ts.map +1 -1
- package/dist/js/integrations/expoconstants.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/integrations/expoupdateslistener.d.ts.map +1 -1
- package/dist/js/integrations/expoupdateslistener.js +0 -1
- package/dist/js/integrations/expoupdateslistener.js.map +1 -1
- package/dist/js/integrations/graphql.d.ts.map +1 -1
- package/dist/js/integrations/graphql.js.map +1 -1
- package/dist/js/integrations/logEnricherIntegration.d.ts.map +1 -1
- package/dist/js/integrations/logEnricherIntegration.js +1 -1
- package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts.map +1 -1
- package/dist/js/integrations/modulesloader.js.map +1 -1
- package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
- package/dist/js/integrations/nativelinkederrors.js +1 -0
- package/dist/js/integrations/nativelinkederrors.js.map +1 -1
- package/dist/js/integrations/primitiveTagIntegration.d.ts.map +1 -1
- package/dist/js/integrations/primitiveTagIntegration.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +2 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.js +0 -5
- package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/integrations/release.d.ts.map +1 -1
- package/dist/js/integrations/release.js +1 -1
- package/dist/js/integrations/release.js.map +1 -1
- package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
- package/dist/js/integrations/rewriteframes.js.map +1 -1
- package/dist/js/integrations/screenshot.d.ts.map +1 -1
- package/dist/js/integrations/screenshot.js +1 -1
- package/dist/js/integrations/screenshot.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/supabase.d.ts.map +1 -1
- package/dist/js/integrations/supabase.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +1 -1
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/misc.js.map +1 -1
- package/dist/js/options.d.ts +1 -1
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/playground/examples.d.ts.map +1 -1
- package/dist/js/playground/examples.js.map +1 -1
- package/dist/js/playground/modal.d.ts +2 -2
- package/dist/js/playground/modal.d.ts.map +1 -1
- package/dist/js/playground/modal.js +5 -103
- package/dist/js/playground/modal.js.map +1 -1
- package/dist/js/playground/modal.styles.d.ts +100 -0
- package/dist/js/playground/modal.styles.d.ts.map +1 -0
- package/dist/js/playground/modal.styles.js +98 -0
- package/dist/js/playground/modal.styles.js.map +1 -0
- package/dist/js/profiling/cache.js +2 -2
- package/dist/js/profiling/cache.js.map +1 -1
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
- package/dist/js/profiling/convertHermesProfile.js.map +1 -1
- package/dist/js/profiling/debugid.d.ts.map +1 -1
- package/dist/js/profiling/debugid.js.map +1 -1
- package/dist/js/profiling/hermes.d.ts.map +1 -1
- package/dist/js/profiling/hermes.js.map +1 -1
- package/dist/js/profiling/integration.d.ts.map +1 -1
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/profiling/types.d.ts.map +1 -1
- package/dist/js/profiling/types.js.map +1 -1
- package/dist/js/profiling/utils.d.ts.map +1 -1
- package/dist/js/profiling/utils.js +1 -1
- package/dist/js/profiling/utils.js.map +1 -1
- package/dist/js/replay/CustomMask.d.ts +1 -1
- package/dist/js/replay/CustomMask.d.ts.map +1 -1
- package/dist/js/replay/CustomMask.js +1 -1
- package/dist/js/replay/CustomMask.js.map +1 -1
- package/dist/js/replay/CustomMask.web.d.ts +1 -1
- package/dist/js/replay/CustomMask.web.d.ts.map +1 -1
- package/dist/js/replay/CustomMask.web.js +2 -2
- package/dist/js/replay/CustomMask.web.js.map +1 -1
- package/dist/js/replay/browserReplay.d.ts.map +1 -1
- package/dist/js/replay/browserReplay.js +0 -2
- package/dist/js/replay/browserReplay.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js +21 -2
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/replay/networkUtils.d.ts +0 -1
- package/dist/js/replay/networkUtils.d.ts.map +1 -1
- package/dist/js/replay/networkUtils.js.map +1 -1
- package/dist/js/replay/xhrUtils.d.ts.map +1 -1
- package/dist/js/replay/xhrUtils.js.map +1 -1
- package/dist/js/scopeSync.d.ts.map +1 -1
- package/dist/js/scopeSync.js +1 -1
- package/dist/js/scopeSync.js.map +1 -1
- package/dist/js/sdk.d.ts +21 -0
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +42 -18
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/ModulesCollector.js +1 -1
- package/dist/js/tools/ModulesCollector.js.map +1 -1
- package/dist/js/tools/collectModules.js +0 -1
- package/dist/js/tools/collectModules.js.map +1 -1
- package/dist/js/tools/easBuildHooks.d.ts.map +1 -1
- package/dist/js/tools/easBuildHooks.js +13 -14
- package/dist/js/tools/easBuildHooks.js.map +1 -1
- package/dist/js/tools/enableLogger.js +1 -2
- package/dist/js/tools/enableLogger.js.map +1 -1
- package/dist/js/tools/metroMiddleware.d.ts.map +1 -1
- package/dist/js/tools/metroMiddleware.js.map +1 -1
- package/dist/js/tools/metroconfig.d.ts.map +1 -1
- package/dist/js/tools/metroconfig.js +10 -12
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.js +9 -10
- package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +6 -7
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/sentryOptionsSerializer.d.ts.map +1 -1
- package/dist/js/tools/sentryOptionsSerializer.js +3 -5
- package/dist/js/tools/sentryOptionsSerializer.js.map +1 -1
- package/dist/js/tools/sentryReleaseInjector.d.ts +1 -1
- package/dist/js/tools/sentryReleaseInjector.d.ts.map +1 -1
- package/dist/js/tools/sentryReleaseInjector.js.map +1 -1
- package/dist/js/tools/utils.d.ts.map +1 -1
- package/dist/js/tools/utils.js +7 -10
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tools/vendor/metro/countLines.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.js +5 -5
- package/dist/js/tools/vendor/metro/utils.js.map +1 -1
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +19 -19
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/expoAsset.js.map +1 -1
- package/dist/js/tracing/expoImage.d.ts.map +1 -1
- package/dist/js/tracing/expoImage.js +1 -1
- package/dist/js/tracing/expoImage.js.map +1 -1
- package/dist/js/tracing/expoRouter.d.ts.map +1 -1
- package/dist/js/tracing/expoRouter.js.map +1 -1
- package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
- package/dist/js/tracing/gesturetracing.js.map +1 -1
- package/dist/js/tracing/integrations/appStart.d.ts +19 -1
- package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
- package/dist/js/tracing/integrations/appStart.js +144 -9
- package/dist/js/tracing/integrations/appStart.js.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.js +47 -1
- package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.js +4 -2
- package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js +15 -15
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
- package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
- package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.js +43 -14
- package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.js +2 -2
- package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +0 -1
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts +3 -0
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +6 -4
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/span.d.ts +2 -17
- package/dist/js/tracing/span.d.ts.map +1 -1
- package/dist/js/tracing/span.js +1 -1
- package/dist/js/tracing/span.js.map +1 -1
- package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.js +42 -19
- package/dist/js/tracing/timetodisplay.js.map +1 -1
- package/dist/js/tracing/timetodisplaynative.d.ts +1 -1
- package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplaynative.js +5 -4
- package/dist/js/tracing/timetodisplaynative.js.map +1 -1
- package/dist/js/tracing/types.js.map +1 -1
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/encodePolyfill.d.ts +1 -1
- package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
- package/dist/js/transports/encodePolyfill.js.map +1 -1
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
- package/dist/js/utils/encode.js.map +1 -1
- package/dist/js/utils/envelope.d.ts.map +1 -1
- package/dist/js/utils/envelope.js.map +1 -1
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/expomodules.d.ts.map +1 -1
- package/dist/js/utils/expomodules.js.map +1 -1
- package/dist/js/utils/fill.js +1 -1
- package/dist/js/utils/fill.js.map +1 -1
- package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
- package/dist/js/utils/normalize.js +2 -2
- package/dist/js/utils/normalize.js.map +1 -1
- package/dist/js/utils/outcome.js.map +1 -1
- package/dist/js/utils/primitiveConverter.js.map +1 -1
- package/dist/js/utils/release.js.map +1 -1
- package/dist/js/utils/rnlibraries.d.ts.map +1 -1
- package/dist/js/utils/rnlibraries.js +1 -7
- package/dist/js/utils/rnlibraries.js.map +1 -1
- package/dist/js/utils/safe.d.ts.map +1 -1
- package/dist/js/utils/safe.js.map +1 -1
- package/dist/js/utils/span.d.ts.map +1 -1
- package/dist/js/utils/span.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +0 -1
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/utils/xhr.d.ts +0 -1
- package/dist/js/utils/xhr.d.ts.map +1 -1
- package/dist/js/utils/xhr.js.map +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.js +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
- package/dist/js/vendor/buffer/utf8ToBytes.js +1 -1
- package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
- package/dist/js/vendor/react-native/index.d.ts.map +1 -1
- package/dist/js/vendor/react-native/index.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +1 -0
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +20 -9
- package/dist/js/wrapper.js.map +1 -1
- package/expo-module.config.json +7 -0
- package/ios/RNSentry.mm +18 -1
- package/ios/RNSentryReplay.mm +1 -1
- package/ios/RNSentrySDK.m +1 -1
- package/ios/RNSentryStart.m +4 -1
- package/ios/RNSentryTimeToDisplay.m +48 -32
- package/ios/RNSentryVersion.m +1 -1
- package/ios/SentryScreenFramesWrapper.h +2 -0
- package/ios/SentryScreenFramesWrapper.m +35 -0
- package/package.json +18 -22
- package/plugin/build/logger.js +1 -1
- package/plugin/build/utils.js +2 -0
- package/plugin/build/withSentry.js +1 -2
- package/plugin/build/withSentryAndroid.js +2 -0
- package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
- package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
- package/plugin/build/withSentryIOS.js +1 -3
- package/scripts/eas-build-hook.js +0 -2
- package/scripts/expo-upload-sourcemaps.js +0 -1
- package/src/js/NativeRNSentry.ts +3 -0
- package/src/js/RNSentryReplayMaskNativeComponent.ts +2 -3
- package/src/js/RNSentryReplayUnmaskNativeComponent.ts +2 -3
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
- package/ts3.8/dist/js/feedback/FeedbackButton.d.ts +2 -1
- package/ts3.8/dist/js/feedback/{FeedbackWidget.d.ts → FeedbackForm.d.ts} +5 -5
- package/ts3.8/dist/js/feedback/FeedbackForm.styles.d.ts +11 -0
- package/ts3.8/dist/js/feedback/{FeedbackWidget.theme.d.ts → FeedbackForm.theme.d.ts} +7 -5
- package/{dist/js/feedback/FeedbackWidget.types.d.ts → ts3.8/dist/js/feedback/FeedbackForm.types.d.ts} +305 -299
- package/ts3.8/dist/js/feedback/{FeedbackWidgetManager.d.ts → FeedbackFormManager.d.ts} +12 -4
- package/ts3.8/dist/js/feedback/{FeedbackWidgetProvider.d.ts → FeedbackFormProvider.d.ts} +10 -10
- package/ts3.8/dist/js/feedback/ScreenshotButton.d.ts +2 -2
- package/ts3.8/dist/js/feedback/defaults.d.ts +2 -2
- package/ts3.8/dist/js/feedback/integration.d.ts +13 -13
- package/ts3.8/dist/js/feedback/lazy.d.ts +5 -0
- package/ts3.8/dist/js/index.d.ts +12 -3
- package/ts3.8/dist/js/options.d.ts +1 -1
- package/ts3.8/dist/js/playground/modal.d.ts +2 -2
- package/ts3.8/dist/js/playground/modal.styles.d.ts +100 -0
- package/ts3.8/dist/js/replay/CustomMask.d.ts +1 -1
- package/ts3.8/dist/js/replay/CustomMask.web.d.ts +1 -1
- package/ts3.8/dist/js/replay/networkUtils.d.ts +0 -1
- package/ts3.8/dist/js/sdk.d.ts +21 -0
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +19 -1
- package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnavigation.d.ts +3 -0
- package/ts3.8/dist/js/tracing/span.d.ts +2 -17
- package/ts3.8/dist/js/tracing/timetodisplaynative.d.ts +1 -1
- package/ts3.8/dist/js/transports/encodePolyfill.d.ts +1 -1
- package/ts3.8/dist/js/utils/worldwide.d.ts +0 -1
- package/ts3.8/dist/js/utils/xhr.d.ts +0 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +1 -0
- package/dist/js/feedback/FeedbackWidget.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.js.map +0 -1
- package/dist/js/feedback/FeedbackWidget.styles.d.ts +0 -11
- package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.styles.js.map +0 -1
- package/dist/js/feedback/FeedbackWidget.theme.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.theme.js.map +0 -1
- package/dist/js/feedback/FeedbackWidget.types.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidget.types.js +0 -2
- package/dist/js/feedback/FeedbackWidget.types.js.map +0 -1
- package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidgetManager.js.map +0 -1
- package/dist/js/feedback/FeedbackWidgetProvider.d.ts.map +0 -1
- package/dist/js/feedback/FeedbackWidgetProvider.js.map +0 -1
- package/ts3.8/dist/js/feedback/FeedbackWidget.styles.d.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoconstants.js","sourceRoot":"","sources":["../../../src/js/integrations/expoconstants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expoconstants.js","sourceRoot":"","sources":["../../../src/js/integrations/expoconstants.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAA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UAAU,CAAC,OAAO,CAAC,CAAC;IACzE,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,kBAAkB,CAAC,OAA6B,EAAE,aAA4B;IACrF,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import type { Event, Integration } from '@sentry/core';\n\nimport type { ExpoConstants } from '../utils/expoglobalobject';\n\nimport { isExpo } from '../utils/environment';\nimport { getExpoConstants } from '../utils/expomodules';\n\nconst INTEGRATION_NAME = 'ExpoConstants';\n\nexport const EXPO_CONSTANTS_CONTEXT_KEY = 'expo_constants';\n\n/** Load Expo Constants as event context. */\nexport const expoConstantsIntegration = (): Integration => {\n let _expoConstantsContextCached: ExpoConstantsContext | undefined;\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n event.contexts = event.contexts || {};\n event.contexts[EXPO_CONSTANTS_CONTEXT_KEY] = {\n ...getExpoConstantsContextCached(),\n };\n\n return event;\n }\n\n function getExpoConstantsContextCached(): ExpoConstantsContext {\n if (_expoConstantsContextCached) {\n return _expoConstantsContextCached;\n }\n\n return (_expoConstantsContextCached = getExpoConstantsContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoConstantsContext(): ExpoConstantsContext {\n const expoConstants = getExpoConstants();\n if (!expoConstants) {\n return {};\n }\n\n const context: ExpoConstantsContext = {};\n\n addStringField(context, 'execution_environment', expoConstants.executionEnvironment);\n addStringField(context, 'app_ownership', expoConstants.appOwnership);\n addBooleanField(context, 'debug_mode', expoConstants.debugMode);\n addStringField(context, 'expo_version', expoConstants.expoVersion);\n addStringField(context, 'expo_runtime_version', expoConstants.expoRuntimeVersion);\n addStringField(context, 'session_id', expoConstants.sessionId);\n addNumberField(context, 'status_bar_height', expoConstants.statusBarHeight);\n\n addExpoConfigFields(context, expoConstants);\n addEasConfigFields(context, expoConstants);\n\n return context;\n}\n\nfunction addStringField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: string | null | undefined,\n): void {\n if (typeof value === 'string' && value) {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addBooleanField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: boolean | undefined,\n): void {\n if (typeof value === 'boolean') {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addNumberField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: number | undefined,\n): void {\n if (typeof value === 'number') {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addExpoConfigFields(context: ExpoConstantsContext, expoConstants: ExpoConstants): void {\n if (!expoConstants.expoConfig) {\n return;\n }\n\n addStringField(context, 'app_name', expoConstants.expoConfig.name);\n addStringField(context, 'app_slug', expoConstants.expoConfig.slug);\n addStringField(context, 'app_version', expoConstants.expoConfig.version);\n addStringField(context, 'expo_sdk_version', expoConstants.expoConfig.sdkVersion);\n}\n\nfunction addEasConfigFields(context: ExpoConstantsContext, expoConstants: ExpoConstants): void {\n if (!expoConstants.easConfig) {\n return;\n }\n\n addStringField(context, 'eas_project_id', expoConstants.easConfig.projectId);\n}\n\ntype ExpoConstantsContext = Partial<{\n execution_environment: string;\n app_ownership: string;\n debug_mode: boolean;\n expo_version: string;\n expo_runtime_version: string;\n session_id: string;\n status_bar_height: number;\n app_name: string;\n app_slug: string;\n app_version: string;\n expo_sdk_version?: string;\n eas_project_id: string;\n}>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,WAAW,EAAkB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,WAAW,EAAkB,MAAM,cAAc,CAAC;AAUvG,eAAO,MAAM,uBAAuB,gBAAgB,CAAC;AAErD,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,QAAO,WAsFzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAqC1D;AAsED,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoE,MAAM,cAAc,CAAC;AAEvG,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,GA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QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { debug, type DeviceContext, type Event, type Integration, type OsContext } from '@sentry/core';\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 captureEmergencyLaunchEvent(client);\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 debug.error('Error setting Expo updates context:', error);\n }\n }\n\n function captureEmergencyLaunchEvent(client: ReactNativeClient): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const updatesContext = getExpoUpdatesContextCached();\n if (!updatesContext.is_emergency_launch) {\n return;\n }\n\n const message = updatesContext.emergency_launch_reason\n ? `Expo Updates emergency launch: ${updatesContext.emergency_launch_reason}`\n : 'Expo Updates emergency launch';\n\n client.captureEvent({\n level: 'warning',\n message,\n tags: {\n 'expo.updates.emergency_launch': 'true',\n },\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 const updatesContext = getExpoUpdatesContextCached();\n\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...updatesContext,\n };\n\n addExpoUpdatesTags(event, updatesContext);\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 addExpoUpdatesTags(event: Event, updatesContext: ExpoUpdatesContext): void {\n event.tags = event.tags || {};\n\n if (updatesContext.update_id) {\n event.tags['expo.updates.update_id'] = updatesContext.update_id;\n }\n if (updatesContext.channel) {\n event.tags['expo.updates.channel'] = updatesContext.channel;\n }\n if (updatesContext.runtime_version) {\n event.tags['expo.updates.runtime_version'] = updatesContext.runtime_version;\n }\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.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoE,MAAM,cAAc,C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C,QAAQ,CAAC,EAAE,CAAE,CAAC;IACjE,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;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,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;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 { debug, type DeviceContext, type Event, type Integration, type OsContext } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\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(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!client.getOptions().enableNative) {\n return;\n }\n\n setExpoUpdatesNativeContext();\n captureEmergencyLaunchEvent(client);\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 debug.error('Error setting Expo updates context:', error);\n }\n }\n\n function captureEmergencyLaunchEvent(client: ReactNativeClient): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const updatesContext = getExpoUpdatesContextCached();\n if (!updatesContext.is_emergency_launch) {\n return;\n }\n\n const message = updatesContext.emergency_launch_reason\n ? `Expo Updates emergency launch: ${updatesContext.emergency_launch_reason}`\n : 'Expo Updates emergency launch';\n\n client.captureEvent({\n level: 'warning',\n message,\n tags: {\n 'expo.updates.emergency_launch': 'true',\n },\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 const updatesContext = getExpoUpdatesContextCached();\n\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...updatesContext,\n };\n\n addExpoUpdatesTags(event, updatesContext);\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 addExpoUpdatesTags(event: Event, updatesContext: ExpoUpdatesContext): void {\n event.tags = event.tags || {};\n\n if (updatesContext.update_id) {\n event.tags['expo.updates.update_id'] = updatesContext.update_id;\n }\n if (updatesContext.channel) {\n event.tags['expo.updates.channel'] = updatesContext.channel;\n }\n if (updatesContext.runtime_version) {\n event.tags['expo.updates.runtime_version'] = updatesContext.runtime_version;\n }\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":"expoupdateslistener.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expoupdateslistener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAsB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"expoupdateslistener.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expoupdateslistener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAsB,MAAM,cAAc,CAAC;AAU1F;;;GAGG;AACH,UAAU,gCAAgC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,kBAAkB,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,QAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB;AAwFD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,QAAO,WAwCjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,CAAC,gCAAgC,CAAC,EACnD,OAAO,EAAE,gCAAgC,GACxC,IAAI,CAWN"}
|
|
@@ -8,7 +8,6 @@ const BREADCRUMB_CATEGORY = 'expo.updates';
|
|
|
8
8
|
*/
|
|
9
9
|
function getExpoUpdatesExports() {
|
|
10
10
|
try {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
12
11
|
const expoUpdates = require('expo-updates');
|
|
13
12
|
if (typeof expoUpdates.addUpdatesStateChangeListener === 'function') {
|
|
14
13
|
return expoUpdates;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoupdateslistener.js","sourceRoot":"","sources":["../../../src/js/integrations/expoupdateslistener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAwC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"expoupdateslistener.js","sourceRoot":"","sources":["../../../src/js/integrations/expoupdateslistener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAwC,MAAM,cAAc,CAAC;AAI1F,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAE/C,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAkC3C;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAgC,CAAC;QAC3E,IAAI,OAAO,WAAW,CAAC,6BAA6B,KAAK,UAAU,EAAE,CAAC;YACpE,OAAO,WAAiC,CAAC;QAC3C,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G,CAAC;YACxB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACtB,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,EAAE,CAAC;YACvB,YAAY,GAAG,SAAS,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAmD,EACnD,OAAyC;;IAEzC,KAAK,MAAM,UAAU,IAAI,iBAAiB,EAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7D,aAAa,CAAC;gBACZ,QAAQ,EAAE,mBAAmB;gBAC7B,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,IAAI,EAAE,MAAA,UAAU,CAAC,OAAO,2DAAG,OAAO,CAAC;aACpC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { addBreadcrumb, debug, type Integration, type SeverityLevel } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\n\nimport { isExpo, isExpoGo } from '../utils/environment';\n\nconst INTEGRATION_NAME = 'ExpoUpdatesListener';\n\nconst BREADCRUMB_CATEGORY = 'expo.updates';\n\n/**\n * Describes the state machine context from `expo-updates`.\n * We define our own minimal type to avoid a hard dependency on `expo-updates`.\n */\ninterface UpdatesNativeStateMachineContext {\n isChecking: boolean;\n isDownloading: boolean;\n isUpdateAvailable: boolean;\n isUpdatePending: boolean;\n isRestarting: boolean;\n latestManifest?: { id?: string };\n downloadedManifest?: { id?: string };\n rollback?: { commitTime: string };\n checkError?: Error;\n downloadError?: Error;\n}\n\ninterface UpdatesNativeStateChangeEvent {\n context: UpdatesNativeStateMachineContext;\n}\n\ninterface UpdatesStateChangeSubscription {\n remove(): void;\n}\n\ninterface ExpoUpdatesExports {\n addUpdatesStateChangeListener: (\n listener: (event: UpdatesNativeStateChangeEvent) => void,\n ) => UpdatesStateChangeSubscription;\n latestContext: UpdatesNativeStateMachineContext;\n}\n\n/**\n * Tries to load `expo-updates` and retrieve exports needed by this integration.\n * Returns `undefined` if `expo-updates` is not installed.\n */\nfunction getExpoUpdatesExports(): ExpoUpdatesExports | undefined {\n try {\n const expoUpdates = require('expo-updates') as Partial<ExpoUpdatesExports>;\n if (typeof expoUpdates.addUpdatesStateChangeListener === 'function') {\n return expoUpdates as ExpoUpdatesExports;\n }\n } catch (_) {\n // that happens when expo-updates is not installed\n }\n return undefined;\n}\n\ninterface StateTransition {\n field: keyof UpdatesNativeStateMachineContext;\n message: string;\n level: SeverityLevel;\n getData?: (ctx: UpdatesNativeStateMachineContext) => Record<string, unknown> | undefined;\n}\n\nconst STATE_TRANSITIONS: StateTransition[] = [\n { field: 'isChecking', message: 'Checking for update', level: 'info' },\n {\n field: 'isUpdateAvailable',\n message: 'Update available',\n level: 'info',\n getData: ctx => {\n const updateId = ctx.latestManifest?.id;\n return updateId ? { updateId } : undefined;\n },\n },\n { field: 'isDownloading', message: 'Downloading update', level: 'info' },\n {\n field: 'isUpdatePending',\n message: 'Update downloaded',\n level: 'info',\n getData: ctx => {\n const updateId = ctx.downloadedManifest?.id;\n return updateId ? { updateId } : undefined;\n },\n },\n {\n field: 'checkError',\n message: 'Update check failed',\n level: 'error',\n getData: ctx => ({\n error: (ctx.checkError as Error).message || String(ctx.checkError),\n }),\n },\n {\n field: 'downloadError',\n message: 'Update download failed',\n level: 'error',\n getData: ctx => ({\n error: (ctx.downloadError as Error).message || String(ctx.downloadError),\n }),\n },\n {\n field: 'rollback',\n message: 'Rollback directive received',\n level: 'warning',\n getData: ctx => ({\n commitTime: ctx.rollback!.commitTime,\n }),\n },\n { field: 'isRestarting', message: 'Restarting for update', level: 'info' },\n];\n\n/**\n * Listens to Expo Updates native state machine changes and records\n * breadcrumbs for meaningful transitions such as checking for updates,\n * downloading updates, errors, rollbacks, and restarts.\n */\nexport const expoUpdatesListenerIntegration = (): Integration => {\n let subscription: UpdatesStateChangeSubscription | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesExports();\n if (!expoUpdates) {\n debug.log('[ExpoUpdatesListener] expo-updates is not available, skipping.');\n return;\n }\n\n // Remove any previous subscription to prevent duplicate breadcrumbs\n // if Sentry.init() is called multiple times.\n subscription?.remove();\n\n // Seed with the current state so that the first event does not\n // generate spurious breadcrumbs for already-truthy fields.\n let previousContext: Partial<UpdatesNativeStateMachineContext> = expoUpdates.latestContext ?? {};\n\n subscription = expoUpdates.addUpdatesStateChangeListener((event: UpdatesNativeStateChangeEvent) => {\n const ctx = event.context;\n handleStateChange(previousContext, ctx);\n previousContext = ctx;\n });\n });\n\n client.on('close', () => {\n subscription?.remove();\n subscription = undefined;\n });\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n };\n};\n\n/**\n * Compares previous and current state machine contexts and emits\n * breadcrumbs for meaningful transitions (falsy→truthy).\n *\n * @internal Exposed for testing purposes\n */\nexport function handleStateChange(\n previous: Partial<UpdatesNativeStateMachineContext>,\n current: UpdatesNativeStateMachineContext,\n): void {\n for (const transition of STATE_TRANSITIONS) {\n if (!previous[transition.field] && current[transition.field]) {\n addBreadcrumb({\n category: BREADCRUMB_CATEGORY,\n message: transition.message,\n level: transition.level,\n data: transition.getData?.(current),\n });\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/graphql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/graphql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,UAAU,oCAAoC;IAC5C,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,oCAAoC,GAAG,WAAW,CAE7F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/js/integrations/graphql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/js/integrations/graphql.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,IAAI,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAM9F;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA6C;IAC9E,OAAO,+BAA+B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import type { Integration } from '@sentry/core';\n\nimport { graphqlClientIntegration as browserGraphqlClientIntegration } from '@sentry/browser';\n\ninterface GraphQLReactNativeIntegrationOptions {\n endpoints: Array<string | RegExp>;\n}\n\n/**\n * This integration ensures that GraphQL requests made in the React Native apps\n * have their GraphQL-specific data captured and attached to spans and breadcrumbs.\n */\nexport function graphqlIntegration(options: GraphQLReactNativeIntegrationOptions): Integration {\n return browserGraphqlClientIntegration({ endpoints: options.endpoints });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEnricherIntegration.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logEnricherIntegration.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAO,MAAM,cAAc,CAAC;AAUrD,eAAO,MAAM,sBAAsB,QAAO,WAkBzC,CAAC"}
|
|
@@ -41,8 +41,8 @@ function setLogAttribute(logAttributes, key, value, setEvenIfPresent = true) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
function cacheLogContext() {
|
|
44
|
-
var _a, _b, _c, _d, _e, _f;
|
|
45
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f;
|
|
46
46
|
try {
|
|
47
47
|
const response = yield NATIVE.fetchNativeLogAttributes();
|
|
48
48
|
NativeCache = Object.assign(Object.assign(Object.assign({}, (((_a = response === null || response === void 0 ? void 0 : response.contexts) === null || _a === void 0 ? void 0 : _a.device) && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEnricherIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"logEnricherIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIzF,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK,CAAC,MAAyB;YAC7B,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC1B,eAAe,EAAE,CAAC,IAAI,CACpB,GAAG,EAAE;oBACH,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAA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\n\nimport { debug, getCurrentScope, getGlobalScope, getIsolationScope } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\n\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'LogEnricher';\n\nexport const logEnricherIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setup(client: ReactNativeClient) {\n client.on('afterInit', () => {\n cacheLogContext().then(\n () => {\n client.on('beforeCaptureLog', (log: Log) => {\n processLog(log, client);\n });\n },\n reason => {\n debug.log(reason);\n },\n );\n });\n },\n };\n};\n\nlet NativeCache: Record<string, unknown> | undefined = undefined;\n\n/**\n * Sets a log attribute if the value exists and the attribute key is not already present.\n *\n * @param logAttributes - The log attributes object to modify.\n * @param key - The attribute key to set.\n * @param value - The value to set (only sets if not null/undefined and key not present).\n * @param setEvenIfPresent - Whether to set the attribute if it is present. Defaults to true.\n */\nfunction setLogAttribute(\n logAttributes: Record<string, unknown>,\n key: string,\n value: unknown,\n setEvenIfPresent = true,\n): void {\n if (value != null && (!logAttributes[key] || setEvenIfPresent)) {\n logAttributes[key] = value;\n }\n}\n\nasync function cacheLogContext(): Promise<void> {\n try {\n const response = await NATIVE.fetchNativeLogAttributes();\n\n NativeCache = {\n ...(response?.contexts?.device && {\n brand: response.contexts.device?.brand,\n model: response.contexts.device?.model,\n family: response.contexts.device?.family,\n }),\n ...(response?.contexts?.os && {\n os: response.contexts.os.name,\n version: response.contexts.os.version,\n }),\n ...(response?.contexts?.release && {\n release: response.contexts.release,\n }),\n };\n } catch (e) {\n return Promise.reject(`[LOGS]: Failed to prepare attributes from Native Layer: ${e}`);\n }\n return Promise.resolve();\n}\n\nfunction processLog(log: Log, client: ReactNativeClient): void {\n if (NativeCache === undefined) {\n return;\n }\n\n // Save log.attributes to a new variable\n const logAttributes = log.attributes ?? {};\n\n // Apply scope attributes from all active scopes (global, isolation, and current)\n // These are applied first so they can be overridden by more specific attributes\n const scopeAttributes = collectScopeAttributes();\n Object.keys(scopeAttributes).forEach((key: string) => {\n setLogAttribute(logAttributes, key, scopeAttributes[key], false);\n });\n\n // Use setLogAttribute with the variable instead of direct assignment\n setLogAttribute(logAttributes, 'device.brand', NativeCache.brand);\n setLogAttribute(logAttributes, 'device.model', NativeCache.model);\n setLogAttribute(logAttributes, 'device.family', NativeCache.family);\n setLogAttribute(logAttributes, 'os.name', NativeCache.os);\n setLogAttribute(logAttributes, 'os.version', NativeCache.version);\n setLogAttribute(logAttributes, 'sentry.release', NativeCache.release);\n\n const replay = client.getIntegrationByName<Integration & { getReplayId: () => string | null }>('MobileReplay');\n setLogAttribute(logAttributes, 'sentry.replay_id', replay?.getReplayId());\n\n // Set log.attributes to the variable\n log.attributes = logAttributes;\n}\n\n/**\n * Extracts primitive attributes from a scope and merges them into the target object.\n * Only string, number, and boolean attribute values are included.\n *\n * @param scope - The scope to extract attributes from\n * @param target - The target object to merge attributes into\n */\nfunction extractScopeAttributes(\n scope: ReturnType<typeof getCurrentScope>,\n target: Record<string, string | number | boolean>,\n): void {\n if (scope && typeof scope.getScopeData === 'function') {\n const scopeAttrs = scope?.getScopeData?.().attributes || {};\n Object.keys(scopeAttrs).forEach(key => {\n const value = scopeAttrs[key];\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n target[key] = value;\n }\n });\n }\n}\n\n/**\n * Collects attributes from all active scopes (global, isolation, and current).\n * Only string, number, and boolean attribute values are supported.\n * Attributes are merged in order of precedence: global < isolation < current.\n *\n * @returns A merged object containing all scope attributes.\n */\nfunction collectScopeAttributes(): Record<string, string | number | boolean> {\n const attributes: Record<string, string | number | boolean> = {};\n\n // Collect attributes from all scopes in order of precedence\n extractScopeAttributes(getGlobalScope(), attributes);\n extractScopeAttributes(getIsolationScope(), attributes);\n extractScopeAttributes(getCurrentScope(), attributes);\n\n return attributes;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modulesloader.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"modulesloader.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,WAAW,EAAE,MAAM,cAAc,CAAC;AAQvD,mDAAmD;AACnD,eAAO,MAAM,wBAAwB,QAAO,WAQ3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modulesloader.js","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"modulesloader.js","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,mDAAmD;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY,EAAE,kBAAkB,EAAE;KACnC,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,kBAAkB;IACzB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,OAAO,GAAkC,IAAI,CAAC;IAElD,OAAO,CAAO,KAAY,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC;gBACH,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;YACxC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,KAAK,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;YACvD,CAAC;YACD,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,CAAC,OAAO,mCACR,OAAO,GACP,KAAK,CAAC,OAAO,CACjB,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import type { Event, Integration } from '@sentry/core';\n\nimport { debug } from '@sentry/core';\n\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ModulesLoader';\n\n/** Loads runtime JS modules from prepared file. */\nexport const modulesLoaderIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: createProcessEvent(),\n };\n};\n\nfunction createProcessEvent(): (event: Event) => Promise<Event> {\n let isSetup = false;\n let modules: Record<string, string> | null = null;\n\n return async (event: Event) => {\n if (!isSetup) {\n try {\n modules = await NATIVE.fetchModules();\n } catch (e) {\n debug.log(`Failed to get modules from native: ${e}`);\n }\n isSetup = true;\n }\n if (modules) {\n event.modules = {\n ...modules,\n ...event.modules,\n };\n }\n return event;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativelinkederrors.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nativelinkederrors.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOV,WAAW,EAGZ,MAAM,cAAc,CAAC;AActB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAS,OAAO,CAAC,mBAAmB,CAAM,KAAG,WAY1F,CAAC"}
|
|
@@ -63,6 +63,7 @@ function walkErrorTree(parser, limit, error, key, exceptions = [], debugImages =
|
|
|
63
63
|
exception = exceptionFromError(parser, error[key]);
|
|
64
64
|
}
|
|
65
65
|
else if (isPlainObject(linkedError)) {
|
|
66
|
+
// oxlint-disable-next-line typescript-eslint(no-unnecessary-type-assertion)
|
|
66
67
|
const plainError = linkedError;
|
|
67
68
|
exception = {
|
|
68
69
|
type: typeof plainError.name === 'string' ? plainError.name : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAYrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AAOxB;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAwC,EAAE,EAAe,EAAE;IACvG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAS,EAAE;YACpB,OAAO;QACT,CAAC;QACD,eAAe,EAAE,CAAC,KAAY,EAAE,IAAe,EAAE,MAAc,EAAQ,EAAE,CACvE,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAAY,EAAE,IAA2B,EAAE,MAAc,EAAE,KAAa,EAAE,GAAW;;IAC5G,IAAI,CAAC,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,CAAA,IAAI,CAAC,IAAI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;AAC3D,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport { isInstanceOf, isPlainObject, isString } from '@sentry/core';\nimport type { NativeStackFrames } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'NativeLinkedErrors';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptions> = {}): Integration => {\n const key = options.key || DEFAULT_KEY;\n const limit = options.limit || DEFAULT_LIMIT;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: (): void => {\n // noop\n },\n preprocessEvent: (event: Event, hint: EventHint, client: Client): void =>\n preprocessEvent(event, hint, client, limit, key),\n };\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n const parser = client.getOptions().stackParser;\n\n const { exceptions: linkedErrors, debugImages } = walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n}\n\n/**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\nfunction walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n} {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if (isString(linkedError)) {\n exception = {\n value: linkedError,\n };\n } else if ('stackElements' in linkedError) {\n // isJavaException\n exception = exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n const plainError = linkedError as Record<string, unknown>;\n exception = {\n type: typeof plainError.name === 'string' ? plainError.name : undefined,\n value: typeof plainError.message === 'string' ? plainError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n}\n\n/**\n * Converts a Java Throwable to an SentryException\n */\nfunction exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n}): Exception {\n const nativePackage = fetchNativePackage();\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,\n },\n )\n .reverse(),\n },\n };\n}\n\n/**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\nfunction exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n}): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n} {\n const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: nativeStackFrames?.frames.reverse() || [],\n },\n },\n appleDebugImages: (nativeStackFrames?.debugMetaImages as DebugImage[]) || [],\n };\n}\n\nlet nativePackage: string | null = null;\n/**\n * Fetches the native package/image name from the native layer\n */\nfunction fetchNativePackage(): string | null {\n if (nativePackage === null) {\n nativePackage = NATIVE.fetchNativePackageName();\n }\n return nativePackage;\n}\n\n/**\n * Fetches native debug image information on iOS\n */\nfunction fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AAOxB;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAwC,EAAE,EAAe,EAAE;IACvG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAS,EAAE;YACpB,OAAO;QACT,CAAC;QACD,eAAe,EAAE,CAAC,KAAY,EAAE,IAAe,EAAE,MAAc,EAAQ,EAAE,CACvE,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC;KACnD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AACJ,CAAC;AAED,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC;;GAEG;AACH,SAAS,kBAAkB;IACzB,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;QAC3B,aAAa,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,gBAA0B;IACxD,OAAO,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n StackFrame,\n StackParser,\n} from '@sentry/core';\n\nimport { exceptionFromError } from '@sentry/browser';\nimport { isInstanceOf, isPlainObject, isString } from '@sentry/core';\n\nimport type { NativeStackFrames } from '../NativeRNSentry';\n\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'NativeLinkedErrors';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptions> = {}): Integration => {\n const key = options.key || DEFAULT_KEY;\n const limit = options.limit || DEFAULT_LIMIT;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: (): void => {\n // noop\n },\n preprocessEvent: (event: Event, hint: EventHint, client: Client): void =>\n preprocessEvent(event, hint, client, limit, key),\n };\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n const parser = client.getOptions().stackParser;\n\n const { exceptions: linkedErrors, debugImages } = walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n}\n\n/**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\nfunction walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n} {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if (isString(linkedError)) {\n exception = {\n value: linkedError,\n };\n } else if ('stackElements' in linkedError) {\n // isJavaException\n exception = exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n // oxlint-disable-next-line typescript-eslint(no-unnecessary-type-assertion)\n const plainError = linkedError as Record<string, unknown>;\n exception = {\n type: typeof plainError.name === 'string' ? plainError.name : undefined,\n value: typeof plainError.message === 'string' ? plainError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n}\n\n/**\n * Converts a Java Throwable to an SentryException\n */\nfunction exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n}): Exception {\n const nativePackage = fetchNativePackage();\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,\n },\n )\n .reverse(),\n },\n };\n}\n\n/**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\nfunction exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n}): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n} {\n const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: nativeStackFrames?.frames.reverse() || [],\n },\n },\n appleDebugImages: (nativeStackFrames?.debugMetaImages as DebugImage[]) || [],\n };\n}\n\nlet nativePackage: string | null = null;\n/**\n * Fetches the native package/image name from the native layer\n */\nfunction fetchNativePackage(): string | null {\n if (nativePackage === null) {\n nativePackage = NATIVE.fetchNativePackageName();\n }\n return nativePackage;\n}\n\n/**\n * Fetches native debug image information on iOS\n */\nfunction fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveTagIntegration.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/primitiveTagIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"primitiveTagIntegration.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/primitiveTagIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,cAAc,CAAC;AAK3D,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,QAAO,WAkB1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveTagIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/primitiveTagIntegration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"primitiveTagIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/primitiveTagIntegration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAgB,EAAE;IACvD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK,CAAC,MAAM;YACV,MAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE;gBACnC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;oBACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;wBACpC,KAAK,CAAC,IAAK,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAK,CAAC,GAAG,CAAC,CAAC,CAAC;oBACzD,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,aAAa;YACX,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;gBACxB,MAAM,CAAC,sBAAsB,CAAC,CAAC,KAAgB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;YAChF,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Integration, Primitive } from '@sentry/core';\n\nimport { PrimitiveToString } from '../utils/primitiveConverter';\nimport { NATIVE } from '../wrapper';\n\nexport const INTEGRATION_NAME = 'PrimitiveTagIntegration';\n\n/**\n * Format tags set with Primitive values with a standard string format.\n *\n * When this Integration is enable, the following types will have the following behaviour:\n *\n * Unaltered: string, null, number, and undefined values remain unchanged.\n *\n * Altered:\n * Boolean values are now capitalized: true -> True, false -> False.\n * Symbols are stringified.\n *\n */\nexport const primitiveTagIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n client.on('beforeSendEvent', event => {\n if (event.tags) {\n Object.keys(event.tags).forEach(key => {\n event.tags![key] = PrimitiveToString(event.tags![key]);\n });\n }\n });\n },\n afterAllSetup() {\n if (NATIVE.enableNative) {\n NATIVE._setPrimitiveProcessor((value: Primitive) => PrimitiveToString(value));\n }\n },\n };\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;
|
|
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;AAoB1E,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,GAC9C,UAAS,OAAO,CAAC,+BAA+B,CAAM,KACrD,WAWF,CAAC"}
|
|
@@ -107,8 +107,9 @@ function setupErrorUtilsGlobalHandler() {
|
|
|
107
107
|
debug.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-member-access)
|
|
110
111
|
const defaultHandler = (_a = errorUtils.getGlobalHandler) === null || _a === void 0 ? void 0 : _a.call(errorUtils);
|
|
111
|
-
//
|
|
112
|
+
// oxlint-disable-next-line typescript-eslint(no-explicit-any), typescript-eslint(no-unsafe-member-access)
|
|
112
113
|
errorUtils.setGlobalHandler((error, isFatal) => __awaiter(this, void 0, void 0, function* () {
|
|
113
114
|
// We want to handle fatals, but only in production mode.
|
|
114
115
|
const shouldHandleFatal = isFatal && !__DEV__;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,qBAAqB,EACrB,iDAAiD,EACjD,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,eAAe,GAChB,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;IAC7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,OAAO,EAAE;YACX,gFAAgF;YAChF,mCAAmC;YACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO;SACR;QAED,KAAK,MAAM,CAAC,KAAK,CAAE,MAAM,CAAC,UAAU,EAA+B,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAC/F,GAAG,EAAE;YACH,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,KAAK,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAC/G,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 debug,\n getClient,\n getCurrentScope,\n} from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\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 debug.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 debug.log('Unhandled promise rejections will be caught by Sentry.');\n } else if (isWeb()) {\n debug.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 debug.log('Unhandled promise rejections will not be caught by Sentry.');\n }\n } catch (e) {\n debug.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 debug.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 debug.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 debug.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = 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 debug.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 debug.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() as ReactNativeClientOptions).shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n debug.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":";;;;;;;;;AAEA,OAAO,EACL,qBAAqB,EACrB,iDAAiD,EACjD,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,eAAe,GAChB,MAAM,cAAc,CAAC;AAItB,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;IAC7F,OAAO,CAAC,OAAO,IAAI,4BAA4B,EAAE,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,SAAS,gCAAgC,CAAC,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AC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEjC,IAAI,OAAO,EAAE,CAAC;YACZ,gFAAgF;YAChF,mCAAmC;YACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO;QACT,CAAC;QAED,KAAK,MAAM,CAAC,KAAK,CAAE,MAAM,CAAC,UAAU,EAA+B,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAC/F,GAAG,EAAE;YACH,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,KAAK,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAC/G,CAAC,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { EventHint, Integration, SeverityLevel } from '@sentry/core';\n\nimport {\n addExceptionMechanism,\n addGlobalUnhandledRejectionInstrumentationHandler,\n captureException,\n debug,\n getClient,\n getCurrentScope,\n} from '@sentry/core';\n\nimport type { ReactNativeClientOptions } from '../options';\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 debug.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 debug.log('Unhandled promise rejections will be caught by Sentry.');\n } else if (isWeb()) {\n debug.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 debug.log('Unhandled promise rejections will not be caught by Sentry.');\n }\n } catch (e) {\n debug.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 debug.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 debug.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 debug.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n // oxlint-disable-next-line typescript-eslint(no-unsafe-member-access)\n const defaultHandler = errorUtils.getGlobalHandler?.();\n\n // oxlint-disable-next-line typescript-eslint(no-explicit-any), typescript-eslint(no-unsafe-member-access)\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 debug.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 debug.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() as ReactNativeClientOptions).shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n debug.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);\n },\n );\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlersutils.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlersutils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reactnativeerrorhandlersutils.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlersutils.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAatC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAChC,CAEA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAoC1C"}
|
|
@@ -17,9 +17,7 @@ export function polyfillPromise() {
|
|
|
17
17
|
}
|
|
18
18
|
const Promise = getPromisePolyfill();
|
|
19
19
|
// As of RN 0.67 only done and finally are used
|
|
20
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
21
20
|
require('promise/setimmediate/done');
|
|
22
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
23
21
|
require('promise/setimmediate/finally');
|
|
24
22
|
ReactNativeLibraries.Utilities.polyfillGlobal('Promise', () => Promise);
|
|
25
23
|
}
|
|
@@ -28,7 +26,6 @@ export function polyfillPromise() {
|
|
|
28
26
|
* This is important for verifying that the rejected promise tracing will work as expected.
|
|
29
27
|
*/
|
|
30
28
|
export function getPromisePolyfill() {
|
|
31
|
-
/* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */
|
|
32
29
|
// Below, we follow the exact way React Native initializes its promise library, and we globally replace it.
|
|
33
30
|
return require('promise/setimmediate/es6-extensions');
|
|
34
31
|
}
|
|
@@ -36,7 +33,6 @@ export function getPromisePolyfill() {
|
|
|
36
33
|
* Lazy require the rejection tracking module
|
|
37
34
|
*/
|
|
38
35
|
export function requireRejectionTracking() {
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
|
|
40
36
|
return require('promise/setimmediate/rejection-tracking');
|
|
41
37
|
}
|
|
42
38
|
/**
|
|
@@ -50,7 +46,6 @@ export function checkPromiseAndWarn() {
|
|
|
50
46
|
// We have to check if the React Native Promise and the `promise` package Promise are using the same reference.
|
|
51
47
|
// If they are not, likely there are multiple versions of the `promise` package installed.
|
|
52
48
|
const ReactNativePromise = ReactNativeLibraries.Promise;
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
|
|
54
49
|
const PromisePackagePromise = require('promise/setimmediate/es6-extensions');
|
|
55
50
|
const UsedPromisePolyfill = getPromisePolyfill();
|
|
56
51
|
if (ReactNativePromise !== PromisePackagePromise) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlersutils.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlersutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativeerrorhandlersutils.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlersutils.ts"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QAED,qEAAqE;QACrE,IAAI,mBAAmB,KAAK,aAAa,CAAC,OAAO,EAAE,CAAC;YAClD,KAAK,CAAC,IAAI,CACR,6DAA6D;gBAC3D,sFAAsF,CACzF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,aAAa;QACb,KAAK,CAAC,IAAI,CACR,6DAA6D;YAC3D,sFAAsF,CACzF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { debug } from '@sentry/core';\n\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\nexport function polyfillPromise(): void {\n if (!ReactNativeLibraries.Utilities) {\n debug.warn('Could not polyfill Promise. React Native Libraries Utilities not found.');\n return;\n }\n\n const Promise = getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n ReactNativeLibraries.Utilities.polyfillGlobal('Promise', () => Promise);\n}\n\n/**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\nexport function getPromisePolyfill(): unknown {\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n}\n\n/**\n * Lazy require the rejection tracking module\n */\nexport function requireRejectionTracking(): {\n disable: () => void;\n enable: (arg: unknown) => void;\n} {\n return require('promise/setimmediate/rejection-tracking');\n}\n\n/**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\nexport function checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n const ReactNativePromise = ReactNativeLibraries.Promise;\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n debug.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n debug.warn(\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 } else {\n debug.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n debug.warn(\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativeinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;AAiB3E,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,eAAO,MAAM,0BAA0B,QAAO,WAQ7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reactnativeinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeinfo.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,EACN,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAe3C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAgB,EAAE;IAC1D,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,YAAY,CAAC,KAAY,EAAE,IAAe;IACjD,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;IAE7G,MAAM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K,CAAC,QAAQ,CAClB,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;;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,CAAC;QAC3E,KAAK,MAAM,KAAK,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,KAAI,EAAE,EAAE,CAAC;YACnD,mGAAmG;YACnG,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { Context, Event, EventHint, Integration } from '@sentry/core';\n\nimport type { ReactNativeError } from './debugsymbolicator';\n\nimport {\n getExpoGoVersion,\n getExpoSdkVersion,\n getHermesVersion,\n getReactNativeVersion,\n isExpo,\n isFabricEnabled,\n isHermesEnabled,\n isTurboModuleEnabled,\n} from '../utils/environment';\n\nconst INTEGRATION_NAME = 'ReactNativeInfo';\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 const reactNativeInfoIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nfunction processEvent(event: Event, hint: EventHint): Event {\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 * 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":"release.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiE,WAAW,EAAE,MAAM,cAAc,CAAC;AAM/G,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,QAAO,WAQ3C,CAAC"}
|
|
@@ -20,8 +20,8 @@ export const nativeReleaseIntegration = () => {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
function processEvent(event, _, client) {
|
|
23
|
-
var _a, _b;
|
|
24
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
var _a, _b;
|
|
25
25
|
const options = client.getOptions();
|
|
26
26
|
/*
|
|
27
27
|
__sentry_release and __sentry_dist is set by the user with setRelease and setDist. If this is used then this is the strongest.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/js/integrations/release.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC,iEAAiE;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CACzB,KAAY,EACZ,CAAY,EACZ,MAAmD;;;QAEnD,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAEpC;;;UAGE;QACF,IAAI,OAAO,CAAA,MAAA,K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CAAC;YACb,yCAAyC;QAC3C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CAAA","sourcesContent":["import type { BaseTransportOptions, Client, ClientOptions, Event, EventHint, Integration } from '@sentry/core';\n\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'Release';\n\n/** Release integration responsible to load release from file. */\nexport const nativeReleaseIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(\n event: Event,\n _: EventHint,\n client: Client<ClientOptions<BaseTransportOptions>>,\n): Promise<Event> {\n const options = client.getOptions();\n\n /*\n __sentry_release and __sentry_dist is set by the user with setRelease and setDist. If this is used then this is the strongest.\n Otherwise we check for the release and dist in the options passed on init, as this is stronger than the release/dist from the native build.\n */\n if (typeof event.extra?.__sentry_release === 'string') {\n event.release = `${event.extra.__sentry_release}`;\n } else if (typeof options?.release === 'string') {\n event.release = options.release;\n }\n\n if (typeof event.extra?.__sentry_dist === 'string') {\n event.dist = `${event.extra.__sentry_dist}`;\n } else if (typeof options?.dist === 'string') {\n event.dist = options.dist;\n }\n\n if (event.release && event.dist) {\n return event;\n }\n\n try {\n const nativeRelease = await NATIVE.fetchNativeRelease();\n if (nativeRelease) {\n if (!event.release) {\n event.release = `${nativeRelease.id}@${nativeRelease.version}+${nativeRelease.build}`;\n }\n if (!event.dist) {\n event.dist = `${nativeRelease.build}`;\n }\n }\n } catch (_Oo) {\n // Something went wrong, we just continue\n }\n\n return event;\n}\n"]}
|