microsoft / microsoft/TypeScript
Support lib: "baseline-widely-available"
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
"Baseline Widely Available"
✅ Viability Checklist
- 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, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
When creating websites, it is now an industry standard to support Baseline Widely Available JS APIs. Rather than only being able to select an ECMAScript year in the lib config, how about adding "baseline-widely-available" where it updates with each TS release, only allowing JS API and syntax that is marked as Widely Available?
📃 Motivating Example
To ensure that you only use API and syntax supported by all major browsers, you will be able to set:
{
"compilerOptions": {
"lib": ["baseline-widely-available"]
}
}
This means that you can be assured that all the JS you write has been supported for at least 30 months.
💻 Use Cases
- Writing modern websites and always knowing which APIs are available for use.
- You could use ESLint rules to ban too modern JS API but that is an opt-out structure, where this would prevent mistakes at the lowest level, when writing the code.
- Currently using
lib: "ES2022"as this covers the time gap but it's not self-updating and could still include items that some browsers are yet to support in the 30 month version history.
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
Beginnen Sie mit der im Issue beschriebenen Einstellung compilerOptions.lib und vergleichen Sie das angeforderte Verhalten „Baseline Widely Available“ mit der bestehenden Auswahl nach ECMAScript-Jahr. Sehen Sie die verlinkte Baseline-Dokumentation durch, um zu bestimmen, wie qualifizierende APIs und Syntax dargestellt und pro TypeScript-Release aktualisiert werden sollten. Als abgeschlossen gilt die Arbeit, wenn ein definiertes, wartbares lib-Ziel vorhanden ist, das die angegebene Browser-Unterstützungsgarantie durchsetzt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100