Migrating to ESM only

Đang mở
#703 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
build-system, release

Hướng nghiên cứu

Rà soát package.json và bố cục hiện tại của dist/, libjs/ và libesm/ để lập bản đồ các entry point, kiểu và sourcemap hiện có. So sánh metadata của package và nội dung đã phát hành, sau đó xác định quá trình migration lên major version để dist/ là entry point ES module duy nhất và xác nhận các thay đổi sourcemap dự kiến trước khi triển khai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
9.2k
Fork
555
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của kpdecker/jsdiff

Tất cả issue của kpdecker/jsdiff

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.