microsoft / microsoft/TypeScript

Transpiling async/await to generators instead of es6-Generator-function for es6

Aperta
#35,697 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

Search Terms

async await es6 transpile generator

Suggestion

If there was a compile option that i can tell the compiler to emit generators instead of es6-Generator-function when targeting es6.

Use Cases

I have to use 3rd-party libs that implemented in es6,so targeting es5 will not work. But i can't write code with async/await when targeting es6 because the platform on which to run the app dose not support yield/funtion* (but other es6 features's ok).

Examples

Checklist

I try Babel and regenerator, all of them transpile es6 code into es5(or other version), but then I can't use 3rd-party libs. Work round is applying transpilation on libs too.

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

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

L'issue non indica alcun file sorgente, test o punto di ingresso del compilatore. Inizia tracciando il modo in cui TypeScript abbassa async/await per un target ES6 e confronta l'output del generatore richiesto con l'output ES6 attuale. Il lavoro è completato quando un'opzione del compilatore chiaramente definita produce l'output richiesto senza compromettere i target o il comportamento esistenti.

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

Valutazione

Stack tecnologico
javascript, typescript
Ambito
compilers
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.