@sentry/react-native 5.19.2 → 5.20.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 +63 -1
- package/README.md +1 -1
- package/RNSentry.podspec +2 -2
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/{MapConverter.java → RNSentryMapConverter.java} +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +55 -10
- package/android/src/main/java/io/sentry/react/RNSentryOnDrawReporterManager.java +139 -0
- package/android/src/main/java/io/sentry/react/RNSentryPackage.java +13 -0
- package/android/src/main/java/io/sentry/react/RNSentryReactFragmentLifecycleTracer.java +99 -0
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +15 -1
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +15 -0
- package/dist/js/NativeRNSentry.d.ts +3 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/index.d.ts +2 -2
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/tools/utils.js +1 -1
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tracing/index.d.ts +1 -0
- package/dist/js/tracing/index.d.ts.map +1 -1
- package/dist/js/tracing/index.js +1 -0
- package/dist/js/tracing/index.js.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.d.ts +4 -0
- package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.js +12 -0
- package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +15 -2
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts +10 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +69 -4
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/timetodisplay.d.ts +46 -0
- package/dist/js/tracing/timetodisplay.d.ts.map +1 -0
- package/dist/js/tracing/timetodisplay.js +198 -0
- package/dist/js/tracing/timetodisplay.js.map +1 -0
- package/dist/js/tracing/timetodisplaynative.d.ts +17 -0
- package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -0
- package/dist/js/tracing/timetodisplaynative.js +27 -0
- package/dist/js/tracing/timetodisplaynative.js.map +1 -0
- package/dist/js/tracing/timetodisplaynative.types.d.ts +14 -0
- package/dist/js/tracing/timetodisplaynative.types.d.ts.map +1 -0
- package/dist/js/tracing/timetodisplaynative.types.js +2 -0
- package/dist/js/tracing/timetodisplaynative.types.js.map +1 -0
- package/dist/js/tracing/utils.d.ts +8 -3
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js +19 -0
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/utils/sentryeventemitter.d.ts +24 -0
- package/dist/js/utils/sentryeventemitter.d.ts.map +1 -0
- package/dist/js/utils/sentryeventemitter.js +82 -0
- package/dist/js/utils/sentryeventemitter.js.map +1 -0
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +5 -0
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +20 -3
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.h +2 -1
- package/ios/RNSentry.mm +44 -0
- package/ios/RNSentryDependencyContainer.h +15 -0
- package/ios/RNSentryDependencyContainer.m +32 -0
- package/ios/RNSentryEvents.h +3 -0
- package/ios/RNSentryEvents.m +3 -0
- package/ios/RNSentryFramesTrackerListener.h +17 -0
- package/ios/RNSentryFramesTrackerListener.m +30 -0
- package/ios/RNSentryOnDrawReporter.m +70 -0
- package/ios/RNSentryRNSScreen.h +7 -0
- package/ios/RNSentryRNSScreen.m +26 -0
- package/package.json +9 -6
- package/scripts/expo-upload-sourcemaps.js +15 -1
- package/src/js/NativeRNSentry.ts +3 -0
- package/ts3.8/dist/js/NativeRNSentry.d.ts +3 -0
- package/ts3.8/dist/js/index.d.ts +2 -2
- package/ts3.8/dist/js/tracing/index.d.ts +1 -0
- package/ts3.8/dist/js/tracing/reactnativeprofiler.d.ts +4 -0
- package/ts3.8/dist/js/tracing/reactnavigation.d.ts +10 -1
- package/ts3.8/dist/js/tracing/timetodisplay.d.ts +46 -0
- package/ts3.8/dist/js/tracing/timetodisplaynative.d.ts +17 -0
- package/ts3.8/dist/js/tracing/timetodisplaynative.types.d.ts +14 -0
- package/ts3.8/dist/js/tracing/utils.d.ts +8 -3
- package/ts3.8/dist/js/utils/sentryeventemitter.d.ts +24 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +5 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#import <Sentry/SentryFramesTracker.h>
|
|
2
|
+
#import <Sentry/SentryDependencyContainer.h>
|
|
3
|
+
#import <Sentry/SentrySwizzle.h>
|
|
4
|
+
|
|
5
|
+
#import "RNSentryRNSScreen.h"
|
|
6
|
+
#import "RNSentryDependencyContainer.h"
|
|
7
|
+
|
|
8
|
+
@implementation RNSentryRNSScreen
|
|
9
|
+
|
|
10
|
+
+ (void)swizzleViewDidAppear {
|
|
11
|
+
Class rnsscreenclass = NSClassFromString(@"RNSScreen");
|
|
12
|
+
if (rnsscreenclass == nil)
|
|
13
|
+
{
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
SEL selector = NSSelectorFromString(@"viewDidAppear:");
|
|
18
|
+
SentrySwizzleInstanceMethod(rnsscreenclass, selector, SentrySWReturnType(void),
|
|
19
|
+
SentrySWArguments(BOOL animated), SentrySWReplacement({
|
|
20
|
+
[[[RNSentryDependencyContainer sharedInstance] framesTrackerListener] startListening];
|
|
21
|
+
SentrySWCallOriginal(animated);
|
|
22
|
+
}),
|
|
23
|
+
SentrySwizzleModeOncePerClass, (void *)selector);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@end
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sentry/react-native",
|
|
3
3
|
"homepage": "https://github.com/getsentry/sentry-react-native",
|
|
4
4
|
"repository": "https://github.com/getsentry/sentry-react-native",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.20.0",
|
|
6
6
|
"description": "Official Sentry SDK for react-native",
|
|
7
7
|
"typings": "dist/js/index.d.ts",
|
|
8
8
|
"types": "dist/js/index.d.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@sentry/browser": "7.100.1",
|
|
70
|
-
"@sentry/cli": "2.
|
|
70
|
+
"@sentry/cli": "2.30.0",
|
|
71
71
|
"@sentry/core": "7.100.1",
|
|
72
72
|
"@sentry/hub": "7.100.1",
|
|
73
73
|
"@sentry/integrations": "7.100.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@babel/core": "^7.23.5",
|
|
80
|
-
"@expo/metro-config": "0.
|
|
80
|
+
"@expo/metro-config": "0.17.5",
|
|
81
81
|
"@mswjs/interceptors": "^0.25.15",
|
|
82
82
|
"@sentry-internal/eslint-config-sdk": "7.100.1",
|
|
83
83
|
"@sentry-internal/eslint-plugin-sdk": "7.100.1",
|
|
@@ -85,17 +85,19 @@
|
|
|
85
85
|
"@sentry/wizard": "3.16.3",
|
|
86
86
|
"@types/jest": "^29.5.3",
|
|
87
87
|
"@types/node": "^20.9.3",
|
|
88
|
-
"@types/react": "^18.2.
|
|
88
|
+
"@types/react": "^18.2.64",
|
|
89
89
|
"@types/uglify-js": "^3.17.2",
|
|
90
90
|
"@types/uuid": "^9.0.4",
|
|
91
91
|
"@types/xmlhttprequest": "^1.8.2",
|
|
92
92
|
"babel-jest": "^29.6.2",
|
|
93
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
94
|
+
"babel-preset-fbjs": "^3.4.0",
|
|
93
95
|
"downlevel-dts": "^0.11.0",
|
|
94
96
|
"eslint": "^7.6.0",
|
|
95
97
|
"eslint-plugin-react": "^7.20.6",
|
|
96
98
|
"eslint-plugin-react-native": "^3.8.1",
|
|
97
|
-
"expo": "50.0.
|
|
98
|
-
"expo-module-scripts": "
|
|
99
|
+
"expo": "^50.0.8",
|
|
100
|
+
"expo-module-scripts": "3.1.0",
|
|
99
101
|
"jest": "^29.6.2",
|
|
100
102
|
"jest-environment-jsdom": "^29.6.2",
|
|
101
103
|
"jest-extended": "^4.0.2",
|
|
@@ -104,6 +106,7 @@
|
|
|
104
106
|
"prettier": "^2.0.5",
|
|
105
107
|
"react": "18.2.0",
|
|
106
108
|
"react-native": "0.73.2",
|
|
109
|
+
"react-test-renderer": "^18.2.0",
|
|
107
110
|
"replace-in-file": "^7.0.1",
|
|
108
111
|
"rimraf": "^4.1.1",
|
|
109
112
|
"ts-jest": "^29.1.1",
|
|
@@ -4,6 +4,7 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const process = require('process');
|
|
6
6
|
|
|
7
|
+
const SENTRY_URL = 'SENTRY_URL';
|
|
7
8
|
const SENTRY_ORG = 'SENTRY_ORG';
|
|
8
9
|
const SENTRY_PROJECT = 'SENTRY_PROJECT';
|
|
9
10
|
const SENTRY_AUTH_TOKEN = 'SENTRY_AUTH_TOKEN';
|
|
@@ -111,11 +112,12 @@ try {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
let sentryOrg = getEnvVar(SENTRY_ORG);
|
|
115
|
+
let sentryUrl = getEnvVar(SENTRY_URL);
|
|
114
116
|
let sentryProject = getEnvVar(SENTRY_PROJECT);
|
|
115
117
|
let authToken = getEnvVar(SENTRY_AUTH_TOKEN);
|
|
116
118
|
const sentryCliBin = getEnvVar(SENTRY_CLI_EXECUTABLE) || require.resolve('@sentry/cli/bin/sentry-cli');
|
|
117
119
|
|
|
118
|
-
if (!sentryOrg || !sentryProject) {
|
|
120
|
+
if (!sentryOrg || !sentryProject || !sentryUrl) {
|
|
119
121
|
console.log('🐕 Fetching from expo config...');
|
|
120
122
|
const pluginConfig = getSentryPluginPropertiesFromExpoConfig();
|
|
121
123
|
if (!pluginConfig) {
|
|
@@ -146,6 +148,17 @@ if (!sentryOrg || !sentryProject) {
|
|
|
146
148
|
sentryProject = pluginConfig.project;
|
|
147
149
|
console.log(`${SENTRY_PROJECT} resolved to ${sentryProject} from expo config.`);
|
|
148
150
|
}
|
|
151
|
+
if (!sentryUrl) {
|
|
152
|
+
if (!pluginConfig.url) {
|
|
153
|
+
console.error(
|
|
154
|
+
`Could not resolve sentry url, set it in the environment variable ${SENTRY_URL} or in the '@sentry/react-native' plugin properties in your expo config.`,
|
|
155
|
+
);
|
|
156
|
+
process.exit(1);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
sentryUrl = pluginConfig.url;
|
|
160
|
+
console.log(`${SENTRY_URL} resolved to ${sentryUrl} from expo config.`);
|
|
161
|
+
}
|
|
149
162
|
}
|
|
150
163
|
|
|
151
164
|
if (!authToken) {
|
|
@@ -186,6 +199,7 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) {
|
|
|
186
199
|
...process.env,
|
|
187
200
|
[SENTRY_PROJECT]: sentryProject,
|
|
188
201
|
[SENTRY_ORG]: sentryOrg,
|
|
202
|
+
[SENTRY_URL]: sentryUrl
|
|
189
203
|
},
|
|
190
204
|
stdio: 'inherit',
|
|
191
205
|
});
|
package/src/js/NativeRNSentry.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { UnsafeObject } from './utils/rnlibrariesinterface';
|
|
|
7
7
|
// There has to be only one interface and it has to be named `Spec`
|
|
8
8
|
// Only extra allowed definitions are types (probably codegen bug)
|
|
9
9
|
export interface Spec extends TurboModule {
|
|
10
|
+
addListener: (eventType: string) => void;
|
|
11
|
+
removeListeners: (id: number) => void;
|
|
10
12
|
addBreadcrumb(breadcrumb: UnsafeObject): void;
|
|
11
13
|
captureEnvelope(
|
|
12
14
|
bytes: string,
|
|
@@ -41,6 +43,7 @@ export interface Spec extends TurboModule {
|
|
|
41
43
|
};
|
|
42
44
|
fetchNativePackageName(): string | undefined | null;
|
|
43
45
|
fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;
|
|
46
|
+
initNativeReactNavigationNewFrameTracking(): Promise<void>;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
export type NativeStackFrame = {
|
|
@@ -2,6 +2,8 @@ import type { Package } from '@sentry/types';
|
|
|
2
2
|
import type { TurboModule } from 'react-native';
|
|
3
3
|
import type { UnsafeObject } from './utils/rnlibrariesinterface';
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
|
+
addListener: (eventType: string) => void;
|
|
6
|
+
removeListeners: (id: number) => void;
|
|
5
7
|
addBreadcrumb(breadcrumb: UnsafeObject): void;
|
|
6
8
|
captureEnvelope(bytes: string, options: {
|
|
7
9
|
store: boolean;
|
|
@@ -36,6 +38,7 @@ export interface Spec extends TurboModule {
|
|
|
36
38
|
};
|
|
37
39
|
fetchNativePackageName(): string | undefined | null;
|
|
38
40
|
fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;
|
|
41
|
+
initNativeReactNavigationNewFrameTracking(): Promise<void>;
|
|
39
42
|
}
|
|
40
43
|
export type NativeStackFrame = {
|
|
41
44
|
platform: string;
|
package/ts3.8/dist/js/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type { ReactNativeOptions } from './options';
|
|
|
8
8
|
export { ReactNativeClient } from './client';
|
|
9
9
|
export { init, wrap, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback, withScope, configureScope, } from './sdk';
|
|
10
10
|
export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
|
|
11
|
-
export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, } from './tracing';
|
|
12
|
-
export type { ReactNavigationTransactionContext } from './tracing';
|
|
11
|
+
export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, sentryTraceGesture, TimeToInitialDisplay, TimeToFullDisplay, startTimeToInitialDisplaySpan, startTimeToFullDisplaySpan, } from './tracing';
|
|
12
|
+
export type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';
|
|
13
13
|
export { Integrations, SDK_NAME, SDK_VERSION };
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,4 +8,5 @@ export type { ReactNavigationCurrentRoute, ReactNavigationRoute, ReactNavigation
|
|
|
8
8
|
export { ReactNativeProfiler } from './reactnativeprofiler';
|
|
9
9
|
export { sentryTraceGesture } from './gesturetracing';
|
|
10
10
|
export * from './ops';
|
|
11
|
+
export * from './timetodisplay';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,5 +8,9 @@ export declare class ReactNativeProfiler extends Profiler {
|
|
|
8
8
|
* Get the app root mount time.
|
|
9
9
|
*/
|
|
10
10
|
componentDidMount(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Notifies the Tracing integration that the app start has finished.
|
|
13
|
+
*/
|
|
14
|
+
private _reportAppStart;
|
|
11
15
|
}
|
|
12
16
|
//# sourceMappingURL=reactnativeprofiler.d.ts.map
|
|
@@ -12,9 +12,16 @@ interface ReactNavigationOptions {
|
|
|
12
12
|
* before the transaction is discarded.
|
|
13
13
|
* Time is in ms.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* @default 1000
|
|
16
16
|
*/
|
|
17
17
|
routeChangeTimeoutMs: number;
|
|
18
|
+
/**
|
|
19
|
+
* Time to initial display measures the time it takes from
|
|
20
|
+
* navigation dispatch to the render of the first frame of the new screen.
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
enableTimeToInitialDisplay: boolean;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
27
|
* Instrumentation for React-Navigation V5 and above. See docs or sample app for usage.
|
|
@@ -28,9 +35,11 @@ export declare class ReactNavigationInstrumentation extends InternalRoutingInstr
|
|
|
28
35
|
static instrumentationName: string;
|
|
29
36
|
readonly name: string;
|
|
30
37
|
private _navigationContainer;
|
|
38
|
+
private _newScreenFrameEventEmitter;
|
|
31
39
|
private readonly _maxRecentRouteLen;
|
|
32
40
|
private _latestRoute?;
|
|
33
41
|
private _latestTransaction?;
|
|
42
|
+
private _navigationProcessingSpan?;
|
|
34
43
|
private _initialStateHandled;
|
|
35
44
|
private _stateChangeTimeout?;
|
|
36
45
|
private _recentRouteKeys;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Span, StartSpanOptions } from '@sentry/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Flags of active spans with manual initial display.
|
|
5
|
+
*/
|
|
6
|
+
export declare const manualInitialDisplaySpans: WeakMap<Span, true>;
|
|
7
|
+
export type TimeToDisplayProps = {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
spanName?: string;
|
|
10
|
+
record?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Component to measure time to initial display.
|
|
14
|
+
*
|
|
15
|
+
* The initial display is recorded when the component prop `record` is true.
|
|
16
|
+
*
|
|
17
|
+
* <TimeToInitialDisplay record />
|
|
18
|
+
*/
|
|
19
|
+
export declare function TimeToInitialDisplay(props: TimeToDisplayProps): React.ReactElement;
|
|
20
|
+
/**
|
|
21
|
+
* Component to measure time to full display.
|
|
22
|
+
*
|
|
23
|
+
* The initial display is recorded when the component prop `record` is true.
|
|
24
|
+
*
|
|
25
|
+
* <TimeToInitialDisplay record />
|
|
26
|
+
*/
|
|
27
|
+
export declare function TimeToFullDisplay(props: TimeToDisplayProps): React.ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Starts a new span for the initial display.
|
|
30
|
+
*
|
|
31
|
+
* Returns current span if already exists in the currently active span.
|
|
32
|
+
*/
|
|
33
|
+
export declare function startTimeToInitialDisplaySpan(options?: Exclude<StartSpanOptions, 'op' | 'name'> & {
|
|
34
|
+
name?: string;
|
|
35
|
+
isAutoInstrumented?: boolean;
|
|
36
|
+
}): Span | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Starts a new span for the full display.
|
|
39
|
+
*
|
|
40
|
+
* Returns current span if already exists in the currently active span.
|
|
41
|
+
*/
|
|
42
|
+
export declare function startTimeToFullDisplaySpan(options?: Omit<StartSpanOptions, 'op' | 'name'> & {
|
|
43
|
+
name?: string;
|
|
44
|
+
timeoutMs?: number;
|
|
45
|
+
}): Span | undefined;
|
|
46
|
+
//# sourceMappingURL=timetodisplay.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { HostComponent } from 'react-native';
|
|
3
|
+
import type { RNSentryOnDrawReporterProps } from './timetodisplaynative.types';
|
|
4
|
+
export declare const nativeComponentExists: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* This is a fallback component for environments where the native component is not available.
|
|
7
|
+
*/
|
|
8
|
+
declare class RNSentryOnDrawReporterNoop extends React.Component<RNSentryOnDrawReporterProps> {
|
|
9
|
+
render(): React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare let RNSentryOnDrawReporter: HostComponent<RNSentryOnDrawReporterProps> | typeof RNSentryOnDrawReporterNoop;
|
|
12
|
+
/**
|
|
13
|
+
* Native component that reports the on draw timestamp.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getRNSentryOnDrawReporter: () => typeof RNSentryOnDrawReporter;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=timetodisplaynative.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface RNSentryOnDrawNextFrameEvent {
|
|
3
|
+
newFrameTimestampInSeconds: number;
|
|
4
|
+
type: 'initialDisplay' | 'fullDisplay';
|
|
5
|
+
}
|
|
6
|
+
export interface RNSentryOnDrawReporterProps {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
onDrawNextFrame: (event: {
|
|
9
|
+
nativeEvent: RNSentryOnDrawNextFrameEvent;
|
|
10
|
+
}) => void;
|
|
11
|
+
initialDisplay?: boolean;
|
|
12
|
+
fullDisplay?: boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=timetodisplaynative.types.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IdleTransaction, Span, Transaction } from '@sentry/core';
|
|
2
|
-
import type { TransactionContext, TransactionSource } from '@sentry/types';
|
|
1
|
+
import type { IdleTransaction, Span as SpanClass, Transaction } from '@sentry/core';
|
|
2
|
+
import type { Span, TransactionContext, TransactionSource } from '@sentry/types';
|
|
3
3
|
export declare const defaultTransactionSource: TransactionSource;
|
|
4
4
|
export declare const customTransactionSource: TransactionSource;
|
|
5
5
|
export declare const getBlankTransactionContext: (name: string) => TransactionContext;
|
|
@@ -19,9 +19,14 @@ export declare function getTimeOriginMilliseconds(): number;
|
|
|
19
19
|
/**
|
|
20
20
|
* Calls the callback every time a child span of the transaction is finished.
|
|
21
21
|
*/
|
|
22
|
-
export declare function instrumentChildSpanFinish(transaction: Transaction, callback: (span:
|
|
22
|
+
export declare function instrumentChildSpanFinish(transaction: Transaction, callback: (span: SpanClass, endTimestamp?: number) => void): void;
|
|
23
23
|
/**
|
|
24
24
|
* Determines if the timestamp is now or within the specified margin of error from now.
|
|
25
25
|
*/
|
|
26
26
|
export declare function isNearToNow(timestamp: number): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the duration of the span as a measurement.
|
|
29
|
+
* Uses `setMeasurement` function from @sentry/core.
|
|
30
|
+
*/
|
|
31
|
+
export declare function setSpanDurationAsMeasurement(name: string, span: Span): void;
|
|
27
32
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { NativeModule } from 'react-native';
|
|
2
|
+
import { NativeEventEmitter } from 'react-native';
|
|
3
|
+
export declare const NewFrameEventName = "rn_sentry_new_frame";
|
|
4
|
+
export type NewFrameEventName = typeof NewFrameEventName;
|
|
5
|
+
export type NewFrameEvent = {
|
|
6
|
+
newFrameTimestampInSeconds: number;
|
|
7
|
+
};
|
|
8
|
+
export interface SentryEventEmitter {
|
|
9
|
+
/**
|
|
10
|
+
* Initializes the native event emitter
|
|
11
|
+
* This method is synchronous in JS but the native event emitter starts asynchronously
|
|
12
|
+
* https://github.com/facebook/react-native/blob/d09c02f9e2d468e4d0bde51890e312ae7003a3e6/packages/react-native/React/Modules/RCTEventEmitter.m#L95
|
|
13
|
+
*/
|
|
14
|
+
initAsync: (eventType: NewFrameEventName) => void;
|
|
15
|
+
closeAllAsync: () => void;
|
|
16
|
+
addListener: (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) => void;
|
|
17
|
+
removeListener: (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) => void;
|
|
18
|
+
once: (eventType: NewFrameEventName, listener: (event: NewFrameEvent) => void) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates emitter that allows to listen to native RNSentry events
|
|
22
|
+
*/
|
|
23
|
+
export declare function createSentryEventEmitter(sentryNativeModule?: NativeModule | undefined, createNativeEventEmitter?: (nativeModule: NativeModule | undefined) => NativeEventEmitter): SentryEventEmitter;
|
|
24
|
+
//# sourceMappingURL=sentryeventemitter.d.ts.map
|
|
@@ -4,6 +4,10 @@ import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFrames
|
|
|
4
4
|
import type { ReactNativeClientOptions } from './options';
|
|
5
5
|
import type * as Hermes from './profiling/hermes';
|
|
6
6
|
import type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';
|
|
7
|
+
/**
|
|
8
|
+
* Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getRNSentryModule(): Spec | undefined;
|
|
7
11
|
export interface Screenshot {
|
|
8
12
|
data: Uint8Array;
|
|
9
13
|
contentType: string;
|
|
@@ -58,6 +62,7 @@ interface SentryNativeWrapper {
|
|
|
58
62
|
* Fetches native stack frames and debug images for the instructions addresses.
|
|
59
63
|
*/
|
|
60
64
|
fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;
|
|
65
|
+
initNativeReactNavigationNewFrameTracking(): Promise<void>;
|
|
61
66
|
}
|
|
62
67
|
/**
|
|
63
68
|
* Our internal interface for calling native functions
|