Intro: Which framework to use with Ionic
What's up Simon? Welcome to a new vlog and the question: which framework should I use with Ionic? You might have read that Ionic is basically for everyone since Ionic 4 and the move to web components. But especially if you're new to Ionic you get the choice to use Angular, to use React, and now also to use Vue or to even use vanilla JavaScript. I would definitely be confused by this choice and I also saw some questions on Reddit, Twitter everywhere about which would be the best way to get started with Ionic. So here's my explanation about different factors that you have to calculate in and think about if you're making a framework choice for Ionic and also for experienced developers if it's worth actually to switch to a different framework with Ionic.
Ionic history and core purpose
First of all, Ionic traditionally used AngularJS. When I got started with Ionic 1, AngularJS was the default. That continued with Angular 2, since I think Ionic 2 as well, and only since version 4 Ionic opened up to other frameworks because they moved to web components which are basically a standard set of components that can be used with every framework. It was actually a great move but that's just history. The current state is that Ionic, or if you think about Ionic, is basically a set of UI components to build a great mobile application for every platform. On top of those components like a list, an item, a card, Ionic also offers special UI components like a modal, an alert, so things like these overlay components that can be used. Everything else is basically handled by the framework of your choice, meaning Angular, React, or Vue. That's actually the only real options we will consider in this video.
Pick a framework you already know
If you're new to Ionic the first question I would ask myself is actually: do I have any skills with Angular, React, or Vue? Have you built any kind of web application with one of these frameworks before? In that case I would highly recommend to just pick that framework for Ionic as well. In general, all of these three frameworks are a great choice for building web applications. Each of them has some strengths. Angular is more opinionated; it gives you a lot of architecture and structure of your applications. React is more focused on the virtual DOM, it uses JSX, it has a bit different coding style. And Vue is a lot easier to get started, I feel. I like it because you basically just need one or two files to really set up your project and then you can already create a Vue application. So if you have any skills with one of these frameworks I highly recommend to just go with that.
Documentation, tutorials and community support
Then let's consider support or documentation. First of all, within the Ionic documentation you can by now find examples for all of these three frameworks. That means if you want to get started, if you want to check out the documentation you will find examples for all these languages and you're not completely lost. But if we talk about tutorials on the other hand, we have to consider that Ionic existed for AngularJS and Angular for quite some time at this point and therefore there's just a lot more content on Ionic Angular. That's just the fact. Of course this will or might change in the future depending on how many people will move to Ionic from different frameworks, but at the time recording this video in 2020 of course there are a lot more Angular tutorials and it might be harder for you to find the right information for you to fix your problems. But on the other hand you can always simply fall back to pure Angular, React, or Vue questions on Stack Overflow because most of the time it's not really an Ionic issue that you encounter but like an issue with the Angular router or the React state management, React hooks, anything like this. Usually that's already answered by the community of that specific framework. You don't really have to look for how can I do whatever with Ionic React; you most of the time can simply look up how to do it with React and then you can easily incorporate this into your Ionic application because remember Ionic is mostly a library of components on top of that framework.
Downloads, packages, and component parity
If you want to see this in real numbers you can check out the download statistics for the different packages: ionic-angular, ionic-react, and ionic-vue. We have to consider that ionic-vue is pretty new and also React has been around for maybe a year I think at this point. Of course these statistics can change but in general we see ionic-angular around 100k downloads per week. For React we got 16k and for Vue we got below 10k. So that shows the difference between the people using these different frameworks, but again this is from the tradition. Perhaps in two or three years we will see a completely different picture. Let's also speak about Cordova. You might have heard my opinion about Cordova versus Capacitor or check out my other video on that topic. In general as far as I've seen React only uses Capacitor. This doesn't mean you can't use Cordova plugins as you might know you can also use Cordova plugins in Capacitor — not all but like 99% for you. I actually saw some tutorials how to use Cordova with Vue as well and for Angular you can also use both Cordova and Capacitor. There is maybe a tiny difference as you can't use directly Cordova with React, but I won't say this is a very important factor because at this point I only start new projects with Capacitor. You can still use Cordova plugins with Capacitor and there's really nothing to whine about that you can't use Cordova so that shouldn't be a reason for your choice. Do you get access to all the Ionic components with each of these frameworks? Actually the answer is no but it's really just a tiny fraction of things that you can't do. What I saw is that you can't use the ion-virtual-scroll and the infinite scroll with React and Vue. I'm not too far into that issue but what I've seen is that both the React and the Vue community have their own solution for this problem. Yes, they might not yet exist with Ionic so with Angular you can use it and with these other things you can't, but once again this shouldn't be really a huge factor affecting your selection.
Job market and career considerations
Another huge thing that you should think about is actually the job market and what you're looking for in general. People select a framework or get started with something like Ionic to get new skills for a job. If you're looking for a job in your country, your city and you see like all the offers are for React, then it's not really a good idea to pick Angular, right? In Germany there's actually a lot of demand for Angular developers, so this can be really different. That means if you're selecting Ionic because you're preparing for a job or you're inside a company that already uses a specific framework you should really check what they're using or what the demand is in your country and the job that you want to get. If you just do this for fun, for your own learning or just creating your own project then of course pick the one that you think you will learn the most from or will get you the most, but otherwise also make a wise choice about what you should learn because in the end you're like an Ionic React expert and nobody is hiring you, that's of course not the good idea.
Do you need to learn the framework before Ionic?
Finally one more question that I also asked on Twitter: do I have to learn the framework, like Angular, React, or Vue, before getting into Ionic? There were different opinions about this topic and my very own opinion is actually no, not really. When I got started with Ionic I knew nothing about AngularJS and it took me maybe a few months or years to understand what Ionic is and what Angular really is. But it was never really a big problem for me to find the solution for my problems. So if you really want to understand how a framework works of course you can also create a project with just React, Angular, Vue and then compare it to how it looks inside your Ionic application. But from my point of view I would actually just get started with Ionic. There's nothing like a barrier. You don't really have to learn any of these frameworks or be an expert in React before you can get started with Ionic React. I would just get started with Ionic, use React as good as possible or Vue or Angular and then learn while you're also picking up new Ionic skills.
Final recommendations and closing thoughts
All right, so that's my analysis of the current situation. Let me say this: Angular, React, and Vue are all great frameworks. I don't want to promote any framework more. All of them are really great and it's really a kind of personal or a company choice to pick any of these frameworks. Any or all of them will work definitely great with Ionic and you get the benefits for why you picked Ionic in the first place. But especially in the beginning this choice might not be easy, so really think about the things we discussed: the demand, what you really want to do, why you want to build Ionic applications — job, fun, something like this — and then select the framework because getting into Angular or React or Vue might consume a lot of your time. It really takes a lot of time to become an expert which you don't have to be, but at least getting to a decent level might take you some time, so really think about your choice upfront. Vue might be a bit easier, Angular might take a longer, React might sit somewhere in the middle. I always like to compare Angular, React, and Vue to Mac, Windows, and Linux because Angular is making a lot of choices for you just like Apple is making for you. So you might like this or might not like this. React is a lot more free; you can do certain things in a different way. And Vue is putting together a lot of different things manually or in the beginning I felt like React was a bit like this as well. It's also a personal choice if you're more like the tinkering type who just wants to have the core and the small package and then wants to add your own stuff, or if you like the Angular approach where you got a decent architecture, a lot of build tools and a huge project right out of the gate. Finally, if you plan to use Ionic with Angular check out my very own Ionic Academy, ionicacademy.com, where I got like 50-plus courses by now and a huge arsenal of quick wins and the community to help you with everything Ionic and Angular. I hope you like this video, give it a thumbs up and subscribe to the channel for more Ionic content and hopefully you will have a great week with the framework of your choice. Really there's no one-size-fits-all solution. You have to make your own choice based on the factors we discussed and perhaps also the factors inside your company or the development team in your company. Whatever you pick I hope you have a great week with some Ionic fun. I will catch you next week like always. So happy coding. Simon.