Deprecate `td.function` in favor of `td.func`
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
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, rollup, webpack
- Lĩnh vực
- api, build-system, documentation
Hướng nghiên cứu
Start by tracing the current package exports and build setup, then compare how webpack, Rollup, and Browserify handle the proposed ES-module and CommonJS shapes. Done means preserving the intended top-level distribution API and tree shaking, documenting td.func(), and deciding when td.function should be removed in a major release.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Terrible luck to discover this after releasing 2.0.0, but subsequent improvements to the build have made me realize that the cute way we do this:
module.exports = { function: require('./function') /*...*/ }
Just won't fly in ES module-land, where something like this:
export { function }
Will blow up because it's a reserved word. (import {function} from 'testdouble' also blows up)
We can do:
export default {
function: tdFunction
}
But then any module/bundler like webpack/rollup/browserify is going to have that default tacked onto it, which means that our distribution will be td.default.object or whatever.
I hope we can find some workaround to use ES exports exclusively and then solve this with build cleverness using one of the bundlers, but even if we do manage, having a top-level API that's a reserved word is probably not a great long-term play.
Goals:
- hack up some short-term win with a bundler that'll let us still get tree shaking while using a CJS export at the top level or a way to modify the bundled content to
td = td.defaultdynamically. - documentation change from
td.function()totd.func() - figure out how soon we want to think about dropping
td.functionwith another major bump.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.4k
- Fork
- 140
- Merge trung bình
- 5 giờ 55 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testdouble/testdouble.js
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
testdouble/testdouble.js#538 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
testdouble/testdouble.js#537 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
testdouble/testdouble.js#536 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
testdouble/testdouble.js#534 ·
-
`npm-run-all` to `npm-run-all2`Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 45/100
testdouble/testdouble.js#533 ·
Tất cả issue của testdouble/testdouble.js
Issue tương tự
-
新讀者走讀回報,照著一篇文章實際操作Đang mởdocumentation good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
lirantal/discoprint#29 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RSS feed autodiscoveryĐang mởfeature-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
louislam/uptime-kuma#7914 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Code Cleanup dependencies
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
ProjectSidewalk/SidewalkWebpage#5609 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OWASP/cornucopia#3538 ·
Maintainer thường phản hồi trong vòng 1 ngày