chore: correct rust integration docs to match published crate#295
Merged
Conversation
This was referenced May 16, 2026
c5626a9 to
3b4ac07
Compare
3b4ac07 to
52351e1
Compare
The page instructed `cargo add webui` and `webui = "*"` in Cargo.toml, but the bare `webui` crate on crates.io is owned by an unrelated project. The Microsoft package is published as `microsoft-webui`; the crate's `[lib] name = "webui"` keeps `use webui::...` imports working unchanged when the dependency is renamed via Cargo. The example also referenced `webui_handler::Result<()>` and `webui::RenderOptions`. `RenderOptions` and the handler `Result` alias are not re-exported by the `webui` crate today, so the example does not compile against a project that only depends on `microsoft-webui`. This PR: - Re-exports `RenderOptions` from `webui`. - Re-exports `Result as HandlerResult` from `webui` (renamed to avoid colliding with `std::result::Result` usage inside `crates/webui`). - Updates the integration page to use `microsoft-webui = "*"`, fixes the trait-impl return types to `webui::HandlerResult<()>`, and adds a one-paragraph note explaining the published name vs the import namespace. Verified by `cargo check -p microsoft-webui`.
52351e1 to
e2b651c
Compare
mohamedmansour
approved these changes
May 16, 2026
This was referenced May 16, 2026
Co-authored-by: Copilot <[email protected]>
Contributor
Author
|
Thanks for the review! Fixed in e475181 — |
mohamedmansour
approved these changes
May 20, 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.
What
Two small fixes to the public
rustintegration:crates/webui/src/lib.rs- re-exportRenderOptionsandResult as HandlerResultfromwebui_handlerthrough thewebuifacade crate.docs/guide/integrations/rust.md- use the published crate name (microsoft-webui) in the install block, fix trait-impl return types, and note the rename.Resultis renamed toHandlerResulton re-export so it does not collide with the existingstd::result::Result<T, E>usage insidecrates/webui/src/lib.rs(buildandbuild_to_disk).Why
I'm integrating WebUI into an embedded host by following
docs/guide/integrations/rust.md. Two things were blocking:webui = "*"in Cargo.toml resolves to an unrelated crate on crates.io. The Microsoft crate is published asmicrosoft-webui; the[lib] name = "webui"setting keepsuse webui::...working unchanged, but the docs don't mention this. This costs a first-time adopter the same hour every time.webui_handler::Result<()>(thewebui_handlercrate is not the dependency the page tells you to add) andwebui::RenderOptions(not currently re-exported). Copying the example into a fresh project does not compile.The scope is intentionally narrow: just unblock the first-render-from-a-non-WebUI-host story that the page already promises.
How I tested
(passes after the re-export)
Happy to also copy one of the framework examples into a scratch crate that depends only on
microsoft-webuito confirm the rendered text compiles end-to-end - can add that as a doctest if you'd prefer.Notes
users/janechu/fix-rust-integration-docsbecause that's the convention my host repo uses for agent-driven branches. Happy to rename tojanechu/fix-rust-integration-docs(matching the local convention in.github/skills/pr/SKILL.md) if you prefer.@microsoft/webui/platform.jssubpath export, and a fragment-rendering recipe page - opened as siblings rather than stacked.