microsoft / microsoft/TypeScript

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

Offen
#58,336 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Domain: tsc -b Experience Enhancement
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die vorhandenen Tests im Stil von --build und tscWatch sowie die in der Issue erwähnten Beschreibungsfelder der .buildinfo-Option zu überprüfen. Verfolge, wie CLI-Builds Optionen aufzeichnen und Ausgaben invalidieren, einschließlich über die API erstellter Builds. Als abgeschlossen gilt die Aufgabe, wenn --noCheck mit einem obersten --build öffentlich nutzbar ist und Optionsänderungen auch ohne --incremental die erforderliche Invalidierung auslösen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
build-system, cli, compilers
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.