pub struct RenderFanInMetric {
pub per_component: Vec<RenderFanInComponent>,
pub p95_distinct_parents: Option<u32>,
pub high_pct: Option<f64>,
pub max_distinct_parents: Option<u32>,
}Expand description
Per-component render fan-in counts plus the precomputed concentration aggregates.
DESCRIPTIVE blast-radius signal (NOT a rule, finding, or threshold): the
component-graph analogue of module-level fan-in. Module fan-in counts
importing MODULES; render fan-in counts JSX render CALL SITES (a shared
<Button> is rendered in far more places than it is imported).
per_component is the internal carrier (keyed for hotspot path annotation),
#[serde(skip)] on AnalysisResults so it never appears under bare
fallow / audit; the aggregates feed the descriptive VitalSigns block
(p95_render_fan_in / render_fan_in_high_pct / max_render_fan_in).
UNDERCOUNT is the documented safe direction: a child rendered via a JSX
spread, a dynamic / createElement(var) form, or a member-expression tag
(<Lib.Button/>) is not resolved by the shared ChildResolver and so
increments no component’s fan-in. A true high-fan-in component can only be
undersold, never falsely flagged. A rare name-collision over-credit is
possible via the default-import sole-component fallback (inherited verbatim
from the prop-drilling / thin-wrapper resolver); low-harm for a descriptive,
non-gating metric.
Fields§
§per_component: Vec<RenderFanInComponent>Per-component render-site + distinct-parent counts. Keyed by
(component file path, component name) so the hotspot surface can map a
file back to its top component’s fan-in. Components rendered nowhere ARE
included as a real 0 so the percentile distribution is not skewed.
p95_distinct_parents: Option<u32>95th-percentile DISTINCT-PARENTS render fan-in across components (the
per-component distribution analogue of the module-fan-in p95). None on
an empty population. Mirrors compute_coupling_concentration.
high_pct: Option<f64>Percentage of components whose distinct-parents render fan-in exceeds the
max(p95, 10) threshold (the same floor coupling concentration uses).
None on an empty population.
max_distinct_parents: Option<u32>The single highest DISTINCT-PARENTS count across all components (the
headline blast-radius number: the most distinct render LOCATIONS any one
component is rendered from, the honest edit-ripple count). None on an
empty population. render_sites (incl. repeats) is secondary per-component
context, never the headline.