microsoft / microsoft/TypeScript
Make standard library types more polyfills‑friendly
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
A significant number of ECMAScript / web standards features that have recently standardized (like Iterator.concat) are still missing from the TypeScript standard library. There are ECMAScript proposals (like Iterator.zip) that are supported by modern browsers but still lack corresponding type definitions. Finally, many projects intentionally target older TypeScript versions with old standard library types.
I am working on types for the core-js polyfill library, which is used on most websites, so it makes a lot of sense to add type definitions for it. While doing this work, I have encountered some significant issues:
-
Some DOM types, for example
URL, are declared as ambient variable declarations with type literals inlib.dom.d.ts. This approach does not allow declaration merging. Possible solution: define them via interfaces (like in ECMAScript types) to allow declaration merging. -
The use of getters/setters. For example,
ArrayBufferdefines the detached property via a getter. This makes it impossible to create a compatible polyfill type for different targets. Similar issues often cause conflicts between different type libraries. In most similar cases, accessors are declared as readonly properties, and this does not cause any problems.
If there were some mechanism for conditional type usage, it could make the standard types more polyfills‑friendly.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、lib.dom.d.ts の ambient 宣言と src/lib/es2024.arraybuffer.d.ts の ArrayBuffer accessor を、リンクされている core-js および ECMAScript proposal のコンテキストと併せて確認します。標準ライブラリの型を polyfill および古い TypeScript ライブラリターゲットと互換にする、合意済みの仕組みと、それに対応するライブラリの変更があれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100