Skip to content

feat: re-export hydration plugins from microsoft-webui facade#300

Draft
janechu wants to merge 1 commit into
mainfrom
users/janechu/add-facade-plugin-exports
Draft

feat: re-export hydration plugins from microsoft-webui facade#300
janechu wants to merge 1 commit into
mainfrom
users/janechu/add-facade-plugin-exports

Conversation

@janechu
Copy link
Copy Markdown
Contributor

@janechu janechu commented May 16, 2026

Summary

Adds pub use re-exports for FastV3HydrationPlugin and WebUIHydrationPlugin from the microsoft-webui facade crate.

Problem

microsoft-webui already re-exports WebUIHandler, HandlerError, ResponseWriter, and the HandlerPlugin trait from microsoft-webui-handler. But the concrete hydration plugin types - FastV3HydrationPlugin and WebUIHydrationPlugin - are not re-exported. Every embedder that wants client-side hydration must add microsoft-webui-handler as a direct dependency just to write one line like:

use webui_handler::plugin::fast_v3::FastV3HydrationPlugin;

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:

pub use webui_handler::plugin::fast_v3::FastV3HydrationPlugin;
pub use webui_handler::plugin::webui::WebUIHydrationPlugin;

After this change, a typical embedder needs only microsoft-webui as a direct dep:

use webui::{FastV3HydrationPlugin, RenderOptions, ResponseWriter, WebUIHandler, WebUIProtocol};

let handler = WebUIHandler::with_plugin(|| Box::new(FastV3HydrationPlugin::new()));

The deep path webui_handler::plugin::fast_v3::FastV3HydrationPlugin remains available for embedders that depend on microsoft-webui-handler directly, so this is purely additive.

Why this pair

These two plugins are the only concrete HandlerPlugin impls shipped today. The pair matches the existing facade pattern where (CssStrategy, DomStrategy, Plugin) parser-side types are re-exported alongside the parser Plugin trait - all the wiring types an embedder needs to construct a render pipeline now live on webui.

Verification

  • cargo check -p microsoft-webui passes (clean compile)
  • No existing import paths break (additive only)
  • Tested by an embedded integration that consumes microsoft-webui only and constructs both plugins via the facade

Companion PRs

`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`.
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.

1 participant