pub struct BuildOptions {Show 13 fields
pub app_dir: PathBuf,
pub entry: String,
pub css: CssStrategy,
pub dom: DomStrategy,
pub plugin: Option<Plugin>,
pub components: Vec<String>,
pub component_asset_roots: Vec<String>,
pub metafile: bool,
pub css_file_name_template: String,
pub css_public_base: Option<String>,
pub legal_comments: LegalComments,
pub theme: Option<TokenFile>,
pub projection_manifests: Vec<ProjectionManifestSource>,
}Expand description
Options for building a WebUI application.
Fields§
§app_dir: PathBufPath to the application folder containing templates.
entry: StringEntry HTML file name (e.g., "index.html").
css: CssStrategyCSS delivery strategy for component stylesheets.
dom: DomStrategyDOM strategy for component rendering (shadow or light).
plugin: Option<Plugin>Framework plugin to load.
components: Vec<String>Additional component sources (npm packages or local paths).
component_asset_roots: Vec<String>Additional root components to compile for static component asset emission.
These roots are parsed into the protocol so their templates, styles, and dependency closures can be emitted later, but they are not connected to the entry fragment and therefore are not rendered during initial SSR.
metafile: boolWhether to serialize an esbuild-compatible component asset metafile.
css_file_name_template: StringEmitted asset filename template using [name], [hash], and [ext].
Applies to Link-mode CSS files and static component assets.
css_public_base: Option<String>Optional URL/base-path prefix for Link-mode css_href values.
When set, emitted protocol hrefs become <base>/<filename>.
legal_comments: LegalCommentsLegal comment preservation strategy.
theme: Option<TokenFile>Optional loaded design-token theme used to validate discovered CSS tokens.
When present, every discovered CSS token that remains unresolved after
local and ancestor CSS definitions are removed must exist in every theme,
unless the var() usage supplies a literal CSS fallback (e.g.
var(--x, 16px)), which provides its own value. Missing required tokens
fail the build as parser diagnostics.
projection_manifests: Vec<ProjectionManifestSource>Bundler-neutral state projection manifest fragments supplied as disk paths or inline JSON with a logical manifest path.
Empty (the default) means projection is disabled: the build emits
webui_protocol::InitialStateStrategy::Full and every scripted
component keeps a full-state (All) partial-navigation surface. No
JavaScript/TypeScript analysis ever runs in Rust.
When non-empty, every manifest is loaded, hash-validated against the
files it declares, merged by component tag, and used to narrow each
scripted component that is actually compiled into the protocol down to
an exact hydration/navigation key surface. Every such scripted
component must have exactly one manifest entry, or the build fails
with WebUIError::Projection (PROJ-B001). Supplying manifests with
a plugin other than Plugin::WebUI fails the build immediately
(PROJ-B002): only the WebUI plugin produces protocol fields
compatible with per-component key encoding.
Manifests are read only at build time. The runtime handler never opens a manifest file; the compiled protocol is fully self-contained.
Trait Implementations§
Source§impl Clone for BuildOptions
impl Clone for BuildOptions
Source§fn clone(&self) -> BuildOptions
fn clone(&self) -> BuildOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildOptions
impl Debug for BuildOptions
Auto Trait Implementations§
impl Freeze for BuildOptions
impl RefUnwindSafe for BuildOptions
impl Send for BuildOptions
impl Sync for BuildOptions
impl Unpin for BuildOptions
impl UnsafeUnpin for BuildOptions
impl UnwindSafe for BuildOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more