feat: split WASM parser and handler bundles#344
Open
mohamedmansour wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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-wasmintohandler,parser, and defaultallfeature 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. |
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]>
129929a to
302fff8
Compare
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
microsoft-webui-wasminto feature-gatedhandler,parser, and defaultallbundles.Uint8Array) so handler-only consumers can renderprotocol.bindirectly without JSON conversion.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
webui_wasm_all.jswebui_wasm_all_bg.wasmwebui_wasm_handler.jswebui_wasm_handler_bg.wasmwebui_wasm_parser.jswebui_wasm_parser_bg.wasmValidation
CI=true cargo xtask check