-
Notifications
You must be signed in to change notification settings - Fork 454
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
chore(compiler): improve typescript compiler #1417
Conversation
Pull Request Test Coverage Report for Build 4087
💛 - Coveralls |
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 was a big one to review!
Nice PR @ahnpnl 🙂
I haven't updated docs for this PR so there will be another PR for that. Besides, right now |
Related to #1310, #1146
What has changed
A new folder
compiler
is introduced. This folder contains an entry pointinstance.ts
which takes care of using different typescript apis to compilets
file: eitherLanguageService
,Program
orisolatedModule
.Each way of using typescript apis has its own respected files.
Most of the codes in the old file
compiler
(for Language Service and transpile module) were kept and moved to their own respected files (language-service.ts
ortranspile-module.ts
)Improve performance when compiling with
LanguageService
, thanks to great idea from Implement getProjectVersion TypeStrong/ts-node#963 (improvement for RFC: Performance report for each ts-jest version #1115 and all related issues mentioned there).Remove
getTypeInfo
since this is not used. Perhaps if someone needs it, we can add it again.Introduce new option in
ts-jest
config:compilerHost
. This option will allow users to use typescriptProgram
orIncremental Program
to compilets
files.What can be done further after this ?
Try out separating emit typescript diagnostics into another node process using worker, see https://github.com/microsoft/TypeScript/wiki/Performance#concurrent-type-checking
Since introducing
Program
orIncremental Program
, we need to get feedbacks from community.LanguageService
should still work normally.