Performance: Tree shaking and dead code removal
HIGH IMPACT
This affects the bundle size and initial load speed by removing unused code from the final app package.
import { ComponentA } from 'library'; @Component({ ... }) export class MyComponent { ... }
import { ComponentA, ComponentB, ComponentC } from 'library'; // Using only ComponentA in the app @Component({ ... }) export class MyComponent { ... }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Import entire library | No direct impact | No direct impact | Larger JS bundle delays paint | [X] Bad |
| Import only used modules | No direct impact | No direct impact | Smaller JS bundle speeds paint | [OK] Good |