Hey all. I want to suggest you some improvements, please tell me what do you think about it.
I think that typescript loader should not be loader at all :) I think it should be plugin + loader, where plugin startup tsserver, and loader communicate with it (as vscode do). This improvement could significant improve performance of the build, because typescript compilation process would not break webpack process, as tssserver would start in separate process.
Sounds interesting - I'm guessing this would significantly increase the complexity though? I'm not familiar with VSCode's codebase and so can't say I understand the implications of the proposed change.
Of coulrse this would increase complexity, we should interop with tsserver, this could be tricky.
Feel free to have a go implementing this in a fork. I'd be really interested to see what the results look like. We could take a view then as to whether any added complexity "earns it keep" in terms of performance / stability. Could be interesting!
Why? I wonder.
tsserver is based on typescript service, so you will not gain performance benefit if ts-loader is optimally implemented. For example, ts-loader also implements a selective compilation like tsserver. I think you know the best :). https://github.com/TypeStrong/ts-loader/pull/187/files
Using tsserver means you will lose a lot of customization available only in service. Also, vscode is a code editor. But ts-loader is a webpack loader. They are fundamentally different.
I've already tried this approach in awesome-typescript-loader, I can share the code with you. In fact, it significantly _slower_ (2-3 times) in webpack cases and also right now tsserver don't have commands to emit files with response back to client:
Thanks for sharing that link @s-panferov - I'd not seen that conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing as stale. Please reopen if you'd like to work on this further.
Most helpful comment
I've already tried this approach in awesome-typescript-loader, I can share the code with you. In fact, it significantly _slower_ (2-3 times) in webpack cases and also right now tsserver don't have commands to emit files with response back to client:
https://github.com/Microsoft/TypeScript/issues/11468