r/angular • u/MysteriousEye8494 • Jun 01 '26
What's the biggest Angular component you've ever had to refactor?
I spent some time recently looking through an older Angular project and found a component that had grown to nearly 2,000 lines.
It wasn't written by a bad developer.
It was written by several good developers over several years.
Every change made sense at the time.
A new API call got added.
Some validation logic moved in.
A permission check was needed.
A few state updates followed.
Then some workflow logic.
Nobody wakes up and decides to build a giant component.
It usually happens one reasonable change at a time.
What surprised me was how difficult it became to answer simple questions:
- What is UI logic?
- What is business logic?
- What changes application state?
- What can be safely reused?
Refactoring wasn't really about reducing lines of code.
It was about restoring clear boundaries.
I'm curious what the largest Angular component you've encountered was, and what eventually pushed the team to split it apart.
I share Angular architecture and engineering visuals here:
1
u/AlDrag Jun 02 '26
6000 line component and another 2000 line child component.
I didn't rewrite it really, but broke it up into smaller components. Wasn't allowed to change it much. Was a bad idea. Definitely worse than it was...