microsoft / microsoft/TypeScript
'Compile on save' feature for TypeScript slower than a Rebuild
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
When I change a TS file and save it, most of the times will Visual Studio start "compiling" all TS files in the project directory. It starts looping through all the files, and the status bar shows the following for each file:
Generation of '..... ts' complete. Remaining files still compiling.
And it finishes with the message:
Output(s) generating successfully.
I have 493 TS files in total, in several VS projects, in the same directory, and the recompiling takes 50 seconds to complete, after each save. Yet, a complete project rebuild takes only 25 seconds. This means that the compile-on-save feature is not usable (for me), and most of the times I will have to rebuild my entire project after each change in order to save time.
The first problem that I see is that all existing TS files in the project directory are recompiled, regardless if they are part of the current project or not. It would have been better to recompile only the files included in the current project -- that would save some time.
The second problem is that most of the time there is no need to recompile all files after a small change -- only the changed file should be recompiled. Sometimes, VS detects that situation and does just that, but rarely. Most of the times it recompiles all files, completely needless. VS should analyze better if all the files need to be recompiled, or just the changed file. In my case, I would be quite satisfied if I had a setting to limit the compile-on-save feature only to the changed file. When I want all files to be compiled I can just rebuild the project myself -- an automatic feature for that is not that usefull.
Original Comments
Feedback Bot on 1/26/2021, 06:04 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Benjamin Lichtman [MSFT] on 1/27/2021, 10:30 AM:
Thank you for your feedback!
Where possible, the compile-on-save feature should only recompile necessary files.
However, this is sometimes not possible - for example, when values are defined globally (as opposed to within modules), it is very difficult to track the impact of changes, and so we conservatively recompile all possibly impacted files.
In order for us to investigate this further, could you please provide us with log files so that we can conduct further research?
- Please follow the instructions below in the “Enable detailed language service logging” section to collect the log files.
- After reproducing the problem, log files should be created in the folder specified.
- Upload these files to this feedback by replying and inserting the files using the insert (attach) button.
We look forward to hearing from you!
Remus Vasii on 1/29/2021, 09:24 AM:
(private comment, text removed)
Original Solutions
(no solutions)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リポジトリのファイルやテストは指定されていません。Issue にリンクされている詳細な language service のロギング手順から始め、複数プロジェクトのディレクトリで compile-on-save を再現し、関係のないファイルが再ビルドされる理由を特定するためにログを調べてください。完了の条件は、compile-on-save が現在のプロジェクトと必要な変更済みファイルに作業を限定するか、変更済みファイルのみをコンパイルする設定を提供することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- build-system, developer-experience
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100