@sentry/react-native 8.6.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/android/build.gradle +2 -2
- package/android/expo-handler/build.gradle +1 -1
- 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 +48 -0
- 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} +26 -24
- 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 +1 -1
- 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 +11 -11
- 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 +1 -2
- 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 +0 -1
- 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.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.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 -1
- 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.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.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.map +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.map +1 -1
- package/dist/js/playground/modal.js +4 -102
- 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.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 +38 -16
- 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.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 +4 -5
- 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 +2 -3
- 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 +4 -5
- 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 +2 -3
- package/dist/js/tools/sentryOptionsSerializer.js.map +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 +0 -3
- package/dist/js/tools/utils.js.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 -21
- package/dist/js/touchevents.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 +18 -0
- package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
- package/dist/js/tracing/integrations/appStart.js +141 -6
- 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 +43 -0
- package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.js +0 -1
- 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 +1 -1
- 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 +23 -1
- 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.map +1 -1
- package/dist/js/tracing/reactnavigation.js +2 -2
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- 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/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/native.d.ts.map +1 -1
- package/dist/js/transports/native.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/normalize.js +2 -2
- package/dist/js/utils/normalize.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.map +1 -1
- package/dist/js/utils/worldwide.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 +16 -4
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +18 -1
- package/ios/RNSentryReplay.mm +1 -1
- package/ios/RNSentrySDK.m +1 -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 +17 -21
- 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 +1 -1
- package/ts3.8/dist/js/feedback/defaults.d.ts +2 -2
- package/ts3.8/dist/js/feedback/integration.d.ts +11 -11
- 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/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/sdk.d.ts +21 -0
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +18 -0
- package/ts3.8/dist/js/tracing/timetodisplaynative.d.ts +1 -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
|
@@ -18,9 +18,7 @@ const browserReplayIntegration = (options = {}) => {
|
|
|
18
18
|
const browserReplayIntegrationNoop = () => {
|
|
19
19
|
return {
|
|
20
20
|
name: INTEGRATION_NAME,
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
22
21
|
start: () => { },
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
24
22
|
startBuffering: () => { },
|
|
25
23
|
stop: () => Promise.resolve(),
|
|
26
24
|
flush: () => Promise.resolve(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserReplay.js","sourceRoot":"","sources":["../../../src/js/replay/browserReplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"browserReplay.js","sourceRoot":"","sources":["../../../src/js/replay/browserReplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAS9C,gJAAgJ;AAChJ,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,CAAC,UAA+B,EAAE,EAAU,EAAE;IAC7E,IAAI,MAAM,EAAE,EAAE,CAAC;QACb,qEAAqE;QACrE,yBAAyB;QACzB,OAAO,4BAA4B,EAAE,CAAC;IACxC,CAAC;IAED,OAAO,iBAAiB,iCACnB,OAAO,KACV,IAAI,EAAE,CAAC,2BAA2B,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,EAC5D,MAAM,EAAE,CAAC,kEAAkE,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IACvG,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,GAAW,EAAE;IAChD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;QACf,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;QACxB,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;QAC7B,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;QAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;QAC5B,gBAAgB,EAAE,GAAG,EAAE,CAAC,SAAS;KAClC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC","sourcesContent":["import { replayIntegration } from '@sentry/react';\n\nimport type { Replay } from './replayInterface';\n\nimport { notWeb } from '../utils/environment';\n\n/**\n * ReplayConfiguration for browser replay integration.\n *\n * See the [Configuration documentation](https://docs.sentry.io/platforms/javascript/session-replay/configuration/) for more information.\n */\ntype ReplayConfiguration = Parameters<typeof replayIntegration>[0];\n\n// https://github.com/getsentry/sentry-javascript/blob/e00cb04f1bbf494067cd8475d392266ba296987a/packages/replay-internal/src/integration.ts#L109\nconst INTEGRATION_NAME = 'Replay';\n\n/**\n * Browser Replay integration for React Native.\n *\n * See the [Browser Replay documentation](https://docs.sentry.io/platforms/javascript/session-replay/) for more information.\n */\nconst browserReplayIntegration = (options: ReplayConfiguration = {}): Replay => {\n if (notWeb()) {\n // This is required because `replayIntegration` browser check doesn't\n // work for React Native.\n return browserReplayIntegrationNoop();\n }\n\n return replayIntegration({\n ...options,\n mask: ['.sentry-react-native-mask', ...(options.mask || [])],\n unmask: ['.sentry-react-native-unmask:not(.sentry-react-native-mask *) > *', ...(options.unmask || [])],\n });\n};\n\nconst browserReplayIntegrationNoop = (): Replay => {\n return {\n name: INTEGRATION_NAME,\n start: () => {},\n startBuffering: () => {},\n stop: () => Promise.resolve(),\n flush: () => Promise.resolve(),\n getReplayId: () => undefined,\n getRecordingMode: () => undefined,\n };\n};\n\nexport { browserReplayIntegration };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8C,KAAK,EAAE,SAAS,EAAE,WAAW,EAAU,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8C,KAAK,EAAE,SAAS,EAAE,WAAW,EAAU,MAAM,cAAc,CAAC;AAUtH,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExD,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;OAUG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;;;;;OAWG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,E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AC9D,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC;QACpD,aAAa,CAAC,UAAU,GAAG,CAAO,KAAiB,EAAE,IAAe,EAA8B,EAAE;YAClG,IAAI,MAAM,GAAsB,KAAK,CAAC;YACtC,IAAI,kBAAkB,EAAE,CAAC;gBACvB,MAAM,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAC/C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;oBACpB,+DAA+D;oBAC/D,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YACD,IAAI,CAAC;gBACH,OAAO,MAAM,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC1C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,KAAK,CAAC,KAAK,CAAC,YAAY,8BAA8B,qCAAqC,EAAE,KAAK,CAAC,CAAC;gBACpG,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC,CAAA,CAAC;IACJ,CAAC;IAED,SAAS,WAAW;QAClB,OAAO,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAED,iHAAiH;IACjH,8GAA8G;IAC9G,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,KAAK;QACL,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,WAAW;KACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAA4B,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,cAAc;QACvB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,uCAAuC;KACjE,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Client, DynamicSamplingContext, ErrorEvent, Event, EventHint, Integration, Metric } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\n/**\n * Screenshot strategy type for Android Session Replay.\n *\n * - `'canvas'`: Canvas-based screenshot strategy. This strategy does **not** support any masking options, it always masks text and images. Use this if your application has strict PII requirements.\n * - `'pixelCopy'`: Pixel copy screenshot strategy (default). Supports all masking options.\n */\nexport type ScreenshotStrategy = 'canvas' | 'pixelCopy';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllText?: boolean;\n\n /**\n * Mask all images in recordings\n *\n * @default true\n */\n maskAllImages?: boolean;\n\n /**\n * Mask all vector graphics in recordings\n * Supports `react-native-svg`\n *\n * @default true\n */\n maskAllVectors?: boolean;\n\n /**\n * Enables the up to 5x faster experimental view renderer used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag.\n *\n * - Experiment: This is an experimental feature and is therefore disabled by default.\n *\n * @deprecated Use `enableViewRendererV2` instead.\n * @platform ios\n */\n enableExperimentalViewRenderer?: boolean;\n\n /**\n * Enables up to 5x faster new view renderer used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag. [Our benchmarks](https://github.com/getsentry/sentry-cocoa/pull/4940) have shown a significant improvement of\n * **up to 4-5x faster rendering** (reducing `~160ms` to `~36ms` per frame) on older devices.\n *\n * - Experiment: In case you are noticing issues with the new view renderer, please report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).\n * Eventually, we will remove this feature flag and use the new view renderer by default.\n *\n * @default true\n * @platform ios\n */\n enableViewRendererV2?: boolean;\n\n /**\n * Enables up to 5x faster but incomplete view rendering used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag.\n *\n * - Note: This flag can only be used together with `enableExperimentalViewRenderer` with up to 20% faster render times.\n * - Experiment: This is an experimental feature and is therefore disabled by default.\n *\n * @default false\n * @platform ios\n */\n enableFastViewRendering?: boolean;\n\n /**\n * Array of view class names to include in subtree traversal during session replay and screenshot capture on iOS.\n *\n * Only views that are instances of these classes (or subclasses) will be traversed.\n * This helps prevent crashes when traversing problematic view hierarchies by allowing you to explicitly include only safe view classes.\n *\n * If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence:\n * views matching excluded classes won't be traversed even if they match an included class.\n *\n * @default undefined\n * @platform ios\n */\n includedViewClasses?: string[];\n\n /**\n * Array of view class names to exclude from subtree traversal during session replay and screenshot capture on iOS.\n *\n * Views of these classes (or subclasses) will be skipped entirely, including all their children.\n * This helps prevent crashes when traversing problematic view hierarchies by allowing you to explicitly exclude problematic view classes.\n *\n * If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence:\n * views matching excluded classes won't be traversed even if they match an included class.\n *\n * @default undefined\n * @platform ios\n */\n excludedViewClasses?: string[];\n\n /**\n * Sets the screenshot strategy used by the Session Replay integration on Android.\n *\n * If your application has strict PII requirements we recommend using `'canvas'`.\n * This strategy does **not** support any masking options, it always masks text and images.\n *\n * - Experiment: In case you are noticing issues with the canvas screenshot strategy, please report the issue on [GitHub](https://github.com/getsentry/sentry-java).\n *\n * @default 'pixelCopy'\n * @platform android\n */\n screenshotStrategy?: ScreenshotStrategy;\n\n /**\n * Callback to determine if a replay should be captured for a specific error.\n * When this callback returns `false`, no replay will be captured for the error.\n * This callback is only called when an error occurs and `replaysOnErrorSampleRate` is set.\n *\n * @param event The error event\n * @param hint Additional event information\n * @returns `false` to skip capturing a replay for this error, `true` or `undefined` to proceed with sampling\n */\n beforeErrorSampling?: (event: Event, hint: EventHint) => boolean;\n}\n\nconst defaultOptions: MobileReplayOptions = {\n maskAllText: true,\n maskAllImages: true,\n maskAllVectors: true,\n enableExperimentalViewRenderer: false,\n enableViewRendererV2: true,\n enableFastViewRendering: false,\n screenshotStrategy: 'pixelCopy',\n};\n\nfunction mergeOptions(initOptions: Partial<MobileReplayOptions>): MobileReplayOptions {\n const merged = {\n ...defaultOptions,\n ...initOptions,\n };\n\n if (initOptions.enableViewRendererV2 === undefined && initOptions.enableExperimentalViewRenderer !== undefined) {\n merged.enableViewRendererV2 = initOptions.enableExperimentalViewRenderer;\n }\n\n return merged;\n}\n\ntype MobileReplayIntegration = Integration & {\n options: MobileReplayOptions;\n getReplayId: () => string | null;\n};\n\n/**\n * The Mobile Replay Integration, let's you adjust the default mobile replay options.\n * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.\n *\n * ```javascript\n * Sentry.init({\n * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\n * integrations: [mobileReplayIntegration({\n * // Adjust the default options\n * })],\n * });\n * ```\n *\n * @experimental\n */\nexport const mobileReplayIntegration = (initOptions: MobileReplayOptions = defaultOptions): MobileReplayIntegration => {\n if (isExpoGo()) {\n debug.warn(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \\`expo prebuild\\` to enable it.`,\n );\n }\n if (notMobileOs()) {\n debug.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);\n }\n\n if (isExpoGo() || notMobileOs()) {\n return mobileReplayIntegrationNoop();\n }\n\n const options = mergeOptions(initOptions);\n\n // Cache the replay ID in JavaScript to avoid excessive bridge calls\n // This will be updated when we know the replay ID changes (e.g., after captureReplay)\n let cachedReplayId: string | null = null;\n\n function updateCachedReplayId(replayId: string | null): void {\n cachedReplayId = replayId;\n }\n\n function getCachedReplayId(): string | null {\n if (cachedReplayId !== null) {\n return cachedReplayId;\n }\n const nativeReplayId = NATIVE.getCurrentReplayId();\n if (nativeReplayId) {\n cachedReplayId = nativeReplayId;\n }\n return nativeReplayId;\n }\n\n async function processEvent(event: ErrorEvent, hint: EventHint): Promise<ErrorEvent> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException) {\n // Event is not an error, will not capture replay\n return event;\n }\n\n // Check if beforeErrorSampling callback filters out this error\n if (initOptions.beforeErrorSampling) {\n try {\n if (initOptions.beforeErrorSampling(event, hint) === false) {\n debug.log(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sent; beforeErrorSampling conditions not met for event ${event.event_id}.`,\n );\n return event;\n }\n } catch (error) {\n debug.error(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} beforeErrorSampling callback threw an error, proceeding with replay capture`,\n error,\n );\n // Continue with replay capture if callback throws\n }\n }\n\n const replayId = await NATIVE.captureReplay(isHardCrash(event));\n if (replayId) {\n updateCachedReplayId(replayId);\n debug.log(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} Captured recording replay ${replayId} for event ${event.event_id}.`,\n );\n // Add replay_id to error event contexts to link replays to events/traces\n event.contexts = event.contexts || {};\n event.contexts.replay = {\n ...event.contexts.replay,\n replay_id: replayId,\n };\n } else {\n // Check if there's an ongoing recording and update cache if found\n const recordingReplayId = NATIVE.getCurrentReplayId();\n if (recordingReplayId) {\n updateCachedReplayId(recordingReplayId);\n debug.log(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`,\n );\n // Add replay_id to error event contexts to link replays to events/traces\n event.contexts = event.contexts || {};\n event.contexts.replay = {\n ...event.contexts.replay,\n replay_id: recordingReplayId,\n };\n } else {\n updateCachedReplayId(null);\n debug.log(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);\n }\n }\n\n return event;\n }\n\n function setup(client: Client): void {\n if (!hasHooks(client)) {\n return;\n }\n\n // Initialize the cached replay ID on setup\n cachedReplayId = NATIVE.getCurrentReplayId();\n\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n if (dsc.replay_id) {\n return;\n }\n\n // Use cached replay ID to avoid bridge calls\n const currentReplayId = getCachedReplayId();\n if (currentReplayId) {\n dsc.replay_id = currentReplayId;\n }\n });\n\n client.on('processMetric', (metric: Metric) => {\n // Add replay_id to metric attributes to link metrics to replays\n const currentReplayId = getCachedReplayId();\n if (currentReplayId) {\n metric.attributes = metric.attributes || {};\n metric.attributes.replay_id = currentReplayId;\n }\n });\n\n client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);\n\n // Wrap beforeSend to run processEvent after user's beforeSend\n const clientOptions = client.getOptions();\n const originalBeforeSend = clientOptions.beforeSend;\n clientOptions.beforeSend = async (event: ErrorEvent, hint: EventHint): Promise<ErrorEvent | null> => {\n let result: ErrorEvent | null = event;\n if (originalBeforeSend) {\n result = await originalBeforeSend(event, hint);\n if (result === null) {\n // Event was dropped by user's beforeSend, don't capture replay\n return null;\n }\n }\n try {\n return await processEvent(result, hint);\n } catch (error) {\n debug.error(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} Failed to process event for replay`, error);\n return result;\n }\n };\n }\n\n function getReplayId(): string | null {\n return getCachedReplayId();\n }\n\n // TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably\n // https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setup,\n options: options,\n getReplayId: getReplayId,\n };\n};\n\nconst mobileReplayIntegrationNoop = (): MobileReplayIntegration => {\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n options: defaultOptions,\n getReplayId: () => null, // Mock implementation for noop version\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"mobilereplay.js","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,E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AM,EAAE,IAAI,CAAC,CAAC;YAC1C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,KAAK,CAAC,KAAK,CAAC,YAAY,8BAA8B,qCAAqC,EAAE,KAAK,CAAC,CAAC;gBACpG,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC,CAAA,CAAC;IACJ,CAAC;IAED,SAAS,WAAW;QAClB,OAAO,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAED,iHAAiH;IACjH,8GAA8G;IAC9G,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,KAAK;QACL,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,WAAW;KACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAA4B,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,cAAc;QACvB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,uCAAuC;KACjE,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Client, DynamicSamplingContext, ErrorEvent, Event, EventHint, Integration, Metric } from '@sentry/core';\n\nimport { debug } from '@sentry/core';\n\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\n/**\n * Screenshot strategy type for Android Session Replay.\n *\n * - `'canvas'`: Canvas-based screenshot strategy. This strategy does **not** support any masking options, it always masks text and images. Use this if your application has strict PII requirements.\n * - `'pixelCopy'`: Pixel copy screenshot strategy (default). Supports all masking options.\n */\nexport type ScreenshotStrategy = 'canvas' | 'pixelCopy';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllText?: boolean;\n\n /**\n * Mask all images in recordings\n *\n * @default true\n */\n maskAllImages?: boolean;\n\n /**\n * Mask all vector graphics in recordings\n * Supports `react-native-svg`\n *\n * @default true\n */\n maskAllVectors?: boolean;\n\n /**\n * Enables the up to 5x faster experimental view renderer used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag.\n *\n * - Experiment: This is an experimental feature and is therefore disabled by default.\n *\n * @deprecated Use `enableViewRendererV2` instead.\n * @platform ios\n */\n enableExperimentalViewRenderer?: boolean;\n\n /**\n * Enables up to 5x faster new view renderer used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag. [Our benchmarks](https://github.com/getsentry/sentry-cocoa/pull/4940) have shown a significant improvement of\n * **up to 4-5x faster rendering** (reducing `~160ms` to `~36ms` per frame) on older devices.\n *\n * - Experiment: In case you are noticing issues with the new view renderer, please report the issue on [GitHub](https://github.com/getsentry/sentry-cocoa).\n * Eventually, we will remove this feature flag and use the new view renderer by default.\n *\n * @default true\n * @platform ios\n */\n enableViewRendererV2?: boolean;\n\n /**\n * Enables up to 5x faster but incomplete view rendering used by the Session Replay integration on iOS.\n *\n * Enabling this flag will reduce the amount of time it takes to render each frame of the session replay on the main thread, therefore reducing\n * interruptions and visual lag.\n *\n * - Note: This flag can only be used together with `enableExperimentalViewRenderer` with up to 20% faster render times.\n * - Experiment: This is an experimental feature and is therefore disabled by default.\n *\n * @default false\n * @platform ios\n */\n enableFastViewRendering?: boolean;\n\n /**\n * Array of view class names to include in subtree traversal during session replay and screenshot capture on iOS.\n *\n * Only views that are instances of these classes (or subclasses) will be traversed.\n * This helps prevent crashes when traversing problematic view hierarchies by allowing you to explicitly include only safe view classes.\n *\n * If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence:\n * views matching excluded classes won't be traversed even if they match an included class.\n *\n * @default undefined\n * @platform ios\n */\n includedViewClasses?: string[];\n\n /**\n * Array of view class names to exclude from subtree traversal during session replay and screenshot capture on iOS.\n *\n * Views of these classes (or subclasses) will be skipped entirely, including all their children.\n * This helps prevent crashes when traversing problematic view hierarchies by allowing you to explicitly exclude problematic view classes.\n *\n * If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence:\n * views matching excluded classes won't be traversed even if they match an included class.\n *\n * @default undefined\n * @platform ios\n */\n excludedViewClasses?: string[];\n\n /**\n * Sets the screenshot strategy used by the Session Replay integration on Android.\n *\n * If your application has strict PII requirements we recommend using `'canvas'`.\n * This strategy does **not** support any masking options, it always masks text and images.\n *\n * - Experiment: In case you are noticing issues with the canvas screenshot strategy, please report the issue on [GitHub](https://github.com/getsentry/sentry-java).\n *\n * @default 'pixelCopy'\n * @platform android\n */\n screenshotStrategy?: ScreenshotStrategy;\n\n /**\n * Callback to determine if a replay should be captured for a specific error.\n * When this callback returns `false`, no replay will be captured for the error.\n * This callback is only called when an error occurs and `replaysOnErrorSampleRate` is set.\n *\n * @param event The error event\n * @param hint Additional event information\n * @returns `false` to skip capturing a replay for this error, `true` or `undefined` to proceed with sampling\n */\n beforeErrorSampling?: (event: Event, hint: EventHint) => boolean;\n}\n\nconst defaultOptions: MobileReplayOptions = {\n maskAllText: true,\n maskAllImages: true,\n maskAllVectors: true,\n enableExperimentalViewRenderer: false,\n enableViewRendererV2: true,\n enableFastViewRendering: false,\n screenshotStrategy: 'pixelCopy',\n};\n\nfunction mergeOptions(initOptions: Partial<MobileReplayOptions>): MobileReplayOptions {\n const merged = {\n ...defaultOptions,\n ...initOptions,\n };\n\n if (initOptions.enableViewRendererV2 === undefined && initOptions.enableExperimentalViewRenderer !== undefined) {\n merged.enableViewRendererV2 = initOptions.enableExperimentalViewRenderer;\n }\n\n return merged;\n}\n\ntype MobileReplayIntegration = Integration & {\n options: MobileReplayOptions;\n getReplayId: () => string | null;\n};\n\n/**\n * The Mobile Replay Integration, let's you adjust the default mobile replay options.\n * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.\n *\n * ```javascript\n * Sentry.init({\n * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\n * integrations: [mobileReplayIntegration({\n * // Adjust the default options\n * })],\n * });\n * ```\n *\n * @experimental\n */\nexport const mobileReplayIntegration = (initOptions: MobileReplayOptions = defaultOptions): MobileReplayIntegration => {\n if (isExpoGo()) {\n debug.warn(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \\`expo prebuild\\` to enable it.`,\n );\n }\n if (notMobileOs()) {\n debug.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);\n }\n\n if (isExpoGo() || notMobileOs()) {\n return mobileReplayIntegrationNoop();\n }\n\n const options = mergeOptions(initOptions);\n\n // Cache the replay ID in JavaScript to avoid excessive bridge calls\n // This will be updated when we know the replay ID changes (e.g., after captureReplay)\n let cachedReplayId: string | null = null;\n\n function updateCachedReplayId(replayId: string | null): void {\n cachedReplayId = replayId;\n }\n\n function getCachedReplayId(): string | null {\n if (cachedReplayId !== null) {\n return cachedReplayId;\n }\n const nativeReplayId = NATIVE.getCurrentReplayId();\n if (nativeReplayId) {\n cachedReplayId = nativeReplayId;\n }\n return nativeReplayId;\n }\n\n async function processEvent(event: ErrorEvent, hint: EventHint): Promise<ErrorEvent> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException) {\n // Event is not an error, will not capture replay\n return event;\n }\n\n // Check if beforeErrorSampling callback filters out this error\n if (initOptions.beforeErrorSampling) {\n try {\n if (initOptions.beforeErrorSampling(event, hint) === false) {\n debug.log(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sent; beforeErrorSampling conditions not met for event ${event.event_id}.`,\n );\n return event;\n }\n } catch (error) {\n debug.error(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} beforeErrorSampling callback threw an error, proceeding with replay capture`,\n error,\n );\n // Continue with replay capture if callback throws\n }\n }\n\n const replayId = await NATIVE.captureReplay(isHardCrash(event));\n if (replayId) {\n updateCachedReplayId(replayId);\n debug.log(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} Captured recording replay ${replayId} for event ${event.event_id}.`,\n );\n // Add replay_id to error event contexts to link replays to events/traces\n event.contexts = event.contexts || {};\n event.contexts.replay = {\n ...event.contexts.replay,\n replay_id: replayId,\n };\n } else {\n // Check if there's an ongoing recording and update cache if found\n const recordingReplayId = NATIVE.getCurrentReplayId();\n if (recordingReplayId) {\n updateCachedReplayId(recordingReplayId);\n debug.log(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`,\n );\n // Add replay_id to error event contexts to link replays to events/traces\n event.contexts = event.contexts || {};\n event.contexts.replay = {\n ...event.contexts.replay,\n replay_id: recordingReplayId,\n };\n } else {\n updateCachedReplayId(null);\n debug.log(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);\n }\n }\n\n return event;\n }\n\n function setup(client: Client): void {\n if (!hasHooks(client)) {\n return;\n }\n\n // Initialize the cached replay ID on setup\n cachedReplayId = NATIVE.getCurrentReplayId();\n\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n if (dsc.replay_id) {\n return;\n }\n\n // Use cached replay ID to avoid bridge calls\n const currentReplayId = getCachedReplayId();\n if (currentReplayId) {\n dsc.replay_id = currentReplayId;\n }\n });\n\n client.on('processMetric', (metric: Metric) => {\n // Add replay_id to metric attributes to link metrics to replays\n const currentReplayId = getCachedReplayId();\n if (currentReplayId) {\n metric.attributes = metric.attributes || {};\n metric.attributes.replay_id = currentReplayId;\n }\n });\n\n client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);\n\n // Wrap beforeSend to run processEvent after user's beforeSend\n const clientOptions = client.getOptions();\n const originalBeforeSend = clientOptions.beforeSend;\n clientOptions.beforeSend = async (event: ErrorEvent, hint: EventHint): Promise<ErrorEvent | null> => {\n let result: ErrorEvent | null = event;\n if (originalBeforeSend) {\n result = await originalBeforeSend(event, hint);\n if (result === null) {\n // Event was dropped by user's beforeSend, don't capture replay\n return null;\n }\n }\n try {\n return await processEvent(result, hint);\n } catch (error) {\n debug.error(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} Failed to process event for replay`, error);\n return result;\n }\n };\n }\n\n function getReplayId(): string | null {\n return getCachedReplayId();\n }\n\n // TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably\n // https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setup,\n options: options,\n getReplayId: getReplayId,\n };\n};\n\nconst mobileReplayIntegrationNoop = (): MobileReplayIntegration => {\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n options: defaultOptions,\n getReplayId: () => null, // Mock implementation for noop version\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkD,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkD,MAAM,cAAc,CAAC;AAQ/G;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAyBlH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xhrUtils.js","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xhrUtils.js","sourceRoot":"","sources":["../../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AI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1G,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import type { Breadcrumb, BreadcrumbHint, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/core';\n\nimport { dropUndefinedKeys } from '@sentry/core';\n\nimport type { RequestBody } from './networkUtils';\n\nimport { getBodySize, parseContentLengthHeader } from './networkUtils';\n\n/**\n * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.\n */\nexport function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void {\n if (breadcrumb.category !== 'xhr' || !hint) {\n return;\n }\n\n const xhrHint = hint as Partial<XhrHint>;\n if (!xhrHint.xhr) {\n return;\n }\n\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;\n\n const reqSize = getBodySize(input);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType);\n\n breadcrumb.data = dropUndefinedKeys({\n start_timestamp: startTimestamp,\n end_timestamp: endTimestamp,\n request_body_size: reqSize,\n response_body_size: resSize,\n ...breadcrumb.data,\n });\n}\n\ntype XhrHint = XhrBreadcrumbHint & {\n xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;\n input?: RequestBody;\n};\n\nfunction _getBodySize(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n): number | undefined {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr);\n } catch {\n return undefined;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopeSync.d.ts","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"scopeSync.d.ts","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,cAAc,CAAC;AAgBtD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CA6FrD"}
|
package/dist/js/scopeSync.js
CHANGED
|
@@ -58,7 +58,7 @@ export function enableSyncToNative(scope) {
|
|
|
58
58
|
NATIVE.clearBreadcrumbs();
|
|
59
59
|
return original.call(scope);
|
|
60
60
|
});
|
|
61
|
-
//
|
|
61
|
+
// oxlint-disable-next-line typescript-eslint(no-explicit-any)
|
|
62
62
|
fillTyped(scope, 'setContext', original => (key, context) => {
|
|
63
63
|
NATIVE.setContext(key, context);
|
|
64
64
|
return original.call(scope, key, context);
|
package/dist/js/scopeSync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopeSync.js","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scopeSync.js","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAe,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAY;I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';\nimport { logger } from '@sentry/react';\n\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { fillTyped } from './utils/fill';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { NATIVE } from './wrapper';\n\n/**\n * This WeakMap is used to keep track of which scopes have been synced to the native SDKs.\n * This ensures that we don't double sync the same scope.\n */\nconst syncedToNativeMap = new WeakMap<Scope, true>();\n\n/**\n * Hooks into the scope set methods and sync new data added to the given scope with the native SDKs.\n */\nexport function enableSyncToNative(scope: Scope): void {\n if (syncedToNativeMap.has(scope)) {\n return;\n }\n syncedToNativeMap.set(scope, true);\n\n fillTyped(scope, 'setUser', original => (user): Scope => {\n NATIVE.setUser(user);\n return original.call(scope, user);\n });\n\n fillTyped(scope, 'setTag', original => (key, value): Scope => {\n NATIVE.setTag(key, NATIVE.primitiveProcessor(value));\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setTags', original => (tags): Scope => {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, NATIVE.primitiveProcessor(tags[key]));\n });\n return original.call(scope, tags);\n });\n\n fillTyped(scope, 'setExtras', original => (extras): Scope => {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return original.call(scope, extras);\n });\n\n fillTyped(scope, 'setExtra', original => (key, value): Scope => {\n NATIVE.setExtra(key, value);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'addBreadcrumb', original => (breadcrumb, maxBreadcrumbs): Scope => {\n const mergedBreadcrumb: Breadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n data: breadcrumb.data ? convertToNormalizedObject(breadcrumb.data) : undefined,\n };\n\n original.call(scope, mergedBreadcrumb, maxBreadcrumbs);\n\n const finalBreadcrumb = scope.getLastBreadcrumb();\n if (finalBreadcrumb) {\n NATIVE.addBreadcrumb(finalBreadcrumb);\n } else {\n logger.warn('[ScopeSync] Last created breadcrumb is undefined. Skipping sync to native.');\n }\n\n return scope;\n });\n\n fillTyped(scope, 'clearBreadcrumbs', original => (): Scope => {\n NATIVE.clearBreadcrumbs();\n return original.call(scope);\n });\n\n // oxlint-disable-next-line typescript-eslint(no-explicit-any)\n fillTyped(scope, 'setContext', original => (key: string, context: { [key: string]: any } | null): Scope => {\n NATIVE.setContext(key, context);\n return original.call(scope, key, context);\n });\n\n fillTyped(scope, 'setAttribute', original => (key: string, value: unknown): Scope => {\n debug.warn('This feature is currently not supported.');\n // Only sync primitive types\n // Native layer still not supported\n // if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n // NATIVE.setAttribute(key, value);\n // }\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setAttributes', original => (attributes: Record<string, unknown>): Scope => {\n // Native layer not supported\n debug.warn('This feature is currently not supported.');\n // Filter to only primitive types\n // const primitiveAttrs: Record<string, string | number | boolean> = {};\n // Object.keys(attributes).forEach(key => {\n // const value = attributes[key];\n // if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n // primitiveAttrs[key] = value;\n // }\n // });\n //\n // if (Object.keys(primitiveAttrs).length > 0) {\n // NATIVE.setAttributes(primitiveAttrs);\n // }\n return original.call(scope, attributes);\n });\n}\n"]}
|
package/dist/js/sdk.d.ts
CHANGED
|
@@ -14,6 +14,27 @@ export declare function wrap<P extends Record<string, unknown>>(RootComponent: R
|
|
|
14
14
|
* Use this only for testing purposes.
|
|
15
15
|
*/
|
|
16
16
|
export declare function nativeCrash(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Signals that the application has finished loading and is ready for user interaction.
|
|
19
|
+
*
|
|
20
|
+
* Call this when your app is truly ready — after async initialization, data loading,
|
|
21
|
+
* splash screen dismissal, auth session restore, etc. This marks the end of the app start span,
|
|
22
|
+
* giving you a more accurate measurement of perceived startup time.
|
|
23
|
+
*
|
|
24
|
+
* If not called, the SDK falls back to the root component mount time (via `Sentry.wrap()`)
|
|
25
|
+
* or JS bundle execution start.
|
|
26
|
+
*
|
|
27
|
+
* @experimental This API is subject to change in future versions.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* await loadRemoteConfig();
|
|
32
|
+
* await restoreSession();
|
|
33
|
+
* SplashScreen.hide();
|
|
34
|
+
* Sentry.appLoaded();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function appLoaded(): void;
|
|
17
38
|
/**
|
|
18
39
|
* Flushes all pending events in the queue to disk.
|
|
19
40
|
* Use this before applying any realtime updates such as code-push or expo updates.
|
package/dist/js/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,KAAK,EAAE,MAAM,cAAc,CAAC;AAcnF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAA4B,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAsCzG;;GAEG;AACH,wBAAgB,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CA6H5D;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpD,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,OAAO,CAAC,EAAE,yBAAyB,GAClC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAsBxB;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC;AAED;;;GAGG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAc9C;AAED;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAUzE;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAE9D"}
|
package/dist/js/sdk.js
CHANGED
|
@@ -11,13 +11,14 @@ import { debug, getClient, getGlobalScope, getIntegrationsToSetup, getIsolationS
|
|
|
11
11
|
import { defaultStackParser, makeFetchTransport, Profiler } from '@sentry/react';
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import { ReactNativeClient } from './client';
|
|
14
|
-
import {
|
|
14
|
+
import { FeedbackFormProvider } from './feedback/FeedbackFormProvider';
|
|
15
15
|
import { getDevServer } from './integrations/debugsymbolicatorutils';
|
|
16
16
|
import { getDefaultIntegrations } from './integrations/default';
|
|
17
17
|
import { shouldEnableNativeNagger } from './options';
|
|
18
18
|
import { enableSyncToNative } from './scopeSync';
|
|
19
19
|
import { TouchEventBoundary } from './touchevents';
|
|
20
20
|
import { ReactNativeProfiler } from './tracing';
|
|
21
|
+
import { _appLoaded } from './tracing/integrations/appStart';
|
|
21
22
|
import { useEncodePolyfill } from './transports/encodePolyfill';
|
|
22
23
|
import { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';
|
|
23
24
|
import { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer, isWeb } from './utils/environment';
|
|
@@ -53,9 +54,7 @@ export function init(passedOptions) {
|
|
|
53
54
|
}
|
|
54
55
|
const userOptions = Object.assign(Object.assign({}, RN_GLOBAL_OBJ.__SENTRY_OPTIONS__), passedOptions);
|
|
55
56
|
const maxQueueSize = (_c = (_a = userOptions.maxQueueSize) !== null && _a !== void 0 ? _a : (_b = userOptions.transportOptions) === null || _b === void 0 ? void 0 : _b.bufferSize) !== null && _c !== void 0 ? _c : DEFAULT_OPTIONS.maxQueueSize;
|
|
56
|
-
const enableNative = userOptions.enableNative === undefined || userOptions.enableNative
|
|
57
|
-
? NATIVE.isNativeAvailable()
|
|
58
|
-
: false;
|
|
57
|
+
const enableNative = userOptions.enableNative === undefined || userOptions.enableNative ? NATIVE.isNativeAvailable() : false;
|
|
59
58
|
useEncodePolyfill();
|
|
60
59
|
if (enableNative) {
|
|
61
60
|
enableSyncToNative(getGlobalScope());
|
|
@@ -73,7 +72,9 @@ export function init(passedOptions) {
|
|
|
73
72
|
const port = dsnComponents.port ? `:${dsnComponents.port}` : '';
|
|
74
73
|
return `${dsnComponents.protocol}://${dsnComponents.host}${port}`;
|
|
75
74
|
};
|
|
76
|
-
const userBeforeBreadcrumb = safeFactory(userOptions.beforeBreadcrumb, {
|
|
75
|
+
const userBeforeBreadcrumb = safeFactory(userOptions.beforeBreadcrumb, {
|
|
76
|
+
loggerMessage: 'The beforeBreadcrumb threw an error',
|
|
77
|
+
});
|
|
77
78
|
// Exclude Dev Server and Sentry Dsn request from Breadcrumbs
|
|
78
79
|
const devServerUrl = (_d = getDevServer()) === null || _d === void 0 ? void 0 : _d.url;
|
|
79
80
|
const dsn = getURLFromDSN(userOptions.dsn);
|
|
@@ -99,17 +100,17 @@ export function init(passedOptions) {
|
|
|
99
100
|
};
|
|
100
101
|
const options = Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), userOptions), { release: (_e = userOptions.release) !== null && _e !== void 0 ? _e : getDefaultRelease(), enableNative, enableNativeNagger: shouldEnableNativeNagger(userOptions.enableNativeNagger),
|
|
101
102
|
// If custom transport factory fails the SDK won't initialize
|
|
102
|
-
transport: userOptions.transport
|
|
103
|
-
|
|
103
|
+
transport: userOptions.transport ||
|
|
104
|
+
makeNativeTransportFactory({
|
|
104
105
|
enableNative,
|
|
105
|
-
})
|
|
106
|
-
|
|
106
|
+
}) ||
|
|
107
|
+
makeFetchTransport, transportOptions: Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS.transportOptions), ((_f = userOptions.transportOptions) !== null && _f !== void 0 ? _f : {})), { bufferSize: maxQueueSize }), maxQueueSize, integrations: [], stackParser: stackParserFromStackParserOptions(userOptions.stackParser || defaultStackParser), beforeBreadcrumb: chainedBeforeBreadcrumb, initialScope: safeFactory(userOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }) });
|
|
107
108
|
if (!('autoInitializeNativeSdk' in userOptions) && RN_GLOBAL_OBJ.__SENTRY_OPTIONS__ && !__DEV__) {
|
|
108
109
|
// Options file is present in a release build, native SDK is expected to be initialized
|
|
109
110
|
// before JS from the native app entry point (e.g. AppDelegate, MainApplication).
|
|
110
111
|
// In dev builds, we always re-initialize from JS to set up the native log bridge
|
|
111
112
|
// and provide runtime values (devServerUrl, defaultSidecarUrl, etc.).
|
|
112
|
-
//
|
|
113
|
+
// oxlint-disable-next-line eslint(no-console)
|
|
113
114
|
console.info('[Sentry] Using options file. Native SDK is expected to be initialized before JS, skipping automatic native initialization from JS.');
|
|
114
115
|
options.autoInitializeNativeSdk = false;
|
|
115
116
|
}
|
|
@@ -119,9 +120,7 @@ export function init(passedOptions) {
|
|
|
119
120
|
if (!('environment' in options)) {
|
|
120
121
|
options.environment = getDefaultEnvironment();
|
|
121
122
|
}
|
|
122
|
-
const defaultIntegrations = userOptions.defaultIntegrations === undefined
|
|
123
|
-
? getDefaultIntegrations(options)
|
|
124
|
-
: userOptions.defaultIntegrations;
|
|
123
|
+
const defaultIntegrations = userOptions.defaultIntegrations === undefined ? getDefaultIntegrations(options) : userOptions.defaultIntegrations;
|
|
125
124
|
options.integrations = getIntegrationsToSetup({
|
|
126
125
|
integrations: safeFactory(userOptions.integrations, { loggerMessage: 'The integrations threw an error' }),
|
|
127
126
|
defaultIntegrations,
|
|
@@ -140,13 +139,13 @@ export function init(passedOptions) {
|
|
|
140
139
|
*/
|
|
141
140
|
export function wrap(RootComponent, options) {
|
|
142
141
|
var _a;
|
|
143
|
-
const profilerProps = Object.assign(Object.assign({},
|
|
142
|
+
const profilerProps = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.profilerProps), { name: (_a = RootComponent.displayName) !== null && _a !== void 0 ? _a : 'Root', updateProps: {} });
|
|
144
143
|
const ProfilerComponent = isWeb() ? Profiler : ReactNativeProfiler;
|
|
145
144
|
const RootApp = appProps => {
|
|
146
145
|
var _a;
|
|
147
146
|
return (React.createElement(TouchEventBoundary, Object.assign({}, ((_a = options === null || options === void 0 ? void 0 : options.touchEventBoundaryProps) !== null && _a !== void 0 ? _a : {})),
|
|
148
147
|
React.createElement(ProfilerComponent, Object.assign({}, profilerProps),
|
|
149
|
-
React.createElement(
|
|
148
|
+
React.createElement(FeedbackFormProvider, null,
|
|
150
149
|
React.createElement(RootComponent, Object.assign({}, appProps))))));
|
|
151
150
|
};
|
|
152
151
|
return RootApp;
|
|
@@ -158,6 +157,30 @@ export function wrap(RootComponent, options) {
|
|
|
158
157
|
export function nativeCrash() {
|
|
159
158
|
NATIVE.nativeCrash();
|
|
160
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Signals that the application has finished loading and is ready for user interaction.
|
|
162
|
+
*
|
|
163
|
+
* Call this when your app is truly ready — after async initialization, data loading,
|
|
164
|
+
* splash screen dismissal, auth session restore, etc. This marks the end of the app start span,
|
|
165
|
+
* giving you a more accurate measurement of perceived startup time.
|
|
166
|
+
*
|
|
167
|
+
* If not called, the SDK falls back to the root component mount time (via `Sentry.wrap()`)
|
|
168
|
+
* or JS bundle execution start.
|
|
169
|
+
*
|
|
170
|
+
* @experimental This API is subject to change in future versions.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* await loadRemoteConfig();
|
|
175
|
+
* await restoreSession();
|
|
176
|
+
* SplashScreen.hide();
|
|
177
|
+
* Sentry.appLoaded();
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export function appLoaded() {
|
|
181
|
+
// oxlint-disable-next-line typescript-eslint(no-floating-promises)
|
|
182
|
+
_appLoaded();
|
|
183
|
+
}
|
|
161
184
|
/**
|
|
162
185
|
* Flushes all pending events in the queue to disk.
|
|
163
186
|
* Use this before applying any realtime updates such as code-push or expo updates.
|
|
@@ -170,7 +193,6 @@ export function flush() {
|
|
|
170
193
|
const result = yield client.flush();
|
|
171
194
|
return result;
|
|
172
195
|
}
|
|
173
|
-
// eslint-disable-next-line no-empty
|
|
174
196
|
}
|
|
175
197
|
catch (_) { }
|
|
176
198
|
debug.error('Failed to flush the event queue.');
|
package/dist/js/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EACL,KAAK,EACL,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,iCAAiC,EACjC,SAAS,IAAI,aAAa,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAA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AAC,EAAE,CAAC,CAAC,CAAC;QAEf,KAAK,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAEhD,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,UAAgB,KAAK;;QACzB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAE3B,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAI,QAA6B;IACxD,MAAM,YAAY,GAAG,CAAC,KAAY,EAAiB,EAAE;QACnD,IAAI,CAAC;YACH,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,KAAK,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;YACzD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;IACF,OAAO,aAAa,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,cAAc;;QAClC,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;CAAA","sourcesContent":["/* eslint-disable complexity */\nimport type { Breadcrumb, BreadcrumbHint, Integration, Scope } from '@sentry/core';\nimport {\n debug,\n getClient,\n getGlobalScope,\n getIntegrationsToSetup,\n getIsolationScope,\n initAndBind,\n makeDsn,\n stackParserFromStackParserOptions,\n withScope as coreWithScope,\n} from '@sentry/core';\nimport { defaultStackParser, makeFetchTransport, Profiler } from '@sentry/react';\nimport * as React from 'react';\nimport { ReactNativeClient } from './client';\nimport { FeedbackWidgetProvider } from './feedback/FeedbackWidgetProvider';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { getDefaultIntegrations } from './integrations/default';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { shouldEnableNativeNagger } from './options';\nimport { enableSyncToNative } from './scopeSync';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler } from './tracing';\nimport { useEncodePolyfill } from './transports/encodePolyfill';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer, isWeb } from './utils/environment';\nimport { getDefaultRelease } from './utils/release';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { RN_GLOBAL_OBJ } from './utils/worldwide';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n enableNdk: true,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n propagateTraceparent: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n if (isRunningInMetroDevServer()) {\n return;\n }\n\n const userOptions = {\n ...RN_GLOBAL_OBJ.__SENTRY_OPTIONS__,\n ...passedOptions,\n };\n\n const maxQueueSize = userOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? userOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = userOptions.enableNative === undefined || userOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n\n useEncodePolyfill();\n if (enableNative) {\n enableSyncToNative(getGlobalScope());\n enableSyncToNative(getIsolationScope());\n }\n\n const getURLFromDSN = (dsn: string | undefined): string | undefined => {\n if (!dsn) {\n return undefined;\n }\n const dsnComponents = makeDsn(dsn);\n if (!dsnComponents) {\n debug.error('Failed to extract url from DSN: ', dsn);\n return undefined;\n }\n const port = dsnComponents.port ? `:${dsnComponents.port}` : '';\n return `${dsnComponents.protocol}://${dsnComponents.host}${port}`;\n };\n\n const userBeforeBreadcrumb = safeFactory(userOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' });\n\n // Exclude Dev Server and Sentry Dsn request from Breadcrumbs\n const devServerUrl = getDevServer()?.url;\n const dsn = getURLFromDSN(userOptions.dsn);\n const defaultBeforeBreadcrumb = (breadcrumb: Breadcrumb, _hint?: BreadcrumbHint): Breadcrumb | null => {\n const type = breadcrumb.type || '';\n const url = typeof breadcrumb.data?.url === 'string' ? breadcrumb.data.url : '';\n if (type === 'http' && ((devServerUrl && url.startsWith(devServerUrl)) || (dsn && url.startsWith(dsn)))) {\n return null;\n }\n return breadcrumb;\n };\n\n const chainedBeforeBreadcrumb = (breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null => {\n let modifiedBreadcrumb = breadcrumb;\n if (userBeforeBreadcrumb) {\n const result = userBeforeBreadcrumb(breadcrumb, hint);\n if (result === null) {\n return null;\n }\n modifiedBreadcrumb = result;\n }\n return defaultBeforeBreadcrumb(modifiedBreadcrumb, hint);\n };\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...userOptions,\n release: userOptions.release ?? getDefaultRelease(),\n enableNative,\n enableNativeNagger: shouldEnableNativeNagger(userOptions.enableNativeNagger),\n // If custom transport factory fails the SDK won't initialize\n transport: userOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(userOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(userOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: chainedBeforeBreadcrumb,\n initialScope: safeFactory(userOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n };\n\n if (!('autoInitializeNativeSdk' in userOptions) && RN_GLOBAL_OBJ.__SENTRY_OPTIONS__ && !__DEV__) {\n // Options file is present in a release build, native SDK is expected to be initialized\n // before JS from the native app entry point (e.g. AppDelegate, MainApplication).\n // In dev builds, we always re-initialize from JS to set up the native log bridge\n // and provide runtime values (devServerUrl, defaultSidecarUrl, etc.).\n // eslint-disable-next-line no-console\n console.info('[Sentry] Using options file. Native SDK is expected to be initialized before JS, skipping automatic native initialization from JS.');\n options.autoInitializeNativeSdk = false;\n }\n\n if ('tracesSampler' in options) {\n options.tracesSampler = safeTracesSampler(options.tracesSampler);\n }\n\n if (!('environment' in options)) {\n options.environment = getDefaultEnvironment();\n }\n\n const defaultIntegrations: false | Integration[] = userOptions.defaultIntegrations === undefined\n ? getDefaultIntegrations(options)\n : userOptions.defaultIntegrations;\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(userOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n if (isExpoGo()) {\n debug.log('Offline caching, native errors features are not available in Expo Go.');\n debug.log('Use EAS Build / Native Release Build to test these features.');\n }\n\n if (RN_GLOBAL_OBJ.__SENTRY_OPTIONS__) {\n debug.log('Sentry JS initialized with options from the options file.');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends Record<string, unknown>>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const profilerProps = {\n ...(options?.profilerProps),\n name: RootComponent.displayName ?? 'Root',\n updateProps: {}\n };\n\n const ProfilerComponent = isWeb() ? Profiler : ReactNativeProfiler;\n\n const RootApp: React.FC<P> = appProps => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ProfilerComponent {...profilerProps}>\n <FeedbackWidgetProvider>\n <RootComponent {...appProps} />\n </FeedbackWidgetProvider>\n </ProfilerComponent>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n NATIVE.nativeCrash();\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getClient();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n debug.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getClient();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n debug.error('Failed to close the SDK');\n }\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T | undefined {\n const safeCallback = (scope: Scope): T | undefined => {\n try {\n return callback(scope);\n } catch (e) {\n debug.error('Error while running withScope callback', e);\n return undefined;\n }\n };\n return coreWithScope(safeCallback);\n}\n\n/**\n * Returns if the app crashed in the last run.\n */\nexport async function crashedLastRun(): Promise<boolean | null> {\n return NATIVE.crashedLastRun();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EACL,KAAK,EACL,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,iCAAiC,EACjC,SAAS,IAAI,aAAa,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE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AAE,CAAC;YACX,KAAK,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;YACzD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;IACF,OAAO,aAAa,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,cAAc;;QAClC,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;CAAA","sourcesContent":["/* oxlint-disable eslint(complexity) */\nimport type { Breadcrumb, BreadcrumbHint, Integration, Scope } from '@sentry/core';\n\nimport {\n debug,\n getClient,\n getGlobalScope,\n getIntegrationsToSetup,\n getIsolationScope,\n initAndBind,\n makeDsn,\n stackParserFromStackParserOptions,\n withScope as coreWithScope,\n} from '@sentry/core';\nimport { defaultStackParser, makeFetchTransport, Profiler } from '@sentry/react';\nimport * as React from 'react';\n\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\n\nimport { ReactNativeClient } from './client';\nimport { FeedbackFormProvider } from './feedback/FeedbackFormProvider';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { getDefaultIntegrations } from './integrations/default';\nimport { shouldEnableNativeNagger } from './options';\nimport { enableSyncToNative } from './scopeSync';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler } from './tracing';\nimport { _appLoaded } from './tracing/integrations/appStart';\nimport { useEncodePolyfill } from './transports/encodePolyfill';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer, isWeb } from './utils/environment';\nimport { getDefaultRelease } from './utils/release';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { RN_GLOBAL_OBJ } from './utils/worldwide';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n enableNdk: true,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n propagateTraceparent: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n if (isRunningInMetroDevServer()) {\n return;\n }\n\n const userOptions = {\n ...RN_GLOBAL_OBJ.__SENTRY_OPTIONS__,\n ...passedOptions,\n };\n\n const maxQueueSize =\n userOptions.maxQueueSize ?? userOptions.transportOptions?.bufferSize ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative =\n userOptions.enableNative === undefined || userOptions.enableNative ? NATIVE.isNativeAvailable() : false;\n\n useEncodePolyfill();\n if (enableNative) {\n enableSyncToNative(getGlobalScope());\n enableSyncToNative(getIsolationScope());\n }\n\n const getURLFromDSN = (dsn: string | undefined): string | undefined => {\n if (!dsn) {\n return undefined;\n }\n const dsnComponents = makeDsn(dsn);\n if (!dsnComponents) {\n debug.error('Failed to extract url from DSN: ', dsn);\n return undefined;\n }\n const port = dsnComponents.port ? `:${dsnComponents.port}` : '';\n return `${dsnComponents.protocol}://${dsnComponents.host}${port}`;\n };\n\n const userBeforeBreadcrumb = safeFactory(userOptions.beforeBreadcrumb, {\n loggerMessage: 'The beforeBreadcrumb threw an error',\n });\n\n // Exclude Dev Server and Sentry Dsn request from Breadcrumbs\n const devServerUrl = getDevServer()?.url;\n const dsn = getURLFromDSN(userOptions.dsn);\n const defaultBeforeBreadcrumb = (breadcrumb: Breadcrumb, _hint?: BreadcrumbHint): Breadcrumb | null => {\n const type = breadcrumb.type || '';\n const url = typeof breadcrumb.data?.url === 'string' ? breadcrumb.data.url : '';\n if (type === 'http' && ((devServerUrl && url.startsWith(devServerUrl)) || (dsn && url.startsWith(dsn)))) {\n return null;\n }\n return breadcrumb;\n };\n\n const chainedBeforeBreadcrumb = (breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null => {\n let modifiedBreadcrumb = breadcrumb;\n if (userBeforeBreadcrumb) {\n const result = userBeforeBreadcrumb(breadcrumb, hint);\n if (result === null) {\n return null;\n }\n modifiedBreadcrumb = result;\n }\n return defaultBeforeBreadcrumb(modifiedBreadcrumb, hint);\n };\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...userOptions,\n release: userOptions.release ?? getDefaultRelease(),\n enableNative,\n enableNativeNagger: shouldEnableNativeNagger(userOptions.enableNativeNagger),\n // If custom transport factory fails the SDK won't initialize\n transport:\n userOptions.transport ||\n makeNativeTransportFactory({\n enableNative,\n }) ||\n makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(userOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(userOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: chainedBeforeBreadcrumb,\n initialScope: safeFactory(userOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n };\n\n if (!('autoInitializeNativeSdk' in userOptions) && RN_GLOBAL_OBJ.__SENTRY_OPTIONS__ && !__DEV__) {\n // Options file is present in a release build, native SDK is expected to be initialized\n // before JS from the native app entry point (e.g. AppDelegate, MainApplication).\n // In dev builds, we always re-initialize from JS to set up the native log bridge\n // and provide runtime values (devServerUrl, defaultSidecarUrl, etc.).\n // oxlint-disable-next-line eslint(no-console)\n console.info(\n '[Sentry] Using options file. Native SDK is expected to be initialized before JS, skipping automatic native initialization from JS.',\n );\n options.autoInitializeNativeSdk = false;\n }\n\n if ('tracesSampler' in options) {\n options.tracesSampler = safeTracesSampler(options.tracesSampler);\n }\n\n if (!('environment' in options)) {\n options.environment = getDefaultEnvironment();\n }\n\n const defaultIntegrations: false | Integration[] =\n userOptions.defaultIntegrations === undefined ? getDefaultIntegrations(options) : userOptions.defaultIntegrations;\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(userOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n if (isExpoGo()) {\n debug.log('Offline caching, native errors features are not available in Expo Go.');\n debug.log('Use EAS Build / Native Release Build to test these features.');\n }\n\n if (RN_GLOBAL_OBJ.__SENTRY_OPTIONS__) {\n debug.log('Sentry JS initialized with options from the options file.');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends Record<string, unknown>>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions,\n): React.ComponentType<P> {\n const profilerProps = {\n ...options?.profilerProps,\n name: RootComponent.displayName ?? 'Root',\n updateProps: {},\n };\n\n const ProfilerComponent = isWeb() ? Profiler : ReactNativeProfiler;\n\n const RootApp: React.FC<P> = appProps => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ProfilerComponent {...profilerProps}>\n <FeedbackFormProvider>\n <RootComponent {...appProps} />\n </FeedbackFormProvider>\n </ProfilerComponent>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n NATIVE.nativeCrash();\n}\n\n/**\n * Signals that the application has finished loading and is ready for user interaction.\n *\n * Call this when your app is truly ready — after async initialization, data loading,\n * splash screen dismissal, auth session restore, etc. This marks the end of the app start span,\n * giving you a more accurate measurement of perceived startup time.\n *\n * If not called, the SDK falls back to the root component mount time (via `Sentry.wrap()`)\n * or JS bundle execution start.\n *\n * @experimental This API is subject to change in future versions.\n *\n * @example\n * ```ts\n * await loadRemoteConfig();\n * await restoreSession();\n * SplashScreen.hide();\n * Sentry.appLoaded();\n * ```\n */\nexport function appLoaded(): void {\n // oxlint-disable-next-line typescript-eslint(no-floating-promises)\n _appLoaded();\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getClient();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n } catch (_) {}\n\n debug.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getClient();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n debug.error('Failed to close the SDK');\n }\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T | undefined {\n const safeCallback = (scope: Scope): T | undefined => {\n try {\n return callback(scope);\n } catch (e) {\n debug.error('Error while running withScope callback', e);\n return undefined;\n }\n };\n return coreWithScope(safeCallback);\n}\n\n/**\n * Returns if the app crashed in the last run.\n */\nexport async function crashedLastRun(): Promise<boolean | null> {\n return NATIVE.crashedLastRun();\n}\n"]}
|
|
@@ -4,7 +4,7 @@ const core_1 = require("@sentry/core");
|
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
core_1.debug.enable();
|
|
7
|
-
//
|
|
7
|
+
// oxlint-disable-next-line typescript-eslint(unbound-method)
|
|
8
8
|
const { dirname, join, resolve, sep: posixSep } = path_1.posix;
|
|
9
9
|
/**
|
|
10
10
|
* Collects JS modules from source paths.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModulesCollector.js","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":";;AAAA,uCAAqC;AACrC,2BAAwE;AACxE,+BAAkC;AAElC,YAAK,CAAC,MAAM,EAAE,CAAC;AAEf,6DAA6D;AAC7D,MAAM,EAA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iB,CAAC,CAAC;QACxD,IAAI,CAAC,IAAA,eAAU,EAAC,oBAAoB,CAAC,EAAE,CAAC;YACtC,IAAA,cAAS,EAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,IAAA,kBAAa,EAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,YAAK,CAAC,GAAG,CAAC,mCAAmC,iBAAiB,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AAtHD,mCAsHC","sourcesContent":["import { debug } from '@sentry/core';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { posix, sep } from 'path';\n\ndebug.enable();\n\n//
|
|
1
|
+
{"version":3,"file":"ModulesCollector.js","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":";;AAAA,uCAAqC;AACrC,2BAAwE;AACxE,+BAAkC;AAElC,YAAK,CAAC,MAAM,EAAE,CAAC;AAEf,6DAA6D;AAC7D,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,YAAK,CAAC;AAOxD;;GAEG;AACH,MAAqB,gBAAgB;IACnC,qBAAqB;IACd,MAAM,CAAC,OAAO,CAAC,OAAkB,EAAE,YAAsB;QAC9D,MAAM,sBAAsB,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,UAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE/G,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,MAAM,IAAI,GAAyB,EAAE,CAAC;QAEtC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAa,EAAE,EAAE;YAChC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7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IAAA,eAAU,EAAC,WAAW,CAAC,EAAE,CAAC;gBAC7B,YAAK,CAAC,KAAK,CAAC,kCAAkC,WAAW,EAAE,CAAC,CAAC;gBAC7D,OAAO;YACT,CAAC;QACH,CAAC;QAED,MAAM,GAAG,GAA0B,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;QACnF,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAChD,YAAK,CAAC,KAAK,CAAC,8DAA8D,aAAa,IAAI,CAAC,CAAC;YAC7F,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAc,GAAG,CAAC,OAAO,CAAC;QACvC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAE3G,MAAM,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACxD,IAAI,CAAC,IAAA,eAAU,EAAC,oBAAoB,CAAC,EAAE,CAAC;YACtC,IAAA,cAAS,EAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,IAAA,kBAAa,EAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,YAAK,CAAC,GAAG,CAAC,mCAAmC,iBAAiB,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AAtHD,mCAsHC","sourcesContent":["import { debug } from '@sentry/core';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { posix, sep } from 'path';\n\ndebug.enable();\n\n// oxlint-disable-next-line typescript-eslint(unbound-method)\nconst { dirname, join, resolve, sep: posixSep } = posix;\n\ninterface Package {\n name?: string;\n version?: string;\n}\n\n/**\n * Collects JS modules from source paths.\n */\nexport default class ModulesCollector {\n /** Collect method */\n public static collect(sources: unknown[], modulesPaths: string[]): Record<string, string> {\n const normalizedModulesPaths = modulesPaths.map(modulesPath => resolve(modulesPath.split(sep).join(posixSep)));\n\n const infos: Record<string, string> = {};\n const seen: Record<string, true> = {};\n\n sources.forEach((path: unknown) => {\n if (typeof path !== 'string') {\n return;\n }\n\n let dir = path; // included source file path\n let candidate: Package | null = null;\n\n /** Traverse directories upward in the search of all package.json files */\n const upDirSearch = (): void => {\n const parentDir = dir;\n dir = dirname(parentDir);\n\n if (normalizedModulesPaths.includes(resolve(dir))) {\n if (candidate?.name && candidate?.version) {\n infos[candidate.name] = candidate.version;\n } else if (candidate?.name) {\n infos[candidate.name] = 'unknown';\n }\n return;\n }\n\n if (!dir || parentDir === dir || seen[dir]) {\n return;\n }\n seen[dir] = true;\n\n const pkgPath = join(dir, 'package.json');\n if (!existsSync(pkgPath)) {\n // fast-forward if the package.json doesn't exist\n return upDirSearch();\n }\n\n try {\n const info: Package = JSON.parse(readFileSync(pkgPath, 'utf8'));\n candidate = {\n name: info.name,\n version: info.version,\n };\n } catch (error) {\n debug.error(`Failed to read ${pkgPath}`);\n }\n\n return upDirSearch(); // processed package.json file, continue up search\n };\n\n upDirSearch();\n });\n\n return infos;\n }\n\n /**\n * Runs collection of modules.\n */\n public static run({\n sourceMapPath,\n outputModulesPath,\n modulesPaths,\n collect,\n }: Partial<{\n sourceMapPath: string;\n outputModulesPath: string;\n modulesPaths: string[];\n collect: (sources: unknown[], modulesPaths: string[]) => Record<string, string>;\n }>): void {\n if (!sourceMapPath) {\n debug.error('First argument `source-map-path` is missing!');\n return;\n }\n if (!outputModulesPath) {\n debug.error('Second argument `modules-output-path` is missing!');\n return;\n }\n if (!modulesPaths || modulesPaths.length === 0) {\n debug.error('Third argument `modules-paths` is missing!');\n return;\n }\n\n debug.log('Reading source map from', sourceMapPath);\n debug.log('Saving modules to', outputModulesPath);\n debug.log('Resolving modules from paths', modulesPaths.join(', '));\n\n if (!existsSync(sourceMapPath)) {\n debug.error(`Source map file does not exist at ${sourceMapPath}`);\n return;\n }\n for (const modulesPath of modulesPaths) {\n if (!existsSync(modulesPath)) {\n debug.error(`Modules path does not exist at ${modulesPath}`);\n return;\n }\n }\n\n const map: { sources?: unknown } = JSON.parse(readFileSync(sourceMapPath, 'utf8'));\n if (!map.sources || !Array.isArray(map.sources)) {\n debug.error(`Modules not collected. No sources found in the source map (${sourceMapPath})!`);\n return;\n }\n\n const sources: unknown[] = map.sources;\n const modules = collect ? collect(sources, modulesPaths) : ModulesCollector.collect(sources, modulesPaths);\n\n const outputModulesDirPath = dirname(outputModulesPath);\n if (!existsSync(outputModulesDirPath)) {\n mkdirSync(outputModulesDirPath, { recursive: true });\n }\n writeFileSync(outputModulesPath, JSON.stringify(modules, null, 2));\n debug.log(`Modules collected and saved to: ${outputModulesPath}`);\n }\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
4
3
|
const process_1 = require("process");
|
|
5
4
|
const ModulesCollector_1 = require("./ModulesCollector");
|
|
6
5
|
const sourceMapPath = process_1.argv[2];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectModules.js","sourceRoot":"","sources":["../../../src/js/tools/collectModules.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"collectModules.js","sourceRoot":"","sources":["../../../src/js/tools/collectModules.ts"],"names":[],"mappings":";;AAAA,qCAA+B;AAE/B,yDAAkD;AAElD,MAAM,aAAa,GAAuB,cAAI,CAAC,CAAC,CAAC,CAAC;AAClD,MAAM,iBAAiB,GAAuB,cAAI,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,YAAY,GAAa,cAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAEjE,0BAAgB,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC,CAAC","sourcesContent":["import { argv } from 'process';\n\nimport ModulesCollector from './ModulesCollector';\n\nconst sourceMapPath: string | undefined = argv[2];\nconst outputModulesPath: string | undefined = argv[3];\nconst modulesPaths: string[] = argv[4] ? argv[4].split(',') : [];\n\nModulesCollector.run({ sourceMapPath, outputModulesPath, modulesPaths });\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easBuildHooks.d.ts","sourceRoot":"","sources":["../../../src/js/tools/easBuildHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"easBuildHooks.d.ts","sourceRoot":"","sources":["../../../src/js/tools/easBuildHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAA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