Performance: Creating a service with CLI
LOW IMPACT
This affects initial bundle size and load time by adding service code and potential dependencies.
Use Angular CLI to generate a service and inject it with providedIn: 'root' for tree-shaking and tree-shaking benefits.
Manually creating a service file with large synchronous logic and importing it everywhere without lazy loading.
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Manual large service import | 0 (no DOM changes) | 0 | 0 | [X] Bad |
| CLI-generated service with providedIn root | 0 | 0 | 0 | [OK] Good |