File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -270,6 +270,15 @@ class RNPerfMetrics {
270270 } ) ;
271271 }
272272
273+ stackTraceSymbolicationSucceeded ( specialHermesFrameTypes : string [ ] ) : void {
274+ this . sendEvent ( {
275+ eventName : 'StackTraceSymbolicationSucceeded' ,
276+ params : {
277+ specialHermesFrameTypes,
278+ } ,
279+ } ) ;
280+ }
281+
273282 panelShown ( _panelName : string , _isLaunching ?: boolean ) : void {
274283 // no-op
275284 // We only care about the "main" and "drawer" panels for now via panelShownInLocation(…)
@@ -443,10 +452,18 @@ export type StackTraceSymbolicationFailed = Readonly<{
443452 } > ,
444453} > ;
445454
455+ export type StackTraceSymbolicationSucceeded = Readonly < {
456+ eventName : 'StackTraceSymbolicationSucceeded' ,
457+ params : Readonly < {
458+ specialHermesFrameTypes : string [ ] ,
459+ } > ,
460+ } > ;
461+
446462export type ReactNativeChromeDevToolsEvent =
447463 EntrypointLoadingStartedEvent | EntrypointLoadingFinishedEvent | DebuggerReadyEvent | BrowserVisibilityChangeEvent |
448464 BrowserErrorEvent | RemoteDebuggingTerminatedEvent | DeveloperResourceLoadingStartedEvent |
449465 DeveloperResourceLoadingFinishedEvent | FuseboxSetClientMetadataStartedEvent | FuseboxSetClientMetadataFinishedEvent |
450- MemoryPanelActionStartedEvent | MemoryPanelActionFinishedEvent | PanelShownEvent | PanelClosedEvent | StackTraceSymbolicationFailed ;
466+ MemoryPanelActionStartedEvent | MemoryPanelActionFinishedEvent | PanelShownEvent | PanelClosedEvent |
467+ StackTraceSymbolicationFailed | StackTraceSymbolicationSucceeded ;
451468
452469export type DecoratedReactNativeChromeDevToolsEvent = CommonEventFields & ReactNativeChromeDevToolsEvent ;
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ export function parseSourcePositionsFromErrorStack(
5959
6060 const lines = stack . split ( '\n' ) ;
6161 const linkInfos = [ ] ;
62+ const specialHermesFramesParsed = new Set < SpecialHermesStackTraceFrameTypes > ( ) ;
63+
6264 for ( const line of lines ) {
6365 const match = / ^ \s * a t \s ( a s y n c \s ) ? / . exec ( line ) ;
6466 if ( ! match ) {
@@ -100,6 +102,9 @@ export function parseSourcePositionsFromErrorStack(
100102 const splitResult = Common . ParsedURL . ParsedURL . splitLineAndColumn ( linkCandidate ) ;
101103 const specialHermesFrameType = getSpecialHermesStackTraceFrameType ( splitResult ) ;
102104 if ( splitResult . url === '<anonymous>' || specialHermesFrameType !== null ) {
105+ if ( specialHermesFrameType !== null ) {
106+ specialHermesFramesParsed . add ( specialHermesFrameType ) ;
107+ }
103108 if ( linkInfos . length && linkInfos [ linkInfos . length - 1 ] . isCallFrame && ! linkInfos [ linkInfos . length - 1 ] . link ) {
104109 // Combine builtin frames.
105110 linkInfos [ linkInfos . length - 1 ] . line += `\n${ line } ` ;
@@ -130,6 +135,11 @@ export function parseSourcePositionsFromErrorStack(
130135 } ,
131136 } ) ;
132137 }
138+
139+ if ( linkInfos ?. length ) {
140+ Host . rnPerfMetrics . stackTraceSymbolicationSucceeded ( Array . from ( specialHermesFramesParsed ) ) ;
141+ }
142+
133143 return linkInfos ;
134144}
135145
You can’t perform that action at this time.
0 commit comments