Member-only story
How I write React after 8 years
I am starting with my contrarians views that way I can get rid of 90% of coders that think that know what they are doing but end up building Frankensteins. This article is for that 10% of coders that want to learn and are constantly pushing the limit of conventional best practices. So here we go.
My contrarian Views
Don’t use (almost) any libraries: Most libraries are crap, they are written by junior developers. A lot of the time they are written by devs that want to publish something just because it looks good on their resume. Most libraries don’t go through a process of deep thought. That’s why we decided a few years ago we only use selected libraries. The only libraries we use are where I know the dev team, and I know the library will continue to be maintained.
Another reason we don’t use libraries is that most of the libraries out there you can write it yourself and we trust more our code than others. I will give you a few examples, one of front end devs wanted to develop a sliding animation for a text using a plugin that had hundreds of lines of code. It took me less than 10 lines of code to animate the text. Or when a dev wants to loop using await/async he uses a library called loop. I can write that in 4 lines of code as opposed to using a 2KB library that is not going to be maintained forever.
Redux is scrap: We don’t use redux (even do we have twice). I’ve developed two massive applications with millions in transactions and both of the times redux becomes a nightmare. The only reason people use redux is that they want a sharable state across the app. I can think of 10 ways to do that very easily without all of Redux boilerplate. In one of the projects at Noritex we’ve implemented a store that doesn’t use redux and it is extremely easy to maintain (I will show how to do it further in the article).
Web Vitals (Largest contentful paint, first input delay, etc…) is a way for Google to sell more products: Think about this, if you are google and your primary product is a search engine you want to make that search engine as amazing as possible. That’s why they created web vitals, it is a way for them to make their experience amazing.
Centralizing API calls in one place
Through out the years and many projects i have started and mantained I have learned that the best way to build a front end is to centralized all the API requests in one place. Why…