DEV Community

Lightning Bolt
Lightning Bolt

Posted on

Why I choose CRA ( Create-react-app) over Vite for this React project ?

You must have stumbled upon many posts praising Vite and how it should be the de-facto standard to get started with React apps. Vite is awesome, nothing wrong with it. But, sometimes I just believe when you're put into this decision-making situation, you should give yourself some time instead of blindly picking the new tech upgrade in the market and ditching the older one.

I still use both CRA (create-react-app) and Vite for my React projects. In the organization (Mercedes Benz) I work, we had to start a new project from nothing. We had interns, and junior developers to collaborate with on that project. The project requirements were mostly already defined and were not likely to change in a short period. It was established to be a small to medium-sized full-stack application with an estimated completion time of two months. There weren't major performance-related concerns so I decided to pick CRA even though I, myself am a big admirer of Vite.

CRA has been proven successful over these many years and got support from Facebook. It was easier to find help related to deployment, installation of new packages and more issues in case they show up in the development process (which they would). It is not an app which is likely to be in the development phase for a long period. Had that been the case, or we were likely to face performance-related issues in the long run because of the app being too bulky, I'd have opted to go with Vite. But, that wasn't the case here. Sticking with CRA ensures that we have more help available on the internet, less time spent on learning and more in development. Most packages have stable compatible versions with CRA available with proper documentation. So, why not stick with it?

I've seen some developers blindly going for the upgrades in the market instead of considering the older technology while making architectural-level decisions in designing an application from scratch. In my opinion, it is completely fine to sometimes stick with older tech stack even while creating new applications. I'd bring Vue into the picture for a moment where there is a buzz in the market about why you should ditch Vue 2 ever since a stable version of Vue 3 has been released. But, why always? Why can't I use Vue 2.6 in my apps in 2023? Maybe there is a UI library that only has a stable version for Vue 2. It is your choice to still use Vue 2 or create-react-app, it is not obsolete and not likely to be so for the next few years. So relax, and use what you love. You should however have a pretty convincing reason to justify your choice.

So, that's it for this post. Here, I just put my two cents on why it's fine to continue using existing technologies despite them having better upgrades available. If you have anything to say, please comment in the comments section. See you in the next post. πŸ˜€

Top comments (2)

Collapse
 
brense profile image
Rense Bakker

Its not like you're switching out the framework though... You're just opting for a faster build tool, that doesn't introduce a whole bunch of major vulnerabilities into your code (that haven't been fixed in over 2 years and counting). Vite is vulnerability free. Maybe in the beginning when the vite react plugin wasn't stable yet, but that's years ago now... And tbh the vite (and rollup) community has a lot of people working on it now, due to its much better plugin system compared to webpack. If you have some extremely advanced setup, that only works in webpack (you should ask yourself what you're really trying to do) that would be the only reason not to use vite, but in that case you wouldn't use CRA either, because you're going to eject anyways... CRA was great for a long time, but those days are really gone... Vite starter for react has faster setup/install, faster dev server and faster build times in deployment 🀷

Collapse
 
apfirebolt profile image
Lightning Bolt

Couldn't agree more, Vite is indeed awesome. There were other legacy React projects in our team which used CRA, we just thought interns who we planned to deploy on the project might find it easier to work with CRA