Skip to content
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

[vscode] Make the Relay Compiler Terminal Transient #4455

Closed

Conversation

ianobermiller
Copy link
Contributor

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.

Test Plan:

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

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.

Test Plan:

- Debug on a project with `"relay.autoStartCompiler": true`
- Reload the window
- Note there is only one "Relay Compiler" terminal
@ianobermiller ianobermiller changed the title VS Code Extension: Make the Relay Compiler Terminal Transient [vscode] Make the Relay Compiler Terminal Transient Sep 29, 2023
@Lalitha-Iyer
Copy link
Contributor

cc @tbezman @captbaritone is this something you could help review and merge? Thanks!

@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@captbaritone
Copy link
Contributor

Awesome! Thanks for tracking this down.

@tobias-tengler
Copy link
Contributor

Just wanted to add my two cents: The compiler startup time depends on the size of your application. For us it takes 20-30 seconds. I would image it takes even longer in larger code bases. Would be cool if there was a solution that didn't require the compiler to restart.

@ianobermiller
Copy link
Contributor Author

@tobias-tengler The only thing I can think of would be if we could somehow query the relay compiler process, but that seems quite complicated. Considering that a VS Code reload already restarts things like ESLint and TypeScript, this brings nice parity, but that is a good point that startup is not always fast.

@captbaritone
Copy link
Contributor

I think this change is better than the current state, and restarting is probably not too common. Let's start here.

@facebook-github-bot
Copy link
Contributor

@captbaritone merged this pull request in f67e9c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants