So, I started out to create a web application, no idea what web application, but back in the late 80's and early 90's I could happily make a living by writing software systems for real people. For the last 25+ years, I've been in corporate land taking the easy money. Basically I wanted to know what tool set would I use if I was to make a living writing software systems for real people again. That was what took me into the land of the MEAN Stack, which I am reasonably convinced, if I had all the time in the world to create a world changing software as a service product would be the solution I would use.
However, I don't have all the time in the world, and whilst it is rewarding to work with MEAN Stack, its just a whole bunch of work before you get anywhere. I thought about how much effort it was going to take to write a simple user management system to allow me to setup users and permissions, shuddered a little at the prospect and I took a step back. Sure, I can write that, but I really, really don't want to. I'm looking for a solution to allow me to easily create business systems for small companies. I want stuff like user management to be "for free", and I've been around the block enough times to know that even if I can write it for free, maintaining it will be a bunch of hassle, I want something properly free!
So I looked around at what people where actually using. The answer was resoundingly WordPress. As of May 2020 wordpress is powering some 37% of the internet. Indeed WordPress uses PHP for the backend, and PHP is now on the backend of some 78% of the internet. Wow, I had no idea these technologies where so dominant. So I knocked up a wordpress development environment, banged together a small system, found siteground hosting as the only wordpress recommended hosted with servers in the EU, and in like a couple of days I have a live system out there, with real users on it. You cannot argue with that, it would have taken many weeks if not months of development to accomplish the same thing with the MEAN Stack.
It's easy, but it can be a wee bit painful. It's like I have skipped the last 25 years and I'm back in 1995 dealing with raw HTML, CSS, PHP, a relational database, a roundtrip to the server for every page update arrgghh... I have to admit, back in the 1990s I was not doing internet development. I developed for the desktop. It was the DOS days and my preferred language was a thing called Clipper, that you could buy a single license for, and then sell as many applications as you wanted. A single language to develop the whole system. Windows 3.1 was complete rubbish, Windows 95 was only catching on. I looked at web technologies and thought, you know what, I'll wait before I get into that lark, there has to be an easier way. So 25 odd years later, MEAN Stack truly look s like the evolution to leave that whole complex immature world behind and get back to having a single language that can create a complete system. But I'll wait until I get things like user management for free before I start using it for one off business systems!
But can there not be a middle ground? IMHO the biggest step forward for software developers in the last 25 years of the internet, is the evolution of javascript frameworks. Things like Angular that will allow creating a complete application that runs in the browser and that simply talks through an API to the backend. I remember chatting to the VP of a large software firm who had migrated their platform to an Angular 1.x based solution. They where livid and wanted to fire the whole development team for choosing a technology where they would now need to rewrite everything due to google decision to release angular 2 as a completely incompatible rewrite rather than an incremental upgrade. She was somewhat placated when I pointed out to her that actually, even if she ditched the whole UI, the server side had been completely preserved, the APIs did not need to change.
So in that spirit, could we not avoid going all the way back to the 1990's, and at least keep that separation between the UI functionality and the backend system that stored the data? WordPress now supports an API, could I not slap Angular or god forbid React on top of that?
So, without doubt Angular & React are the most popular modern JavaScript frameworks. For me, you judge popularity by going to your favorite job site and searching to see how many jobs are advertised for that technology.
But Angular is highly opinionated. If you are going to create a complete working application from the ground up, probably Angular is going to give you the best result. There is a certain format that you will need to follow and you will end up with a solution that most other Angular developers will be able to pick up and work with fairly easily. It would be "relatively easy" to create a complete WordPress theme that was based on Angular, the home page would download your application, it would use the WordPress API to communicate with the backend, nothing whatsoever in the front end would come from the out of the box WordPress functionality. But it seems to me, that misses out on a huge part of the beauty of WordPress. WordPress has some 7,500 themes available to customise the appearance of your site. It also sounds like a whole bunch of work!
React... I just don't like react. Ok, I'll admit it, it could be down to not liking Mark Zuckerberg and having an overriding desire not to having anything whatsoever to do with Facebook, to be a dumb f*** who gives him information or go near anything else the man has ever touched. I'll admit, it is much, much easier that Angular to learn and to get up and running. It does however come at the cost of loosing the two way synchronization between your in memory objects and your on screen text. setState is perfectly acceptable if you have never used Angular, but for anyone who has gone to the trouble of learning Angular it just looks like amateur hour. But perhaps, I'd need to hold my nose and in this particular context, React might be a better solution than Angular.
And then to my relief I discovered Vue JS. I had kind of heard of it, but never bothered to look in detail. Yes, on the job count front, Angular and React are miles out in front. In fact if you search for Vue on a job site it probably specifies something like "Modern JS Frameworks like Angular, React or Vue" rather than explicitly looking just for Vue. But if you believe w3techs, is a tiny bit behind Angular and a bit ahead of React in terms of the number of websites that actually use it. I'll admit that the popularity is largely because it is designed from the groundup to be implemented incrementally, it does not need to take over your whole site, it works with what you already have. I'd been searching for yages for examples of how to integrate React or Angular with WordPress to no avail, but within minutes of discovering Vue.js I had found this excellent tutorial. Seems to me that Vue.js could be the ideal tool for extending WordPress with modern functionality.
If you haven't used any of these frameworks before, I would strongly encourage you to head on over to VueJS.org and watch the 5 minute video there. It is the same principals of two way synchronisation of an in memory JSON object and the HTML page being displayed to the user that you see in Angular. Unlike React, it is a proper two way synchronisation. Unlike either of them, you can plug it into an existing site and have it working in under 5 minutes. I think that is the route I'll follow for now"
Update July 24th 2020, after a couple of weeks of merry progress with VueJS. But I have got a mate, and he wants to help with the code, and so far, all of my code is going into a single Javascript file... And then I discovered I could actually use a Javascript build with VueJS and Wordpress, and I thought great... But then thought, well if I can do it with VueJS, why not Angular? Should I not try getting an Angular build to work as a wordpress theme? And while I was thinking that, VueJS have just announced version 3.0, which is TypeScript based. Fearing the debacle of when Angular 1.x moved to version 2.x with Typescript and everything needed a rewrite, combined with the breakthrough of a build working with wordpress, if I'm gonna have a build, gonna have transpiled typescript, then what the heck, let's go the whole hog and use Angular. Seems Angular elements have been specifically designed for use with CMS type systems, I'm, off to figure out Angular & Wordpress!