@sentry/react-native 6.5.0-beta.1 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +31 -22
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +9 -0
- package/dist/js/NativeRNSentry.d.ts +1 -1
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/breadcrumb.d.ts +1 -1
- package/dist/js/breadcrumb.d.ts.map +1 -1
- package/dist/js/breadcrumb.js +1 -1
- package/dist/js/breadcrumb.js.map +1 -1
- package/dist/js/client.d.ts +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +1 -2
- package/dist/js/client.js.map +1 -1
- package/dist/js/index.d.ts +1 -1
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +1 -1
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.js +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
- package/dist/js/integrations/default.d.ts +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +13 -12
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts +1 -1
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +1 -1
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/eventorigin.d.ts +1 -1
- package/dist/js/integrations/eventorigin.d.ts.map +1 -1
- package/dist/js/integrations/eventorigin.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts +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/factory.d.ts +1 -1
- package/dist/js/integrations/factory.d.ts.map +1 -1
- package/dist/js/integrations/factory.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts +1 -1
- package/dist/js/integrations/modulesloader.d.ts.map +1 -1
- package/dist/js/integrations/modulesloader.js +1 -1
- package/dist/js/integrations/modulesloader.js.map +1 -1
- package/dist/js/integrations/nativelinkederrors.d.ts +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/reactnativeerrorhandlers.d.ts +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +2 -2
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.js +1 -1
- package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts +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 +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 +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 +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 +1 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +1 -1
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts +1 -1
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js +1 -1
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +1 -1
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/misc.d.ts +1 -1
- package/dist/js/misc.d.ts.map +1 -1
- package/dist/js/misc.js.map +1 -1
- package/dist/js/options.d.ts +18 -6
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/profiling/cache.d.ts.map +1 -1
- package/dist/js/profiling/cache.js +53 -1
- package/dist/js/profiling/cache.js.map +1 -1
- package/dist/js/profiling/convertHermesProfile.d.ts +1 -1
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
- package/dist/js/profiling/convertHermesProfile.js +1 -1
- package/dist/js/profiling/convertHermesProfile.js.map +1 -1
- package/dist/js/profiling/debugid.d.ts +1 -1
- package/dist/js/profiling/debugid.d.ts.map +1 -1
- package/dist/js/profiling/debugid.js +1 -1
- package/dist/js/profiling/debugid.js.map +1 -1
- package/dist/js/profiling/integration.d.ts +1 -1
- package/dist/js/profiling/integration.d.ts.map +1 -1
- package/dist/js/profiling/integration.js +1 -3
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/profiling/types.d.ts +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 +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.js +1 -1
- package/dist/js/replay/CustomMask.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts +3 -5
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js +3 -5
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/replay/networkUtils.d.ts +1 -0
- package/dist/js/replay/networkUtils.d.ts.map +1 -1
- package/dist/js/replay/xhrUtils.d.ts +1 -1
- package/dist/js/replay/xhrUtils.d.ts.map +1 -1
- package/dist/js/replay/xhrUtils.js +1 -1
- package/dist/js/replay/xhrUtils.js.map +1 -1
- package/dist/js/scopeSync.d.ts +1 -1
- package/dist/js/scopeSync.d.ts.map +1 -1
- package/dist/js/scopeSync.js.map +1 -1
- package/dist/js/sdk.d.ts +1 -1
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +6 -9
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/ModulesCollector.js +13 -13
- package/dist/js/tools/ModulesCollector.js.map +1 -1
- package/dist/js/tools/enableLogger.js +2 -2
- package/dist/js/tools/enableLogger.js.map +1 -1
- package/dist/js/tools/metroMiddleware.js +8 -8
- package/dist/js/tools/metroMiddleware.js.map +1 -1
- package/dist/js/tools/metroconfig.js +4 -4
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.js +3 -3
- package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +1 -2
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
- package/dist/js/tracing/gesturetracing.js +1 -2
- 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 +1 -3
- package/dist/js/tracing/integrations/appStart.js.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
- package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.js +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 +1 -3
- package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
- package/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
- package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
- package/dist/js/tracing/integrations/userInteraction.js +1 -2
- 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 +1 -2
- package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts +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 +1 -1
- package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +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 +1 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +3 -5
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/span.d.ts +1 -1
- package/dist/js/tracing/span.d.ts.map +1 -1
- package/dist/js/tracing/span.js +1 -2
- package/dist/js/tracing/span.js.map +1 -1
- package/dist/js/tracing/timetodisplay.d.ts +1 -1
- package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.js +1 -2
- package/dist/js/tracing/timetodisplay.js.map +1 -1
- package/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
- package/dist/js/tracing/timetodisplaynative.types.d.ts.map +1 -1
- package/dist/js/tracing/types.d.ts +1 -1
- package/dist/js/tracing/types.d.ts.map +1 -1
- package/dist/js/tracing/types.js.map +1 -1
- package/dist/js/tracing/utils.d.ts +1 -1
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js +1 -2
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/native.d.ts +1 -2
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js +1 -1
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/user.d.ts +1 -1
- package/dist/js/user.d.ts.map +1 -1
- package/dist/js/user.js.map +1 -1
- package/dist/js/utils/clientutils.d.ts +1 -1
- package/dist/js/utils/clientutils.d.ts.map +1 -1
- package/dist/js/utils/clientutils.js.map +1 -1
- package/dist/js/utils/envelope.d.ts +1 -1
- package/dist/js/utils/envelope.d.ts.map +1 -1
- package/dist/js/utils/envelope.js +1 -1
- package/dist/js/utils/envelope.js.map +1 -1
- package/dist/js/utils/fill.d.ts +1 -1
- package/dist/js/utils/fill.js +2 -2
- package/dist/js/utils/fill.js.map +1 -1
- package/dist/js/utils/normalize.js +1 -1
- package/dist/js/utils/normalize.js.map +1 -1
- package/dist/js/utils/outcome.d.ts +1 -1
- package/dist/js/utils/outcome.d.ts.map +1 -1
- package/dist/js/utils/outcome.js.map +1 -1
- package/dist/js/utils/safe.js +1 -1
- package/dist/js/utils/safe.js.map +1 -1
- package/dist/js/utils/sentryeventemitter.js +1 -1
- package/dist/js/utils/sentryeventemitter.js.map +1 -1
- package/dist/js/utils/sentryeventemitterfallback.js +1 -1
- package/dist/js/utils/sentryeventemitterfallback.js.map +1 -1
- package/dist/js/utils/span.d.ts +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 +1 -1
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/vendor/react-native/index.d.ts +1 -0
- package/dist/js/vendor/react-native/index.d.ts.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 +1 -1
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +1 -1
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +15 -7
- package/ios/RNSentryReplay.mm +11 -17
- package/ios/RNSentryVersion.h +6 -0
- package/ios/RNSentryVersion.m +6 -0
- package/package.json +12 -12
- package/src/js/NativeRNSentry.ts +1 -1
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
- package/ts3.8/dist/js/breadcrumb.d.ts +1 -1
- package/ts3.8/dist/js/client.d.ts +1 -1
- package/ts3.8/dist/js/index.d.ts +1 -1
- package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +1 -1
- package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
- package/ts3.8/dist/js/integrations/default.d.ts +1 -1
- package/ts3.8/dist/js/integrations/devicecontext.d.ts +1 -1
- package/ts3.8/dist/js/integrations/eventorigin.d.ts +1 -1
- package/ts3.8/dist/js/integrations/expocontext.d.ts +1 -1
- package/ts3.8/dist/js/integrations/factory.d.ts +1 -1
- package/ts3.8/dist/js/integrations/modulesloader.d.ts +1 -1
- package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +1 -1
- package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
- package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +1 -1
- package/ts3.8/dist/js/integrations/release.d.ts +1 -1
- package/ts3.8/dist/js/integrations/rewriteframes.d.ts +1 -1
- package/ts3.8/dist/js/integrations/screenshot.d.ts +1 -1
- package/ts3.8/dist/js/integrations/sdkinfo.d.ts +1 -1
- package/ts3.8/dist/js/integrations/spotlight.d.ts +1 -1
- package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +1 -1
- package/ts3.8/dist/js/misc.d.ts +1 -1
- package/ts3.8/dist/js/options.d.ts +18 -6
- package/ts3.8/dist/js/profiling/convertHermesProfile.d.ts +1 -1
- package/ts3.8/dist/js/profiling/debugid.d.ts +1 -1
- package/ts3.8/dist/js/profiling/integration.d.ts +1 -1
- package/ts3.8/dist/js/profiling/types.d.ts +1 -1
- package/ts3.8/dist/js/profiling/utils.d.ts +1 -1
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +3 -5
- package/ts3.8/dist/js/replay/networkUtils.d.ts +1 -0
- package/ts3.8/dist/js/replay/xhrUtils.d.ts +1 -1
- package/ts3.8/dist/js/scopeSync.d.ts +1 -1
- package/ts3.8/dist/js/sdk.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
- package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnavigation.d.ts +1 -1
- package/ts3.8/dist/js/tracing/span.d.ts +1 -1
- package/ts3.8/dist/js/tracing/timetodisplay.d.ts +1 -1
- package/ts3.8/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
- package/ts3.8/dist/js/tracing/types.d.ts +1 -1
- package/ts3.8/dist/js/tracing/utils.d.ts +1 -1
- package/ts3.8/dist/js/transports/native.d.ts +1 -2
- package/ts3.8/dist/js/user.d.ts +1 -1
- package/ts3.8/dist/js/utils/clientutils.d.ts +1 -1
- package/ts3.8/dist/js/utils/envelope.d.ts +1 -1
- package/ts3.8/dist/js/utils/fill.d.ts +1 -1
- package/ts3.8/dist/js/utils/outcome.d.ts +1 -1
- package/ts3.8/dist/js/utils/span.d.ts +1 -1
- package/ts3.8/dist/js/utils/worldwide.d.ts +1 -1
- package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/tracing/span.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,SAAS,EACT,eAAe,EACf,MAAM,EACN,4BAA4B,EAC5B,gCAAgC,EAChC,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,aAAa,IAAI,iBAAiB,GACnC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,4BAA4B,GAAG,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAgB3B;IACF,WAAW,EAAE,IAAK;IAClB,YAAY,EAAE,MAAO;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,eAAiC,EACjC,EACE,YAAY,GAAG,kBAAkB,CAAC,YAAY,EAC9C,WAAW,GAAG,kBAAkB,CAAC,WAAW,MACN,EAAE,EACxB,EAAE;IACpB,MAAM,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AC;QACvE,OAAO,IAAI,sBAAsB,EAAE,CAAC;KACrC;IAED,eAAe,EAAE,CAAC,qBAAqB,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAEtE,MAAM,IAAI,GAAG,iBAAiB,CAAC,eAAe,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/E,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,mCAAmC;IACjD,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,EAAE,EAAE,YAAY;QAChB,gBAAgB,EAAE,IAAI;QACtB,KAAK,EAAE,eAAe,EAAE;KACzB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAU;IAChD,OAAO,CAAC,4BAA4B,EAAE,8BAA8B,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1G,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAM9C;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAyB;IAChE,gEAAgE;IAChE,OAAO,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,IAAU,EAAE,EAAE;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE;YACxB,IAAI,CAAC,YAAY,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Client, Scope, Span, StartSpanOptions } from '@sentry/core';\nimport {\n generatePropagationContext,\n getActiveSpan,\n getClient,\n getCurrentScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n SPAN_STATUS_ERROR,\n spanToJSON,\n startIdleSpan as coreStartIdleSpan,\n} from '@sentry/core';\n\nimport { isRootSpan } from '../utils/span';\nimport { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';\nimport {\n SPAN_ORIGIN_AUTO_INTERACTION,\n SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM,\n SPAN_ORIGIN_MANUAL_INTERACTION,\n} from './origin';\n\nexport const DEFAULT_NAVIGATION_SPAN_NAME = 'Route Change';\n\nexport const defaultIdleOptions: {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n *\n * @default 1_000 (ms)\n */\n finalTimeout: number;\n\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n *\n * @default 60_0000 (ms)\n */\n idleTimeout: number;\n} = {\n idleTimeout: 1_000,\n finalTimeout: 60_0000,\n};\n\nexport const startIdleNavigationSpan = (\n startSpanOption: StartSpanOptions,\n {\n finalTimeout = defaultIdleOptions.finalTimeout,\n idleTimeout = defaultIdleOptions.idleTimeout,\n }: Partial<typeof defaultIdleOptions> = {},\n): Span | undefined => {\n const client = getClient();\n if (!client) {\n logger.warn(`[startIdleNavigationSpan] Can't create route change span, missing client.`);\n return undefined;\n }\n\n const activeSpan = getActiveSpan();\n clearActiveSpanFromScope(getCurrentScope());\n if (activeSpan && isRootSpan(activeSpan) && isSentryInteractionSpan(activeSpan)) {\n logger.log(\n `[startIdleNavigationSpan] Canceling ${\n spanToJSON(activeSpan).op\n } transaction because of a new navigation root span.`,\n );\n activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n activeSpan.end();\n }\n\n const finalStartStapOptions = {\n ...getDefaultIdleNavigationSpanOptions(),\n ...startSpanOption,\n };\n\n const idleSpan = startIdleSpan(finalStartStapOptions, { finalTimeout, idleTimeout });\n logger.log(\n `[startIdleNavigationSpan] Starting ${finalStartStapOptions.op || 'unknown op'} transaction \"${\n finalStartStapOptions.name\n }\" on scope`,\n );\n\n adjustTransactionDuration(client, idleSpan, finalTimeout);\n\n idleSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_CUSTOM);\n return idleSpan;\n};\n\n/**\n * Starts an idle span from `@sentry/core` with React Native application\n * context awareness.\n *\n * - Span will be started with new propagation context.\n * - Span will be canceled if the app goes to background.\n */\nexport const startIdleSpan = (\n startSpanOption: StartSpanOptions,\n { finalTimeout, idleTimeout }: { finalTimeout: number | undefined; idleTimeout: number | undefined },\n): Span => {\n const client = getClient();\n if (!client) {\n logger.warn(`[startIdleSpan] Can't create idle span, missing client.`);\n return new SentryNonRecordingSpan();\n }\n\n getCurrentScope().setPropagationContext(generatePropagationContext());\n\n const span = coreStartIdleSpan(startSpanOption, { finalTimeout, idleTimeout });\n cancelInBackground(client, span);\n return span;\n};\n\n/**\n * Returns the default options for the idle navigation span.\n */\nexport function getDefaultIdleNavigationSpanOptions(): StartSpanOptions {\n return {\n name: DEFAULT_NAVIGATION_SPAN_NAME,\n op: 'navigation',\n forceTransaction: true,\n scope: getCurrentScope(),\n };\n}\n\n/**\n * Checks if the span is a Sentry User Interaction span.\n */\nexport function isSentryInteractionSpan(span: Span): boolean {\n return [SPAN_ORIGIN_AUTO_INTERACTION, SPAN_ORIGIN_MANUAL_INTERACTION].includes(spanToJSON(span).origin);\n}\n\nexport const SCOPE_SPAN_FIELD = '_sentrySpan';\n\nexport type ScopeWithMaybeSpan = Scope & {\n [SCOPE_SPAN_FIELD]?: Span;\n};\n\n/**\n * Removes the active span from the scope.\n */\nexport function clearActiveSpanFromScope(scope: ScopeWithMaybeSpan): void {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete scope[SCOPE_SPAN_FIELD];\n}\n\n/**\n * Ensures that all created spans have an operation name.\n */\nexport function addDefaultOpForSpanFrom(client: Client): void {\n client.on('spanStart', (span: Span) => {\n if (!spanToJSON(span).op) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'default');\n }\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetodisplay.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timetodisplay.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAC,gBAAgB,EAAG,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;GAEG;AACH,eAAO,MAAM,yBAAyB,qBAA4B,CAAC;AAOnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAQlF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAG/E;AAgCD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,GACA,IAAI,GAAG,SAAS,CAgClB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAG7B,GACA,IAAI,GAAG,SAAS,CAqDlB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getActiveSpan, getSpanDescendants, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';
|
|
2
|
-
import { fill, logger } from '@sentry/utils';
|
|
1
|
+
import { fill, getActiveSpan, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { isTurboModuleEnabled } from '../utils/environment';
|
|
5
4
|
import { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetodisplay.js","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAErK,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,mCAAmC,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC;;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,CAAC","sourcesContent":["import { getActiveSpan, getSpanDescendants, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';\nimport type { Span,StartSpanOptions } from '@sentry/types';\nimport { fill, logger } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { isTurboModuleEnabled } from '../utils/environment';\nimport { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin';\nimport { getRNSentryOnDrawReporter, nativeComponentExists } from './timetodisplaynative';\nimport type {RNSentryOnDrawNextFrameEvent } from './timetodisplaynative.types';\nimport { setSpanDurationAsMeasurement } from './utils';\n\nlet nativeComponentMissingLogged = false;\n\n/**\n * Flags of active spans with manual initial display.\n */\nexport const manualInitialDisplaySpans = new WeakMap<Span, true>();\n\n/**\n * Flag full display called before initial display for an active span.\n */\nconst fullDisplayBeforeInitialDisplay = new WeakMap<Span, true>();\n\nexport type TimeToDisplayProps = {\n children?: React.ReactNode;\n record?: boolean;\n};\n\n/**\n * Component to measure time to initial display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToInitialDisplay(props: TimeToDisplayProps): React.ReactElement {\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n manualInitialDisplaySpans.set(activeSpan, true);\n startTimeToInitialDisplaySpan();\n }\n\n return <TimeToDisplay initialDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\n/**\n * Component to measure time to full display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToFullDisplay(props: TimeToDisplayProps): React.ReactElement {\n startTimeToFullDisplaySpan();\n return <TimeToDisplay fullDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\nfunction TimeToDisplay(props: {\n children?: React.ReactNode;\n initialDisplay?: boolean;\n fullDisplay?: boolean;\n}): React.ReactElement {\n const RNSentryOnDrawReporter = getRNSentryOnDrawReporter();\n const isNewArchitecture = isTurboModuleEnabled();\n\n if (__DEV__ && (isNewArchitecture || (!nativeComponentExists && !nativeComponentMissingLogged))){\n nativeComponentMissingLogged = true;\n // Using setTimeout with a delay of 0 milliseconds to defer execution and avoid printing the React stack trace.\n setTimeout(() => {\n logger.warn(\n 'TimeToInitialDisplay and TimeToFullDisplay are not supported on the web, Expo Go and New Architecture. Run native build or report an issue at https://github.com/getsentry/sentry-react-native');\n }, 0);\n }\n\n const onDraw = (event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void => onDrawNextFrame(event);\n\n return (\n <>\n <RNSentryOnDrawReporter\n onDrawNextFrame={onDraw}\n initialDisplay={props.initialDisplay}\n fullDisplay={props.fullDisplay} />\n {props.children}\n </>\n );\n}\n\n/**\n * Starts a new span for the initial display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToInitialDisplaySpan(\n options?: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string;\n isAutoInstrumented?: boolean\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return undefined;\n }\n\n const existingSpan = getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.initial_display span.`);\n return existingSpan\n }\n\n const initialDisplaySpan = startInactiveSpan({\n op: 'ui.load.initial_display',\n name: 'Time To Initial Display',\n startTime: spanToJSON(activeSpan).start_timestamp,\n ...options,\n });\n\n if (!initialDisplaySpan) {\n return undefined;\n }\n\n if (options?.isAutoInstrumented) {\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n manualInitialDisplaySpans.set(activeSpan, true);\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return initialDisplaySpan;\n}\n\n/**\n * Starts a new span for the full display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToFullDisplaySpan(\n options: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string,\n timeoutMs?: number,\n isAutoInstrumented?: boolean\n } = {\n timeoutMs: 30_000,\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const descendantSpans = getSpanDescendants(activeSpan);\n\n const initialDisplaySpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (!initialDisplaySpan) {\n logger.warn(`[TimeToDisplay] No initial display span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const existingSpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.full_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.full_display span.`);\n return existingSpan;\n }\n\n const fullDisplaySpan = startInactiveSpan({\n op: 'ui.load.full_display',\n name: 'Time To Full Display',\n startTime: spanToJSON(initialDisplaySpan).start_timestamp,\n ...options,\n });\n if (!fullDisplaySpan) {\n return undefined;\n }\n\n const timeout = setTimeout(() => {\n if (spanToJSON(fullDisplaySpan).timestamp) {\n return;\n }\n fullDisplaySpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n fullDisplaySpan.end(spanToJSON(initialDisplaySpan).timestamp);\n setSpanDurationAsMeasurement('time_to_full_display', fullDisplaySpan);\n logger.warn(`[TimeToDisplay] Full display span deadline_exceeded.`);\n }, options.timeoutMs);\n\n fill(fullDisplaySpan, 'end', (originalEnd: Span['end']) => (endTimestamp?: Parameters<Span['end']>[0]) => {\n clearTimeout(timeout);\n originalEnd.call(fullDisplaySpan, endTimestamp);\n });\n\n if (options?.isAutoInstrumented) {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return fullDisplaySpan;\n}\n\nfunction onDrawNextFrame(event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void {\n logger.debug(`[TimeToDisplay] onDrawNextFrame: ${JSON.stringify(event.nativeEvent)}`);\n if (event.nativeEvent.type === 'fullDisplay') {\n return updateFullDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n if (event.nativeEvent.type === 'initialDisplay') {\n return updateInitialDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n}\n\nfunction updateInitialDisplaySpan(frameTimestampSeconds: number): void {\n const span = startTimeToInitialDisplaySpan();\n if (!span) {\n logger.warn(`[TimeToDisplay] No span found or created, possibly performance is disabled.`);\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return;\n }\n\n if (spanToJSON(span).parent_span_id !== spanToJSON(activeSpan).span_id) {\n logger.warn(`[TimeToDisplay] Initial display span is not a child of current active span.`);\n return;\n }\n\n if (spanToJSON(span).timestamp) {\n logger.warn(`[TimeToDisplay] ${spanToJSON(span).description} span already ended.`);\n return;\n }\n\n span.end(frameTimestampSeconds);\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanToJSON(span).description} span updated with end timestamp.`);\n\n if (fullDisplayBeforeInitialDisplay.has(activeSpan)) {\n fullDisplayBeforeInitialDisplay.delete(activeSpan);\n logger.debug(`[TimeToDisplay] Updating full display with initial display (${span.spanContext().spanId}) end.`);\n updateFullDisplaySpan(frameTimestampSeconds, span);\n }\n\n setSpanDurationAsMeasurement('time_to_initial_display', span);\n}\n\nfunction updateFullDisplaySpan(frameTimestampSeconds: number, passedInitialDisplaySpan?: Span): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to update ui.load.full_display in.`);\n return;\n }\n\n const existingInitialDisplaySpan = passedInitialDisplaySpan\n || getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n const initialDisplayEndTimestamp = existingInitialDisplaySpan && spanToJSON(existingInitialDisplaySpan).timestamp;\n if (!initialDisplayEndTimestamp) {\n fullDisplayBeforeInitialDisplay.set(activeSpan, true);\n logger.warn(`[TimeToDisplay] Full display called before initial display for active span (${activeSpan.spanContext().spanId}).`);\n return;\n }\n\n const span = startTimeToFullDisplaySpan({\n isAutoInstrumented: true,\n });\n if (!span) {\n logger.warn(`[TimeToDisplay] No TimeToFullDisplay span found or created, possibly performance is disabled.`);\n return;\n }\n\n const spanJSON = spanToJSON(span);\n if (spanJSON.timestamp) {\n logger.warn(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span already ended.`);\n return;\n }\n\n if (initialDisplayEndTimestamp > frameTimestampSeconds) {\n logger.warn(`[TimeToDisplay] Using initial display end. Full display end frame timestamp is before initial display end.`);\n span.end(initialDisplayEndTimestamp);\n } else {\n span.end(frameTimestampSeconds);\n }\n\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span updated with end timestamp.`);\n\n setSpanDurationAsMeasurement('time_to_full_display', span);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"timetodisplay.js","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnL,OAAO,KAAK,KAAK,MA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;KACtC;SAAM;QACL,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;KACjC;IAED,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,CAAC,mBAAmB,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,OAAO,oCAAoC,CAAC,CAAC;IAE/G,4BAA4B,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import type { Span,StartSpanOptions } from '@sentry/core';\nimport { fill, getActiveSpan, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, SPAN_STATUS_OK, spanToJSON, startInactiveSpan } from '@sentry/core';\nimport * as React from 'react';\n\nimport { isTurboModuleEnabled } from '../utils/environment';\nimport { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin';\nimport { getRNSentryOnDrawReporter, nativeComponentExists } from './timetodisplaynative';\nimport type {RNSentryOnDrawNextFrameEvent } from './timetodisplaynative.types';\nimport { setSpanDurationAsMeasurement } from './utils';\n\nlet nativeComponentMissingLogged = false;\n\n/**\n * Flags of active spans with manual initial display.\n */\nexport const manualInitialDisplaySpans = new WeakMap<Span, true>();\n\n/**\n * Flag full display called before initial display for an active span.\n */\nconst fullDisplayBeforeInitialDisplay = new WeakMap<Span, true>();\n\nexport type TimeToDisplayProps = {\n children?: React.ReactNode;\n record?: boolean;\n};\n\n/**\n * Component to measure time to initial display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToInitialDisplay(props: TimeToDisplayProps): React.ReactElement {\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n manualInitialDisplaySpans.set(activeSpan, true);\n startTimeToInitialDisplaySpan();\n }\n\n return <TimeToDisplay initialDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\n/**\n * Component to measure time to full display.\n *\n * The initial display is recorded when the component prop `record` is true.\n *\n * <TimeToInitialDisplay record />\n */\nexport function TimeToFullDisplay(props: TimeToDisplayProps): React.ReactElement {\n startTimeToFullDisplaySpan();\n return <TimeToDisplay fullDisplay={props.record}>{props.children}</TimeToDisplay>;\n}\n\nfunction TimeToDisplay(props: {\n children?: React.ReactNode;\n initialDisplay?: boolean;\n fullDisplay?: boolean;\n}): React.ReactElement {\n const RNSentryOnDrawReporter = getRNSentryOnDrawReporter();\n const isNewArchitecture = isTurboModuleEnabled();\n\n if (__DEV__ && (isNewArchitecture || (!nativeComponentExists && !nativeComponentMissingLogged))){\n nativeComponentMissingLogged = true;\n // Using setTimeout with a delay of 0 milliseconds to defer execution and avoid printing the React stack trace.\n setTimeout(() => {\n logger.warn(\n 'TimeToInitialDisplay and TimeToFullDisplay are not supported on the web, Expo Go and New Architecture. Run native build or report an issue at https://github.com/getsentry/sentry-react-native');\n }, 0);\n }\n\n const onDraw = (event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void => onDrawNextFrame(event);\n\n return (\n <>\n <RNSentryOnDrawReporter\n onDrawNextFrame={onDraw}\n initialDisplay={props.initialDisplay}\n fullDisplay={props.fullDisplay} />\n {props.children}\n </>\n );\n}\n\n/**\n * Starts a new span for the initial display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToInitialDisplaySpan(\n options?: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string;\n isAutoInstrumented?: boolean\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return undefined;\n }\n\n const existingSpan = getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.initial_display span.`);\n return existingSpan\n }\n\n const initialDisplaySpan = startInactiveSpan({\n op: 'ui.load.initial_display',\n name: 'Time To Initial Display',\n startTime: spanToJSON(activeSpan).start_timestamp,\n ...options,\n });\n\n if (!initialDisplaySpan) {\n return undefined;\n }\n\n if (options?.isAutoInstrumented) {\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n manualInitialDisplaySpans.set(activeSpan, true);\n initialDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return initialDisplaySpan;\n}\n\n/**\n * Starts a new span for the full display.\n *\n * Returns current span if already exists in the currently active span.\n */\nexport function startTimeToFullDisplaySpan(\n options: Omit<StartSpanOptions, 'op' | 'name'> & {\n name?: string,\n timeoutMs?: number,\n isAutoInstrumented?: boolean\n } = {\n timeoutMs: 30_000,\n },\n): Span | undefined {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const descendantSpans = getSpanDescendants(activeSpan);\n\n const initialDisplaySpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n if (!initialDisplaySpan) {\n logger.warn(`[TimeToDisplay] No initial display span found to attach ui.load.full_display to.`);\n return undefined;\n }\n\n const existingSpan = descendantSpans.find((span) => spanToJSON(span).op === 'ui.load.full_display');\n if (existingSpan) {\n logger.debug(`[TimeToDisplay] Found existing ui.load.full_display span.`);\n return existingSpan;\n }\n\n const fullDisplaySpan = startInactiveSpan({\n op: 'ui.load.full_display',\n name: 'Time To Full Display',\n startTime: spanToJSON(initialDisplaySpan).start_timestamp,\n ...options,\n });\n if (!fullDisplaySpan) {\n return undefined;\n }\n\n const timeout = setTimeout(() => {\n if (spanToJSON(fullDisplaySpan).timestamp) {\n return;\n }\n fullDisplaySpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n fullDisplaySpan.end(spanToJSON(initialDisplaySpan).timestamp);\n setSpanDurationAsMeasurement('time_to_full_display', fullDisplaySpan);\n logger.warn(`[TimeToDisplay] Full display span deadline_exceeded.`);\n }, options.timeoutMs);\n\n fill(fullDisplaySpan, 'end', (originalEnd: Span['end']) => (endTimestamp?: Parameters<Span['end']>[0]) => {\n clearTimeout(timeout);\n originalEnd.call(fullDisplaySpan, endTimestamp);\n });\n\n if (options?.isAutoInstrumented) {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY);\n } else {\n fullDisplaySpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY);\n }\n\n return fullDisplaySpan;\n}\n\nfunction onDrawNextFrame(event: { nativeEvent: RNSentryOnDrawNextFrameEvent }): void {\n logger.debug(`[TimeToDisplay] onDrawNextFrame: ${JSON.stringify(event.nativeEvent)}`);\n if (event.nativeEvent.type === 'fullDisplay') {\n return updateFullDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n if (event.nativeEvent.type === 'initialDisplay') {\n return updateInitialDisplaySpan(event.nativeEvent.newFrameTimestampInSeconds);\n }\n}\n\nfunction updateInitialDisplaySpan(frameTimestampSeconds: number): void {\n const span = startTimeToInitialDisplaySpan();\n if (!span) {\n logger.warn(`[TimeToDisplay] No span found or created, possibly performance is disabled.`);\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to attach ui.load.initial_display to.`);\n return;\n }\n\n if (spanToJSON(span).parent_span_id !== spanToJSON(activeSpan).span_id) {\n logger.warn(`[TimeToDisplay] Initial display span is not a child of current active span.`);\n return;\n }\n\n if (spanToJSON(span).timestamp) {\n logger.warn(`[TimeToDisplay] ${spanToJSON(span).description} span already ended.`);\n return;\n }\n\n span.end(frameTimestampSeconds);\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanToJSON(span).description} span updated with end timestamp.`);\n\n if (fullDisplayBeforeInitialDisplay.has(activeSpan)) {\n fullDisplayBeforeInitialDisplay.delete(activeSpan);\n logger.debug(`[TimeToDisplay] Updating full display with initial display (${span.spanContext().spanId}) end.`);\n updateFullDisplaySpan(frameTimestampSeconds, span);\n }\n\n setSpanDurationAsMeasurement('time_to_initial_display', span);\n}\n\nfunction updateFullDisplaySpan(frameTimestampSeconds: number, passedInitialDisplaySpan?: Span): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n logger.warn(`[TimeToDisplay] No active span found to update ui.load.full_display in.`);\n return;\n }\n\n const existingInitialDisplaySpan = passedInitialDisplaySpan\n || getSpanDescendants(activeSpan).find((span) => spanToJSON(span).op === 'ui.load.initial_display');\n const initialDisplayEndTimestamp = existingInitialDisplaySpan && spanToJSON(existingInitialDisplaySpan).timestamp;\n if (!initialDisplayEndTimestamp) {\n fullDisplayBeforeInitialDisplay.set(activeSpan, true);\n logger.warn(`[TimeToDisplay] Full display called before initial display for active span (${activeSpan.spanContext().spanId}).`);\n return;\n }\n\n const span = startTimeToFullDisplaySpan({\n isAutoInstrumented: true,\n });\n if (!span) {\n logger.warn(`[TimeToDisplay] No TimeToFullDisplay span found or created, possibly performance is disabled.`);\n return;\n }\n\n const spanJSON = spanToJSON(span);\n if (spanJSON.timestamp) {\n logger.warn(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span already ended.`);\n return;\n }\n\n if (initialDisplayEndTimestamp > frameTimestampSeconds) {\n logger.warn(`[TimeToDisplay] Using initial display end. Full display end frame timestamp is before initial display end.`);\n span.end(initialDisplayEndTimestamp);\n } else {\n span.end(frameTimestampSeconds);\n }\n\n span.setStatus({ code: SPAN_STATUS_OK });\n logger.debug(`[TimeToDisplay] ${spanJSON.description} (${spanJSON.span_id}) span updated with end timestamp.`);\n\n setSpanDurationAsMeasurement('time_to_full_display', span);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetodisplaynative.types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplaynative.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,gBAAgB,GAAG,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,4BAA4B,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"timetodisplaynative.types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/timetodisplaynative.types.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,4BAA4B;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,gBAAgB,GAAG,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,4BAA4B,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,CAAC,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Span } from '@sentry/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/js/tracing/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Span } from '@sentry/core';\n\nexport interface ReactNavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params: Record<string, any>;\n}\n\nexport interface ReactNavigationCurrentRoute extends ReactNavigationRoute {\n hasBeenSeen: boolean;\n}\n\nexport type RouteChangeContextData = {\n previousRoute?: {\n [key: string]: unknown;\n name: string;\n } | null;\n route: {\n [key: string]: unknown;\n name: string;\n hasBeenSeen: boolean;\n };\n};\n\nexport type BeforeNavigate = (context: Span) => void;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/
|
|
1
|
+
import type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/core';
|
|
2
2
|
export declare const defaultTransactionSource: TransactionSource;
|
|
3
3
|
export declare const customTransactionSource: TransactionSource;
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAiBvF,eAAO,MAAM,wBAAwB,EAAE,iBAA+B,CAAC;AACvE,eAAO,MAAM,uBAAuB,EAAE,iBAA4B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAI5C;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAKlE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAO3E;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,CAO3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,IAAI,CAKtG;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAM7E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,GAAG,SAAS,CAe9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,GAAG,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC,GAC7G,QAAQ,CAYV;AAID;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,GAAG,iBAAiB,GAAG,WAAW,CAAC,GAClG,QAAQ,CAQV"}
|
package/dist/js/tracing/utils.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getSpanDescendants, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, setMeasurement, spanToJSON, } from '@sentry/core';
|
|
2
|
-
import { dropUndefinedKeys, logger, timestampInSeconds, uuid4 } from '@sentry/utils';
|
|
1
|
+
import { dropUndefinedKeys, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, setMeasurement, spanToJSON, timestampInSeconds, uuid4, } from '@sentry/core';
|
|
3
2
|
import { RN_GLOBAL_OBJ } from '../utils/worldwide';
|
|
4
3
|
export const defaultTransactionSource = 'component';
|
|
5
4
|
export const customTransactionSource = 'custom';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/tracing/utils.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e,CAAC;KACxB;IAED,mEAAmE;IACnE,MAAM,wBAAwB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC,oBAAoB,EAAE,CAAC;IACnF,OAAO,wBAAwB,GAAG,eAAe,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,IAA8G;IAE9G,OAAO,iBAAiB,+BACtB,MAAM,EAAE,IAAI,IACT,IAAI,KACP,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,EAC5D,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,EACjD,IAAI,EAAE,iBAAiB,iBACrB,CAAC,4BAA4B,CAAC,EAAE,IAAI,CAAC,EAAE,EACvC,CAAC,gCAAgC,CAAC,EAAE,IAAI,CAAC,MAAM,IAC5C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/B,IACF,CAAC;AACL,CAAC;AAED,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAEvC;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAgB,EAChB,IAAmG;IAEnG,OAAO,cAAc,iBACnB,EAAE,EAAE,MAAM,CAAC,EAAE,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,cAAc,EAAE,MAAM,CAAC,OAAO,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,qBAAqB,IAC3C,IAAI,EACP,CAAC;AACL,CAAC","sourcesContent":["import type { MeasurementUnit, Span, SpanJSON, TransactionSource } from '@sentry/core';\nimport {\n dropUndefinedKeys,\n getSpanDescendants,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT,\n SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n setMeasurement,\n spanToJSON,\n timestampInSeconds,\n uuid4,\n} from '@sentry/core';\n\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\nexport const defaultTransactionSource: TransactionSource = 'component';\nexport const customTransactionSource: TransactionSource = 'custom';\n\n/**\n * A margin of error of 50ms is allowed for the async native bridge call.\n * Anything larger would reduce the accuracy of our frames measurements.\n */\nexport const MARGIN_OF_ERROR_SECONDS = 0.05;\n\nconst timeOriginMilliseconds = Date.now();\n\n/**\n * Returns the timestamp where the JS global scope was initialized.\n */\nexport function getTimeOriginMilliseconds(): number {\n return timeOriginMilliseconds;\n}\n\n/**\n * Determines if the timestamp is now or within the specified margin of error from now.\n */\nexport function isNearToNow(timestamp: number | undefined): boolean {\n if (!timestamp) {\n return false;\n }\n return Math.abs(timestampInSeconds() - timestamp) <= MARGIN_OF_ERROR_SECONDS;\n}\n\n/**\n * Sets the duration of the span as a measurement.\n * Uses `setMeasurement` function from @sentry/core.\n */\nexport function setSpanDurationAsMeasurement(name: string, span: Span): void {\n const { timestamp: spanEnd, start_timestamp: spanStart } = spanToJSON(span);\n if (!spanEnd || !spanStart) {\n return;\n }\n\n setMeasurement(name, (spanEnd - spanStart) * 1000, 'millisecond');\n}\n\n/**\n * Sets the duration of the span as a measurement.\n * Uses `setMeasurement` function from @sentry/core.\n */\nexport function setSpanDurationAsMeasurementOnSpan(name: string, span: Span, on: Span): void {\n const { timestamp: spanEnd, start_timestamp: spanStart } = spanToJSON(span);\n if (!spanEnd || !spanStart) {\n return;\n }\n\n setSpanMeasurement(on, name, (spanEnd - spanStart) * 1000, 'millisecond');\n}\n\n/**\n * Sets measurement on the give span.\n */\nexport function setSpanMeasurement(span: Span, key: string, value: number, unit: MeasurementUnit): void {\n span.addEvent(key, {\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value,\n [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit as string,\n });\n}\n\n/**\n * Returns the latest end timestamp of the child spans of the given span.\n */\nexport function getLatestChildSpanEndTimestamp(span: Span): number | undefined {\n const childEndTimestamps = getSpanDescendants(span)\n .map(span => spanToJSON(span).timestamp)\n .filter(timestamp => !!timestamp) as number[];\n\n return childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined;\n}\n\n/**\n * Returns unix timestamp in ms of the bundle start time.\n *\n * If not available, returns undefined.\n */\nexport function getBundleStartTimestampMs(): number | undefined {\n const bundleStartTime = RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;\n if (!bundleStartTime) {\n logger.warn('Missing the bundle start time on the global object.');\n return undefined;\n }\n\n if (!RN_GLOBAL_OBJ.nativePerformanceNow) {\n // bundleStartTime is Date.now() in milliseconds\n return bundleStartTime;\n }\n\n // nativePerformanceNow() is monotonic clock like performance.now()\n const approxStartingTimeOrigin = Date.now() - RN_GLOBAL_OBJ.nativePerformanceNow();\n return approxStartingTimeOrigin + bundleStartTime;\n}\n\n/**\n * Creates valid span JSON object from the given data.\n */\nexport function createSpanJSON(\n from: Partial<SpanJSON> & Pick<Required<SpanJSON>, 'description' | 'start_timestamp' | 'timestamp' | 'origin'>,\n): SpanJSON {\n return dropUndefinedKeys({\n status: 'ok',\n ...from,\n span_id: from.span_id ? from.span_id : uuid4().substring(16),\n trace_id: from.trace_id ? from.trace_id : uuid4(),\n data: dropUndefinedKeys({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: from.op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: from.origin,\n ...(from.data ? from.data : {}),\n }),\n });\n}\n\nconst SENTRY_DEFAULT_ORIGIN = 'manual';\n\n/**\n *\n */\nexport function createChildSpanJSON(\n parent: SpanJSON,\n from: Partial<SpanJSON> & Pick<Required<SpanJSON>, 'description' | 'start_timestamp' | 'timestamp'>,\n): SpanJSON {\n return createSpanJSON({\n op: parent.op,\n trace_id: parent.trace_id,\n parent_span_id: parent.span_id,\n origin: parent.origin || SENTRY_DEFAULT_ORIGIN,\n ...from,\n });\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { BaseTransportOptions, Envelope, Transport, TransportMakeRequestResponse } from '@sentry/
|
|
2
|
-
import type { PromiseBuffer } from '@sentry/utils';
|
|
1
|
+
import type { BaseTransportOptions, Envelope, PromiseBuffer, Transport, TransportMakeRequestResponse } from '@sentry/core';
|
|
3
2
|
export declare const DEFAULT_BUFFER_SIZE = 30;
|
|
4
3
|
export type BaseNativeTransport = BaseTransportOptions;
|
|
5
4
|
export interface BaseNativeTransportOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AAKtB,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD,MAAM,WAAW,0BAA0B;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,qBAAa,eAAgB,YAAW,SAAS;IAC/C,4CAA4C;IAC5C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;gBAE7B,OAAO,GAAE,0BAA+B;IAI3D;;;;OAIG;IACI,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,4BAA4B,CAAC;IAK1E;;;;;;;OAOG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;CAGrD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,eAAe,CAE7F;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,YAAY,GACb,EAAE;IACD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,mBAAmB,GAAG,IAAI,CAKpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/js/transports/native.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAQtC,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAI1B,YAAmB,UAAsC,EAAE;QACzD,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,QAAkB;QAC5B,yEAAyE;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAgB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAsC,EAAE;IAC1E,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,YAAY,GAGb;IACC,IAAI,YAAY,IAAI,MAAM,CAAC,iBAAiB,EAAE,EAAE;QAC9C,OAAO,mBAAmB,CAAC;KAC5B;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type {\n BaseTransportOptions,\n Envelope,\n PromiseBuffer,\n Transport,\n TransportMakeRequestResponse,\n} from '@sentry/core';\nimport { makePromiseBuffer } from '@sentry/core';\n\nimport { NATIVE } from '../wrapper';\n\nexport const DEFAULT_BUFFER_SIZE = 30;\n\nexport type BaseNativeTransport = BaseTransportOptions;\n\nexport interface BaseNativeTransportOptions {\n bufferSize?: number;\n}\n\n/** Native Transport class implementation */\nexport class NativeTransport implements Transport {\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer<void>;\n\n public constructor(options: BaseNativeTransportOptions = {}) {\n this._buffer = makePromiseBuffer(options.bufferSize || DEFAULT_BUFFER_SIZE);\n }\n\n /**\n * Sends the envelope to the Store endpoint in Sentry.\n *\n * @param envelope Envelope that should be sent to Sentry.\n */\n public send(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\n // TODO: We currently can't retrieve the response information from native\n return this._buffer.add(() => NATIVE.sendEnvelope(envelope)).then(() => ({}));\n }\n\n /**\n * Wait for all envelopes to be sent or the timeout to expire, whichever comes first.\n *\n * @param timeout Maximum time in ms the transport should wait for envelopes to be flushed. Omitting this parameter will\n * cause the transport to wait until all events are sent before resolving the promise.\n * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n * still events in the queue when the timeout is reached.\n */\n public flush(timeout?: number): PromiseLike<boolean> {\n return this._buffer.drain(timeout);\n }\n}\n\n/**\n * Creates a Native Transport.\n */\nexport function makeNativeTransport(options: BaseNativeTransportOptions = {}): NativeTransport {\n return new NativeTransport(options);\n}\n\n/**\n * Creates a Native Transport factory if the native transport is available.\n */\nexport function makeNativeTransportFactory({\n enableNative,\n}: {\n enableNative?: boolean;\n}): typeof makeNativeTransport | null {\n if (enableNative && NATIVE.isNativeAvailable()) {\n return makeNativeTransport;\n }\n return null;\n}\n"]}
|
package/dist/js/user.d.ts
CHANGED
package/dist/js/user.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG;KAAG,CAAC,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,CAAC"}
|
package/dist/js/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"","sourcesContent":["import type { User } from '@sentry/
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/js/user.ts"],"names":[],"mappings":"","sourcesContent":["import type { User } from '@sentry/core';\n\n/** Requires all the keys defined on User interface to be present on an object */\nexport type RequiredKeysUser = { [P in keyof Required<User>]: User[P] | undefined };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientutils.d.ts","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"clientutils.d.ts","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;CAAE,CAE1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientutils.js","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import type { Client } from '@sentry/
|
|
1
|
+
{"version":3,"file":"clientutils.js","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import type { Client } from '@sentry/core';\n\n/**\n * Checks if the provided Sentry client has hooks implemented.\n * @param client The Sentry client object to check.\n * @returns True if the client has hooks, false otherwise.\n */\nexport function hasHooks(client: Client): client is Client & { on: Required<Client>['on'] } {\n return client.on !== undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,cAAc,CAAC;AAG9G,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,KAAK,IAAI,CAAC;AAEvB;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;CAChC,GACA,aAAa,CAgBf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../../src/js/utils/envelope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC;AACxB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC;AAEvB;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAAsB,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GAKJ;IAED,MAAM,OAAO,iCACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAC9B,CAAC,QAAQ;QACV,QAAQ,CAAC,GAAG,IAAI;QACd,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;YACvB,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;SAC9B;KACF,CAAC,GACD,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CACpD,CAAC;IACF,MAAM,IAAI,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAEtD,OAAO,cAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,8BAA8B,CAAC,QAAsB;IAC5D,MAAM,eAAe,GAAwB;QAC3C,IAAI,EAAE,aAAa;KACpB,CAAC;IACF,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core';\nimport { createEnvelope, dsnToString } from '@sentry/core';\n\nexport const header = 0;\nexport const items = 1;\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"]}
|
package/dist/js/utils/fill.d.ts
CHANGED
package/dist/js/utils/fill.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { fill } from '@sentry/
|
|
1
|
+
import { fill } from '@sentry/core';
|
|
2
2
|
/**
|
|
3
|
-
* The same as `import { fill } from '@sentry/
|
|
3
|
+
* The same as `import { fill } from '@sentry/core';` but with explicit types.
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
6
|
export function fillTyped(source, name, replacement) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill.js","sourceRoot":"","sources":["../../../src/js/utils/fill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fill.js","sourceRoot":"","sources":["../../../src/js/utils/fill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CACvB,MAAc,EACd,IAAU,EACV,WAAqD;IAErD,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { fill } from '@sentry/core';\n\n/**\n * The same as `import { fill } from '@sentry/core';` but with explicit types.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function fillTyped<Source extends { [key: string]: any }, Name extends keyof Source & string>(\n source: Source,\n name: Name,\n replacement: (original: Source[Name]) => Source[Name],\n): void {\n fill(source, name, replacement);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/js/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/js/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,GAAG,GAAG,OAAO,CAAC;AAEpB;;GAEG;AACH,8DAA8D;AAC9D,MAAM,UAAU,yBAAyB,CAAC,IAAa;IACrD,MAAM,UAAU,GAAY,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5C,IACE,UAAU,KAAK,IAAI;QACnB,OAAO,UAAU,KAAK,QAAQ;QAC9B,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QAC1B,UAAU,CAAC,WAAW,KAAK,MAAM,EACjC;QACA,8DAA8D;QAC9D,OAAO,UAAiC,CAAC;KAC1C;SAAM;QACL,OAAO;YACL,CAAC,GAAG,CAAC,EAAE,UAAU;SAClB,CAAC;KACH;AACH,CAAC","sourcesContent":["import { normalize } from '@sentry/core';\n\nconst KEY = 'value';\n\n/**\n * Converts any input into a valid record with string keys.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function convertToNormalizedObject(data: unknown): Record<string, any> {\n const normalized: unknown = normalize(data);\n if (\n normalized !== null &&\n typeof normalized === 'object' &&\n !Array.isArray(normalized) &&\n normalized.constructor === Object\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return normalized as Record<string, any>;\n } else {\n return {\n [KEY]: normalized,\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../src/js/utils/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../src/js/utils/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,CAgB9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../../src/js/utils/outcome.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,KAAkB;IACjD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEvC,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAQ,EAAE;QACzC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;SACvC;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAErD,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import type { Outcome } from '@sentry/
|
|
1
|
+
{"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../../src/js/utils/outcome.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,KAAkB;IACjD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEvC,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAQ,EAAE;QACzC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;SACvC;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAErD,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import type { Outcome } from '@sentry/core';\n\n/**\n * Merges buffer with new outcomes.\n */\nexport function mergeOutcomes(...merge: Outcome[][]): Outcome[] {\n const map = new Map<string, Outcome>();\n\n const process = (outcome: Outcome): void => {\n const key = `${outcome.reason}:${outcome.category}`;\n const existing = map.get(key);\n if (existing) {\n existing.quantity += outcome.quantity;\n } else {\n map.set(key, outcome);\n }\n };\n\n merge.forEach(outcomes => outcomes.forEach(process));\n\n return [...map.values()];\n}\n"]}
|
package/dist/js/utils/safe.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.js","sourceRoot":"","sources":["../../../src/js/utils/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"safe.js","sourceRoot":"","sources":["../../../src/js/utils/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQtC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,MAA+B,EAC/B,UAEI,EAAE;IAEN,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;QAChC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;YACjB,IAAI;gBACF,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;aACxB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CACV,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,0BAA0B,EAC5F,KAAK,CACN,CAAC;gBACF,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;aAChB;QACH,CAAC,CAAC;KACH;SAAM;QACL,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AAID;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAkD;IAElD,IAAI,aAAa,EAAE;QACjB,OAAO,CAAC,GAAG,IAA+B,EAA6B,EAAE;YACvE,IAAI;gBACF,OAAO,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;aAC/B;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,KAAK,CAAC,CAAC;gBACjE,OAAO,CAAC,CAAC;aACV;QACH,CAAC,CAAC;KACH;SAAM;QACL,OAAO,aAAa,CAAC;KACtB;AACH,CAAC","sourcesContent":["import { logger } from '@sentry/core';\n\nimport type { ReactNativeOptions } from '../options';\n\ntype DangerTypesWithoutCallSignature =\n // eslint-disable-next-line @typescript-eslint/ban-types\n Object | null | undefined;\n\n/**\n * Returns callback factory wrapped with try/catch\n * or the original passed value is it's not a function.\n *\n * If the factory fails original data are returned as it.\n * They might be partially modified by the failed function.\n */\nexport function safeFactory<A extends [R, ...unknown[]], R, T extends DangerTypesWithoutCallSignature>(\n danger: ((...args: A) => R) | T,\n options: {\n loggerMessage?: string;\n } = {},\n): ((...args: A) => R) | T {\n if (typeof danger === 'function') {\n return (...args) => {\n try {\n return danger(...args);\n } catch (error) {\n logger.error(\n options.loggerMessage ? options.loggerMessage : `The ${danger.name} callback threw an error`,\n error,\n );\n return args[0];\n }\n };\n } else {\n return danger;\n }\n}\n\ntype TracesSampler = Required<ReactNativeOptions>['tracesSampler'];\n\n/**\n * Returns sage tracesSampler that returns 0 if the original failed.\n */\nexport function safeTracesSampler(\n tracesSampler: ReactNativeOptions['tracesSampler'],\n): ReactNativeOptions['tracesSampler'] {\n if (tracesSampler) {\n return (...args: Parameters<TracesSampler>): ReturnType<TracesSampler> => {\n try {\n return tracesSampler(...args);\n } catch (error) {\n logger.error('The tracesSampler callback threw an error', error);\n return 0;\n }\n };\n } else {\n return tracesSampler;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryeventemitter.js","sourceRoot":"","sources":["../../../src/js/utils/sentryeventemitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sentryeventemitter.js","sourceRoot":"","sources":["../../../src/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AW,EAAE,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QACtD,CAAC;QACD,cAAc,EAAE,GAAG,EAAE;YACnB,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACzD,CAAC;QACD,IAAI,EAAE,GAAG,EAAE;YACT,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport type { EmitterSubscription, NativeModule } from 'react-native';\nimport { NativeEventEmitter } from 'react-native';\n\nimport { getRNSentryModule } from '../wrapper';\n\nexport const NewFrameEventName = 'rn_sentry_new_frame';\nexport type NewFrameEventName = typeof NewFrameEventName;\nexport type NewFrameEvent = { newFrameTimestampInSeconds: number };\n\nexport interface SentryEventEmitter {\n /**\n * Initializes the native event emitter\n * This method is synchronous in JS but the native event emitter starts asynchronously\n * https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/React/Modules/RCTEventEmitter.m#L95\n */\n initAsync: (eventType: NewFrameEventName) => void;\n closeAllAsync: () => void;\n addListener: (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) => void;\n removeListener: (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) => void;\n once: (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) => void;\n}\n\n/**\n * Creates emitter that allows to listen to native RNSentry events\n */\nexport function createSentryEventEmitter(\n sentryNativeModule: NativeModule | undefined = getRNSentryModule(),\n createNativeEventEmitter: (nativeModule: NativeModule | undefined) => NativeEventEmitter = nativeModule =>\n new NativeEventEmitter(nativeModule),\n): SentryEventEmitter {\n if (!sentryNativeModule) {\n return createNoopSentryEventEmitter();\n }\n\n const openNativeListeners = new Map<NewFrameEventName, EmitterSubscription>();\n const listenersMap = new Map<NewFrameEventName, Map<(event: NewFrameEvent) => void, true>>();\n\n const nativeEventEmitter = createNativeEventEmitter(getRNSentryModule());\n\n const addListener = function (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void): void {\n const map = listenersMap.get(eventType);\n if (!map) {\n logger.warn(`EventEmitter was not initialized for event type: ${eventType}`);\n return;\n }\n listenersMap.get(eventType)?.set(listener, true);\n };\n\n const removeListener = function (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void): void {\n listenersMap.get(eventType)?.delete(listener);\n };\n\n return {\n initAsync(eventType: NewFrameEventName) {\n if (openNativeListeners.has(eventType)) {\n return;\n }\n\n const nativeListener = nativeEventEmitter.addListener(eventType, (event: NewFrameEvent) => {\n const listeners = listenersMap.get(eventType);\n if (!listeners) {\n return;\n }\n\n listeners.forEach((_, listener) => {\n listener(event);\n });\n });\n openNativeListeners.set(eventType, nativeListener);\n\n listenersMap.set(eventType, new Map());\n },\n closeAllAsync() {\n openNativeListeners.forEach(subscription => {\n subscription.remove();\n });\n openNativeListeners.clear();\n listenersMap.clear();\n },\n addListener,\n removeListener,\n once(eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) {\n const tmpListener = (event: NewFrameEvent): void => {\n listener(event);\n removeListener(eventType, tmpListener);\n };\n addListener(eventType, tmpListener);\n },\n };\n}\n\nfunction createNoopSentryEventEmitter(): SentryEventEmitter {\n return {\n initAsync: () => {\n logger.warn('Noop SentryEventEmitter: initAsync');\n },\n closeAllAsync: () => {\n logger.warn('Noop SentryEventEmitter: closeAllAsync');\n },\n addListener: () => {\n logger.warn('Noop SentryEventEmitter: addListener');\n },\n removeListener: () => {\n logger.warn('Noop SentryEventEmitter: removeListener');\n },\n once: () => {\n logger.warn('Noop SentryEventEmitter: once');\n },\n };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, timestampInSeconds } from '@sentry/
|
|
1
|
+
import { logger, timestampInSeconds } from '@sentry/core';
|
|
2
2
|
import { NATIVE } from '../wrapper';
|
|
3
3
|
import { createSentryEventEmitter, NewFrameEventName } from './sentryeventemitter';
|
|
4
4
|
export const FALLBACK_TIMEOUT_MS = 10000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryeventemitterfallback.js","sourceRoot":"","sources":["../../../src/js/utils/sentryeventemitterfallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sentryeventemitterfallback.js","sourceRoot":"","sources":["../../../src/js/utils/sentryeventemitterfallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAM,CAAC;AAY1C;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,UAA8B,wBAAwB,EAAE,EACxD,iBAAiB,GAAG,mBAAmB;IAEvC,IAAI,eAA0D,CAAC;IAC/D,IAAI,8BAAkD,CAAC;IACvD,IAAI,8BAAkD,CAAC;IAEvD,SAAS,iCAAiC;QACxC,6CAA6C;QAC7C,wEAAwE;QACxE,iEAAiE;QACjE,uPAAuP;QACvP,qBAAqB,CAAC,GAAG,EAAE;YACzB,IAAI,eAAe,KAAK,SAAS,EAAE;gBACjC,OAAO;aACR;YACD,8BAA8B,GAAG,kBAAkB,EAAE,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,iCAAiC;QACxC,MAAM,CAAC,yBAAyB,EAAE;aAC/B,IAAI,CAAC,OAAO,CAAC,EAAE;YACd,IAAI,eAAe,KAAK,SAAS,EAAE;gBACjC,OAAO;aACR;YACD,8BAA8B,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,SAAS,CAAC;QACxD,CAAC,CAAC;aACD,KAAK,CAAC,MAAM,CAAC,EAAE;YACd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,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { logger, timestampInSeconds } from '@sentry/core';\n\nimport { NATIVE } from '../wrapper';\nimport type { NewFrameEvent, SentryEventEmitter } from './sentryeventemitter';\nimport { createSentryEventEmitter, NewFrameEventName } from './sentryeventemitter';\n\nexport const FALLBACK_TIMEOUT_MS = 10_000;\n\nexport type FallBackNewFrameEvent = { newFrameTimestampInSeconds: number; isFallback?: boolean };\nexport interface SentryEventEmitterFallback {\n /**\n * Initializes the fallback event emitter\n * This method is synchronous in JS but the event emitter starts asynchronously.\n */\n initAsync: () => void;\n onceNewFrame: (listener: (event: FallBackNewFrameEvent) => void) => void;\n}\n\n/**\n * Creates emitter that allows to listen to UI Frame events when ready.\n */\nexport function createSentryFallbackEventEmitter(\n emitter: SentryEventEmitter = createSentryEventEmitter(),\n fallbackTimeoutMs = FALLBACK_TIMEOUT_MS,\n): SentryEventEmitterFallback {\n let fallbackTimeout: ReturnType<typeof setTimeout> | undefined;\n let animationFrameTimestampSeconds: number | undefined;\n let nativeNewFrameTimestampSeconds: number | undefined;\n\n function getAnimationFrameTimestampSeconds(): void {\n // https://reactnative.dev/docs/timers#timers\n // NOTE: The current implementation of requestAnimationFrame is the same\n // as setTimeout(0). This isn't exactly how requestAnimationFrame\n // is supposed to work on web, so it doesn't get called when UI Frames are rendered.: https://github.com/facebook/react-native/blob/5106933c750fee2ce49fe1945c3e3763eebc92bc/packages/react-native/ReactCommon/react/runtime/TimerManager.cpp#L442-L443\n requestAnimationFrame(() => {\n if (fallbackTimeout === undefined) {\n return;\n }\n animationFrameTimestampSeconds = timestampInSeconds();\n });\n }\n\n function getNativeNewFrameTimestampSeconds(): void {\n NATIVE.getNewScreenTimeToDisplay()\n .then(resolve => {\n if (fallbackTimeout === undefined) {\n return;\n }\n nativeNewFrameTimestampSeconds = resolve ?? undefined;\n })\n .catch(reason => {\n logger.error('Failed to receive Native fallback timestamp.', reason);\n });\n }\n\n return {\n initAsync() {\n emitter.initAsync(NewFrameEventName);\n },\n\n onceNewFrame(listener: (event: FallBackNewFrameEvent) => void) {\n animationFrameTimestampSeconds = undefined;\n nativeNewFrameTimestampSeconds = undefined;\n\n const internalListener = (event: NewFrameEvent): void => {\n if (fallbackTimeout !== undefined) {\n clearTimeout(fallbackTimeout);\n fallbackTimeout = undefined;\n }\n animationFrameTimestampSeconds = undefined;\n nativeNewFrameTimestampSeconds = undefined;\n listener(event);\n };\n fallbackTimeout = setTimeout(() => {\n if (nativeNewFrameTimestampSeconds) {\n logger.log('Native event emitter did not reply in time');\n return listener({\n newFrameTimestampInSeconds: nativeNewFrameTimestampSeconds,\n isFallback: true,\n });\n } else if (animationFrameTimestampSeconds) {\n logger.log('[Sentry] Native event emitter did not reply in time. Using JavaScript fallback emitter.');\n return listener({\n newFrameTimestampInSeconds: animationFrameTimestampSeconds,\n isFallback: true,\n });\n } else {\n emitter.removeListener(NewFrameEventName, internalListener);\n logger.error('Failed to receive any fallback timestamp.');\n }\n }, fallbackTimeoutMs);\n\n getNativeNewFrameTimestampSeconds();\n getAnimationFrameTimestampSeconds();\n emitter.once(NewFrameEventName, internalListener);\n },\n };\n}\n"]}
|
package/dist/js/utils/span.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../../src/js/utils/span.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../../src/js/utils/span.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAe,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,UAAU,CAE3D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE9C;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAEtE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,GAAG,SAAS,CAEjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/utils/span.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"span.js","sourceRoot":"","sources":["../../../src/js/utils/span.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,OAAO,IAAI,YAAY,UAAU,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,OAAO,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,oBAAoB,GAAG,UAAU,CAAC;AACxC,MAAM,iCAAiC,GAAG,2BAA2B,CAAC;AAOtE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU,EAAE,YAAoB;IAC7D,IAAwB,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAU;;IACjD,OAAO,MAAA,MAAC,IAAwB,EAAC,2BAA2B,CAAC,kDAAI,CAAC;AACpE,CAAC","sourcesContent":["import type { Span, TransactionEvent } from '@sentry/core';\nimport { getRootSpan, SentrySpan } from '@sentry/core';\n\n/**\n *\n */\nexport function isSentrySpan(span: Span): span is SentrySpan {\n return span instanceof SentrySpan;\n}\n\n/**\n *\n */\nexport function isRootSpan(span: Span): boolean {\n return span === getRootSpan(span);\n}\n\nconst END_TIME_SCOPE_FIELD = '_endTime';\nconst CONVERT_SPAN_TO_TRANSACTION_FIELD = '_convertSpanToTransaction';\n\ntype SpanWithPrivate = Span & {\n [END_TIME_SCOPE_FIELD]?: number;\n [CONVERT_SPAN_TO_TRANSACTION_FIELD]?: () => TransactionEvent | undefined;\n};\n\n/**\n *\n */\nexport function setEndTimeValue(span: Span, endTimestamp: number): void {\n (span as SpanWithPrivate)['_endTime'] = endTimestamp;\n}\n\n/**\n *\n */\nexport function convertSpanToTransaction(span: Span): TransactionEvent | undefined {\n return (span as SpanWithPrivate)['_convertSpanToTransaction']?.();\n}\n"]}
|