pub struct ComponentTemplateArtifact {
pub tag_name: String,
pub template: String,
pub template_json: String,
pub template_functions: String,
pub hydration: StateSurface,
pub navigation: StateSurface,
pub template_roots: Vec<String>,
pub is_scripted: bool,
pub uses_shadow_dom: bool,
}Expand description
Client template payload generated by a parser plugin for one component.
Fields§
§tag_name: StringComponent custom-element tag name.
template: StringPlugin-owned client template payload.
template_json: StringWebUI JSON-safe template metadata.
template_functions: StringWebUI component-local JavaScript condition closure array.
hydration: StateSurfaceInitial hydration state surface derived by the producing plugin.
Partial-navigation state surface derived by the producing plugin.
template_roots: Vec<String>Compiled template roots — the reactive property names referenced
directly by the template (e.g. {{name}}) independent of any
authored client script. Always populated (possibly empty), even when
hydration/navigation collapse to StateSurface::All, so a
bundler-neutral manifest consumer can union exact client keys with
these Rust-derived roots without re-deriving them.
is_scripted: boolWhether this component has an authored client module (sibling script or an externally client-owned package), as opposed to a scriptless compiled template. Bundler manifest coverage validation only requires an entry for scripted components; scriptless ones are always Rust-derived and never require a manifest entry.
uses_shadow_dom: boolWhether this component effectively uses Shadow DOM.
Implementations§
Source§impl ComponentTemplateArtifact
impl ComponentTemplateArtifact
Sourcepub fn template(
tag_name: String,
template: String,
uses_shadow_dom: bool,
) -> Self
pub fn template( tag_name: String, template: String, uses_shadow_dom: bool, ) -> Self
Create a non-WebUI template payload.
Sourcepub fn webui(
tag_name: String,
template_json: String,
template_functions: String,
uses_shadow_dom: bool,
) -> Self
pub fn webui( tag_name: String, template_json: String, template_functions: String, uses_shadow_dom: bool, ) -> Self
Create a WebUI split metadata/function payload.
The hydration surface starts empty; the producing plugin attaches it with
Self::with_hydration once it has derived the surface.
Sourcepub fn with_hydration(self, hydration: StateSurface) -> Self
pub fn with_hydration(self, hydration: StateSurface) -> Self
Attach the initial hydration surface derived by the plugin.
Attach the partial-navigation surface derived by the plugin.
Sourcepub fn with_template_roots(self, roots: Vec<String>) -> Self
pub fn with_template_roots(self, roots: Vec<String>) -> Self
Attach the compiled template roots (see Self::template_roots).