microsoft / microsoft/TypeScript
Dynamic import breaks global onError with requirejs
Đang mở
@rbuckton đang làm issue này rồi.
Từ ngày 26/6/2019.
Needs Investigation
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.4k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 117
Mô tả
TypeScript Version: 3.2.2
Search Terms: dynamic import, requirejs, amd, onerror
Code
import('module').then(()=>{ /* some code*/ });
compiled to
new Promise(function (resolve_1, reject_1) {
require(['module'], resolve_1, reject_1);
});
If require are called with 3 arguments then require.onError is not fired. Reject should be adeed only in case when we have a catch call after import.
Some propose:
//@ts-import-no-reject
import('module').then(()=>{ /* some code*/ });
new Promise(function (resolve_1) {
require(['module'], resolve_1);
});
Hướng dẫn đóng góp
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.
Đánh giá
Issue này chưa được đánh giá.