3.9 KiB
3.9 KiB
4-19 [done] 树域 final status 与 Rust DOM shell 切换记录 v1
更新时间:2026-04-28
本文由
process/1.md归档而来,用于记录design/04-tree-domain当前代码已完成的最终树域收口状态。
执行状态(2026-04-28)
- 口径收口:
task-001至task-009完成的是 Rust/WASM reducer runtime、runtime artifact、route thinning 与 projection hardening;task-010至task-013才是4-18-tree-final-dom-shell-cutover-hard-gate-v1.md定义的 final DOM shell 默认路径切换。 - 默认 host 已从历史
rust_runtime_artifact_host + iframe_srcdoc切到rust_wasm_dom_shell_host + dom_wasm。rust_runtime_artifact_host与data-tree-browser-bridge="iframe_srcdoc"只允许出现在显式 legacy/debug host。 TreeShellHost在rust_family + workspaceId下默认挂载TreeShellRustDomShellHost;旧TreeShellIframeHost只能通过NEXT_PUBLIC_TREE_SHELL_LEGACY_IFRAME_HOST=1进入。- 默认 DOM host 不再调用
LOCAL_TREE_SHELL_TEMPLATE、buildInlinePageTreeHtml、buildInlineFileTreeHtml、buildInlinePickerHtml,也不再把srcDocinline DOM shell 当作成功路径。 - 默认 page / filetree / picker DOM host 标注
data-tree-runtime-artifact-host="rust_tree_shell_runtime_artifact_v1"与data-tree-browser-bridge="dom_wasm"。 - 默认 DOM host 的 page focus / keyboard / expand / collapse / open / context / create / rename / drop,filetree selection / open / context / internal drop / external drop / drop target,以及 picker keyboard / focus / pick,均通过
TreeShellRuntimeRequest/Result消费 WASM artifact 或同源 Rust HTTP seam 返回的 state、hostEvents、commandEvents。 - 旧 JS DOM renderer、inline template、fallback reducer/state machine 已从默认真实流量隔离,只保留在显式 legacy iframe host 内作为短期排障面。
- 默认主路径负向测试已覆盖:
tree-shell-host.test.tsx、tree-shell-surface.test.tsx、move-embed-picker-dialog.test.tsx均断言默认路径不得出现iframe_srcdoc/rust-iframe。 task112-tree-rust-family-regression-smoke.js与task113-picker-keyboard-regression-smoke.js默认验证dom_wasmDOM host;legacy iframe 仅在显式 legacy flag 下兼容。
历史 runtime 阶段保留记录
- Rust/WASM reducer runtime artifact 已落地:
rust/crates/tree-shell-runtime-wasm通过 wasm-bindgen 导出reduceTreeShellRuntime,3000 同源/api/tree-shell-runtime/*发布mnote-tree-shell-runtime.js与mnote-tree-shell-runtime_bg.wasm。 mnote-web与 3000 同源均保留POST /api/tree/runtime/reduceseam;默认 DOM host 优先调用 WASM artifact,HTTP seam 作为同源 Rust fallback/debug。- 历史
TreeShellIframeHost已完成过 page/filetree/picker reducer result 回放、hostEvent/commandEvent 回放、page drop target runtime 收口、picker runtime-first、filetree drop hardening 等切片;这些能力现在作为 legacy/debug host 的保留行为,不再代表默认 DOM shell。
当前保留边界
normalizedMovecompat fallback 已删除;无treeWriteOperation的 move 不再进入主写路径。document.snapshot.saved已作为独立 event type 固定;page.body.saved不再携带 snapshot payload。tree.node.embed的pageReferenceblock 结构与插入位置已迁入 RustpageAggregateEmbedPlan;3000 route 只负责读取源/目标 substrate 快照并作为 preflight 传入。TreeShellIframeHost仍作为显式 legacy/debug host 暂留;默认路径稳定后可继续删除 legacy iframe host 与对应旧测试。- 3000 仍保留挂载、认证、transport、文件字节读取、浏览器 DnD
File[]、菜单状态、实际命令调度、乐观 UI 与副作用通知等浏览器能力边界;这是浏览器公开入口职责,不再代表树域主语义滞留在 Next route。