-
Notifications
You must be signed in to change notification settings - Fork 81
Add react devtools profiler support #1117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
16e84bb
3b7fa1f
ec87062
2a8028c
d86894c
63f5994
113de3f
785df18
fb7a130
9a00985
fd1dec1
b997d3d
e07db5c
21ee5aa
1c183fd
489cb72
46abb86
7ec2d54
3789e98
206b4a3
d9da576
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -211,6 +211,9 @@ export class Project implements Disposable, ProjectInterface, DeviceSessionsMana | |
| } | ||
| this.updateProjectState({ status: "running" }); | ||
| break; | ||
| case "isProfilingReact": | ||
| this.eventEmitter.emit("isProfilingReact", payload); | ||
| break; | ||
| } | ||
| }; | ||
| //#endregion | ||
|
|
@@ -291,6 +294,18 @@ export class Project implements Disposable, ProjectInterface, DeviceSessionsMana | |
| } | ||
| } | ||
|
|
||
| async startProfilingReact() { | ||
| await this.deviceSession?.devtools.startProfilingReact(); | ||
| } | ||
|
|
||
| async stopProfilingReact() { | ||
| const uri = await this.deviceSession?.devtools.stopProfilingReact(); | ||
| if (uri) { | ||
| // open profile file in vscode using our custom editor | ||
| commands.executeCommand("vscode.open", uri); | ||
|
||
| } | ||
| } | ||
|
|
||
| onProfilingCPUStarted(event: DebugSessionCustomEvent): void { | ||
| this.eventEmitter.emit("isProfilingCPU", true); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| html, | ||
| body, | ||
| #root { | ||
| box-sizing: border-box; | ||
| height: 100%; | ||
| width: 100%; | ||
| margin: 0; | ||
| padding: 0; | ||
| background-color: var(--background); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check
this.socket === wsin that case as well? Doesn't it break in the exact same scenario (i.e. a new connection is started before the previous one closes?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the check was just defensive code as we never call
starInternalmore than once on devtools. But it'd be good to have the same check forthis.socketanyways.