microsoft / microsoft/TypeScript
`importHelpers` generates code, that is incompatible with browsers
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、importHelpers の tslib import を出力する TypeScript コンパイラコードを追跡します。現在の module specifier と、要求されたブラウザー互換のパスを比較し、次に生成された import が Ecma modules 環境から解決されること、そして node_modules のパスがコンパイル時に決定されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100