microsoft / microsoft/TypeScript
Move TextEncoder out of lib.dom.d.ts.
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
Search Terms
TextEncoder
Suggestion
Put (window|global).TextEncoder in a library that is automatically available to both browser and nodejs.
Use Cases
TextEncoder now exists on window in all major browsers as well as on global in NodeJS (as of NodeJS 11). At the moment, the TextEncoder definition lives in lib.dom.d.ts which means it isn't available when working on a project/library that is targeting both NodeJS and Browser.
I don't mind submitting a PR, but I don't know where the appropriate location for such a change is, and how to reconcile it properly with removal from lib.dom.d.ts. It isn't part of an annual ES specification, but it should go somewhere that is automatically included in both browser and node now that it is implemented by both. The specification for it can be found at https://encoding.spec.whatwg.org/ and I believe that is what has been implemented in NodeJS.
Checklist
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 could be implemented without emitting different JS based on the types of the expressions
- 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.
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 mit dem Lesen von lib.dom.d.ts und vergleiche die dort für Browser und NodeJS beschriebene Verfügbarkeit von TextEncoder. Erledigt ist es, wenn die Deklaration aus lib.dom.d.ts entfernt und in eine Bibliothek verschoben wird, die für Projekte sowohl im Browser als auch in NodeJS automatisch verfügbar ist; im Issue wird keine Testdatei genannt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- node.js, typescript
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100