-
Notifications
You must be signed in to change notification settings - Fork 109
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
Question: Compiler is updating all files all the time #70
Comments
This is the way the Typescript compiler works, so this is expected behavior! Typescript exposes two API's:
There's a great breakdown of the two API's by @mhegazy here. Here's the output from the integration-tests@latest project on my laptop:
It compiled 2056 files in 4954 ms on the first run and then 2056 files in 2625 ms on the second run, not too shabby eh? Having said that, there's always room for improvement, so if you have any suggestions or want to discuss performance improvements I'm all ears! Sorry for the wall of text and I hope i haven't gone off on a tangent here 😃 |
@erikbarke thanks for the fast reply. I have tried on one of my own projects and got the following results: |
BTW: Is there a way to slide in constants similar to what I did with the webpack |
How many seconds does it take to compile your project on the command line with Judging by the issues and comments here there's quite a few |
Running the |
I had a look into the |
Most of the time the compiler spends in a compilation is in doing type-check. type-check is a program-wide operations, since changes to types in one file can result in errors in another. When doing incremental build either through If your commandline compilation with If the issue is just incremental build, then consider 1. using |
@mhegazy thanks, I followed the various suggestions there to speed up me |
@mhegazy here is the stats of my project. It seems that there are too many files processed and way too many lines too. It there a way of making typescript verbose to see which files exactly it is compiling?:
|
--listFiles |
Thanks for this input guys! I'm not sure the LanguageService api is a good fit for this plugin as it's designed mainly for creating code completion etc in IDE's and However, I think it would be possible to introduce some kind of "transpileMode" which would speed up compilation quite a bit for us TDD heads 😃 The plugin currently relies heavily on the Typescript compiler for creating AST's and resolving dependencies, so this functionality will have to be moved to the bundler instead, making the bundler a bit slower on startup, but incremental builds/bundling would probably be almost instant if type checking and resolving is skipped in the compilation step. |
That would be great. And considering source maps: Is there a way to emit and serve source map files. VSCode does not support inline source code as it is included by the bundler (is it really him?) at the moment. |
Off the top of my head I'd say that it should be possible to inject a dummy source map file for each .ts|.tsx file in the project into the Karma file list and output the source map there, instead of as a part of the bundle wrapper! |
@sechel, the bundler relies so much on the Typescript compiler doing the grunt work with resolving dependencies that a "transpileMode" really can't be implemented without breaking the bundling process, and implementing all that logic (already implemented by the Typescript team) in the bundler would take a considerable effort so I'm closing this for now :( |
Does this new |
I have a question: It seems to me that the typescript compiler compiles all files even if I touch only one of the source files. Only the bundler seems to know what really changed. For a big project this seems odd as it may take a lot of time to do this. In a TDD environment this could be frustrating. Is this the expected behaviour? Here is the CLI output of me touching one of the files in the example-project:
The text was updated successfully, but these errors were encountered: