microsoft / microsoft/TypeScript

Add ability to get emit output from the API

Offen
#63,851 0 Kommentare 2 Reaktionen 1 zugewiesene Person Beansprucht von @andrewbranch Auf GitHub ansehen
Needs Investigation
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

Our internal tool uses the TypeScript compiler to generate JS output from TS. While there are other solutions that perform TS->JS transpilation, since we already use the TS API we would like to also get the JS output from it (as well as declarations and source maps). In the Strada API this was possible using `program.emit`.

Possible solution: Add back the `program.emit` method. Instead of accepting a write-file callback (which would incur IPC overhead per file when called from Go), return the output files as an array in the response. The method should also accept an array of files so that multiple files can be emitted in a single round-trip.

Limitation: This approach currently would not allow us to get the tsbuildinfo file with the per file variant. Then again the API currently does not seem to use incremental programs anyway.

Related: microsoft/TypeScript#63843 similar, but only mentions declaration files.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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