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

fix: remove TSC_NONPOLLING_WATCHER env variable and provide default watchOptions #1326

Merged
merged 1 commit into from
May 4, 2021

Conversation

atscott
Copy link
Collaborator

@atscott atscott commented May 4, 2021

patch version of #1323

TSC_NONPOLLING_WATCHER was used back in the early days to improve
file watcher performance, but it prevents files / directories from
being moved / renamed.
Since TS now provides built-in option to configure file watcher, this
environment variable is no longer needed.

See https://www.typescriptlang.org/docs/handbook/configuring-watch.html

The watch options used are derived from the user defined options in
their tsconfig combined with the default options provided to the
project service via setHostConfiguration
(code reference).

As noted in the documentation for configuration watch options, the
default when no watch options are provided falls back to fs.watchFile
with 250ms for any file. This would cause the performance issues as
seen in #1310.

Fixes #750

…atchOptions (angular#1323)

`TSC_NONPOLLING_WATCHER` was used back in the early days to improve
file watcher performance, but it prevents files / directories from
being moved / renamed.
Since TS now provides built-in option to configure file watcher, this
environment variable is no longer needed.

See https://www.typescriptlang.org/docs/handbook/configuring-watch.html

The watch options used are derived from the user defined options in
their `tsconfig` combined with the default options provided to the
project service via `setHostConfiguration`
([code reference](https://github.com/microsoft/TypeScript/blob/f7ef1540d3c10fb282d1d433d9f2850b28391169/src/server/editorServices.ts#L2985-L2989)).

As noted in the documentation for configuration watch options, the
default when no watch options are provided falls back to `fs.watchFile`
with `250ms` for any file. This would cause the performance issues as
seen in angular#1310.

Fixes angular#750
@atscott atscott added the target: patch This PR is targeted for the next patch release label May 4, 2021
@google-cla google-cla bot added the cla: yes label May 4, 2021
@atscott atscott added the action: merge Ready to merge label May 4, 2021
@atscott atscott merged commit bbd0c60 into angular:11.2.x May 4, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge Ready to merge cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants