bytecodealliance / bytecodealliance/ComponentizeJS
Semver aware WASI module resolution when dealing with imports
- 主要語言
- Rust
- 星號
- 391
- 分支
- 53
- 平均合併
- 3 天 5 小時
- 30 天內合併 PR
- 1
描述
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).
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從 ComponentizeJS 的 WASI import 解析路徑開始,追蹤對 wasi:http/types@0.2.6 等 import 的現有直接匹配處理。定義精確匹配、在受支援的 WASI 2.x 系列內升級,以及拒絕不相容的較舊版本時應遵循的相容 semver 行為。完成的標準是,所述 import 能夠解析到較新的相容 world,而 jco transpile 不在範圍內。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, rust, wasm
- 領域
- compilers, developer-experience
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 活躍
- 描述清晰度
- 基本清楚
- 新手友好度
- 56/100