Skip to content

Fixes issues with reload because of output emit #39030

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

Merged
merged 4 commits into from
Jun 16, 2020
Merged

Conversation

sheetalkamat
Copy link
Member

This has two changes:
1020ea2 ensure that if there is no change in folder structure, only files are added or removed the directory watcher is invoked with those fileNames and other wise its invoked with directory name being watched since the watches on child are updated at later time, we wouldn't know comprehensive list of changes. This change helps in optimizing in not having to refresh program when we get better paths for file or directories added

a37585e unifies the logic to ignore wild card directory watch call back invoke. It checks if the file is excluded by config or output file next to the input file so that those emits can be ignored.

Note :
2cf6d4f shows testcase where rootFile thats being renamed invokes file watcher first and update happens... after which the actual directory watcher is invoked.. so there is intermittent program update that still includes file to be renamed but that file is deleted from the disk. So the error is that file not found. After wild card directory update (because of async nature of the directory watching update) the correct error is shown (module not found).
I did consider having to update the filenames if fileWatcher was invoked with file created with deleted but given that the update eventually happens i think it would be extra cost to bet the new files names from the disk on such events for the config and hence decided to keep it as is. Note that before this fix the correct error was never shown till you invoke tsc again.

Fixes #37994, #38684

@sheetalkamat
Copy link
Member Author

Ping.. I want to get this in and there is another PR I am working on that depends on this.

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.

Typescript recompile app two times in watch mode with non recursive watching on os like linux
4 participants