feat(wasm): single-window web entry + trunk harness (issue #45)
The binary now compiles for wasm32 as a runnable web target: - Split the main-window render into `view_main`, bypassing the multi-window id dispatch the browser cannot use. - Add `run_web` / `boot_web`: a single-window `iced::application` entry for wasm (the browser canvas is the only window). Native keeps the multi-window `iced::daemon` via cfg-split in `main`. - Add a `console_error_panic_hook` (wasm-only) for readable panics. - Add `index.html` + `Trunk.toml` so `trunk serve` builds the wasm bundle (no-default-features → no solid3d) with COOP/COEP headers. Native build and all 75 tests unchanged. Browser runtime (rayon threads, canvas attach, real file I/O) is the next iteration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
b2e20c95fe
commit
157d54a4d4
7 changed files with 93 additions and 1 deletions
16
index.html
Normal file
16
index.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Open CAD Studio</title>
|
||||
<style>
|
||||
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #1e1e1e; }
|
||||
canvas { display: block; }
|
||||
</style>
|
||||
<!-- Trunk builds the wasm32 binary without the `solid3d` feature (no 3-D
|
||||
solid kernel / vtkio C deps on the web). See issue #45. -->
|
||||
<link data-trunk rel="rust" data-bin="OpenCADStudio" data-no-default-features />
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue