Skip to content

feat: split WASM parser and handler bundles#344

Open
mohamedmansour wants to merge 1 commit into
mainfrom
feat/split
Open

feat: split WASM parser and handler bundles#344
mohamedmansour wants to merge 1 commit into
mainfrom
feat/split

Conversation

@mohamedmansour

Copy link
Copy Markdown
Contributor

Summary

  • Split microsoft-webui-wasm into feature-gated handler, parser, and default all bundles.
  • Changed the WASM protocol boundary to protobuf bytes (Uint8Array) so handler-only consumers can render protocol.bin directly without JSON conversion.
  • Updated cargo xtask build-wasm, CI verification, release staging, the docs playground, DESIGN.md, and integration docs for the new bundle layout.

Closes #338

WASM bundle sizes

Variant File Ungzipped Gzip Brotli
all webui_wasm_all.js 24.2 KiB 4.9 KiB 4.3 KiB
all webui_wasm_all_bg.wasm 707.0 KiB 256.4 KiB 199.2 KiB
handler webui_wasm_handler.js 14.2 KiB 3.1 KiB 2.7 KiB
handler webui_wasm_handler_bg.wasm 379.6 KiB 143.0 KiB 115.4 KiB
parser webui_wasm_parser.js 15.0 KiB 3.7 KiB 3.2 KiB
parser webui_wasm_parser_bg.wasm 427.6 KiB 168.4 KiB 136.1 KiB

Validation

  • CI=true cargo xtask check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the microsoft-webui-wasm distribution into feature-gated parser/handler/combined bundles and updates the build + release tooling and docs to support using protobuf protocol bytes (Uint8Array) directly in browser consumers.

Changes:

  • Split webui-wasm into handler, parser, and default all feature sets, with separate wasm-pack outputs per variant.
  • Switch the WASM protocol boundary from JSON strings to protobuf bytes, updating the docs playground and integration documentation accordingly.
  • Update cargo xtask build-wasm, publish staging, CI verification, and release artifact globbing for the new output directory layout.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xtask/src/publish.rs Stage all built WASM variant outputs into publish/wasm/ via a directory copy helper.
xtask/src/build_wasm.rs Build three wasm-pack variants (all, handler, parser) into stable subdirectories and names.
docs/guide/integrations/wasm.md Document the new bundle variants and the protobuf-bytes JS API surface.
docs/guide/integrations/index.md Update integrations index copy to reflect split WASM bundles.
docs/ai.md Add AI-reference examples for the new split WASM bundle imports and protobuf bytes usage.
docs/.webui-press/components/docs-playground/docs-playground.ts Update playground to import the combined bundle and pass protocol bytes between build/render.
DESIGN.md Specify the new WASM distribution model and feature-gated bundle surfaces.
crates/webui-wasm/src/parser.rs Introduce parser-only WASM exports (build_protocol) returning protobuf bytes.
crates/webui-wasm/src/lib.rs Reorganize crate entry to feature-gate modules/exports and keep combined tests working.
crates/webui-wasm/src/handler.rs Introduce handler-only WASM exports consuming protobuf bytes and supporting plugins.
crates/webui-wasm/src/error.rs Add a shared WASM error enum with feature-gated variants.
crates/webui-wasm/src/combined.rs Implement combined build_and_render using the parser + handler modules.
crates/webui-wasm/README.md Update crate README to describe the three bundles and their intended usage.
crates/webui-wasm/Cargo.toml Add handler/parser/all features and make handler/parser deps optional.
.github/workflows/publish.yml Include nested publish/wasm/** artifacts for the new folder layout.
.github/actions/setup-wasm/action.yml Verify presence/shape of the three variant outputs in CI.

Comment thread docs/guide/integrations/wasm.md
Build microsoft-webui-wasm as feature-gated handler, parser, and all variants so consumers can avoid shipping unused parser or handler code.

Use protobuf bytes for the WASM protocol boundary, keeping the handler aligned with native protocol.bin consumers and avoiding JSON conversion in browser integrations.

Update xtask, CI, publish staging, docs playground, DESIGN.md, and user docs for the new bundle layout.

Co-authored-by: Copilot <[email protected]>
@mohamedmansour mohamedmansour force-pushed the feat/split branch 2 times, most recently from 129929a to 302fff8 Compare June 13, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Break apart WASM into two WASM Modules Handler and Parser

2 participants