Supporting a 'wasm:' prefix on imports
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, wasm
- 领域
- tooling
调研方向
首先阅读 ComponentizeJS issue 的讨论,并跟踪其中所示的 JavaScript imports 是如何处理的,包括被描述为位于 ComponentizeJS 上方和下方的更改。只有在社区就前缀达成一致,并且所选形式能够端到端地用于 WASI 或 WebAssembly 组件 imports 后,工作才算完成。
由索引模型根据 Issue 内容生成。
描述
Right now, code that uses imports via WASI look like regular imports, with the package name being the first indicator:
import { someFn } from "ns:pkg/iface@0.1.0";
export const run = {
run() { ... }
}
This works, but I think going forward life for embedders and tooling/ecosystem projects will be much easier if we prefix these imports with wasi: (or something similar) to note them/control how the imports are done.
The idea is that the above code would turn into:
import { someFn } from "wasi:ns:pkg/iface@0.1.0";
export const run = {
run() { ... }
}
There are other ways to indicate the type of an import/control (i.e. import attributes, for example) , but prefixing with wasi: is incredibly simple and offers a point of leverage -- being able to easily tell which imports are "wasi"/underlying paltform imports. This mirrors the convention of node: as an import prefix which is used in more modern code bases (i.e. from "node:fs" rather than from "fs").
Changes may be required "below" and "above" componentize JS to make this work, but I figure that ComponentizeJS is a good place to discuss and eventually start this work.
[EDIT] I changed the title to wasm since wasi is clearly not the right prefix -- wasm:, wit:, component: or something else are clearly more correct, though it's not exactly clear which is best.
- 主要语言
- Rust
- 星标
- 392
- 派生
- 54
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/ComponentizeJS 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
enhancement
难度 4/5 3-5 天 新手友好度 56/100
-
难度 3/5 1-2 天 新手友好度 52/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
bytecodealliance/ComponentizeJS#335 · 3 条评论 ·
查看 bytecodealliance/ComponentizeJS 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2413 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
todo:ticket
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
taikoxyz/taiko-mono#22168 · 1 条评论 ·