feat(wasm): C5 release-wasm size profile and build reporting

Add opt-level=z/LTO strip profile, print KiB from marqdo wasm build,
optional wasm-opt, and document tree-only browser sessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-01 10:58:42 +08:00
1 parent ab52db2037
commit 04890e0c73
9 files changed
+134 -30

No files matched your search

+14 -16
View File
@@ -2,9 +2,9 @@
| | |
|---|---|
| 状态 | **进行中**(C0–C4 已落地) |
| 状态 | **C0–C5 首轮完结**(会话 bytecode / view 复用仍可加深) |
| 日期 | 2026-09-01 |
| ADR | [0002](../adr/0002-browser-marqdo-wasm.md) · [0003 异步效应](../adr/0003-browser-async-effects.md) |
| ADR | [0002](../adr/0002-browser-marqdo-wasm.md) · [0003](../adr/0003-browser-async-effects.md) |
| 设计 | [browser-marqdo-wasm.md](../design/browser-marqdo-wasm.md) |
| 阶段 | 内容 | 状态 |
@@ -12,25 +12,23 @@
| **C0** | feature 门控;`wasm32` check | **done** |
| **C1** | `run_source` + `mq_run` | **done** |
| **C2** | loader + `marqdo wasm build` | **done** |
| **C3** | `mq_boot`/`mq_call`;wire;`set_text` | **done** |
| **C4** | `fetch` / `after` 效应 + 续体(ADR 0003) | **done** |
| **C5** | bytecode / 体积 / view 调试 | pending |
## C4 — 异步效应
- Bridge:`applyEffects` 识别返回值中的 `fetch` / `after`
- 完成后 `mq_call(then, payload)`,可再链式效应
- 示例:`fetch.html` + `fetch.mq.md`
**验收:** 点「请求 UUID」后 `#status` 出现 httpbin JSON;点「延迟 pong」约 600ms 后显示 `pong`。
| **C3** | session wire + `set_text` | **done** |
| **C4** | `fetch` / `after` 效应 | **done** |
| **C5** | `release-wasm` 体积;`wasm-opt`;`run_source` bytecode 测 | **done**(会话仍 tree) |
## C5
见设计硬化项。
```bash
marqdo wasm build -o examples/browser-hello # prints KiB; wasm-opt if installed
```
- Profile:`release-wasm`(`opt-level=z`, LTO, strip)
- `BrowserSession` 明确拒绝 bytecode(待 VM entry-env)
- 一发 `run_source(..., backend=bytecode)` 单测绿
## 进度
| 日期 | 记录 |
|------|------|
| 2026-09-01 | C0–C3 |
| 2026-09-01 | C4 ADR 0003 + fetch/after demo |
| 2026-09-01 | C0–C4 |
| 2026-09-01 | C5 体积 profile + 文档 |