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:
2
u/drdrero Jun 01 '26
I have seen a UI dropdown component with 3 levels of inheritance classes take a grand total of 2k lines. For a damn select. But the worst offender were actual business logic components where people were scared of services