Performance: Creating components with CLI
MEDIUM IMPACT
This affects initial page load speed and bundle size by controlling how components are generated and included in the app.
ng generate component my-component --skip-tests --inline-style --inline-template
ng generate component my-component
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Default CLI component generation | Moderate (extra files increase DOM complexity) | Multiple reflows if many CSS files | Higher paint cost due to separate CSS | [X] Bad |
| CLI component with inline styles/templates and no tests | Lower (fewer files, simpler DOM) | Single reflow | Lower paint cost with inline styles | [OK] Good |