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

Configure non-polling watcher from tsconfig.json #25715

Closed
4 tasks done
lauripiisang opened this issue Jul 17, 2018 · 3 comments
Closed
4 tasks done

Configure non-polling watcher from tsconfig.json #25715

lauripiisang opened this issue Jul 17, 2018 · 3 comments
Assignees
Labels
Suggestion An idea for TypeScript

Comments

@lauripiisang
Copy link

lauripiisang commented Jul 17, 2018

Search Terms

TSC_NONPOLLING_WATCHER , nonpolling, tsconfig

Suggestion

I'd like to be able to configure tsc polling/nonpolling approach from tsconfig.json, instead of being limited to environment variables.

Acceptance Criteria

This feature should be documented, so people know to use it, as it has true performance advantage for some scenarios, e.g.: in docker, even with delegated volumes, on macOs the tsc watcher by default eats 8-10% of CPU just watching files. With TSC_NONPOLLING_WATCHER

Use Cases

Having a central typescript-based framework, with projects based on it, we would like for the users to be able to easily override polling behavior, due to having different environment or issues arising, while retaining the ability to have non polling behavior as the default.

Examples

{
  "compilerOptions": {
    "watch": {
      "useNonPollingWatcher": true,
      "watchFile": "...",
      "watchDirectory": "..."
    }
}

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)
@mhegazy mhegazy added the Suggestion An idea for TypeScript label Jul 17, 2018
@mhegazy mhegazy added this to the TypeScript 3.1 milestone Jul 17, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jul 17, 2018

@sheetalkamat can you add docs for these variables for users to be able to discover and test them.

@lauripiisang
Copy link
Author

Why was this closed? Documentation is merely the first step!

@mhegazy
Copy link
Contributor

mhegazy commented Jul 25, 2018

These settings are global and not per-project. for instance, tsserver uses the same settings, and the server can be handling multiple open projects at the same time. thus, tsconfig is not the correct place to host these configuration options.

alipiry pushed a commit to alipiry/TypeScript-Handbook that referenced this issue Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants