-
-
Notifications
You must be signed in to change notification settings - Fork 431
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 SolutionBuilder watches #1003
Conversation
src/instances.ts
Outdated
{ verbose: true, watch: true } | ||
{ verbose: true } | ||
); | ||
loader._compiler.hooks.watchRun.tap( |
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.
I am not sure if this is correct way to do cleanup before watch compilation begins.. Also I think we need to create solutionbuilder host and solutionBuilder both again but I don't know how to check that..
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.
Edit i checked this isnt right way to do this. I think we need to create with watch host when running with --watch. Can someone let me know how to detect that here?
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.
There should be a watchMode
property on the webpack Compiler
object: https://github.com/webpack/webpack/pull/8253/files
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.
I think even with that we need to implement watchFile
as loader.addDepencedency
but that needs more work I think given there are too many places clearing dependencies...
Thanks for this @sheetalkamat! Copied across from linked issue:
From looking at the changes here it mostly seems that be dropping usage of the watch APIs. Swapping from Whilst this fixes the webpack not exiting with project references issue does this mean that watch mode doesn't work for project references with this PR? i.e. If I make a change to a dependent project with this change in place, does that mean that changes will not be picked up / builds retriggered? I'm not totally clear on the intent of this PR and so wanted to clarify. Thanks again so much for your time and work! |
Run in the same issue with hanging webpack. Tested this PR (a2a37c). Just building works - webpack exists. But if webpack is in watch mode, then recompilation works only for the current project, but not for referenced one. Does it make sense to synchronize webpack watch mode with typescript watch mode? |
On the surface it would seem so, no? Are there other contexts other than webpack need to consider as well ? (Personally only ever used ts-loader with webpack) |
I am looking into supporting watch mode separately. This mean while should unblock people that just run webpack |
Makes sense, sounds good to me :) |
src/instances.ts
Outdated
); | ||
// TODO:: handle --watch? |
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.
Ja, if it's tricky, maybe just should roll this out in the short term
I can unblock with kill, but I can't develop without watch mode. Therefore the watch mode is more critical for me than unblocking. But I'm fine if the next version unblocks and the next one fix the watch mode 👍 |
@Bessonov |
I'm happy for this to be merged and released as v6.1.1 - is there anything more to do?
Done it; love that GitHub makes editing a PRs branch possible by default now! Are we good to merge this when Travis / AppVeyor are finished? |
(edit: broke up this for easier reading)
Hrmm, something is up |
Thanks for testing and reporting with detail @sublimator. @sheetalkamat - it looks like there's still issues. |
Looking into it |
Note:: This should fix initial thing but still working on it.. (reporting error and I think watch) |
Are there tests reporting error that I can see sample of to add test to it |
Also note that I know there are tests for project references failing on older build because I was trying to work clean slate.. Once this work is stabilized, will add the deleted code back. |
@sheetalkamat |
I think what you're looking for is a comparison test. There's a specific test that you could clone if you wanted to create a new comparison test which specifically tests for an expected error case: https://github.com/TypeStrong/ts-loader/tree/master/test/comparison-tests/errors Details of how you can work with comparison tests can be found here: https://github.com/TypeStrong/ts-loader/blob/master/test/comparison-tests/README.md Does that give you what you need? |
@johnnyreilly Thank you for the pointer.. That's exactly what I needed.. |
We are green! Are you ready for this to be merged and released @sheetalkamat? |
Will look into --watch today and if that takes longer, we can merge this? Will let you know.. |
|
I tested it. Tsc -b definitely worked for me.
I was on MacOS though.
Currently out at the moment.
Will test again when I get home.
|
Note that the deleted file in my test was in reference project, not the
primary one, if that means anything?
|
Still haven’t tested btw
|
@sublimator have you had chance to test with @sheetalkamat's latest changes? It sounds like we may be there, I'd love to get you to try it out and confirm. |
@johnnyreilly I think this should be it for this PR,., This still doesn't emit |
@sublimator as mentioned at #1003 (comment) deleting js file from referenced project's output is not supported scenario even with |
@sheetalkamat I am referring to a leaf project as per: Although, editing that test project to make the entry point "main" tsconfig.json have compilerOptions Is this a windows vs MacOS thing ?? |
That is the message that indicates to build but does not really build.. Check out the microsoft/TypeScript#30602 as per my earlier comment. that's not something that would be fixed here. |
@sheetalkamat |
Let's get this merged and released. There's been a ton of progress here - thanks so much @sheetalkamat! If there's further things to do they can be addressed subsequently. |
Yeah, don't mean to come off as ungrateful :) |
--watch mode seems to be working, and picking up changes! |
Fixes #998