-
Notifications
You must be signed in to change notification settings - Fork 662
Incremental watch host fixes #1453 #1457
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes issues with the incremental watch host functionality by refactoring how the compiler host is shared across different compilation modes. The changes ensure that the same compiler host instance is used consistently for watch mode, incremental compilation, and regular compilation, preventing potential issues with inconsistent state.
Key changes:
- Moved compiler host creation up to the main compilation function to ensure consistent host usage
- Updated function signatures to accept the host as a parameter instead of creating separate instances
- Added a test case for watch mode with incremental compilation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
internal/execute/tsc.go | Refactored to create a single compiler host instance and pass it to all compilation functions |
internal/execute/watcher.go | Updated createWatcher function to accept compiler host as parameter |
internal/execute/tscwatch_test.go | Added test case for watch with tsconfig and incremental compilation |
testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-and-incremental.js | New baseline file for the added test case |
#1457 was supposed to fix the issue; is this PR still needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed by #1455
Oh, yeah #1455 did fix it (I haven't tried it, but it looks about the same)! My fix is a little different in that instead of creating typescript-go/internal/execute/tsc.go Lines 189 to 209 in 5ab1364
it's created before the if/else and then passed in, so it's a little DRYer.
I don't understand the implications of setting typescript-go/internal/execute/watcher.go Line 45 in 5ab1364
That is different than the other places that create Totally happy to close this! |
|
Ok got it, closing. Thanks! |
You'll find that --watch still eats a ton of cpu /cc #1317 |
No description provided.