forked from react-native-community/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from MLH-Fellowship/test/transformer
Integrated transformer tool into CLI
- Loading branch information
Showing
9 changed files
with
669 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
import {EventsPhase} from './Phases'; | ||
|
||
export interface SharedEventProperties { | ||
/** | ||
* name of the event | ||
*/ | ||
name?: string; | ||
/** | ||
* event category | ||
*/ | ||
cat?: string; | ||
/** | ||
* tracing clock timestamp | ||
*/ | ||
ts?: number; | ||
/** | ||
* process ID | ||
*/ | ||
pid?: number; | ||
/** | ||
* thread ID | ||
*/ | ||
tid?: number; | ||
/** | ||
* event type (phase) | ||
*/ | ||
ph: EventsPhase; | ||
/** | ||
* id for a stackFrame object | ||
*/ | ||
sf?: number; | ||
/** | ||
* thread clock timestamp | ||
*/ | ||
tts?: number; | ||
/** | ||
* a fixed color name | ||
*/ | ||
cname?: string; | ||
/** | ||
* event arguments | ||
*/ | ||
args?: {[key in string]: any}; | ||
} | ||
|
||
interface DurationEventBegin extends SharedEventProperties { | ||
ph: EventsPhase.DURATION_EVENTS_BEGIN; | ||
} | ||
|
||
interface DurationEventEnd extends SharedEventProperties { | ||
ph: EventsPhase.DURATION_EVENTS_END; | ||
} | ||
|
||
export type DurationEvent = DurationEventBegin | DurationEventEnd; | ||
|
||
export type Event = DurationEvent; | ||
|
||
/** | ||
* Each item in the stackFrames object of the hermes profile | ||
*/ | ||
export interface HermesStackFrame { | ||
line: string; | ||
column: string; | ||
funcLine: string; | ||
funcColumn: string; | ||
name: string; | ||
category: string; | ||
/** | ||
* A parent function may or may not exist | ||
*/ | ||
parent?: number; | ||
} | ||
/** | ||
* Each item in the samples array of the hermes profile | ||
*/ | ||
export interface HermesSample { | ||
cpu: string; | ||
name: string; | ||
ts: string; | ||
pid: number; | ||
tid: string; | ||
weight: string; | ||
/** | ||
* Will refer to an element in the stackFrames object of the Hermes Profile | ||
*/ | ||
sf: number; | ||
stackFrameData?: HermesStackFrame; | ||
} | ||
|
||
/** | ||
* Hermes Profile Interface | ||
*/ | ||
export interface HermesCPUProfile { | ||
traceEvents: SharedEventProperties[]; | ||
samples: HermesSample[]; | ||
stackFrames: {[key in string]: HermesStackFrame}; | ||
} | ||
|
||
export interface CPUProfileChunk { | ||
id: string; | ||
pid: number; | ||
tid: string; | ||
startTime: number; | ||
nodes: CPUProfileChunkNode[]; | ||
samples: number[]; | ||
timeDeltas: number[]; | ||
} | ||
|
||
export interface CPUProfileChunkNode { | ||
id: number; | ||
callFrame: { | ||
line: string; | ||
column: string; | ||
funcLine: string; | ||
funcColumn: string; | ||
name: string; | ||
url?: string; | ||
category: string; | ||
}; | ||
parent?: number; | ||
} | ||
|
||
export type CPUProfileChunker = { | ||
nodes: CPUProfileChunkNode[]; | ||
sampleNumbers: number[]; | ||
timeDeltas: number[]; | ||
}; | ||
|
||
export interface SourceMap { | ||
version: string; | ||
sources: string[]; | ||
sourceContent: string[]; | ||
x_facebook_sources: {names: string[]; mappings: string}[] | null; | ||
names: string[]; | ||
mappings: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export enum EventsPhase { | ||
DURATION_EVENTS_BEGIN = 'B', | ||
DURATION_EVENTS_END = 'E', | ||
COMPLETE_EVENTS = 'X', | ||
INSTANT_EVENTS = 'I', | ||
COUNTER_EVENTS = 'C', | ||
ASYNC_EVENTS_NESTABLE_START = 'b', | ||
ASYNC_EVENTS_NESTABLE_INSTANT = 'n', | ||
ASYNC_EVENTS_NESTABLE_END = 'e', | ||
FLOW_EVENTS_START = 's', | ||
FLOW_EVENTS_STEP = 't', | ||
FLOW_EVENTS_END = 'f', | ||
SAMPLE_EVENTS = 'P', | ||
OBJECT_EVENTS_CREATED = 'N', | ||
OBJECT_EVENTS_SNAPSHOT = 'O', | ||
OBJECT_EVENTS_DESTROYED = 'D', | ||
METADATA_EVENTS = 'M', | ||
MEMORY_DUMP_EVENTS_GLOBAL = 'V', | ||
MEMORY_DUMP_EVENTS_PROCESS = 'v', | ||
MARK_EVENTS = 'R', | ||
CLOCK_SYNC_EVENTS = 'c', | ||
CONTEXT_EVENTS_ENTER = '(', | ||
CONTEXT_EVENTS_LEAVE = ')', | ||
// Deprecated | ||
ASYNC_EVENTS_START = 'S', | ||
ASYNC_EVENTS_STEP_INTO = 'T', | ||
ASYNC_EVENTS_STEP_PAST = 'p', | ||
ASYNC_EVENTS_END = 'F', | ||
LINKED_ID_EVENTS = '=', | ||
} |
Oops, something went wrong.