1
1
import type { Scope } from '@sentry/core' ;
2
2
import { getIntegrationsToSetup , Hub , initAndBind , makeMain , setExtra } from '@sentry/core' ;
3
- import { RewriteFrames } from '@sentry/integrations' ;
4
3
import {
5
4
defaultIntegrations as reactDefaultIntegrations ,
6
5
defaultStackParser ,
7
6
getCurrentHub ,
8
7
makeFetchTransport ,
9
8
} from '@sentry/react' ;
10
- import type { Integration , StackFrame , UserFeedback } from '@sentry/types' ;
9
+ import type { Integration , UserFeedback } from '@sentry/types' ;
11
10
import { logger , stackParserFromStackParserOptions } from '@sentry/utils' ;
12
11
import * as React from 'react' ;
13
12
@@ -22,6 +21,7 @@ import {
22
21
Release ,
23
22
SdkInfo ,
24
23
} from './integrations' ;
24
+ import { createReactNativeRewriteFrames } from './integrations/rewriteframes' ;
25
25
import { Screenshot } from './integrations/screenshot' ;
26
26
import { ViewHierarchy } from './integrations/viewhierarchy' ;
27
27
import type { ReactNativeClientOptions , ReactNativeOptions , ReactNativeWrapperOptions } from './options' ;
@@ -107,29 +107,7 @@ export function init(passedOptions: ReactNativeOptions): void {
107
107
defaultIntegrations . push ( new DebugSymbolicator ( ) ) ;
108
108
}
109
109
110
- defaultIntegrations . push ( new RewriteFrames ( {
111
- iteratee : ( frame : StackFrame ) => {
112
- if ( frame . filename ) {
113
- frame . filename = frame . filename
114
- . replace ( / ^ f i l e : \/ \/ / , '' )
115
- . replace ( / ^ a d d r e s s a t / , '' )
116
- . replace ( / ^ .* \/ [ ^ . ] + ( \. a p p | C o d e P u s h | .* (? = \/ ) ) / , '' ) ;
117
-
118
- if (
119
- frame . filename !== '[native code]' &&
120
- frame . filename !== 'native'
121
- ) {
122
- const appPrefix = 'app://' ;
123
- // We always want to have a triple slash
124
- frame . filename =
125
- frame . filename . indexOf ( '/' ) === 0
126
- ? `${ appPrefix } ${ frame . filename } `
127
- : `${ appPrefix } /${ frame . filename } ` ;
128
- }
129
- }
130
- return frame ;
131
- } ,
132
- } ) ) ;
110
+ defaultIntegrations . push ( createReactNativeRewriteFrames ( ) ) ;
133
111
if ( options . enableNative ) {
134
112
defaultIntegrations . push ( new DeviceContext ( ) ) ;
135
113
}
0 commit comments