mod component;
mod plain;
mod props;
mod slot;
mod vnode;
use vize_atelier_core::{
DirectiveNode, ElementNode, ElementType, ExpressionNode, ForNode, IfNode, PropNode,
RuntimeHelper, TemplateChildNode,
};
use vize_carton::{FxHashSet, String, ToCompactString};
use super::{SsrCodegenContext, helpers::escape_html_attr, helpers::extract_destructure_params};
use vize_carton::cstr;
#[derive(Clone, Debug)]
pub(super) struct VNodePropEntry {
key: String,
value: String,
dynamic: bool,
}
pub(super) enum ComponentSlotChildren<'node, 'a> {
Slice(&'node [TemplateChildNode<'a>]),
Refs(std::vec::Vec<&'node TemplateChildNode<'a>>),
}
pub(super) struct ComponentTemplateSlot<'node, 'a> {
name: String,
props_pattern: Option<String>,
params: FxHashSet<String>,
children: &'node [TemplateChildNode<'a>],
}
impl<'a> SsrCodegenContext<'a> {
pub(crate) fn process_element_with_fallthrough_attrs(
&mut self,
el: &ElementNode<'a>,
disable_nested_fragments: bool,
inherit_attrs: bool,
) {
match el.tag_type {
ElementType::Element => {
self.process_plain_element(el, inherit_attrs);
}
ElementType::Component => {
self.process_component(el, disable_nested_fragments, inherit_attrs);
}
ElementType::Slot => {
self.process_slot_outlet(el);
}
ElementType::Template => {
self.process_children(&el.children, false, disable_nested_fragments, false);
}
}
}
}