@sentry/react-native 6.15.0 → 7.0.0-beta.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 +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +11 -14
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +5 -1
- package/dist/js/client.js.map +1 -1
- package/dist/js/feedback/FeedbackButton.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackButton.js +1 -1
- package/dist/js/feedback/FeedbackButton.js.map +1 -1
- package/dist/js/feedback/FeedbackWidget.d.ts +1 -1
- package/dist/js/feedback/FeedbackWidget.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidget.js +60 -46
- package/dist/js/feedback/FeedbackWidget.js.map +1 -1
- package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidget.styles.js.map +1 -1
- package/dist/js/feedback/FeedbackWidget.theme.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidget.theme.js.map +1 -1
- package/dist/js/feedback/FeedbackWidget.types.d.ts +30 -30
- package/dist/js/feedback/FeedbackWidget.types.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidget.types.js.map +1 -1
- package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidgetManager.js +6 -3
- package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
- package/dist/js/feedback/FeedbackWidgetProvider.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidgetProvider.js +9 -10
- package/dist/js/feedback/FeedbackWidgetProvider.js.map +1 -1
- package/dist/js/feedback/ScreenshotButton.d.ts.map +1 -1
- package/dist/js/feedback/ScreenshotButton.js.map +1 -1
- package/dist/js/feedback/defaults.d.ts +1 -1
- 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 +1 -1
- package/dist/js/feedback/integration.d.ts.map +1 -1
- package/dist/js/feedback/integration.js +1 -1
- package/dist/js/feedback/integration.js.map +1 -1
- package/dist/js/feedback/lazy.d.ts.map +1 -1
- 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 +2 -2
- package/dist/js/feedback/utils.js.map +1 -1
- package/dist/js/index.d.ts +3 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +2 -2
- 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 +47 -0
- package/dist/js/integrations/breadcrumbs.d.ts.map +1 -0
- package/dist/js/integrations/breadcrumbs.js +15 -0
- package/dist/js/integrations/breadcrumbs.js.map +1 -0
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +2 -1
- 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 +12 -2
- 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 +9 -5
- 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/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/integrations/exports.d.ts +2 -1
- package/dist/js/integrations/exports.d.ts.map +1 -1
- package/dist/js/integrations/exports.js +2 -1
- package/dist/js/integrations/exports.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 +4 -3
- package/dist/js/integrations/nativelinkederrors.js.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.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 +3 -3
- 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 +8 -4
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +2 -1
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/options.d.ts +8 -1
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/profiling/cache.d.ts +1 -1
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
- package/dist/js/profiling/convertHermesProfile.js +18 -5
- 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 +9 -1
- package/dist/js/profiling/debugid.js.map +1 -1
- package/dist/js/profiling/hermes.d.ts +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 +2 -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 +15 -17
- package/dist/js/profiling/utils.js.map +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/browserReplay.d.ts +13 -1
- package/dist/js/replay/browserReplay.d.ts.map +1 -1
- package/dist/js/replay/browserReplay.js +26 -0
- 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 +2 -7
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/replay/networkUtils.d.ts.map +1 -1
- package/dist/js/replay/networkUtils.js +4 -11
- package/dist/js/replay/networkUtils.js.map +1 -1
- package/dist/js/replay/replayInterface.d.ts +52 -0
- package/dist/js/replay/replayInterface.d.ts.map +1 -0
- package/dist/js/replay/replayInterface.js +2 -0
- package/dist/js/replay/replayInterface.js.map +1 -0
- 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 +7 -1
- package/dist/js/scopeSync.js.map +1 -1
- package/dist/js/sdk.d.ts +1 -6
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +3 -16
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/ModulesCollector.js +1 -0
- package/dist/js/tools/ModulesCollector.js.map +1 -1
- package/dist/js/tools/collectModules.js +1 -0
- package/dist/js/tools/collectModules.js.map +1 -1
- package/dist/js/tools/enableLogger.js +1 -0
- package/dist/js/tools/enableLogger.js.map +1 -1
- package/dist/js/tools/metroMiddleware.js +2 -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 +6 -4
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformer.js +1 -0
- package/dist/js/tools/sentryBabelTransformer.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.js +2 -1
- 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 +1 -0
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/utils.js +1 -0
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tools/vendor/expo/expoconfig.js +1 -0
- package/dist/js/tools/vendor/expo/expoconfig.js.map +1 -1
- package/dist/js/tools/vendor/metro/metroBabelTransformer.js +1 -0
- package/dist/js/tools/vendor/metro/metroBabelTransformer.js.map +1 -1
- package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.js +1 -0
- 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 +4 -0
- package/dist/js/touchevents.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 +1 -1
- package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
- package/dist/js/tracing/integrations/appStart.js +10 -3
- 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.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js +14 -10
- 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 +1 -1
- package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.js +2 -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 +1 -1
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.d.ts +3 -1
- package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.js +2 -1
- 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.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +5 -4
- 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 +5 -5
- package/dist/js/tracing/span.js.map +1 -1
- package/dist/js/tracing/timeToDisplayFallback.d.ts +1 -1
- package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
- package/dist/js/tracing/timeToDisplayFallback.js.map +1 -1
- package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.js +13 -13
- package/dist/js/tracing/timetodisplay.js.map +1 -1
- package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplaynative.js.map +1 -1
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/encodePolyfill.d.ts +4 -0
- package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
- package/dist/js/transports/encodePolyfill.js +17 -3
- package/dist/js/transports/encodePolyfill.js.map +1 -1
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/utils/AsyncExpiringMap.d.ts.map +1 -1
- package/dist/js/utils/AsyncExpiringMap.js +8 -4
- package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
- package/dist/js/utils/carrier.d.ts +5 -0
- package/dist/js/utils/carrier.d.ts.map +1 -0
- package/dist/js/utils/carrier.js +11 -0
- package/dist/js/utils/carrier.js.map +1 -0
- package/dist/js/utils/encode.d.ts +5 -0
- package/dist/js/utils/encode.d.ts.map +1 -0
- package/dist/js/utils/encode.js +13 -0
- package/dist/js/utils/encode.js.map +1 -0
- package/dist/js/utils/envelope.d.ts.map +1 -1
- package/dist/js/utils/envelope.js +1 -2
- 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 +5 -6
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/rnlibraries.d.ts.map +1 -1
- 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/worldwide.d.ts +3 -2
- 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.d.ts.map +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.js +6 -0
- package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +10 -8
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentryVersion.m +1 -1
- package/package.json +9 -10
- package/plugin/build/withSentry.js +3 -3
- package/plugin/build/withSentryAndroidGradlePlugin.js +3 -3
- package/scripts/expo-upload-sourcemaps.js +2 -2
- package/src/js/NativeRNSentry.ts +0 -1
- package/ts3.8/dist/js/feedback/FeedbackWidget.d.ts +1 -1
- package/ts3.8/dist/js/feedback/FeedbackWidget.types.d.ts +30 -30
- package/ts3.8/dist/js/feedback/defaults.d.ts +1 -1
- package/ts3.8/dist/js/feedback/integration.d.ts +1 -1
- package/ts3.8/dist/js/index.d.ts +3 -3
- package/ts3.8/dist/js/integrations/breadcrumbs.d.ts +47 -0
- package/ts3.8/dist/js/integrations/exports.d.ts +2 -1
- package/ts3.8/dist/js/options.d.ts +8 -1
- package/ts3.8/dist/js/profiling/cache.d.ts +1 -1
- package/ts3.8/dist/js/profiling/hermes.d.ts +1 -1
- package/ts3.8/dist/js/replay/browserReplay.d.ts +13 -1
- package/ts3.8/dist/js/replay/replayInterface.d.ts +52 -0
- package/ts3.8/dist/js/sdk.d.ts +1 -6
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnativeprofiler.d.ts +3 -1
- package/ts3.8/dist/js/tracing/timeToDisplayFallback.d.ts +1 -1
- package/ts3.8/dist/js/transports/encodePolyfill.d.ts +4 -0
- package/ts3.8/dist/js/utils/carrier.d.ts +5 -0
- package/ts3.8/dist/js/utils/encode.d.ts +5 -0
- package/ts3.8/dist/js/utils/worldwide.d.ts +3 -2
- package/ts3.8/dist/js/version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewriteframes.js","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"rewriteframes.js","sourceRoot":"","sources":["../../../src/js/integrations/rewriteframes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,wBAAwB,CAAC;QAC9B,QAAQ,EAAE,CAAC,KAAiB,EAAE,EAAE;YAC9B,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;gBAC3D,sDAAsD;gBACtD,4CAA4C;gBAC5C,OAAO,KAAK,CAAC;aACd;YAED,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACnB,OAAO,KAAK,CAAC;aACd;YACD,OAAO,KAAK,CAAC,QAAQ,CAAC;YAEtB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;iBAC5B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;iBACzB,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;iBAC3B,OAAO,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAC;YAEtD,IAAI,KAAK,CAAC,QAAQ,KAAK,eAAe,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE;gBACrE,OAAO,KAAK,CAAC;aACd;YACD,wBAAwB;YAExB,4DAA4D;YAC5D,IAAI,eAAe,EAAE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE;gBACxE,oEAAoE;gBACpE,yFAAyF;gBACzF,wEAAwE;gBACxE,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;aAClB;YAED,4CAA4C;YAC5C,IAAI,MAAM,EAAE,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;gBACzC,KAAK,CAAC,QAAQ,GAAG,2BAA2B,CAAC;gBAC7C,OAAO,KAAK,CAAC;aACd;YAED,IAAI,MAAM,EAAE,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;gBACrC,KAAK,CAAC,QAAQ,GAAG,uBAAuB,CAAC;gBACzC,OAAO,KAAK,CAAC;aACd;YAED,MAAM,SAAS,GAAG,QAAQ,CAAC;YAC3B,+DAA+D;YAC/D,IAAI,KAAK,CAAC,QAAQ,KAAK,sBAAsB,EAAE;gBAC7C,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;aACtB;YACD,wCAAwC;YACxC,KAAK,CAAC,QAAQ;gBACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACzG,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Integration, StackFrame } from '@sentry/core';\nimport { rewriteFramesIntegration } from '@sentry/core';\nimport { Platform } from 'react-native';\nimport { isExpo, isHermesEnabled } from '../utils/environment';\n\nexport const ANDROID_DEFAULT_BUNDLE_NAME = 'app:///index.android.bundle';\nexport const IOS_DEFAULT_BUNDLE_NAME = 'app:///main.jsbundle';\n\n/**\n * Creates React Native default rewrite frames integration\n * which appends app:// to the beginning of the filename\n * and removes file://, 'address at' prefixes, CodePush postfix,\n * and Expo bundle postfix.\n */\nexport function createReactNativeRewriteFrames(): Integration {\n return rewriteFramesIntegration({\n iteratee: (frame: StackFrame) => {\n if (frame.platform === 'java' || frame.platform === 'cocoa') {\n // Because platform is not required in StackFrame type\n // we assume that if not set it's javascript\n return frame;\n }\n\n if (!frame.filename) {\n return frame;\n }\n delete frame.abs_path;\n\n frame.filename = frame.filename\n .replace(/^file:\\/\\//, '')\n .replace(/^address at /, '')\n .replace(/^.*\\/[^.]+(\\.app|CodePush|.*(?=\\/))/, '');\n\n if (frame.filename === '[native code]' || frame.filename === 'native') {\n return frame;\n }\n // Is React Native frame\n\n // Check Hermes Bytecode Frame and convert to 1-based column\n if (isHermesEnabled() && frame.lineno === 1 && frame.colno !== undefined) {\n // hermes bytecode columns are 0-based, while v8 and jsc are 1-based\n // Hermes frames without debug info have always line = 1 and col points to a bytecode pos\n // https://github.com/facebook/react/issues/21792#issuecomment-873171991\n frame.colno += 1;\n }\n\n // Expo adds hash to the end of bundle names\n if (isExpo() && Platform.OS === 'android') {\n frame.filename = ANDROID_DEFAULT_BUNDLE_NAME;\n return frame;\n }\n\n if (isExpo() && Platform.OS === 'ios') {\n frame.filename = IOS_DEFAULT_BUNDLE_NAME;\n return frame;\n }\n\n const appPrefix = 'app://';\n // https://github.com/getsentry/sentry-react-native/issues/3348\n if (frame.filename === '/InternalBytecode.js') {\n frame.in_app = false;\n }\n // We always want to have a triple slash\n frame.filename =\n frame.filename.indexOf('/') === 0 ? `${appPrefix}${frame.filename}` : `${appPrefix}/${frame.filename}`;\n return frame;\n },\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;AAOlE,uCAAuC;AACvC,eAAO,MAAM,qBAAqB,QAAO,WAQxC,CAAC"}
|
|
@@ -20,10 +20,10 @@ export const screenshotIntegration = () => {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
function processEvent(event, hint, client) {
|
|
23
|
-
var _a, _b;
|
|
23
|
+
var _a, _b, _c;
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const hasException = event.exception
|
|
26
|
-
if (!hasException || ((
|
|
25
|
+
const hasException = ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) && event.exception.values.length > 0;
|
|
26
|
+
if (!hasException || ((_c = (_b = client.getOptions()).beforeScreenshot) === null || _c === void 0 ? void 0 : _c.call(_b, event, hint)) === false) {
|
|
27
27
|
return event;
|
|
28
28
|
}
|
|
29
29
|
const screenshots = yield NATIVE.captureScreenshot();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,uCAAuC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAgB,EAAE;IACrD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe,EAAE,MAAyB;;;QAClF,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,UAAU,EAAE,EAAC,gBAAgB,mDAAG,KAAK,EAAE,IAAI,CAAC,MAAK,KAAK,EAAE;YAClF,OAAO,KAAK,CAAC;SACd;QAED,MAAM,WAAW,GAAkC,MAAM,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACpF,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACzC,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC,CAAC,CAAC;SACnE;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["import type { Event, EventHint, Integration } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport type { Screenshot as ScreenshotAttachment } from '../wrapper';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'Screenshot';\n\n/** Adds screenshots to error events */\nexport const screenshotIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint, client: ReactNativeClient): Promise<Event> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException || client.getOptions().beforeScreenshot?.(event, hint) === false) {\n return event;\n }\n\n const screenshots: ScreenshotAttachment[] | null = await NATIVE.captureScreenshot();\n if (screenshots && screenshots.length > 0) {\n hint.attachments = [...screenshots, ...(hint?.attachments || [])];\n }\n\n return event;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,WAAW,EAAW,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,WAAW,EAAW,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAQxF,KAAK,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAEnF,eAAO,MAAM,cAAc,EAAE,cAS5B,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,kBAAkB,QAAO,WAUrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAInC,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,WAAW;SACrB;KACF;IACD,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,sCAAsC;AACtC,MAAM,CAAC,MAAM,kBA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;IAEjD,OAAO,GAAS,EAAE;QAChB,IAAI,QAAQ,EAAE;YACZ,OAAO,qBAAqB,CAAC;SAC9B;QAED,IAAI;YACF,qBAAqB,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC1D,QAAQ,GAAG,IAAI,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC;SACpD;QAED,OAAO,qBAAqB,CAAC;IAC/B,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import type { Event, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'SdkInfo';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport const sdkInfoIntegration = (): Integration => {\n const fetchNativeSdkInfo = createCachedFetchNativeSdkInfo();\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: (event: Event) => processEvent(event, fetchNativeSdkInfo),\n };\n};\n\nasync function processEvent(event: Event, fetchNativeSdkInfo: () => Promise<Package | null>): Promise<Event> {\n const nativeSdkPackage = await fetchNativeSdkInfo();\n\n event.platform = event.platform || 'javascript';\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || defaultSdkInfo.name;\n event.sdk.version = event.sdk.version || defaultSdkInfo.version;\n event.sdk.packages = [\n // default packages are added by baseclient and should not be added here\n ...(event.sdk.packages || []),\n ...((nativeSdkPackage && [nativeSdkPackage]) || []),\n ];\n\n return event;\n}\n\nfunction createCachedFetchNativeSdkInfo(): () => Promise<Package | null> {\n if (!notWeb() || isExpoGo()) {\n return () => {\n return Promise.resolve(null);\n };\n }\n\n let isCached: boolean = false;\n let nativeSdkPackageCache: Package | null = null;\n\n return async () => {\n if (isCached) {\n return nativeSdkPackageCache;\n }\n\n try {\n nativeSdkPackageCache = await NATIVE.fetchNativeSdkInfo();\n isCached = true;\n } catch (e) {\n logger.warn('Could not fetch native sdk info.', e);\n }\n\n return nativeSdkPackageCache;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyD,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyD,WAAW,EAAE,MAAM,cAAc,CAAC;AAKvG,KAAK,sCAAsC,GAAG;IAC5C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,UAAmC,GACpC,GAAE,sCAA2C,GAAG,WAAW,CAc3D;AAkDD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAY7C"}
|
|
@@ -52,19 +52,23 @@ function sendEnvelopesToSidecar(client, sidecarUrl) {
|
|
|
52
52
|
xhr.send(serializeEnvelope(spotlightEnvelope));
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
const DEFAULT_SIDECAR_URL = 'http://localhost:8969/stream';
|
|
55
56
|
/**
|
|
56
57
|
* Gets the default Spotlight sidecar URL.
|
|
57
58
|
*/
|
|
58
59
|
export function getDefaultSidecarUrl() {
|
|
59
|
-
var _a;
|
|
60
|
+
var _a, _b;
|
|
60
61
|
try {
|
|
61
|
-
const { url } = (_a = ReactNativeLibraries.Devtools) === null || _a === void 0 ? void 0 : _a.getDevServer();
|
|
62
|
+
const { url } = (_b = (_a = ReactNativeLibraries.Devtools) === null || _a === void 0 ? void 0 : _a.getDevServer()) !== null && _b !== void 0 ? _b : {};
|
|
63
|
+
if (!url) {
|
|
64
|
+
return DEFAULT_SIDECAR_URL;
|
|
65
|
+
}
|
|
62
66
|
return `http://${getHostnameFromString(url)}:8969/stream`;
|
|
63
67
|
}
|
|
64
68
|
catch (_oO) {
|
|
65
69
|
// We can't load devserver URL
|
|
66
70
|
}
|
|
67
|
-
return
|
|
71
|
+
return DEFAULT_SIDECAR_URL;
|
|
68
72
|
}
|
|
69
73
|
/**
|
|
70
74
|
* React Native implementation of the URL class is missing the `hostname` property.
|
|
@@ -72,7 +76,7 @@ export function getDefaultSidecarUrl() {
|
|
|
72
76
|
function getHostnameFromString(urlString) {
|
|
73
77
|
const regex = /^(?:\w+:)?\/\/([^/:]+)(:\d+)?(.*)$/;
|
|
74
78
|
const matches = urlString.match(regex);
|
|
75
|
-
if (matches
|
|
79
|
+
if (matches === null || matches === void 0 ? void 0 : matches[1]) {
|
|
76
80
|
return matches[1];
|
|
77
81
|
}
|
|
78
82
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlight.js","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"spotlight.js","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYrE;;;;GAIG;AACH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AqB;QACrB,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import type { BaseTransportOptions, Client, ClientOptions, Envelope, Integration } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\n\ntype SpotlightReactNativeIntegrationOptions = {\n /**\n * The URL of the Sidecar instance to connect and forward events to.\n * If not set, Spotlight will try to connect to the Sidecar running on localhost:8969.\n *\n * @default \"http://localhost:8969/stream\"\n */\n sidecarUrl?: string;\n};\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport function spotlightIntegration({\n sidecarUrl = getDefaultSidecarUrl(),\n}: SpotlightReactNativeIntegrationOptions = {}): Integration {\n logger.info('[Spotlight] Using Sidecar URL', sidecarUrl);\n\n return {\n name: 'Spotlight',\n\n setupOnce(): void {\n // nothing to do here\n },\n\n setup(client: Client<ClientOptions<BaseTransportOptions>>): void {\n setup(client, sidecarUrl);\n },\n };\n}\n\nfunction setup(client: Client, sidecarUrl: string): void {\n sendEnvelopesToSidecar(client, sidecarUrl);\n}\n\nfunction sendEnvelopesToSidecar(client: Client, sidecarUrl: string): void {\n if (!client.on) {\n return;\n }\n\n client.on('beforeEnvelope', (originalEnvelope: Envelope) => {\n // TODO: This is a workaround for spotlight/sidecar not supporting images\n const spotlightEnvelope: Envelope = [...originalEnvelope];\n const envelopeItems = [...originalEnvelope[1]].filter(\n item => typeof item[0].content_type !== 'string' || !item[0].content_type.startsWith('image'),\n );\n\n spotlightEnvelope[1] = envelopeItems as Envelope[1];\n\n const xhr = createStealthXhr();\n if (!xhr) {\n logger.error('[Spotlight] Sentry SDK can not create XHR object');\n return;\n }\n\n xhr.open('POST', sidecarUrl, true);\n xhr.setRequestHeader('Content-Type', 'application/x-sentry-envelope');\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n const status = xhr.status;\n if (status === 0 || (status >= 200 && status < 400)) {\n // The request has been completed successfully\n } else {\n // Handle the error\n logger.error(\n \"[Spotlight] Sentry SDK can't connect to Spotlight is it running? See https://spotlightjs.com to download it.\",\n new Error(xhr.statusText),\n );\n }\n }\n };\n\n xhr.send(serializeEnvelope(spotlightEnvelope));\n });\n}\n\nconst DEFAULT_SIDECAR_URL = 'http://localhost:8969/stream';\n\n/**\n * Gets the default Spotlight sidecar URL.\n */\nexport function getDefaultSidecarUrl(): string {\n try {\n const { url } = ReactNativeLibraries.Devtools?.getDevServer() ?? {};\n if (!url) {\n return DEFAULT_SIDECAR_URL;\n }\n\n return `http://${getHostnameFromString(url)}:8969/stream`;\n } catch (_oO) {\n // We can't load devserver URL\n }\n return DEFAULT_SIDECAR_URL;\n}\n\n/**\n * React Native implementation of the URL class is missing the `hostname` property.\n */\nfunction getHostnameFromString(urlString: string): string | null {\n const regex = /^(?:\\w+:)?\\/\\/([^/:]+)(:\\d+)?(.*)$/;\n const matches = urlString.match(regex);\n\n if (matches?.[1]) {\n return matches[1];\n } else {\n // Invalid URL format\n return null;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewhierarchy.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"viewhierarchy.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,WAAW,EAAE,MAAM,cAAc,CAAC;AAU9E,yCAAyC;AACzC,eAAO,MAAM,wBAAwB,QAAO,WAQ3C,CAAC"}
|
|
@@ -24,8 +24,9 @@ export const viewHierarchyIntegration = () => {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
function processEvent(event, hint) {
|
|
27
|
+
var _a;
|
|
27
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const hasException = event.exception
|
|
29
|
+
const hasException = ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) && event.exception.values.length > 0;
|
|
29
30
|
if (!hasException) {
|
|
30
31
|
return event;
|
|
31
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,QAAQ,GAAW,qBAAqB,CAAC;AAC/C,MAAM,WAAW,GAAW,kBAAkB,CAAC;AAC/C,MAAM,cAAc,GAAG,sBAAsD,CAAC;AAE9E,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,yCAAyC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe;;;QACvD,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,aAAa,GAAsB,IAAI,CAAC;QAC5C,IAAI;YACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,CAAC;SAC9D;QAED,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,WAAW,GAAG;gBACjB;oBACE,QAAQ;oBACR,WAAW;oBACX,cAAc;oBACd,IAAI,EAAE,aAAa;iBACpB;gBACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;aAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["import type { Attachment, Event, EventHint, Integration } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { NATIVE } from '../wrapper';\n\nconst filename: string = 'view-hierarchy.json';\nconst contentType: string = 'application/json';\nconst attachmentType = 'event.view_hierarchy' as Attachment['attachmentType'];\n\nconst INTEGRATION_NAME = 'ViewHierarchy';\n\n/** Adds ViewHierarchy to error events */\nexport const viewHierarchyIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy();\n } catch (e) {\n logger.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename,\n contentType,\n attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n}\n"]}
|
package/dist/js/options.d.ts
CHANGED
|
@@ -198,6 +198,13 @@ export interface BaseReactNativeOptions {
|
|
|
198
198
|
* 1.0 will record all sessions and 0 will record none.
|
|
199
199
|
*/
|
|
200
200
|
replaysOnErrorSampleRate?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
|
|
203
|
+
* problems for sending events from command line applications. Setting it too
|
|
204
|
+
* high can cause the application to block for users with network connectivity
|
|
205
|
+
* problems.
|
|
206
|
+
*/
|
|
207
|
+
shutdownTimeout?: number;
|
|
201
208
|
/**
|
|
202
209
|
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
203
210
|
*/
|
|
@@ -240,7 +247,7 @@ export interface ReactNativeClientOptions extends Omit<ClientOptions<ReactNative
|
|
|
240
247
|
}
|
|
241
248
|
export interface ReactNativeWrapperOptions {
|
|
242
249
|
/** Props for the root React profiler */
|
|
243
|
-
profilerProps?: ProfilerProps
|
|
250
|
+
profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;
|
|
244
251
|
/** Props for the root touch event boundary */
|
|
245
252
|
touchEventBoundaryProps?: TouchEventBoundaryProps;
|
|
246
253
|
}
|
package/dist/js/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,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K,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAuSvD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AndroidCombinedProfileEvent, CombinedProfileEvent } from './types';
|
|
2
2
|
export declare const PROFILE_QUEUE: {
|
|
3
|
-
get: (key: string) => AndroidCombinedProfileEvent | CombinedProfileEvent;
|
|
3
|
+
get: (key: string) => AndroidCombinedProfileEvent | CombinedProfileEvent | undefined;
|
|
4
4
|
add: (key: string, value: AndroidCombinedProfileEvent | CombinedProfileEvent) => void;
|
|
5
5
|
delete: (key: string) => boolean;
|
|
6
6
|
clear: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertHermesProfile.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/convertHermesProfile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,cAAc,EAAE,eAAe,EAAkB,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"convertHermesProfile.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/convertHermesProfile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,cAAc,EAAE,eAAe,EAAkB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGhH,OAAO,KAAK,KAAK,MAAM,MAAM,UAAU,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AASnD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,mBAAmB,GAAG,IAAI,CA0ChG;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,EAC9B,sBAAsB,GAAE,MAAgC,GACvD;IACD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACvC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;CAC1B,CAyCA;AAkED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,GAAG,cAAc,CA8BhF"}
|
|
@@ -59,10 +59,19 @@ export function convertToSentryProfile(hermesProfile) {
|
|
|
59
59
|
* @returns the mapped Sentry samples, the set of Hermes stack frame IDs, and the set of JS thread IDs
|
|
60
60
|
*/
|
|
61
61
|
export function mapSamples(hermesSamples, maxElapsedSinceStartNs = MAX_PROFILE_DURATION_NS) {
|
|
62
|
+
const samples = [];
|
|
62
63
|
const jsThreads = new Set();
|
|
63
64
|
const hermesStacks = new Set();
|
|
64
|
-
const
|
|
65
|
-
|
|
65
|
+
const firstSample = hermesSamples[0];
|
|
66
|
+
if (!firstSample) {
|
|
67
|
+
logger.warn('[Profiling] No samples found in profile.');
|
|
68
|
+
return {
|
|
69
|
+
samples,
|
|
70
|
+
hermesStacks,
|
|
71
|
+
jsThreads,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const start = Number(firstSample.ts);
|
|
66
75
|
for (const hermesSample of hermesSamples) {
|
|
67
76
|
jsThreads.add(hermesSample.tid);
|
|
68
77
|
hermesStacks.add(hermesSample.sf);
|
|
@@ -97,8 +106,11 @@ function mapFrames(hermesStackFrames) {
|
|
|
97
106
|
if (!Object.prototype.hasOwnProperty.call(hermesStackFrames, key)) {
|
|
98
107
|
continue;
|
|
99
108
|
}
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
const hermesStackFrame = hermesStackFrames[key];
|
|
110
|
+
if (hermesStackFrame) {
|
|
111
|
+
hermesStackFrameIdToSentryFrameIdMap.set(Number(key), frames.length);
|
|
112
|
+
frames.push(parseHermesJSStackFrame(hermesStackFrame));
|
|
113
|
+
}
|
|
102
114
|
}
|
|
103
115
|
return {
|
|
104
116
|
frames,
|
|
@@ -111,6 +123,7 @@ function mapFrames(hermesStackFrames) {
|
|
|
111
123
|
* @returns the mapped Sentry stacks and a map from Hermes stack IDs to Sentry stack IDs (indices in the stacks array)
|
|
112
124
|
*/
|
|
113
125
|
function mapStacks(hermesStacks, hermesStackFrames, hermesStackFrameIdToSentryFrameIdMap) {
|
|
126
|
+
var _a;
|
|
114
127
|
const hermesStackToSentryStackMap = new Map();
|
|
115
128
|
const stacks = [];
|
|
116
129
|
for (const hermesStackFunctionFrameId of hermesStacks) {
|
|
@@ -121,7 +134,7 @@ function mapStacks(hermesStacks, hermesStackFrames, hermesStackFrameIdToSentryFr
|
|
|
121
134
|
while (currentHermesFrameId !== undefined) {
|
|
122
135
|
const sentryFrameId = hermesStackFrameIdToSentryFrameIdMap.get(currentHermesFrameId);
|
|
123
136
|
sentryFrameId !== undefined && stack.push(sentryFrameId);
|
|
124
|
-
currentHermesFrameId = hermesStackFrames[currentHermesFrameId]
|
|
137
|
+
currentHermesFrameId = (_a = hermesStackFrames[currentHermesFrameId]) === null || _a === void 0 ? void 0 : _a.parent;
|
|
125
138
|
}
|
|
126
139
|
stacks.push(stack);
|
|
127
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertHermesProfile.js","sourceRoot":"","sources":["../../../src/js/profiling/convertHermesProfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc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,EAAE,mBAAmB;QAC7B,MAAM,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACjE,KAAK,EAAE,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;KACrE,CAAC;AACJ,CAAC","sourcesContent":["import type { FrameId, StackId, ThreadCpuFrame, ThreadCpuSample, ThreadCpuStack, ThreadId } from '@sentry/core';\nimport { logger } from '@sentry/core';\n\nimport { MAX_PROFILE_DURATION_MS } from './constants';\nimport type * as Hermes from './hermes';\nimport { DEFAULT_BUNDLE_NAME } from './hermes';\nimport type { RawThreadCpuProfile } from './types';\n\nconst PLACEHOLDER_THREAD_ID_STRING = '0';\nconst MS_TO_NS = 1e6;\nconst MAX_PROFILE_DURATION_NS = MAX_PROFILE_DURATION_MS * MS_TO_NS;\nconst UNKNOWN_STACK_ID = -1;\nconst JS_THREAD_NAME = 'JavaScriptThread';\nconst JS_THREAD_PRIORITY = 1;\n\n/**\n * Converts a Hermes profile to a Sentry profile.\n *\n * Maps Hermes samples to Sentry samples.\n * Maps Hermes stack frames to Sentry frames.\n * Hermes stack frame is an object representing a function call in the stack\n * with a link to its parent stack frame. Root of the represented stack tree\n * is main function call in Hermes that is [root] stack frame.\n *\n * @returns Sentry profile or null if no samples are found.\n */\nexport function convertToSentryProfile(hermesProfile: Hermes.Profile): RawThreadCpuProfile | null {\n if (hermesProfile.samples.length === 0) {\n logger.warn('[Profiling] No samples found in profile.');\n return null;\n }\n\n const { samples, hermesStacks, jsThreads } = mapSamples(hermesProfile.samples);\n\n const { frames, hermesStackFrameIdToSentryFrameIdMap } = mapFrames(hermesProfile.stackFrames);\n\n const { stacks, hermesStackToSentryStackMap } = mapStacks(\n hermesStacks,\n hermesProfile.stackFrames,\n hermesStackFrameIdToSentryFrameIdMap,\n );\n\n for (const sample of samples) {\n const sentryStackId = hermesStackToSentryStackMap.get(sample.stack_id);\n if (sentryStackId === undefined) {\n logger.error(`[Profiling] Hermes Stack ID ${sample.stack_id} not found when mapping to Sentry Stack ID.`);\n sample.stack_id = UNKNOWN_STACK_ID;\n } else {\n sample.stack_id = sentryStackId;\n }\n }\n\n const thread_metadata: Record<ThreadId, { name?: string; priority?: number }> = {};\n for (const jsThreadId of jsThreads) {\n thread_metadata[jsThreadId] = {\n name: JS_THREAD_NAME,\n priority: JS_THREAD_PRIORITY,\n };\n }\n const active_thread_id = Object.keys(thread_metadata)[0] || PLACEHOLDER_THREAD_ID_STRING;\n\n return {\n samples,\n frames,\n stacks,\n thread_metadata,\n active_thread_id,\n };\n}\n\n/**\n * Maps Hermes samples to Sentry samples.\n * Calculates the elapsed time since the first sample based on the absolute timestamps of the Hermes samples.\n * Hermes stack frame IDs represent the last (leaf, furthest from the main func) frame of the call stack.\n * @returns the mapped Sentry samples, the set of Hermes stack frame IDs, and the set of JS thread IDs\n */\nexport function mapSamples(\n hermesSamples: Hermes.Sample[],\n maxElapsedSinceStartNs: number = MAX_PROFILE_DURATION_NS,\n): {\n samples: ThreadCpuSample[];\n hermesStacks: Set<Hermes.StackFrameId>;\n jsThreads: Set<ThreadId>;\n} {\n const jsThreads = new Set<ThreadId>();\n const hermesStacks = new Set<Hermes.StackFrameId>();\n\n const start = Number(hermesSamples[0].ts);\n const samples: ThreadCpuSample[] = [];\n for (const hermesSample of hermesSamples) {\n jsThreads.add(hermesSample.tid);\n hermesStacks.add(hermesSample.sf);\n\n const elapsed_since_start_ns = (Number(hermesSample.ts) - start) * 1e3;\n if (elapsed_since_start_ns >= maxElapsedSinceStartNs) {\n logger.warn(\n `[Profiling] Sample has elapsed time since start ${elapsed_since_start_ns}ns ` +\n `greater than the max elapsed time ${maxElapsedSinceStartNs}ns.`,\n );\n break;\n }\n\n samples.push({\n stack_id: hermesSample.sf,\n thread_id: hermesSample.tid,\n elapsed_since_start_ns: elapsed_since_start_ns.toFixed(0),\n });\n }\n\n return {\n samples,\n hermesStacks,\n jsThreads,\n };\n}\n\n/**\n * Maps Hermes StackFrames tree represented as an JS object to a Sentry frames array.\n * Converts line and columns strings to numbers.\n * @returns the mapped Sentry frames\n */\nfunction mapFrames(hermesStackFrames: Record<Hermes.StackFrameId, Hermes.StackFrame>): {\n frames: ThreadCpuFrame[];\n hermesStackFrameIdToSentryFrameIdMap: Map<Hermes.StackFrameId, FrameId>;\n} {\n const frames: ThreadCpuFrame[] = [];\n const hermesStackFrameIdToSentryFrameIdMap = new Map<Hermes.StackFrameId, FrameId>();\n for (const key in hermesStackFrames) {\n // asc order based on the key is not guaranteed\n if (!Object.prototype.hasOwnProperty.call(hermesStackFrames, key)) {\n continue;\n }\n hermesStackFrameIdToSentryFrameIdMap.set(Number(key), frames.length);\n frames.push(parseHermesJSStackFrame(hermesStackFrames[key]));\n }\n\n return {\n frames,\n hermesStackFrameIdToSentryFrameIdMap,\n };\n}\n\n/**\n * Maps Hermes stack frame IDs to Sentry stack arrays.\n * Hermes stack frame IDs represent the last (leaf, furthest from the main func) frame of the call stack.\n * @returns the mapped Sentry stacks and a map from Hermes stack IDs to Sentry stack IDs (indices in the stacks array)\n */\nfunction mapStacks(\n hermesStacks: Set<Hermes.StackFrameId>,\n hermesStackFrames: Record<Hermes.StackFrameId, Hermes.StackFrame>,\n hermesStackFrameIdToSentryFrameIdMap: Map<Hermes.StackFrameId, FrameId>,\n): {\n stacks: ThreadCpuStack[];\n hermesStackToSentryStackMap: Map<Hermes.StackFrameId, StackId>;\n} {\n const hermesStackToSentryStackMap = new Map<Hermes.StackFrameId, StackId>();\n const stacks: ThreadCpuStack[] = [];\n for (const hermesStackFunctionFrameId of hermesStacks) {\n const stackId = stacks.length;\n hermesStackToSentryStackMap.set(hermesStackFunctionFrameId, stackId);\n const stack: ThreadCpuStack = [];\n let currentHermesFrameId: Hermes.StackFrameId | undefined = hermesStackFunctionFrameId;\n while (currentHermesFrameId !== undefined) {\n const sentryFrameId = hermesStackFrameIdToSentryFrameIdMap.get(currentHermesFrameId);\n sentryFrameId !== undefined && stack.push(sentryFrameId);\n currentHermesFrameId = hermesStackFrames[currentHermesFrameId] && hermesStackFrames[currentHermesFrameId].parent;\n }\n stacks.push(stack);\n }\n\n return {\n stacks,\n hermesStackToSentryStackMap,\n };\n}\n\n/**\n * Parses Hermes StackFrame to Sentry StackFrame.\n * For native frames only function name is returned, for Hermes bytecode the line and column are calculated.\n */\nexport function parseHermesJSStackFrame(frame: Hermes.StackFrame): ThreadCpuFrame {\n if (frame.category !== 'JavaScript') {\n // Native\n if (frame.name === '[root]') {\n return { function: frame.name, in_app: false };\n }\n return { function: frame.name };\n }\n\n if (frame.funcVirtAddr !== undefined && frame.offset !== undefined) {\n // Hermes Bytecode\n return {\n function: frame.name,\n abs_path: DEFAULT_BUNDLE_NAME,\n // https://github.com/krystofwoldrich/metro/blob/417e6f276ff9422af6039fc4d1bce41fcf7d9f46/packages/metro-symbolicate/src/Symbolication.js#L298-L301\n // Hermes lineno is hardcoded 1, currently only one bundle symbolication is supported by metro-symbolicate and thus by us.\n lineno: 1,\n // Hermes colno is 0-based, while Sentry is 1-based\n colno: Number(frame.funcVirtAddr) + Number(frame.offset) + 1,\n };\n }\n\n // JavaScript\n const indexOfLeftParenthesis = frame.name.indexOf('(');\n return {\n function: indexOfLeftParenthesis !== -1 ? frame.name.substring(0, indexOfLeftParenthesis) || undefined : frame.name,\n abs_path: DEFAULT_BUNDLE_NAME,\n lineno: frame.line !== undefined ? Number(frame.line) : undefined,\n colno: frame.column !== undefined ? Number(frame.column) : undefined,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"convertHermesProfile.js","sourceRoot":"","sources":["../../../src/js/profiling/convertHermesProfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,O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,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,sBAAsB,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI;QACnH,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACjE,KAAK,EAAE,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;KACrE,CAAC;AACJ,CAAC","sourcesContent":["import type { FrameId, StackId, ThreadCpuFrame, ThreadCpuSample, ThreadCpuStack, ThreadId } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { MAX_PROFILE_DURATION_MS } from './constants';\nimport type * as Hermes from './hermes';\nimport { DEFAULT_BUNDLE_NAME } from './hermes';\nimport type { RawThreadCpuProfile } from './types';\n\nconst PLACEHOLDER_THREAD_ID_STRING = '0';\nconst MS_TO_NS = 1e6;\nconst MAX_PROFILE_DURATION_NS = MAX_PROFILE_DURATION_MS * MS_TO_NS;\nconst UNKNOWN_STACK_ID = -1;\nconst JS_THREAD_NAME = 'JavaScriptThread';\nconst JS_THREAD_PRIORITY = 1;\n\n/**\n * Converts a Hermes profile to a Sentry profile.\n *\n * Maps Hermes samples to Sentry samples.\n * Maps Hermes stack frames to Sentry frames.\n * Hermes stack frame is an object representing a function call in the stack\n * with a link to its parent stack frame. Root of the represented stack tree\n * is main function call in Hermes that is [root] stack frame.\n *\n * @returns Sentry profile or null if no samples are found.\n */\nexport function convertToSentryProfile(hermesProfile: Hermes.Profile): RawThreadCpuProfile | null {\n if (hermesProfile.samples.length === 0) {\n logger.warn('[Profiling] No samples found in profile.');\n return null;\n }\n\n const { samples, hermesStacks, jsThreads } = mapSamples(hermesProfile.samples);\n\n const { frames, hermesStackFrameIdToSentryFrameIdMap } = mapFrames(hermesProfile.stackFrames);\n\n const { stacks, hermesStackToSentryStackMap } = mapStacks(\n hermesStacks,\n hermesProfile.stackFrames,\n hermesStackFrameIdToSentryFrameIdMap,\n );\n\n for (const sample of samples) {\n const sentryStackId = hermesStackToSentryStackMap.get(sample.stack_id);\n if (sentryStackId === undefined) {\n logger.error(`[Profiling] Hermes Stack ID ${sample.stack_id} not found when mapping to Sentry Stack ID.`);\n sample.stack_id = UNKNOWN_STACK_ID;\n } else {\n sample.stack_id = sentryStackId;\n }\n }\n\n const thread_metadata: Record<ThreadId, { name?: string; priority?: number }> = {};\n for (const jsThreadId of jsThreads) {\n thread_metadata[jsThreadId] = {\n name: JS_THREAD_NAME,\n priority: JS_THREAD_PRIORITY,\n };\n }\n const active_thread_id = Object.keys(thread_metadata)[0] || PLACEHOLDER_THREAD_ID_STRING;\n\n return {\n samples,\n frames,\n stacks,\n thread_metadata,\n active_thread_id,\n };\n}\n\n/**\n * Maps Hermes samples to Sentry samples.\n * Calculates the elapsed time since the first sample based on the absolute timestamps of the Hermes samples.\n * Hermes stack frame IDs represent the last (leaf, furthest from the main func) frame of the call stack.\n * @returns the mapped Sentry samples, the set of Hermes stack frame IDs, and the set of JS thread IDs\n */\nexport function mapSamples(\n hermesSamples: Hermes.Sample[],\n maxElapsedSinceStartNs: number = MAX_PROFILE_DURATION_NS,\n): {\n samples: ThreadCpuSample[];\n hermesStacks: Set<Hermes.StackFrameId>;\n jsThreads: Set<ThreadId>;\n} {\n const samples: ThreadCpuSample[] = [];\n const jsThreads = new Set<ThreadId>();\n const hermesStacks = new Set<Hermes.StackFrameId>();\n\n const firstSample = hermesSamples[0];\n if (!firstSample) {\n logger.warn('[Profiling] No samples found in profile.');\n return {\n samples,\n hermesStacks,\n jsThreads,\n };\n }\n\n const start = Number(firstSample.ts);\n for (const hermesSample of hermesSamples) {\n jsThreads.add(hermesSample.tid);\n hermesStacks.add(hermesSample.sf);\n\n const elapsed_since_start_ns = (Number(hermesSample.ts) - start) * 1e3;\n if (elapsed_since_start_ns >= maxElapsedSinceStartNs) {\n logger.warn(\n `[Profiling] Sample has elapsed time since start ${elapsed_since_start_ns}ns ` +\n `greater than the max elapsed time ${maxElapsedSinceStartNs}ns.`,\n );\n break;\n }\n\n samples.push({\n stack_id: hermesSample.sf,\n thread_id: hermesSample.tid,\n elapsed_since_start_ns: elapsed_since_start_ns.toFixed(0),\n });\n }\n\n return {\n samples,\n hermesStacks,\n jsThreads,\n };\n}\n\n/**\n * Maps Hermes StackFrames tree represented as an JS object to a Sentry frames array.\n * Converts line and columns strings to numbers.\n * @returns the mapped Sentry frames\n */\nfunction mapFrames(hermesStackFrames: Record<Hermes.StackFrameId, Hermes.StackFrame>): {\n frames: ThreadCpuFrame[];\n hermesStackFrameIdToSentryFrameIdMap: Map<Hermes.StackFrameId, FrameId>;\n} {\n const frames: ThreadCpuFrame[] = [];\n const hermesStackFrameIdToSentryFrameIdMap = new Map<Hermes.StackFrameId, FrameId>();\n for (const key in hermesStackFrames) {\n // asc order based on the key is not guaranteed\n if (!Object.prototype.hasOwnProperty.call(hermesStackFrames, key)) {\n continue;\n }\n\n const hermesStackFrame = hermesStackFrames[key];\n if (hermesStackFrame) {\n hermesStackFrameIdToSentryFrameIdMap.set(Number(key), frames.length);\n frames.push(parseHermesJSStackFrame(hermesStackFrame));\n }\n }\n\n return {\n frames,\n hermesStackFrameIdToSentryFrameIdMap,\n };\n}\n\n/**\n * Maps Hermes stack frame IDs to Sentry stack arrays.\n * Hermes stack frame IDs represent the last (leaf, furthest from the main func) frame of the call stack.\n * @returns the mapped Sentry stacks and a map from Hermes stack IDs to Sentry stack IDs (indices in the stacks array)\n */\nfunction mapStacks(\n hermesStacks: Set<Hermes.StackFrameId>,\n hermesStackFrames: Record<Hermes.StackFrameId, Hermes.StackFrame>,\n hermesStackFrameIdToSentryFrameIdMap: Map<Hermes.StackFrameId, FrameId>,\n): {\n stacks: ThreadCpuStack[];\n hermesStackToSentryStackMap: Map<Hermes.StackFrameId, StackId>;\n} {\n const hermesStackToSentryStackMap = new Map<Hermes.StackFrameId, StackId>();\n const stacks: ThreadCpuStack[] = [];\n for (const hermesStackFunctionFrameId of hermesStacks) {\n const stackId = stacks.length;\n hermesStackToSentryStackMap.set(hermesStackFunctionFrameId, stackId);\n const stack: ThreadCpuStack = [];\n let currentHermesFrameId: Hermes.StackFrameId | undefined = hermesStackFunctionFrameId;\n while (currentHermesFrameId !== undefined) {\n const sentryFrameId = hermesStackFrameIdToSentryFrameIdMap.get(currentHermesFrameId);\n sentryFrameId !== undefined && stack.push(sentryFrameId);\n currentHermesFrameId = hermesStackFrames[currentHermesFrameId]?.parent;\n }\n stacks.push(stack);\n }\n\n return {\n stacks,\n hermesStackToSentryStackMap,\n };\n}\n\n/**\n * Parses Hermes StackFrame to Sentry StackFrame.\n * For native frames only function name is returned, for Hermes bytecode the line and column are calculated.\n */\nexport function parseHermesJSStackFrame(frame: Hermes.StackFrame): ThreadCpuFrame {\n if (frame.category !== 'JavaScript') {\n // Native\n if (frame.name === '[root]') {\n return { function: frame.name, in_app: false };\n }\n return { function: frame.name };\n }\n\n if (frame.funcVirtAddr !== undefined && frame.offset !== undefined) {\n // Hermes Bytecode\n return {\n function: frame.name,\n abs_path: DEFAULT_BUNDLE_NAME,\n // https://github.com/krystofwoldrich/metro/blob/417e6f276ff9422af6039fc4d1bce41fcf7d9f46/packages/metro-symbolicate/src/Symbolication.js#L298-L301\n // Hermes lineno is hardcoded 1, currently only one bundle symbolication is supported by metro-symbolicate and thus by us.\n lineno: 1,\n // Hermes colno is 0-based, while Sentry is 1-based\n colno: Number(frame.funcVirtAddr) + Number(frame.offset) + 1,\n };\n }\n\n // JavaScript\n const indexOfLeftParenthesis = frame.name.indexOf('(');\n return {\n function: indexOfLeftParenthesis !== -1 ? frame.name.substring(0, indexOfLeftParenthesis) || undefined : frame.name,\n abs_path: DEFAULT_BUNDLE_NAME,\n lineno: frame.line !== undefined ? Number(frame.line) : undefined,\n colno: frame.column !== undefined ? Number(frame.column) : undefined,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugid.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/debugid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"debugid.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/debugid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,EAAE,CAsC/C"}
|
|
@@ -17,11 +17,19 @@ export function getDebugMetadata() {
|
|
|
17
17
|
}
|
|
18
18
|
if (debugIdsKeys.length > 1) {
|
|
19
19
|
logger.warn('[Profiling] Multiple debug images found, but only one one bundle is supported. Using the first one...');
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
if (!debugIdsKeys[0]) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const debugId = debugIdMap[debugIdsKeys[0]];
|
|
26
|
+
if (!debugId) {
|
|
27
|
+
return [];
|
|
20
28
|
}
|
|
21
29
|
return [
|
|
22
30
|
{
|
|
23
31
|
code_file: DEFAULT_BUNDLE_NAME,
|
|
24
|
-
debug_id:
|
|
32
|
+
debug_id: debugId,
|
|
25
33
|
type: 'sourcemap',
|
|
26
34
|
},
|
|
27
35
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugid.js","sourceRoot":"","sources":["../../../src/js/profiling/debugid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"debugid.js","sourceRoot":"","sources":["../../../src/js/profiling/debugid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,mBAAmB,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,EAAE,CAAC;KACX;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3B,MAAM,CAAC,IAAI,CACT,uGAAuG,CACxG,CAAC;QACF,OAAO,EAAE,CAAC;KACX;IAED,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;QACpB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,EAAE,CAAC;KACX;IAED,OAAO;QACL;YACE,SAAS,EAAE,mBAAmB;YAC9B,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,WAAW;SAClB;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { DebugImage } from '@sentry/core';\nimport { GLOBAL_OBJ, logger } from '@sentry/core';\nimport { DEFAULT_BUNDLE_NAME } from './hermes';\n\n/**\n * Returns debug meta images of the loaded bundle.\n */\nexport function getDebugMetadata(): DebugImage[] {\n if (!DEFAULT_BUNDLE_NAME) {\n return [];\n }\n\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n if (!debugIdMap) {\n return [];\n }\n\n const debugIdsKeys = Object.keys(debugIdMap);\n if (!debugIdsKeys.length) {\n return [];\n }\n\n if (debugIdsKeys.length > 1) {\n logger.warn(\n '[Profiling] Multiple debug images found, but only one one bundle is supported. Using the first one...',\n );\n return [];\n }\n\n if (!debugIdsKeys[0]) {\n return [];\n }\n\n const debugId = debugIdMap[debugIdsKeys[0]];\n if (!debugId) {\n return [];\n }\n\n return [\n {\n code_file: DEFAULT_BUNDLE_NAME,\n debug_id: debugId,\n type: 'sourcemap',\n },\n ];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,qBAAqB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,qBAAqB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IAEzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,mBAAmB,oBACuF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/js/profiling/hermes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAkDrG,MAAM,CAAC,MAAM,mBAAmB,GAC9B,QAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC","sourcesContent":["import { Platform } from 'react-native';\nimport { ANDROID_DEFAULT_BUNDLE_NAME, IOS_DEFAULT_BUNDLE_NAME } from '../integrations/rewriteframes';\n\nexport type StackFrameId = number;\nexport type MicrosecondsSinceBoot = string;\n\nexport interface TraceEvent {\n name: string;\n ph: string;\n cat: string;\n pid: number;\n ts: MicrosecondsSinceBoot;\n tid: string;\n args: {\n name?: string;\n };\n}\n\nexport interface Sample {\n cpu: string;\n name: string;\n ts: MicrosecondsSinceBoot;\n pid: number;\n tid: string;\n weight: string;\n sf: StackFrameId;\n}\n\nexport interface StackFrame {\n // Hermes Bytecode\n funcVirtAddr?: string;\n offset?: string;\n\n // JavaScript\n line?: string;\n column?: string;\n funcLine?: string;\n funcColumn?: string;\n\n // Common\n name: string;\n category: string;\n parent?: number;\n}\n\nexport interface Profile {\n traceEvents: TraceEvent[];\n samples: Sample[];\n stackFrames: Record<string, StackFrame>;\n}\n\nexport const DEFAULT_BUNDLE_NAME =\n Platform.OS === 'android' ? ANDROID_DEFAULT_BUNDLE_NAME : Platform.OS === 'ios' ? IOS_DEFAULT_BUNDLE_NAME : undefined;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,WAAW,EAAQ,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,WAAW,EAAQ,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,kBAAkB,EAAgB,MAAM,SAAS,CAAC;AAYnH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAMD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,sBAAsB,KAAoB,WAyMjG,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOxE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,uBAAuB,EAAE,MAAM,GAC9B,oBAAoB,GAAG,2BAA2B,GAAG,IAAI,CAyB3D;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,yBAAyB,EACxC,UAAU,EAAE,MAAM,GACjB,2BAA2B,CAQ7B;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,kBAAkB,GACzB,oBAAoB,CAOtB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,uBAAuB,EAAE,MAAM,GAAG,SAAS,GAC1C,oBAAoB,CAAC,SAAS,CAAC,CAkCjC"}
|
|
@@ -78,12 +78,13 @@ export const hermesProfilingIntegration = (initOptions = defaultOptions) => {
|
|
|
78
78
|
_startNewProfile(activeSpan);
|
|
79
79
|
};
|
|
80
80
|
const _shouldStartProfiling = (activeSpan) => {
|
|
81
|
+
var _a;
|
|
81
82
|
if (!spanIsSampled(activeSpan)) {
|
|
82
83
|
logger.log('[Profiling] Transaction is not sampled, skipping profiling');
|
|
83
84
|
return false;
|
|
84
85
|
}
|
|
85
86
|
const client = getClient();
|
|
86
|
-
const options = client
|
|
87
|
+
const options = (_a = client === null || client === void 0 ? void 0 : client.getOptions) === null || _a === void 0 ? void 0 : _a.call(client);
|
|
87
88
|
const profilesSampleRate = options && typeof options.profilesSampleRate === 'number' ? options.profilesSampleRate : undefined;
|
|
88
89
|
if (profilesSampleRate === undefined) {
|
|
89
90
|
logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');
|