feat: re-export hydration plugins from microsoft-webui facade#300
Draft
janechu wants to merge 1 commit into
Draft
feat: re-export hydration plugins from microsoft-webui facade#300janechu wants to merge 1 commit into
janechu wants to merge 1 commit into
Conversation
`microsoft-webui` already re-exports `WebUIHandler`, `HandlerError`,
`ResponseWriter`, and the `HandlerPlugin` trait from
`microsoft-webui-handler`, so embedders can write `use webui::WebUIHandler`
without depending on the handler crate directly. But the concrete plugin
types (`FastV3HydrationPlugin`, `WebUIHydrationPlugin`) are not
re-exported, forcing every embedder that wants client-side hydration to
add `microsoft-webui-handler` as a direct dependency just to import a
plugin type, even when no other handler-only API is used.
This change adds `pub use` for the two shipped hydration plugins so a
typical integration becomes:
```rust
use webui::{FastV3HydrationPlugin, RenderOptions, ResponseWriter, WebUIHandler, WebUIProtocol};
let handler = WebUIHandler::with_plugin(|| Box::new(FastV3HydrationPlugin::new()));
```
with `microsoft-webui` as the sole direct dependency. The handler crate
remains accessible via `webui_handler::plugin::...` for embedders that
want it, and no existing import paths break.
The pair `(FastV3HydrationPlugin, WebUIHydrationPlugin)` matches the
existing pattern in the facade where `(CssStrategy, DomStrategy, Plugin)`
are re-exported alongside `HandlerPlugin` - all the types an embedder
needs to wire up a render call live on `webui`.
This was referenced May 16, 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
Adds
pub usere-exports forFastV3HydrationPluginandWebUIHydrationPluginfrom themicrosoft-webuifacade crate.Problem
microsoft-webuialready re-exportsWebUIHandler,HandlerError,ResponseWriter, and theHandlerPlugintrait frommicrosoft-webui-handler. But the concrete hydration plugin types -FastV3HydrationPluginandWebUIHydrationPlugin- are not re-exported. Every embedder that wants client-side hydration must addmicrosoft-webui-handleras a direct dependency just to write one line like:even when no other handler-only API is used. The facade is otherwise complete, so this is a paper cut that doubles the dependency surface for integrations.
Change
Two lines in
crates/webui/src/lib.rs:After this change, a typical embedder needs only
microsoft-webuias a direct dep:The deep path
webui_handler::plugin::fast_v3::FastV3HydrationPluginremains available for embedders that depend onmicrosoft-webui-handlerdirectly, so this is purely additive.Why this pair
These two plugins are the only concrete
HandlerPluginimpls shipped today. The pair matches the existing facade pattern where(CssStrategy, DomStrategy, Plugin)parser-side types are re-exported alongside the parserPlugintrait - all the wiring types an embedder needs to construct a render pipeline now live onwebui.Verification
cargo check -p microsoft-webuipasses (clean compile)microsoft-webuionly and constructs both plugins via the facadeCompanion PRs
RenderOptionsand adds aHandlerResultalias on the same facade. Together with this PR, an integration can dropmicrosoft-webui-handlerfromCargo.tomlentirely.