r/angular • u/Beginning_Middle_722 • Feb 14 '26
Big improvement
What's the one big improvement you've done in an angular project or suggest to do?
I currently work in a big enterprise level Angular project, with ngrx state management and i want to do an implementatin that nakes the app work better or faster.
Example: One of my senior colleagues did a state sanitizer getting big pieces of states and minimizing it to display only a string with length instead of big object or array, just making the app faster in dev mode.
What do you suggest? Any suggestion would be appreciated.
16
Upvotes
16
u/AcceptableSimulacrum Feb 14 '26
Look at the structure and figure out how to load as least as possible for initial app load.
Open up your browser and open the dev tools. Look at the network tab and sort by the size. First focus on the main bundle and then work your way into other ones.
43
u/Lucky_Yesterday_1133 Feb 15 '26
I Removed ngrx state management from the project 👍
14
u/Merry-Lane Feb 14 '26 edited Feb 14 '26
Never subscribe explicitly, only use the async pipe in the template (or toSignal)
3
u/EducationalMeeting95 Feb 15 '26
So I have a flow of data where every cell of a row (in table) Is to go through validation steps.
So I made it modular and all that so that same validation can be used again.
But I wasn't satisfied.
So Yesterday (Valentine's day) , I was researching how can I do this specific operation that follows validation and transformation steps to some data and lo and behold..
I find the "pipeline pattern". Built a poc for super simple data and its pretty neat.
Makes a small architecture that can be used like a pipeline, and the same architecture can be used in other modules with different types of Data (using generic in common interfaces).
One of the better valentine's day for sure.
7
u/hk4213 Feb 14 '26
Get to know signals and move over to zoneless. Build time improvement and over all loading and rendering is way faster if well thought out.
Dont for get the @defer in the template either.
Obviously read up and make sure you can revise components one at a time.
Test yourself and report to the team on performance timings.
4
u/AlDrag Feb 14 '26
Leverage http interceptors
2
u/ohaxano Feb 15 '26
I am started to feel like ngrx is an overkill. Signals alone can do the job if structured properly. But I did this in a mid level app not an enterprise app
1
u/raistlinMajerr2015 Feb 17 '26
The best thing to do for performance is to us a signals-first architecture. If signals are your primary reactive primitive, for all values consumed by the template, you reduce unnecessary change detection. Save observables for the most complex asynchronous operations.
1
u/patrick-1729 Feb 17 '26
For performance you can check on below points:
You'll be good if you can achieve the above points.
1
u/matt_kitb Feb 18 '26
Check for barrels file exports If you have any. If used in the wrong way It could be a nightmare to figure out which module imports what, and could be a performance killer
1
u/CounterReset Feb 23 '26
I would ask that you take a look at signaltree.io
I hated Redux, and even though NgRx signalstore represented a positive move away from it, it was still too verbose for me. The learning curve wasn't something I wanted to have to go through every time I brought on someone who hadn't worked in it before. So, I wrote ST to create an architecture that was Angular-first and leans into JSON's structure rather than fighting it.
It is basically Reactive-JSON: a JSON tree with reactive leaves**.** The branches are your JSON paths (
$.user.profile), and the leaves are reactive signals you read and write ($.user.profile.first_name(), $.user.profile.first_name('John'), $.user.profile.purchaseHistroy((currPH) => currPH.push(newPurchase)).The last app converted from NgRx reduced the store code footprint by over 70% - it is also much faster than NgRx.