Performance: Component libraries integration
MEDIUM IMPACT
This affects page load speed and rendering performance by adding external UI components and styles to the app.
import Button from 'big-ui-library/Button'; export default function Page() { return <Button>Click me</Button>; }
import { Button, Modal, Tooltip, Dropdown } from 'big-ui-library'; export default function Page() { return <Button>Click me</Button>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full library import | High (many nodes) | Multiple reflows | High paint cost | [X] Bad |
| Selective component import | Low (minimal nodes) | Single reflow | Low paint cost | [OK] Good |
| Global full CSS import | N/A | N/A | High paint cost | [X] Bad |
| Selective CSS import | N/A | N/A | Low paint cost | [OK] Good |
| Client-only components without dynamic import | Medium | Multiple reflows | Medium paint cost | [!] OK |
| Client-only components with dynamic import | Medium | Single reflow | Low paint cost | [OK] Good |