diff options
Diffstat (limited to 'docs/web.md')
| -rw-r--r-- | docs/web.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/web.md b/docs/web.md index 339509d2..ddc09d35 100644 --- a/docs/web.md +++ b/docs/web.md @@ -31,6 +31,30 @@ zig build web \ The output is in `zig-out/web`. Serve that directory over HTTP; browsers do not allow a useful WASM module load from `file:` URLs. +The browser shell has no argv: every command-line flag `src/main.zig` parses — +`--tty`, `--tty-toggle`, `-n`, `-l`, `--nested`, `-h`, and the positional +file-or-directory — is native-only, because the wasm module roots at +`src/web.zig` and never links `main.zig`. State comes from the embedded dump +instead. + +What is genuinely absent is narrower than "no IO". The module has no threads +and no host filesystem, so there is no startup config file, LOOK resolves +against the build-generated source archive rather than disk, and no language +BACKEND is compiled in (`zls_backend` is off for wasm — which also means +`lsp.supports` is empty, so the core never even raises a language query there; +`web.zig`'s prong for it is waiting for a host that links one). + +The EFFECTS themselves are all still emitted, each as a numbered code across +the ABI: `spawn` 1, `write` 2, `resize_pty` 3, `open_link` 4, `save_file` 5, +`write_dump` 6, `set_clipboard` 7, `lsp` 8, `watch` 9, `quit` 10, `new_file` +11, `pipe` 12, `read_clipboard` 13. Inbound, `pardes_output`, +`pardes_set_cwd`, `pardes_eof`, `pardes_paste` and `pardes_lsp_response` +exist to answer them. A plain page ignores most of those and gets a replay +viewer; a +process-capable host (the `pardes-io` events above) answers them and gets +terminals. The core does not know the difference — that is the point of the +seam. + Two dependency-free test layers cover the boundary: ```sh |
