Skip to main content

Module recipes

Module recipes 

Source
Expand description

The recipe CONTRACT as code (VAPP-92): which parts each component has and which props a theme’s when may key on. Natives are listed by hand in catalog/recipes.json; macro parts are derived from their templates in macros.json (every part, the macro’s recipeProps + each part’s $recipe keys), so the two files cannot disagree. Mirrors src/recipes.ts.

The TS recomputes the part table per call; here a RecipeIndex is built ONCE per catalog view (RecipeIndex::core is cached).

Re-exports§

pub use crate::types::PartSpec;
pub use crate::types::Props;

Structs§

RecipeIndex
The part table of one catalog view plus the catalog defaults of every recipe prop: what the validator and the node resolver look up.

Constants§

RECIPE_KEYS
The style keys a recipe may set.
RECIPE_STATES
The interaction states a rule’s when.state may name.

Functions§

macro_parts
A macro’s parts and recipe props, read off its template.
native_recipe_props
RecipeIndex::native_recipe_props against the core catalog.
recipe_parts
Every component of the view → its parts and when props. An extension’s natives declare recipe: {parts, props} on their component def; without it a native gets root and its enum/boolean props.