microsoft / microsoft/TypeScript

Allow `--noCheck` on the CLI with top-level `--build`

オープン
#58,336 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Domain: tsc -b Experience Enhancement
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

Review comments on #57934 are mostly concerned with --build usage - as an internal option that errors on the CLI/in a config, it can't currently be used with --build without reaching at nonpublic API internals, which also make it difficult to test in a realistic way. That PR adds some psuedo-build tests that baseline current behavior (along the lines of "how will this work once actually exposed"), but current usage is definitely at-your-own-risk (we may even still rename it before it's exposed 😆) - hopefully that's evident by it being @internal. Specifically, @sheetalkamat has expressed concerns that forcibly running a noCheck build via the API (again, nonpublic, unsupported) and then a normal build on the CLI with --build may not work correctly (in that it may not calculate new diagnostics, since outputs are newer than inputs, and the CLI is unaware the last build was run with differing options). This issue with --build on the CLI and other non---build builds (without --incremental) isn't terribly --noCheck specific, and isn't something you should do - but you may be tempted to do because --noCheck is so useful. Just... don't? Wait for us, please. Our @internals are @internal for a reason. 😅

In the future PR where we make it CLI-accessible (after we enable it for JS emit), we should:

  • Ensure it has an appropriate level of .buildinfo invalidation (which should just be the usual tscWatch style tests and accompanying option description fields, probably, though maybe further optimizations are available).

Additionally, we should:

  • Make changes to --build as a whole to allow semantic-affecting diagnostics like --noCheck globally in a project - this is a fairly independent fix, but has much more value with flags like --noCheck that meaningfully change the compiler's performance profile, and seems to require always emitting a .buildinfo for a build, even when it's not incremental, so we at least know the options that last build was made with and if changes to them cause more invalidation than the timestamps otherwise imply. Hopefully our solution here also applies to any API-made builds (in that they should probably also make a .buildinfo), at least through appropriate API layers (we have many). I don't know if this should be a prerequisite to public CLI --noCheck, but it would certainly be nice to have, and many usecases for --noCheck would be unlocked (or made less footgun-y) by this fix.

Those two parts (exposing --noCheck publicly on the CLI and changing --build to invalidate based on options in .buildinfo even when --incremental is false) are likely independent units of future work without a hard dependency on one another, but both are what you want to see to call this issue complete.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、既存の --build および tscWatch スタイルのテストと、issue で言及されている .buildinfo オプションの説明フィールドを確認します。CLI ビルドがオプションを記録し、出力を無効化する仕組みを、API で作成されたビルドも含めて追跡します。完了条件は、最上位の --build で --noCheck を一般公開された形で使用でき、--incremental がなくてもオプションの変更によって必要な無効化が発生することです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
build-system, cli, compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。