How I settled on React
- Stay updated, or more specifically, get out of the ES5 and script tag workflow.
I shortlisted four popular frameworks for evaluation — Aurelia, Angular, Vue and React. All frameworks are definitely good and opinionated. I subscribe to the No Silver Bullet philosophy and recognize there is no single best framework among these and many others.
I chose React for the time being given its popularity and employability.
React has a few things that discourage some developers automatically.
Learning fatigue refers to the fact that React is just a view library and to do things like routing, http, state management, you would have to learn and use more stuff all of which are independent but mostly used in conjunction. The fact that they are independent causes the problem almost always. In a smaller scale, I have seen this happen with Durandal (knockout, jquery, sammy etc).
Like most people, I didn't jump onto the React bandwagon because of JSX, learning fatigue and licensing issues.
Sometime this year, React became an MIT licensed project. So I figured I should consider React. Still JSX and the fatigue is something I didn't know if I could get over ever.
So, looking at the other choices, I had no choice but to try React. So, I did try and make a few attempts to learn React.
Raw React is the first tutorial I ever tried few years back. I appreciated the simplicity and liked the appeal of React, though it felt somewhat verbose to write.
So this was the first resource I reached out to this year. I found that there is an upgraded version of the tutorial and I was excited. Tutorials updated to latest version always excite me. However, the excitement died down when I found I was going to build a fractal tree. Now there is nothing wrong with this in general, but how often do you write a fractal tree? There is definitely value in knowing how to write such things, but when I want to learn React I want to learn React and nothing else. I just want to learn building boring web applications.
React in 30 days
Next tutorial that caught my eye was React in 30 days. This is a decently paced step by step tutorial and started well. I cheated a bit and completed a more than one article on the first day. I couldn't follow after the 5th or 6th day tutorial where you build a live clock. The reason was that the code in the article doesn't match the intent sometimes. Some pieces of code were left out of the article and you could see the same things said in the comments for the specific article. I was frustrated trying to figure out what the author thought or intended to do. After spending a few days on it, I bailed.
React with ASP.NET Core series
I came across this tutorial React with ASP.NET Core series by Jon Hilton on /r/dotnet which starts with a building a simple user management application with
create-react-app and TypeScript, and then lets you interact with a real backend API. I felt this is a perfect way to start things. Since I was starved for a good tutorial, I didn't mind not fully understanding a few things like
state at first.
I only needed to setup CORS on server-side which was not initially mentioned in the tutorial. Working through this tutorial piqued my interest enough to continue to learn React.
Thinking in React
Then I started with one tutorial from the official documentation called Thinking in React. This is not a bad tutorial per se, but a lot of it went over my head and I couldn't spend more time to understand it thoroughly.
Pure React email course
Then I found Dave Ceddia's Pure React email course and started it. It was a great tutorial and probably the best way to fill in my gaps so far. I loved the authors approach so much that I decided to get serious and buy his book with same name, Pure React. I am currently going through the book and doing the exercises. It is a good decision to buy the book. I am loving it.
The author didn't convince me that JSX is the best or anything, but simply showed me why JSX is good enough by making me write a few bits over and over again. I see the value and I still feel against it, but not enough to not learn React.
As for the fatigue, only time will tell. One thing I felt is that React is here to stay. It may not displace or beat other frameworks but will continue to grow.
If you did not find my recommendations good enough for you, I would say spend some time on the github repo called react-redux-links. I found most of the above resources in this repo.
- Documentation. The getting started tutorial starts by telling us to download an existing tutorial from github and then follow along. I find it easier to learn from a tutorial that lets me build a small sample from scratch and then build on top of this sample. This was the main reason I couldn't go anywhere with Aurelia.
- Community was on Gitter initially. Aurelia has a core group of developers who are very helpful on the Gitter channel. But I found Gitter to be hard to navigate and search older posts and comments. Gitter doesn't have the concepts of topics. One has to ask their question(s) and hope for an answer. This is because sometimes it is possible that no one has seen your question.
These two reasons are why I couldn't stick to Aurelia for more than a couple days. I am fully aware that there is a massive ongoing effort from the community to fix these things. Also the team has listened to the community and moved from gitter to a discourse forum. They have also moved to webpack and provided a CLI tool. If I have to choose again next time, I am sure Aurelia will be my bet. I am confident that Aurelia has only good things in store. I for one wish the documentation story to be addressed as soon as possible.
I am saying so much about Aurelia because I still feel it is the best choice. But this has to be said for the good of the Aurelia community.
- Verbose and complex syntax
- Migration from 1x seems easy but I found it is not quite straightforward.
I have some experience with Angular 2+ but it is not my preferred choice unless it is for a work project.
- Limited learning resources at the moment, though I must add that official documentation is probably the best of all SPA frameworks.
- Not much adoption yet.
I am keeping an eye on Vue. Since v3 is rewritten with TypeScript, I will reevaluate it again.