microsoft / microsoft/TypeScript
Support for Import Maps
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 132
Mô tả
🔍 Search Terms
import, map, path, alias, scope
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
I'm curious to hear thoughts on introducing an importMap option in compilerOptions.
Some initial thoughts:
- Import maps are a WICG standard.
- They can effectively replace
pathsfor most use cases. - They're supported by Deno.
- Projects with colocated Node and Deno workspaces could leverage the same source of truth regarding imports/aliases.
- Import maps provide the ability to configure
scopes(extremely useful in my experience)
📃 Motivating Example
Every project that utilizes import maps.
💻 Use Cases
- What do you want to use this for?
Simplifying my configuration in projects that contain both Node and Deno workspaces.
- What shortcomings exist with current approaches?
One needs to re-specify their aliases in numerous places.
- What workarounds are you using in the meantime?
N/A
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.
Hướng nghiên cứu
Bắt đầu bằng cách đọc cách xử lý hiện có của compilerOptions đối với paths và hành vi của module-resolution mà import maps sẽ ảnh hưởng. So sánh tùy chọn importMap được đề xuất với các aliases và scopes của import-map, sau đó xác định cấu hình được hỗ trợ và hành vi tương thích trước khi triển khai; được xem là hoàn tất khi có một thiết kế đã được xem xét, bao quát trường hợp sử dụng workspace của Node và Deno đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, typescript
- Lĩnh vực
- compilers
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100