Angular vs React vs Vue.js
I have been waiting for a long time to write an article about this. I knew about Vue.js in 2015. At the moment, there are many talks about Angular vs React vs Vue.js. I tried Vue.js at that moment, but did not implement it on a real project. So, I couldn't talk about it at that moment.
There was a lot of positive news at the time about Vue.js. Many people said that "Vue.js is a combination of Angular and React", "Vue.js is the future", etc. Today is the future, and I have already put Vue.js on some of my commercial projects. I will share my experience here.
Am I too late to talk about this? No. Because these frameworks/libraries have evolved. There were many updates on Angular and React; I will talk about them here. Vue.js has also evolved to Vue 3. Let's see how Vue 3 performed.
Before I knew these libraries, I mastered jQuery, then Vanilla JS. The latest library that I created is Semantic Tabs, which I still use today, and here is the jQuery version. Where is jQuery now? jQuery is dead. That's why I mastered Vanilla JS. After that, I learned Meteor.js. Where is Meteor.js now? It has evolved into a full-stack framework. However, I haven't heard any developer talk about it.
The first of these frameworks that I learned is Angular.js (today is "Angular" without ".js"). The reason I learned it was because I wanted to be a full-stack JavaScript developer with the MEAN (MongoDB / Express / Angular / Node.js) stack. Then, the second library that I learned is React.js (today is "React" without ".js"). React.js was cool at that moment. React.js brought JSX, which combined JS and HTML, and it is easier to learn than Angular.js. That's why today React dominates the world.
If you find out that this article is not relevant to you, it is because you used old versions, or because this article is old (in the next 5 years or more). I don't talk about Angular.js, React.js, Vue 2, etc, but the current version of them.
TypeScript
I don't work with JavaScript anymore. I always work with TypeScript. The experience is better than with JavaScript. Can they support it?
Yes, they support TypeScript, especially Angular; it comes with TypeScript by default, which means Angular doesn't let you work with JavaScript. Vue.js works out of the box with TypeScript, even though it doesn't enforce developers, but you can work with TypeScript by putting lang="ts"
on the script
tag. React doesn't work with TypeScript until you install it.
TypeScript programmers can work with JavaScript, but not vice versa. That's why in my Full-Stack class, I use TypeScript instead of JavaScript. If your company wants to encourage developers to use TypeScript, Angular is the best choice.
Installation
All of them are easy to install, but Angular requires Angular CLI to be installed first. You can create a Vue.js project by using npm create vue@latest
or load a CDN only, <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
, pretty simple. React allows you to choose any build tool that you like, such as Vite, Parcel, or Rsbuild, and even a full-stack framework such as Next.js, React Router, or even Expo. React doesn't come with TypeScript by default. If you want to work with TypeScript on React, make sure you add it first.
Server-Side Rendering
They produce CSR (Client-Side Rendering) by default. But, how about if we want to produce an SSR (Server-Side Rendering)? Angular is just like Swiss-Army Knives; it works out of the box. It even supports SSG (Static-Site Generation). React depends on and requires you to start with the full-stack framework. Vue.js has SSR APIs that allow us to produce SSR. If you work with Laravel, especially Laravel Inertia, it comes with Vue.js by default. Any back-end that has a separate front-end but wants a simple front-end and is even included in the Git repository of the project mostly uses Vue.js because of the simplicity of how Vue.js works, including its APIs, I think. This is why Vue.js wins. But Vue.js also has its frameworks that work within its ecosystem, such as Vite SSR, Nuxt, or Quasar, if you want to build SSR/SSG with Vue.js.
Testing
Angular has the best experience in testing. No doubt. Angular is a robust framework.
We need Jest to test React apps. However, I had trouble testing React with SSR on Next.js. I was using React v19.0.0 and React Testing Library. I thought some APIs didn't work or were not supported yet. I didn't know.
Testing in Vue.js is just like creating functions and then testing them. Vue.js recommends other tools out of its ecosystem, such as Playwright and Cypress, for E2E tests.
Deployment
Both Angular and Vue.js have their deployment recommendations. I will talk only about deploying to AWS Amplify here. Because I think AWS Amplify is popular and the easiest way.
Deploying the React project to AWS Amplify works great. It doesn't require you to have an amplify.yml
. It can even work great with its full-stack framework, Next.js, if I'm not mistaken, as SSR.
It is a different story with Angular and Vue.js. We need an amplify.yml. We need to configure how it is built. It works only for CSR. We need a different approach if we want to deploy it as SSR.
Which one is the best?
One of the reasons I talk about it because there are some people who have asked me. Okay, I will give my answer.
Maybe this topic is common, but you are here looking for an answer because many articles that you have found still do not give you an answer. They just gave you recommendations on when to use Angular, React, and Vue.js.
With my respect to the community. I work with these libraries even in commercial projects. I'm familiar enough with them. I tried to work with the best practices on them.
React is the most popular library and has the strongest community. If you're familiar with React, you can go with React. There is no need for you to learn Angular or Vue.js because React has dominated the market. I had problems doing E2E with React Testing Library on React with Next.js, but if I try Playwright or Cypress, maybe it will be solved.
If you want to enforce your team to use TypeScript, make sure they are in the same ecosystem, and separate HTML from TypeScript due to single responsibility, use Angular. It is absolutely a robust framework. I always go with Angular first.
If you want a simple or light front-end included in your back-end project, use Vue.js.
I was a React guy. When I wanted to build an exclusive web with SSR, I chose Angular. Now, I love its architecture. That's why I'm now an Angular guy. But, I still use React in my legacy projects, teach, and recommend React to my students. I work with Vue.js too, especially when I work with Laravel, and even consider it for Go-powered back-ends. Sometimes, it is better to work with Vue.js rather than template engines.
This article may be short. I want to talk more, especially in a technical context like syntax. But this article will be so long and so much effort. Maybe I'll talk about it in the future. Let this article talk at a high level. Feel free to comment if you have a different idea.
Related Articles
- Lesstruct
- Online Multiplayer Game with Go
- React Context with TypeScript
- Convert Any Images to JPEG and WebP, Compress, and Resize on the Client Side
- React with TypeScript