Migrating to ESM only

オープン
#703 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
javascript

調査の方向性

package.json と現在の dist/、libjs/、libesm/ のレイアウトを確認し、既存のエントリーポイント、型、sourcemap を整理します。パッケージメタデータと公開済みの内容を比較し、そのうえで dist/ を唯一の ES module エントリーポイントとするメジャーバージョン移行を定義し、実装前に予定している sourcemap の変更を確認します。

索引モデルが issue の本文から書いたものです。

説明

Hello 👋

today, this package has multiple copies/entries in it:

  • dist/diff.js - a UMD bundle
    • Only exposed under package.json#browser and package.json#unpkg keys
    • Suggests this is the browser bundle
  • dist/diff.min.js - the same UMD bundle minified
  • libjs/ - a CommonJS entry point
    • Includes types
    • Includes sourcemaps
  • libesm/ - an ES module entry point
    • Includes types
    • Includes sourcemaps

Times have changed a bunch since this package was created. We're now in a situation where:

  • All browsers support ES modules
  • All runtimes (e.g. Node, Bun, etc.) support ES modules
  • CommonJS projects in Node can require(esm) an ES module
  • Most web projects today are using a bundler

So it seems there's opportunity here for a new major one day which dumbs this down to:

  • dist/ - an ES module entry point
    • Includes types
    • Includes sourcemaps

would love to hear your thoughts on this @kpdecker 🙏

an extra win from this could also be to stop shipping sourcemaps (which account for a large % of the tarball size we pull from npm). The code is already readable, unminified, and has type definitions. So we're not gaining much from shipping them.

主要言語
JavaScript
スター
9.2k
フォーク
555
平均マージ
1日 9時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kpdecker/jsdiff のほかの issue

kpdecker/jsdiff の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。