Merged
Conversation
Introduce a new webui-wasm crate that compiles the full WebUI parse → protocol → render pipeline to WebAssembly, enabling an interactive browser-based playground with zero server dependencies. WebAssembly crate (crates/webui-wasm): - Exposes build_and_render(), build_protocol(), and render() via wasm-bindgen for JavaScript consumption - Uses the real webui-parser with CssStrategy::Inline so component styles work in-memory without external CSS files - Feature-gates walkdir/filesystem behind 'fs' feature so webui-parser compiles cleanly for wasm32-unknown-unknown - Removes 6 unused deps from webui-parser (tokio, anyhow, tree-sitter-typescript, lazy_static, nom, streaming-iterator) - Bumps tree-sitter-language to 0.1.7 for bundled WASM C headers Build tooling: - Cross-platform cargo xtask build-wasm command with auto-detection of LLVM clang, wasi-libc, and WASM headers per OS - Friendly colored error messages with platform-specific install hints using the console crate (matches webui-cli style) - JS glue patching to replace tree-sitter env imports with inline C stdlib stubs for browser compatibility - Reusable GitHub Actions composite action (.github/actions/setup-wasm) shared by PR checks and docs deployment workflows - Refactored xtask into modules: main.rs, build_wasm.rs, build_apps.rs, util.rs
Remove the label-based gate that required a 'wasm' label on the PR for the WASM build job to run. The job now runs unconditionally on every PR, matching the CI job behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The webui-protocol crate needs protoc for prost-build. Add protobuf-compiler to the apt-get install in the composite action. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tree-sitter-html's scanner.c uses strncpy and towupper which are not in tree-sitter-language's minimal WASM header stubs. Install the wasi-libc package (available on Ubuntu 24.04) to provide the complete C stdlib headers needed for WASM compilation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The wasi-libc apt package installs headers to /usr/include/wasm32-wasi (not /usr/share/wasi-sysroot/include/wasm32-wasi). Update both the CI action and xtask detection to check this path first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ubuntu's system clang already supports --target=wasm32-unknown-unknown. tree-sitter-language 0.1.7 ships bundled WASM C headers (via cargo fetch). Add -Wno-implicit-function-declaration for missing strncpy/towupper declarations in the minimal stubs — these link fine from wasm stubs. Removes: clang, llvm, lld, wasi-libc apt packages from CI. Keeps: protobuf-compiler (for prost-build) and wasm-pack. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Does it require the README change on how to play with wasm? |
akroshg
approved these changes
Feb 25, 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.
Introduce a new webui-wasm crate that compiles the full WebUI parse → protocol → render pipeline to WebAssembly, enabling an interactive browser-based playground with zero server dependencies.
WebAssembly crate (crates/webui-wasm):
Build tooling: