-
-
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
Emitting .tsbuildinfo when using watch api #1017
Conversation
Hey @sheetalkamat, Amazing work! I've been thinking about a good way forward from here. My initial thoughts were that it would be good to get tests running using both watch API and not I started work on 1. and after making some progress I've had a rethink. Whilst we could get the tests working in both modes, doing so would come at the cost of increased complexity in the test packs. The complexity in the test packs is already higher than I'd like and so I'm somewhat reticent to proceed with that. Hence, rethink 😄 I've taken the execution tests for a spin with incremental mode on and by the looks of it they're all green with 2 exceptions: optionsCaching and pnpm. They don't fail meaningfully on CI but at least on Windows they don't appear to be reporting. Travis / Linux is fine. Could you have a quick look at those please? They trigger a weird JScript blocking popup on Windows mentioning a character error in Once those are resolved one way or the other my thoughts are:
There's a possibility that as I'm putting together a PR for 2. problems may present; but hopefully not. If you can help out in the event that that happens that would be great. How does this sound to you? |
I am not that familiar with execution tests so don't know how to make test run in both modes, but I tried running |
Cool - thanks @sheetalkamat; sounds good. By the looks of it the appveyor (windows) tests seem happy now which is a good sign. I'm in a 24 hour hackathon right now and so may not be too active online for a while. (Am learning the hard way that react native is hard work 😄 ) I'll try and check on this later this weekend if I can. By the looks of this we may be ready to merge and release as |
Right - once #1018 is merged (GitHub actions migration to new syntax PR) we'll look to get this shipped. I'll look to make some noise about this on Twitter to encourage people to opt in into trying to use this. |
Shipped with 6.2.0 - thanks @sheetalkamat! I'd love to write a blog post to promote this and get people to opt into using this before doing the 7.0.0 switchover of defaulting people to use the watch API. On that I just wanted to clarify the following points with you before I write the post. As I understand it, with this release:
Is that about right? Please do correct / adjust as necessary! Thanks again! |
Woohoo, thanks @sheetalkamat ! |
@johnnyreilly Yes you have covered it correctly. Thanks for getting this in. |
Excellent - thanks so much @sheetalkamat! I'll put out a blog and try to get people to give this a whirl. Thanks for all your hard work ❤️🌻 |
Hey @sheetalkamat I got a comment on the blog from https://www.twitter.com/danielgut
It looks like he's experiencing problems. I suspect he may not be using project references - Daniel can you confirm please? In fact a repro repo would be helpful Should |
If project has tsconfig options |
Ah cool - thanks @sheetalkamat. I'll update the blogpost |
can't get this to do anything at all. setting incremental or composite doesn't change anyhting. also setting tsBuildInfoFile and outDir didn't change anything. typescript is on 3.6.3 |
executing just |
Thanks for the feedback @OneCyrus. It's interesting that you get nothing at all. I wonder if you could compare your setup with some of the comparison tests that @sheetalkamat put together here: https://github.com/TypeStrong/ts-loader/tree/master/test/comparison-tests As you'll be able to see, these are generating |
couldn't find a incremental example there. but one thing which is different is the |
Good question .... I think @andrewbranch needed to have the I guess it makes sense in that this only works if project has tsconfig options |
I have the same problem: no I am not using project references, but I have added I'm launching webpack via |
Do you have
or similar in your I removed that plugin and i get a I also had to clean out the cache used by |
after further testing it looks like transpileOnly: true disables the tsbuildinfo here. |
it's still very spotty. i can't really build the info-file reliable. also couldn't get to write it with webpack-dev-server at all. also can't see performance improvements after successive builds. the initial build is about 43s while the second build is like 42s. |
@OneCyrus Please share a repro so i can investigate whats going on.. Also please share small repro that's easier to debug.. I just commented at #1005 (comment) where the repro given is too large, but i could see that issue arises with or without transpileOnly set to true |
Ok I think I found scenario that isn't working.. 12b586c Looking into this. |
I'll try to create a repro. I guess a lot of the issues are around that the buildinfo-file is flowing through the regular webpack pipeline. so it is kept in memory when using webpack-dev-server or the babel-cache is keeping it from updating. |
@sheetalkamat i made a repo with some examples: https://github.com/OneCyrus/typescript-incremental the main problem is that i can't get this to work with webpack / webpack-dev-server. with a plain tsc it writes the file. |
@OneCyrus it seems you have |
ok without transpileOnly the simple webpack version works. the one with webpack server still doesn't write the file to disk. another issue i have is the requirement of noEmit: false. we usually don't emit with typescript as we just want the webpack output and don't need the additional files typescript generates.
also declaration: false doesn't work as this is a requirement for incremental.
i've updated the repo with thbe transpile change. |
just tried benchmarking it. bascially running the webpack build 3 times while starting without a tsbuild-file. so basically I expected the first run to take longer than the 2nd or 3rd. but it makes no difference.
|
@johnnyreilly @sheetalkamat I'm having a similar experience as @OneCyrus using webpack 5 beta.6 - successive builds take the same time to build. Running successive production builds with Creation of the |
@thasmo your issue could be same as #1017 (comment) and I am working on the fix and currently blocked on feedback from webpack expert for some of the questions... |
@sheetalkamat, I understand. Thanks for the quick response. |
Updated from #1012