microsoft / microsoft/TypeScript
`importHelpers` generates code, that is incompatible with browsers
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
Currently enabling importHelpers adds
import * as tslib_1 from "tslib";
at the top of every source file.
Such notation is not compatible with browsers. Nowadays, all modern browsers supports Ecma modules, there's no reason for writing code that assumes Node.js environment + bundler build. Code should assume "Ecma modules" environment instead. And bundlers can stop being compilers and do the work they are supposed to do - create optimized builds (if needed at all).
The change is simple, importHelpers should generate:
import * as tslib_1 from "../../../node_modules/tslib/index.js";
The path to "node_modules" should be determined at compile time of course.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den TypeScript-Compiler-Code nachzuverfolgen, der den importHelpers tslib-Import ausgibt. Vergleiche den aktuellen module specifier mit dem angeforderten browser-kompatiblen Pfad und überprüfe anschließend, dass der generierte Import in einer Ecma modules-Umgebung aufgelöst wird und dass der node_modules-Pfad zur Compilezeit bestimmt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100