pub struct RenderEdge {
pub parent_component: String,
pub child_component_name: String,
pub attr_names: Vec<String>,
pub has_spread: bool,
pub forward_attrs: Vec<ForwardAttr>,
pub has_complex_forward: bool,
}Expand description
A render edge: one component rendering another (a capitalized or
member-expression JSX tag). Captured at extraction time with the child’s
written name; resolution of child_component_name to a FileId/export is
deferred to graph build via the existing import map.
Fields§
§parent_component: StringThe name of the component that renders the child (the enclosing component). Empty when the JSX is not inside an identified component (a top-level render expression).
child_component_name: StringThe rendered child component name as written (Foo or the full
member-expression path Foo.Bar).
attr_names: Vec<String>The attribute (prop) names passed at the render site, in source order.
has_spread: booltrue when the render site contains a JSX spread ({...x}), so the
passed-prop set is not statically complete.
forward_attrs: Vec<ForwardAttr>The forwarded attributes at this render site: each pairs the child
attribute NAME with the identifier ROOT of its value expression
(userName={user.name} -> { attr: "userName", root: "user" };
value={x} -> { attr: "value", root: "x" }). ONLY plain identifier or
member-root access values are recorded ({x}, {x.y}, {x.y.z}); a value
that is a call, an arrow/function, a conditional, a JSX element, or any
other complex expression is NOT recorded here (its root would not be a pure
forward) and sets has_complex_forward instead. The prop-drilling chain
walk uses this pairing to map “this component forwards prop P” to “the
child receives it as attribute A”.
has_complex_forward: booltrue when at least one attribute value at this render site is a complex
expression (a call, an arrow/function render-prop, a conditional, a JSX
element-as-prop, a template literal, etc.) whose identifier root was NOT
recorded in forward_attrs. The prop-drilling phase abstains on a chain
whose forwarded prop flows through such a value (ADR-001, zero-FP).