Performance: Component-based framework philosophy
MEDIUM IMPACT
This affects how quickly the page loads and updates by controlling how UI parts are built and reused.
<template id="header-template"><div>Header</div></template><script>const template = document.getElementById('header-template'); document.body.appendChild(template.content.cloneNode(true)); document.body.appendChild(template.content.cloneNode(true));</script>
<div>Header</div><div>Header</div><div>Header</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Repeated HTML blocks | High (many nodes) | Multiple reflows | High paint cost | [X] Bad |
| Component reuse with templates | Low (fewer nodes) | Single reflow | Low paint cost | [OK] Good |