Inline partials vs registered partials: lexical context capture vs global reuse for component libraries
Scenario A component library must expose reusable UI pieces (buttons, cards, modals) that can be composed inside arbitrary parent templates. Some components need strict context isolation so they only see data explicitly passed to them, while others (like a global header or footer) must be shareable across unrelated page templates without duplication. Constra