microsoft / microsoft/TypeScript

Idea: Distinguish between build-signature declarations and for-publication declarations

Aperta
#44,047 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Domain: Performance
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

Some declaration files are intended for publication and they need to be readable and "work" (e.g. no imports from node_modules). Others are, from a user's perspective, basically temporary files produced by the build to make subsequent builds more incremental (i.e. faster). Right now, we produce both sets of declaration files in the same way, but maybe we don't need to? As far as I can tell, the characteristics we require from "build" declarations are:

  1. They change if-and-only-if the API of the underlying code changes
  2. A source map can get you back from the declaration file to the input file

We can satisfy these requirements without, e.g.

  1. Pretty-printing
  2. Adding imports (as in #44044)
  3. Confirming that referenced types are actually accessible (simplifying #44045)
  4. Complaining about node_modules imports

One likely snag is how users will opt in to this behavior (Is it enough to be composite/incremental without having declarations? Is yet another switch required?).

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo la distinzione dell'issue tra build-signature e publication declarations, quindi analizza il comportamento esistente di composite/incremental e declarations. Esamina le discussioni correlate in #44044 e #44045. Il lavoro sarebbe completo quando saranno definiti un design opt-in e un'implementazione che preservino il API-change tracking e la source-map navigation, allentando al contempo i publication-only checks per le build declarations.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
build-system, compilers
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.