bytecodealliance / bytecodealliance/ComponentizeJS
Semver aware WASI module resolution when dealing with imports
- Ngôn ngữ chính
- Rust
- Star
- 391
- Fork
- 53
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Right now when building components with ComponentizeJS, we deal with references WASI types via direct match only.
This is usually fine but forces certain versions (the ones supported by StarlingMonkey below) to be used. Ideally we should be able to do an exact match where possible and the fall back to a compatible semver track (usually allowing upgrades but not downgrades) similar to what wasmtime would do.
As WASI 2.x is unlikely to change going forward I think we can now do this pretty definitively here, with minimal changes required for StarlingMonkey as well.
Also note that while this issue is probably going to be unnecessary when the "new" ComponentizeJS lands, this issue is here for tracking purposes just to make sure this
A simple use case is being able to write `wasi:http` components against any version of 2.x and having that compile (and eventually `jco transpile`, but that's out of scope here!) properly. Essentially the following should never fail:
```js
import { Fields } from "wasi:http/types@0.2.6";
```
(Even if the underlying world is 2.10/2.12, but this should fail if the underlying world is 2.4 probably)
Maybe it should be possible to disable this feature (i.e. supporting very specific imports), but IMO this would be a big DX improvement that is worth doing (maybe we emit some warnings or something if we're worried about it).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu từ đường dẫn phân giải import WASI của ComponentizeJS và theo dõi cách xử lý hiện có đối với các kết quả khớp trực tiếp cho những import như wasi:http/types@0.2.6. Xác định hành vi semver tương thích cho các kết quả khớp chính xác, việc nâng cấp trong nhánh WASI 2.x được hỗ trợ và việc từ chối các phiên bản cũ hơn không tương thích. Hoàn thành có nghĩa là import đã nêu được phân giải với các world tương thích mới hơn, còn jco transpile nằm ngoài phạm vi.
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, rust, wasm
- Lĩnh vực
- compilers, developer-experience
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 56/100