@sentry/react-native 5.29.0 → 6.0.0-alpha.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/CHANGELOG.md +90 -0
- package/dist/js/client.d.ts +5 -9
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +11 -42
- package/dist/js/client.js.map +1 -1
- package/dist/js/index.d.ts +5 -10
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +4 -21
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts +2 -8
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +1 -9
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +18 -7
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/devicecontext.d.ts +2 -8
- package/dist/js/integrations/devicecontext.d.ts.map +1 -1
- package/dist/js/integrations/devicecontext.js +0 -9
- package/dist/js/integrations/devicecontext.js.map +1 -1
- package/dist/js/integrations/eventorigin.d.ts +2 -8
- package/dist/js/integrations/eventorigin.d.ts.map +1 -1
- package/dist/js/integrations/eventorigin.js +0 -8
- package/dist/js/integrations/eventorigin.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts +2 -8
- package/dist/js/integrations/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js +0 -8
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/integrations/exports.d.ts +4 -0
- package/dist/js/integrations/exports.d.ts.map +1 -1
- package/dist/js/integrations/exports.js +4 -0
- package/dist/js/integrations/exports.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts +2 -8
- package/dist/js/integrations/modulesloader.d.ts.map +1 -1
- package/dist/js/integrations/modulesloader.js +0 -8
- package/dist/js/integrations/modulesloader.js.map +1 -1
- package/dist/js/integrations/nativelinkederrors.d.ts +2 -8
- package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
- package/dist/js/integrations/nativelinkederrors.js +0 -8
- package/dist/js/integrations/nativelinkederrors.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts +2 -8
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +1 -8
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts +2 -8
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeinfo.js +0 -8
- package/dist/js/integrations/reactnativeinfo.js.map +1 -1
- package/dist/js/integrations/release.d.ts +2 -8
- package/dist/js/integrations/release.d.ts.map +1 -1
- package/dist/js/integrations/release.js +0 -8
- package/dist/js/integrations/release.js.map +1 -1
- package/dist/js/integrations/rewriteframes.js +1 -1
- package/dist/js/integrations/rewriteframes.js.map +1 -1
- package/dist/js/integrations/screenshot.d.ts +2 -8
- package/dist/js/integrations/screenshot.d.ts.map +1 -1
- package/dist/js/integrations/screenshot.js +2 -11
- package/dist/js/integrations/screenshot.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts +2 -8
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +0 -8
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts +2 -10
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js +1 -10
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.d.ts +2 -8
- package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +0 -8
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/options.d.ts +43 -0
- 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/hermes.d.ts +1 -1
- package/dist/js/profiling/hermes.d.ts.map +1 -1
- package/dist/js/profiling/integration.d.ts +1 -7
- package/dist/js/profiling/integration.d.ts.map +1 -1
- package/dist/js/profiling/integration.js +39 -25
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/profiling/utils.js +2 -1
- package/dist/js/profiling/utils.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts +2 -2
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/scopeSync.d.ts +6 -0
- package/dist/js/scopeSync.d.ts.map +1 -0
- package/dist/js/scopeSync.js +60 -0
- package/dist/js/scopeSync.js.map +1 -0
- package/dist/js/sdk.d.ts +1 -20
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +20 -53
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/touchevents.d.ts +0 -1
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +5 -9
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/gesturetracing.d.ts +1 -6
- package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
- package/dist/js/tracing/gesturetracing.js +8 -12
- package/dist/js/tracing/gesturetracing.js.map +1 -1
- package/dist/js/tracing/index.d.ts +6 -7
- package/dist/js/tracing/index.d.ts.map +1 -1
- package/dist/js/tracing/index.js +4 -7
- package/dist/js/tracing/index.js.map +1 -1
- package/dist/js/tracing/integrations/appStart.d.ts +39 -0
- package/dist/js/tracing/integrations/appStart.d.ts.map +1 -0
- package/dist/js/tracing/integrations/appStart.js +301 -0
- package/dist/js/tracing/integrations/appStart.js.map +1 -0
- package/dist/js/tracing/integrations/nativeFrames.d.ts +20 -0
- package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -0
- package/dist/js/tracing/integrations/nativeFrames.js +256 -0
- package/dist/js/tracing/integrations/nativeFrames.js.map +1 -0
- package/dist/js/tracing/integrations/stalltracking.d.ts +31 -0
- package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -0
- package/dist/js/tracing/integrations/stalltracking.js +236 -0
- package/dist/js/tracing/integrations/stalltracking.js.map +1 -0
- package/dist/js/tracing/integrations/userInteraction.d.ts +11 -0
- package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -0
- package/dist/js/tracing/integrations/userInteraction.js +70 -0
- package/dist/js/tracing/integrations/userInteraction.js.map +1 -0
- package/dist/js/tracing/onSpanEndUtils.d.ts +17 -0
- package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -0
- package/dist/js/tracing/onSpanEndUtils.js +112 -0
- package/dist/js/tracing/onSpanEndUtils.js.map +1 -0
- package/dist/js/tracing/origin.d.ts +2 -0
- package/dist/js/tracing/origin.d.ts.map +1 -0
- package/dist/js/tracing/origin.js +2 -0
- package/dist/js/tracing/origin.js.map +1 -0
- package/dist/js/tracing/reactnativenavigation.d.ts +21 -39
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js +98 -87
- 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 +6 -13
- package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +44 -160
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +51 -481
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts +18 -63
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +200 -205
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/semanticAttributes.d.ts +12 -0
- package/dist/js/tracing/semanticAttributes.d.ts.map +1 -0
- package/dist/js/tracing/semanticAttributes.js +12 -0
- package/dist/js/tracing/semanticAttributes.js.map +1 -0
- package/dist/js/tracing/span.d.ts +52 -0
- package/dist/js/tracing/span.d.ts.map +1 -0
- package/dist/js/tracing/span.js +82 -0
- package/dist/js/tracing/span.js.map +1 -0
- package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
- package/dist/js/tracing/timetodisplay.js +14 -29
- package/dist/js/tracing/timetodisplay.js.map +1 -1
- package/dist/js/tracing/types.d.ts +2 -9
- 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 +19 -14
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js +38 -52
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/encodePolyfill.d.ts +3 -0
- package/dist/js/transports/encodePolyfill.d.ts.map +1 -0
- package/dist/js/transports/encodePolyfill.js +13 -0
- package/dist/js/transports/encodePolyfill.js.map +1 -0
- package/dist/js/transports/native.d.ts +2 -2
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js +2 -1
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/utils/fill.d.ts +7 -0
- package/dist/js/utils/fill.d.ts.map +1 -0
- package/dist/js/utils/fill.js +9 -0
- package/dist/js/utils/fill.js.map +1 -0
- package/dist/js/utils/span.d.ts +19 -0
- package/dist/js/utils/span.d.ts.map +1 -0
- package/dist/js/utils/span.js +29 -0
- package/dist/js/utils/span.js.map +1 -0
- package/dist/js/vendor/react-native/index.d.ts +1 -1
- package/dist/js/vendor/react-native/index.d.ts.map +1 -1
- package/dist/js/vendor/react-native/index.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.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 +1 -0
- package/dist/js/wrapper.js.map +1 -1
- package/package.json +10 -12
- package/ts3.8/dist/js/client.d.ts +5 -9
- package/ts3.8/dist/js/index.d.ts +5 -10
- package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +2 -8
- package/ts3.8/dist/js/integrations/devicecontext.d.ts +2 -8
- package/ts3.8/dist/js/integrations/eventorigin.d.ts +2 -8
- package/ts3.8/dist/js/integrations/expocontext.d.ts +2 -8
- package/ts3.8/dist/js/integrations/exports.d.ts +4 -0
- package/ts3.8/dist/js/integrations/modulesloader.d.ts +2 -8
- package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +2 -8
- package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +2 -8
- package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +2 -8
- package/ts3.8/dist/js/integrations/release.d.ts +2 -8
- package/ts3.8/dist/js/integrations/screenshot.d.ts +2 -8
- package/ts3.8/dist/js/integrations/sdkinfo.d.ts +2 -8
- package/ts3.8/dist/js/integrations/spotlight.d.ts +2 -10
- package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +2 -8
- package/ts3.8/dist/js/options.d.ts +43 -0
- 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/profiling/integration.d.ts +1 -7
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +2 -2
- package/ts3.8/dist/js/scopeSync.d.ts +6 -0
- package/ts3.8/dist/js/sdk.d.ts +1 -20
- package/ts3.8/dist/js/touchevents.d.ts +0 -1
- package/ts3.8/dist/js/tracing/gesturetracing.d.ts +1 -6
- package/ts3.8/dist/js/tracing/index.d.ts +6 -7
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +39 -0
- package/ts3.8/dist/js/tracing/integrations/nativeFrames.d.ts +20 -0
- package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +31 -0
- package/ts3.8/dist/js/tracing/integrations/userInteraction.d.ts +11 -0
- package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +17 -0
- package/ts3.8/dist/js/tracing/origin.d.ts +2 -0
- package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +21 -39
- package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +44 -160
- package/ts3.8/dist/js/tracing/reactnavigation.d.ts +18 -63
- package/ts3.8/dist/js/tracing/semanticAttributes.d.ts +12 -0
- package/ts3.8/dist/js/tracing/span.d.ts +52 -0
- package/ts3.8/dist/js/tracing/types.d.ts +2 -9
- package/ts3.8/dist/js/tracing/utils.d.ts +19 -14
- package/ts3.8/dist/js/transports/encodePolyfill.d.ts +3 -0
- package/ts3.8/dist/js/transports/native.d.ts +2 -2
- package/ts3.8/dist/js/utils/fill.d.ts +7 -0
- package/ts3.8/dist/js/utils/span.d.ts +19 -0
- package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/dist/js/integrations/index.d.ts +0 -16
- package/dist/js/integrations/index.d.ts.map +0 -1
- package/dist/js/integrations/index.js +0 -17
- package/dist/js/integrations/index.js.map +0 -1
- package/dist/js/scope.d.ts +0 -54
- package/dist/js/scope.d.ts.map +0 -1
- package/dist/js/scope.js +0 -89
- package/dist/js/scope.js.map +0 -1
- package/dist/js/tracing/addTracingExtensions.d.ts +0 -8
- package/dist/js/tracing/addTracingExtensions.d.ts.map +0 -1
- package/dist/js/tracing/addTracingExtensions.js +0 -66
- package/dist/js/tracing/addTracingExtensions.js.map +0 -1
- package/dist/js/tracing/nativeframes.d.ts +0 -60
- package/dist/js/tracing/nativeframes.d.ts.map +0 -1
- package/dist/js/tracing/nativeframes.js +0 -210
- package/dist/js/tracing/nativeframes.js.map +0 -1
- package/dist/js/tracing/reactnavigationv4.d.ts +0 -92
- package/dist/js/tracing/reactnavigationv4.d.ts.map +0 -1
- package/dist/js/tracing/reactnavigationv4.js +0 -229
- package/dist/js/tracing/reactnavigationv4.js.map +0 -1
- package/dist/js/tracing/routingInstrumentation.d.ts +0 -52
- package/dist/js/tracing/routingInstrumentation.d.ts.map +0 -1
- package/dist/js/tracing/routingInstrumentation.js +0 -36
- package/dist/js/tracing/routingInstrumentation.js.map +0 -1
- package/dist/js/tracing/stalltracking.d.ts +0 -99
- package/dist/js/tracing/stalltracking.d.ts.map +0 -1
- package/dist/js/tracing/stalltracking.js +0 -286
- package/dist/js/tracing/stalltracking.js.map +0 -1
- package/dist/js/tracing/transaction.d.ts +0 -11
- package/dist/js/tracing/transaction.d.ts.map +0 -1
- package/dist/js/tracing/transaction.js +0 -37
- package/dist/js/tracing/transaction.js.map +0 -1
- package/dist/js/transports/TextEncoder.d.ts +0 -3
- package/dist/js/transports/TextEncoder.d.ts.map +0 -1
- package/dist/js/transports/TextEncoder.js +0 -12
- package/dist/js/transports/TextEncoder.js.map +0 -1
- package/ts3.8/dist/js/integrations/index.d.ts +0 -16
- package/ts3.8/dist/js/scope.d.ts +0 -54
- package/ts3.8/dist/js/tracing/addTracingExtensions.d.ts +0 -8
- package/ts3.8/dist/js/tracing/nativeframes.d.ts +0 -60
- package/ts3.8/dist/js/tracing/reactnavigationv4.d.ts +0 -92
- package/ts3.8/dist/js/tracing/routingInstrumentation.d.ts +0 -52
- package/ts3.8/dist/js/tracing/stalltracking.d.ts +0 -99
- package/ts3.8/dist/js/tracing/transaction.d.ts +0 -11
- package/ts3.8/dist/js/transports/TextEncoder.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getClient,
|
|
1
|
+
import { getClient, Profiler } from '@sentry/react';
|
|
2
2
|
import { timestampInSeconds } from '@sentry/utils';
|
|
3
3
|
import { createIntegration } from '../integrations/factory';
|
|
4
|
-
import {
|
|
4
|
+
import { captureAppStart, setRootComponentCreationTimestampMs } from '../tracing/integrations/appStart';
|
|
5
5
|
const ReactNativeProfilerGlobalState = {
|
|
6
6
|
appStartReported: false,
|
|
7
7
|
};
|
|
@@ -10,9 +10,7 @@ const ReactNativeProfilerGlobalState = {
|
|
|
10
10
|
*/
|
|
11
11
|
export class ReactNativeProfiler extends Profiler {
|
|
12
12
|
constructor(props) {
|
|
13
|
-
|
|
14
|
-
const integration = client && client.getIntegrationByName && client.getIntegrationByName('ReactNativeTracing');
|
|
15
|
-
integration && integration.setRootComponentFirstConstructorCallTimestampMs(timestampInSeconds() * 1000);
|
|
13
|
+
setRootComponentCreationTimestampMs(timestampInSeconds() * 1000);
|
|
16
14
|
super(props);
|
|
17
15
|
this.name = 'ReactNativeProfiler';
|
|
18
16
|
}
|
|
@@ -30,8 +28,7 @@ export class ReactNativeProfiler extends Profiler {
|
|
|
30
28
|
* Notifies the Tracing integration that the app start has finished.
|
|
31
29
|
*/
|
|
32
30
|
_reportAppStart() {
|
|
33
|
-
const
|
|
34
|
-
const client = hub.getClient();
|
|
31
|
+
const client = getClient();
|
|
35
32
|
if (!client) {
|
|
36
33
|
// We can't use logger here because this will be logged before the `Sentry.init`.
|
|
37
34
|
// eslint-disable-next-line no-console
|
|
@@ -39,12 +36,8 @@ export class ReactNativeProfiler extends Profiler {
|
|
|
39
36
|
return;
|
|
40
37
|
}
|
|
41
38
|
client.addIntegration && client.addIntegration(createIntegration(this.name));
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
&& this._mountSpan
|
|
45
|
-
&& typeof this._mountSpan.endTimestamp !== 'undefined'
|
|
46
|
-
// The first root component mount is the app start finish.
|
|
47
|
-
&& tracingIntegration.onAppStartFinish(this._mountSpan.endTimestamp);
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
40
|
+
captureAppStart();
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
//# sourceMappingURL=reactnativeprofiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeprofiler.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnativeprofiler.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"reactnativeprofiler.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnativeprofiler.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AAExG,MAAM,8BAA8B,GAAG;IACrC,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,QAAQ;IAG/C,YAAmB,KAAgD;QACjE,mCAAmC,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,CAAC;QACjE,KAAK,CAAC,KAAK,CAAC,CAAC;QAJC,SAAI,GAAW,qBAAqB,CAAC;IAKrD,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,8BAA8B,CAAC,gBAAgB,EAAE;YACpD,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,8BAA8B,CAAC,gBAAgB,GAAG,IAAI,CAAC;SACxD;IACH,CAAC;IAED;;OAEG;IACK,eAAe;QACrB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,IAAI,CAAC,MAAM,EAAE;YACX,iFAAiF;YACjF,sCAAsC;YACtC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,sFAAsF,CAAC,CAAC;YAChH,OAAO;SACR;QAED,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7E,mEAAmE;QACnE,eAAe,EAAE,CAAC;IACpB,CAAC;CACF","sourcesContent":["import { getClient, Profiler } from '@sentry/react';\nimport { timestampInSeconds } from '@sentry/utils';\n\nimport { createIntegration } from '../integrations/factory';\nimport { captureAppStart, setRootComponentCreationTimestampMs } from '../tracing/integrations/appStart';\n\nconst ReactNativeProfilerGlobalState = {\n appStartReported: false,\n};\n\n/**\n * Custom profiler for the React Native app root.\n */\nexport class ReactNativeProfiler extends Profiler {\n public readonly name: string = 'ReactNativeProfiler';\n\n public constructor(props: ConstructorParameters<typeof Profiler>[0]) {\n setRootComponentCreationTimestampMs(timestampInSeconds() * 1000);\n super(props);\n }\n\n /**\n * Get the app root mount time.\n */\n public componentDidMount(): void {\n super.componentDidMount();\n if (!ReactNativeProfilerGlobalState.appStartReported) {\n this._reportAppStart();\n ReactNativeProfilerGlobalState.appStartReported = true;\n }\n }\n\n /**\n * Notifies the Tracing integration that the app start has finished.\n */\n private _reportAppStart(): void {\n const client = getClient();\n\n if (!client) {\n // We can't use logger here because this will be logged before the `Sentry.init`.\n // eslint-disable-next-line no-console\n __DEV__ && console.warn('App Start Span could not be finished. `Sentry.wrap` was called before `Sentry.init`.');\n return;\n }\n\n client.addIntegration && client.addIntegration(createIntegration(this.name));\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n captureAppStart();\n }\n}\n"]}
|
|
@@ -1,183 +1,67 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';
|
|
5
|
-
import { NativeFramesInstrumentation } from './nativeframes';
|
|
6
|
-
import { StallTrackingInstrumentation } from './stalltracking';
|
|
7
|
-
import type { BeforeNavigate } from './types';
|
|
8
|
-
export interface ReactNativeTracingOptions extends RequestInstrumentationOptions {
|
|
1
|
+
import type { Client, Integration, StartSpanOptions } from '@sentry/types';
|
|
2
|
+
export declare const INTEGRATION_NAME = "ReactNativeTracing";
|
|
3
|
+
export interface ReactNativeTracingOptions {
|
|
9
4
|
/**
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
idleTimeout: number;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Replaced by maxTransactionDurationMs
|
|
15
|
-
*/
|
|
16
|
-
maxTransactionDuration: number;
|
|
17
|
-
/**
|
|
18
|
-
* The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of
|
|
19
|
-
* the last finished span as the endtime for the transaction.
|
|
20
|
-
* Time is in ms.
|
|
5
|
+
* The time that has to pass without any span being created.
|
|
6
|
+
* If this time is exceeded, the idle span will finish.
|
|
21
7
|
*
|
|
22
|
-
*
|
|
8
|
+
* @default 1_000 (ms)
|
|
23
9
|
*/
|
|
24
|
-
idleTimeoutMs
|
|
10
|
+
idleTimeoutMs?: number;
|
|
25
11
|
/**
|
|
26
|
-
* The
|
|
27
|
-
*
|
|
28
|
-
* If you never want to mark a transaction set it to 0.
|
|
29
|
-
* Time is in ms.
|
|
12
|
+
* The max. time an idle span may run.
|
|
13
|
+
* If this time is exceeded, the idle span will finish no matter what.
|
|
30
14
|
*
|
|
31
|
-
*
|
|
15
|
+
* @default 60_0000 (ms)
|
|
32
16
|
*/
|
|
33
|
-
finalTimeoutMs
|
|
17
|
+
finalTimeoutMs?: number;
|
|
34
18
|
/**
|
|
35
|
-
*
|
|
36
|
-
* There is no routing instrumentation if nothing is passed.
|
|
37
|
-
*/
|
|
38
|
-
routingInstrumentation?: RoutingInstrumentationInstance;
|
|
39
|
-
/**
|
|
40
|
-
* Does not sample transactions that are from routes that have been seen any more and don't have any spans.
|
|
41
|
-
* This removes a lot of the clutter as most back navigation transactions are now ignored.
|
|
19
|
+
* Flag to disable patching all together for fetch requests.
|
|
42
20
|
*
|
|
43
|
-
*
|
|
21
|
+
* @default true
|
|
44
22
|
*/
|
|
45
|
-
|
|
23
|
+
traceFetch: boolean;
|
|
46
24
|
/**
|
|
47
|
-
*
|
|
48
|
-
* context data, or drop the transaction entirely (by setting `sampled = false` in the context).
|
|
49
|
-
*
|
|
50
|
-
* @param context: The context data which will be passed to `startTransaction` by default
|
|
25
|
+
* Flag to disable patching all together for xhr requests.
|
|
51
26
|
*
|
|
52
|
-
* @
|
|
27
|
+
* @default true
|
|
53
28
|
*/
|
|
54
|
-
|
|
29
|
+
traceXHR: boolean;
|
|
55
30
|
/**
|
|
56
|
-
*
|
|
57
|
-
* an app start transaction will be started.
|
|
31
|
+
* If true, Sentry will capture http timings and add them to the corresponding http spans.
|
|
58
32
|
*
|
|
59
|
-
*
|
|
33
|
+
* @default true
|
|
60
34
|
*/
|
|
61
|
-
|
|
35
|
+
enableHTTPTimings: boolean;
|
|
62
36
|
/**
|
|
63
|
-
*
|
|
37
|
+
* A callback which is called before a span for a navigation is started.
|
|
38
|
+
* It receives the options passed to `startSpan`, and expects to return an updated options object.
|
|
64
39
|
*/
|
|
65
|
-
|
|
40
|
+
beforeStartSpan?: (options: StartSpanOptions) => StartSpanOptions;
|
|
66
41
|
/**
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* Trace User Interaction events like touch and gestures.
|
|
42
|
+
* This function will be called before creating a span for a request with the given url.
|
|
43
|
+
* Return false if you don't want a span for the given url.
|
|
44
|
+
*
|
|
45
|
+
* @default (url: string) => true
|
|
72
46
|
*/
|
|
73
|
-
|
|
47
|
+
shouldCreateSpanForRequest?(this: void, url: string): boolean;
|
|
74
48
|
}
|
|
49
|
+
export declare const defaultReactNativeTracingOptions: ReactNativeTracingOptions;
|
|
50
|
+
export type ReactNativeTracingState = {
|
|
51
|
+
currentRoute: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
export declare const reactNativeTracingIntegration: (options?: Partial<ReactNativeTracingOptions>) => Integration & {
|
|
54
|
+
options: ReactNativeTracingOptions;
|
|
55
|
+
state: ReactNativeTracingState;
|
|
56
|
+
setCurrentRoute: (route: string) => void;
|
|
57
|
+
};
|
|
58
|
+
export type ReactNativeTracingIntegration = ReturnType<typeof reactNativeTracingIntegration>;
|
|
75
59
|
/**
|
|
76
|
-
*
|
|
60
|
+
* Returns the current React Native Tracing integration.
|
|
77
61
|
*/
|
|
78
|
-
export declare
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/** We filter out App starts more than 60s */
|
|
84
|
-
private static _maxAppStart;
|
|
85
|
-
/** We filter out App starts which timestamp is 60s and more before the transaction start */
|
|
86
|
-
private static _maxAppStartBeforeTransactionMs;
|
|
87
|
-
/**
|
|
88
|
-
* @inheritDoc
|
|
89
|
-
*/
|
|
90
|
-
name: string;
|
|
91
|
-
/** ReactNativeTracing options */
|
|
92
|
-
options: ReactNativeTracingOptions;
|
|
93
|
-
nativeFramesInstrumentation?: NativeFramesInstrumentation;
|
|
94
|
-
stallTrackingInstrumentation?: StallTrackingInstrumentation;
|
|
95
|
-
useAppStartWithProfiler: boolean;
|
|
96
|
-
private _inflightInteractionTransaction?;
|
|
97
|
-
private _getCurrentHub?;
|
|
98
|
-
private _awaitingAppStartData?;
|
|
99
|
-
private _appStartFinishTimestamp?;
|
|
100
|
-
private _currentRoute?;
|
|
101
|
-
private _hasSetTracePropagationTargets;
|
|
102
|
-
private _hasSetTracingOrigins;
|
|
103
|
-
private _currentViewName;
|
|
104
|
-
private _firstConstructorCallTimestampMs;
|
|
105
|
-
constructor(options?: Partial<ReactNativeTracingOptions>);
|
|
106
|
-
/**
|
|
107
|
-
* Registers routing and request instrumentation.
|
|
108
|
-
*/
|
|
109
|
-
setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* To be called on a transaction start. Can have async methods
|
|
112
|
-
*/
|
|
113
|
-
onTransactionStart(transaction: Transaction): void;
|
|
114
|
-
/**
|
|
115
|
-
* To be called on a transaction finish. Cannot have async methods.
|
|
116
|
-
*/
|
|
117
|
-
onTransactionFinish(transaction: Transaction, endTimestamp?: number): void;
|
|
118
|
-
/**
|
|
119
|
-
* Called by the ReactNativeProfiler component on first component mount.
|
|
120
|
-
*/
|
|
121
|
-
onAppStartFinish(endTimestamp: number): void;
|
|
122
|
-
/**
|
|
123
|
-
* Sets the root component first constructor call timestamp.
|
|
124
|
-
*/
|
|
125
|
-
setRootComponentFirstConstructorCallTimestampMs(timestamp: number): void;
|
|
126
|
-
/**
|
|
127
|
-
* Starts a new transaction for a user interaction.
|
|
128
|
-
* @param userInteractionId Consists of `op` representation UI Event and `elementId` unique element identifier on current screen.
|
|
129
|
-
*/
|
|
130
|
-
startUserInteractionTransaction(userInteractionId: {
|
|
131
|
-
elementId: string | undefined;
|
|
132
|
-
op: string;
|
|
133
|
-
}): TransactionType | undefined;
|
|
134
|
-
/**
|
|
135
|
-
* Enables or disables native frames tracking based on the `enableNativeFramesTracking` option.
|
|
136
|
-
*/
|
|
137
|
-
private _enableNativeFramesTracking;
|
|
138
|
-
/**
|
|
139
|
-
* Sets the current view name into the app context.
|
|
140
|
-
* @param event Le event.
|
|
141
|
-
*/
|
|
142
|
-
private _getCurrentViewEventProcessor;
|
|
143
|
-
/**
|
|
144
|
-
* Returns the App Start Duration in Milliseconds. Also returns undefined if not able do
|
|
145
|
-
* define the duration.
|
|
146
|
-
*/
|
|
147
|
-
private _getAppStartDurationMilliseconds;
|
|
148
|
-
/**
|
|
149
|
-
* Instruments the app start measurements on the first route transaction.
|
|
150
|
-
* Starts a route transaction if there isn't routing instrumentation.
|
|
151
|
-
*/
|
|
152
|
-
private _instrumentAppStart;
|
|
153
|
-
/**
|
|
154
|
-
* Adds app start measurements and starts a child span on a transaction.
|
|
155
|
-
*/
|
|
156
|
-
private _addAppStartData;
|
|
157
|
-
/**
|
|
158
|
-
* Adds JS Execution before React Root. If `Sentry.wrap` is not used, create a span for the start of JS Bundle execution.
|
|
159
|
-
*/
|
|
160
|
-
private _addJSExecutionBeforeRoot;
|
|
161
|
-
/**
|
|
162
|
-
* Adds native spans to the app start span.
|
|
163
|
-
*/
|
|
164
|
-
private _addNativeSpansTo;
|
|
165
|
-
/**
|
|
166
|
-
* UIKit init is measured by the native layers till the native SDK start
|
|
167
|
-
* RN initializes the native SDK later, the end timestamp would be wrong
|
|
168
|
-
*/
|
|
169
|
-
private _createUIKitSpan;
|
|
170
|
-
/** To be called when the route changes, but BEFORE the components of the new route mount. */
|
|
171
|
-
private _onRouteWillChange;
|
|
172
|
-
/**
|
|
173
|
-
* Creates a breadcrumb and sets the current route as a tag.
|
|
174
|
-
*/
|
|
175
|
-
private _onConfirmRoute;
|
|
176
|
-
/** Create routing idle transaction. */
|
|
177
|
-
private _createRouteTransaction;
|
|
178
|
-
/**
|
|
179
|
-
* Start app state aware idle transaction on the scope.
|
|
180
|
-
*/
|
|
181
|
-
private _startIdleTransaction;
|
|
182
|
-
}
|
|
62
|
+
export declare function getCurrentReactNativeTracingIntegration(): ReactNativeTracingIntegration | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Returns React Native Tracing integration of given client.
|
|
65
|
+
*/
|
|
66
|
+
export declare function getReactNativeTracingIntegration(client: Client): ReactNativeTracingIntegration | undefined;
|
|
183
67
|
//# sourceMappingURL=reactnativetracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reactnativetracing.d.ts","sourceRoot":"","sources":["../../../src/js/tracing/reactnativetracing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAS,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIlF,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;IAElE;;;;;OAKG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/D;AAID,eAAO,MAAM,gCAAgC,EAAE,yBAI9C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,6BAA6B,aAC/B,QAAQ,yBAAyB,CAAC;aAElC,yBAAyB;WAC3B,uBAAuB;6BACL,MAAM,KAAK,IAAI;CA0CzC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE7F;;GAEG;AACH,wBAAgB,uCAAuC,IAAI,6BAA6B,GAAG,SAAS,CAOnG;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,6BAA6B,GAAG,SAAS,CAE1G"}
|