Skip to content

Commit

Permalink
Make the Relay Compiler Terminal Transient (#4455)
Browse files Browse the repository at this point in the history
Summary:
If you enable `relay.autoStartCompiler`, the extension will open a compiler in a new Terminal on every VS Code reload (e.g. Developer: Reload Window). This can easily lead to many copies of the compiler running.

Instead, we can mark the terminal with `isTransient`, and it won't survive reloads. While this means reloads must restart the compiler, it is very fast and this avoid many "Relay Compiler" terminals.

Pull Request resolved: #4455

Test Plan:
- Debug on a project with `"relay.autoStartCompiler": true`
- Reload the window
- Note there is only one "Relay Compiler" terminal

Reviewed By: alunyov

Differential Revision: D50021664

Pulled By: captbaritone

fbshipit-source-id: 8f725eff1d5e76d98e689641ee64c6a81b587a06
  • Loading branch information
ianobermiller authored and facebook-github-bot committed Oct 6, 2023
1 parent 1d9b120 commit f67e9c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vscode-extension/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function createAndStartCompiler(context: RelayExtensionContext) {
const terminal = window.createTerminal({
name: 'Relay Compiler',
cwd: context.relayBinaryExecutionOptions.rootPath,
isTransient: true,
});

terminal.sendText(
Expand Down

0 comments on commit f67e9c5

Please sign in to comment.