Import WASM viewer crate from rezolus-webview#800
Merged
thinkingfish merged 7 commits intomainfrom Apr 17, 2026
Merged
Conversation
Adds crates/rezolus-webview/ so the WASM module powering site/viewer/ can be built from this repository, allowing iopsystems/rezolus-webview to be archived. The crate lives in its own Cargo workspace because it targets wasm32-unknown-unknown with release profile settings that differ from the main rezolus workspace. build.sh invokes wasm-pack with --out-name wasm_viewer so the output matches the ../pkg/wasm_viewer.js import path used by the frontend. Only the WASM source is migrated; the frontend lives under site/ and src/viewer/assets/ in this repo and has evolved independently.
- Rename crates/rezolus-webview to crates/viewer; the rezolus context is implied. - Promote the root Cargo.toml to an explicit Cargo workspace that includes rezolus, systeminfo, and viewer. xtask stays excluded so it keeps its own lockfile. - Add [workspace.package] and [workspace.dependencies] so shared metadata and dep versions (including metriken-query from the git main branch) are declared once and inherited by members. - viewer now inherits metriken-query from the workspace, keeping it in sync with the rest of the codebase. - Add a custom [profile.wasm-release] (inherits from release, no debug info, opt-level = "s") and have build.sh invoke wasm-pack with --profile wasm-release so the browser bundle stays compact.
- Apply rustfmt to crates/viewer/src/lib.rs now that it's a workspace member and covered by `cargo fmt --all`. - Add an empty `[workspace]` table to xtask/Cargo.toml. `exclude = ["xtask"]` in the root alone isn't enough: when `cargo xtask` invokes cargo against xtask's manifest, cargo walks up, finds the root `[workspace]`, and errors because xtask isn't a member. Declaring xtask as its own workspace root detaches it cleanly and keeps xtask/Cargo.lock separate.
- Root README: point readers at the browser-only static viewer under `site/viewer/` in the Viewer section and add a `build.sh` snippet under "Build from source". - crates/viewer README: describe how the crate plugs into the static site and the main workspace, note the wasm-pack version requirement, and explain the `wasm-release` profile used by build.sh.
The viewer crate targets wasm32 and drags in arrow/parquet/zstd, so building it under rezolus's LTO release profile on every matrix job was pushing `build-ubuntu-24.04-release` past the runner's time/resource limit (exit 143 / SIGTERM). viewer is built out-of-band via crates/viewer/build.sh, so skip it in the main workspace build and test steps.
Apple's system clang can't target wasm32, so build.sh relies on
Homebrew's LLVM. The previous hardcoded `/opt/homebrew/opt/llvm` check
silently missed Intel Macs (where Homebrew lives at `/usr/local`) and
any other non-default layout, causing `wasm-pack build` to fall back to
system clang and fail with
unable to create target: 'No available targets are compatible with
triple "wasm32-unknown-unknown"'
Query `brew --prefix llvm` so the script picks up the right path on any
Homebrew install.
brayniac
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Imports the WASM viewer crate from
iopsystems/rezolus-webviewintocrates/rezolus-webview/so the module that powerssite/viewer/can be built from this repo, allowing the former repository to be archived.crates/rezolus-webview/Cargo.tomlis its own Cargo workspace root: the crate targetswasm32-unknown-unknownand has[profile.release]settings that differ from the main rezolus workspace.crates/rezolus-webview/build.shinvokeswasm-pack build --target web --out-dir ../../site/viewer/pkg --out-name wasm_viewer, matching the../pkg/wasm_viewer.jsimport path used by the frontend.CLAUDE.mddocuments the new build command and the static site WASM architecture.Only the Rust/WASM source is migrated. The frontend (
site/andsrc/viewer/assets/) has evolved independently in this repo and is not affected; any frontend differences in rezolus-webview are discarded.Test plan
./crates/rezolus-webview/build.shproduceswasm_viewer.js,wasm_viewer_bg.wasm, and the accompanying.d.tsfiles insite/viewer/pkg/.site/and confirm the viewer loads a parquet file end-to-end.cargo check --workspacein the rezolus root still passes (webview crate is excluded from the main workspace).