-
-
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 #433, ensure deps not cleared for HMR #471
Conversation
I guess you're looking at the tests? |
Yes, I wonder why I cannot execute comparison test on my local machine. Turns out to be wrong TS version. Working on it. |
Cool |
My initial observation: clearDependencies and addDependency do force refresh webpack rebuild. This is in line with my guess. All test cases fails with at least one patch, which stands for a file change. Yet not all patches fail. The tricky part is: not all change effects compiled output. For example, changing On the other hand, test like I'd rather say it is a trade-off. Forcing rebuild will ensure type/declaration errors up to date. But it also introduces more compiling overhead and breaks HMR. |
It's hard to me to comment too much on the HMR side of things without really digging in deep, but I would say that keeping functionality like You're saying that It's also possible the API changed for webpack2 and you no longer need to At the end of the day though, we need to call |
But sole So to support both dependency watch and HMR would require managing dependencies in ts-loader (which we already have done) and adding declaration file to watch list conditionally (don't know how). |
Pushed further fix. The error diff is trivial. Maybe we need a baseline bump. |
Do you mean the changes in the comparison tests are reasonable and don't represent a regression in functionality? If so, do you want to regenerate the necessary test results? |
Still having two errors remaining... investigating.... |
Remaining failure is due to how ts-loader produces errors. Because changing interface/ type declaration does not change output, so no webpack output is produced. However, every ts-loader error is bound to some module. If not emission is done after compilation, webpack will not produce error. For comparison, awesome-ts-loader does not rely on compilation to report error. |
Would it be possible to switch to that behaviour in ts-loader? I'm keen not to lose error reporting but I don't mind so much how it happens. cc @jbrantly @s-panferov - all opinions / help welcomed! |
Not going well? |
Test is too fragile. An output relies on This conflict makes output annoyingly fickle. Every test run will produce different failure. |
Frustrating... |
Would it be worth having the new functionality behind a |
I have already done that. But it has too much breaking in tests. |
further fix accept new baseline fix error fix issue441 always show errors fix issue372 fix json fix fix ignore built new baseline
26651fc
to
d16f6bd
Compare
This reverts commit d16f6bd.
Discussed in the original issue.