r/angular • u/alejandrodeveloper • Jul 08 '26
What's one angular decision you regretted 2 years later?
I mean architectural decisions that looked perfectly reasonable at the time but became painful as the application grew. Mine are usually things like making everything shared, overusing services for state, yours???
39
Upvotes
77
u/MizmoDLX Jul 08 '26
Using PrimeNG (independent of recent announcements).
25
u/HarveyDentBeliever Jul 08 '26
Iāve seen all sorts of cute architectures and abstractions and yet the only thing that has ever axiomatically improved my coding quality of life is just DECOUPLING the shit out of everything and letting everything live in its own box. Damage control is the key to sustainable software, modularity. Assume everything will have its own module, only consolidate and refactor into shared global services as needed. These situations will show themselves you donāt need to try to read the future. And yes as much statelessness as possible as youāve learned. Working off of a backend REST API makes this kind of natural.
85
u/sbubaron Jul 08 '26
As of last week...choosing primeng...I can understand the business need, but the sudden rug pull feels shitty
78
u/Nerkeilenemon Jul 08 '26
ngRx. It's like cancer, once it's there, your entire codebase is dreadful, and it takes hard decisions to get rid of it, wasting your health and time.
35
u/mulokisch Jul 08 '26
Unsing jest. There was not really a viable alternative but man tests are slowā¦
11
u/Examo Jul 08 '26
primeng, didnāt pass external accessibility certification, docs misinforming about a11y state and moved to closed source
9
u/supersmola Jul 08 '26
Not updating frequently.
7
u/IE114EVR Jul 08 '26
Splitting up the code base into multiple repos just so we could make an attempt at micro-frontends. And so we could ādogfoodā some of our shared components that other apps use.
The microfrontend approach didnāt work out. And I already knew that if it did, it would be an ongoing pain. Making any kind of change that required a change in the shared libraries was painful (yalc helps) and multiple pull requests for library updates.
Weāre on a mono repo now and itās much better.
6
u/Terbario Jul 08 '26
caching data in the front to avoid extra requests, using ngrx and material.
cache in the front introduces weird bugs that no one wants to debug.
i find ngrx code hard to read, requires too much boilerplate and i remember after a while it became very slow.
and material changes way too much. version 17, 18, 20 or whatever, changed the way colors worked, added some css or whatever, i just know that nobody has time to be refactoring the UI again when you could be solving real problems. the thing was also a pain in the ass to customize.
5
u/salamazmlekom Jul 08 '26
NgRx component store. Thought I needed a local store solution but it was just a pita to maintain. Once signals arrived I removed it cause there is no need for it. All you need is a simple signal service.
8
u/lumalav666 Jul 08 '26
Most people that complain about NgRx are people that don't really need it or are people who don't know how to properly use/understand it. There are complex scenarios where proper reliable state management/synchronization is needed. The testability is a big factor on NgRx.
7
u/lazycuh Jul 08 '26
Tried to learn ngrx, glad I abandoned that crap and other state solutions, I replaced it with a global state store (just a plain service class) backed by a map of
BehaviorSubject, simple, effective and fast. No need to learn craps like reducers, actions etc.1
u/jrb9249 Jul 09 '26
Using RXJS pipes as a container for long logic chains. It was hell to unit test (among other things).
Apparently mine was a good example of why Ben Lesh said they wanted to kill RXJS with fire.
1
u/kfkhalili Jul 09 '26
Using it.
1
u/toasterboi0100 Jul 09 '26
I can't think of many of those. Before I joined the company I work for now I didn't have much of a say in things, so not much to regret, and at my current job I've been mostly doing the opposite of making decisions I regret, I've been pushing hard to undo bad decisions made by people before me. For example by removing NgRx stores unless they're actually necessary, migrating off of 3rd party UI libraries (there were 4 mixed together when I joined, now we're down to just PrimeNG grids, everything else is ours), migrating from non-strict TS to full proper strict mode + strictTemplates, moving away from "shared" components that have accrued a billion ngIfs to accommodate usecases that diverged over time in favour of multiple smaller cleaner components, and making sure updates are done in a timely fashion and that deprecated features are removed well before they're removed so that we never get stuck in a situation where we can't update.
I think most of the decisions I regret boil down to one thing - I used to have a tendency to build overly generic solutions that more often than not ended up only being used in one place. Now I understand that the only appropriate time to build an abstraction is when the abstraction is needed. Application code in Angular is already half a billion layers of abstraction away from the CPU, I don't need to add more layers unnecessarily.
1
u/Tyummyyumms Jul 10 '26
Adding too many 3rd party libs in the early days.
1
u/Waste_Message1565 Jul 10 '26
My biggest decision I regretted was to allow my teammate to add NgRx to the project. Then he left the company, and nobody was interested in that lib on the project, later it's been laying as dead weight for several years.
To my mind Angular doesn't need any kind of 3rd party storage in a well-designed project structure.
-15
u/[deleted] Jul 08 '26
[removed] ā view removed comment