diff options
Diffstat (limited to 'docs/web.md')
| -rw-r--r-- | docs/web.md | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/docs/web.md b/docs/web.md index 0f8c068f..dfbc295d 100644 --- a/docs/web.md +++ b/docs/web.md @@ -37,14 +37,18 @@ core ticks, so 120/144 Hz displays do not accelerate frame-count transitions and a returning background tab has bounded catch-up work. The `web` platform is deliberately not one of the shader-capable native GUI -shells. It exposes no `Panel*` transition builtins (`PanelSlide`, `PanelZoom`, -`PanelDissolve`, `PanelAscii`, `PanelVertical`, `PanelEdges`, `PanelFall`, -`PanelWave`, `PanelCurtain`, `PanelScramble`, `PanelType`) and no -`Crt`/`Ripple`/`Glitch`: applying those faithfully -would require a second canvas renderer and give up the DOM renderer's -selectable/accessibility contract. Theme fades and the delayed, -side-effect-free Look hover remain grid animations and continue to use the -fixed 60 Hz ticks above. +shells, and two comptime capability flags say so once each. It exposes no +`Panel*` transition builtins (`PanelSlide`, `PanelZoom`, `PanelDissolve`, +`PanelAscii`, `PanelVertical`, `PanelEdges`, `PanelFall`, `PanelWave`, +`PanelCurtain`, `PanelScramble`, `PanelType`) because +`capabilities.panel_transitions` is `pardes.hosted`, and no +`Crt`/`Ripple`/`Glitch` because `capabilities.scene_shaders` is +`platform == .gui or platform == .macos` (`src/builtins.zig:41-42`; the words +themselves carry those availabilities in `src/runtime_config.zig:155-168`). +Applying either faithfully would require a second canvas renderer and give up +the DOM renderer's selectable/accessibility contract. Theme fades and the +delayed, side-effect-free Look hover remain grid animations and continue to use +the fixed 60 Hz ticks above. Build a replay from a dump: @@ -60,10 +64,12 @@ 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 +`--tty`, `--tty-toggle`, `-n`, `-l`, `--fs[=<dir>]`, `--nested`, +`--detach[=<name>]`, `--attach[=<name>]`, `-h`/`--help`, `--version`, 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. +instead, and there is nothing here to answer `--version` with even though +`pardes.version` and `pardes.commit` are compiled in like everywhere else. Web LOOK's source archive follows Git's working-tree view: tracked `.zig` files plus new, nonignored ones, sorted by path. The checked-in browser replay is a @@ -77,10 +83,18 @@ 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, and the host leaves `lsp` null). + Replay terminals retain the same core shape but use Zig's failing IO value; this keeps the module freestanding without instantiating POSIX threaded IO that the browser can never call. +`Attach` and `Detach` are absent for the same structural reason and behind the +same gate: both are `enabled = pardes.hosted` (`src/builtins.zig`, and +`pardes.hosted` is `tty or gui or macos`), because a detached session is a unix +socket and a page has none. Nothing in this shell speaks +`src/detached/wire.zig`, and `push_detach` is one of the null vtable methods +below. + `src/web.zig` fills in six methods of `Host.VTable` and leaves the rest null, and a null method is answered by the core itself rather than forwarded to a page that could not honour it. The six are `present`, `write_file`, @@ -102,8 +116,12 @@ against the core's virtual filesystem, which is also where every read comes from — the core reads files itself and never asks a host; `watch_file` records the request; `lsp` answers an empty row set at once (`zls_backend` is off for wasm, so the core never raises a query there anyway) and `pipe` answers -failure; `wait_input` is null because wasm must never block, and `theme_file` -and `dump_themes` are not reachable without a config directory. `quit` sets the +failure; `wait_input` is null because wasm must never block, and `watch_theme` +and `dump_themes` are not reachable without a config directory. Of the +remaining nulls, `post_present` and `poll_frame` are per-frame host bookkeeping +a page has none of, `detach` has no session to leave, `gpio_toggle` belongs to +the ESP32-P4 board, and `fs_reply` answers a FUSE control filesystem that +`--fs` is the only way to ask for. `quit` sets the core's flag, which `pardes_should_quit` reports so the page can stop its frame loop. |
