A good example of a preconception occurred to me the other day. I was interviewing for a front-end developer who hadn't had any Episerver experience. He had downloaded the Alloy sample site. The sample site uses an older version of JQuery. The sample site is updated, however, it is updated infrequently, compared to how quickly the world moves. His assumption was that Episerver could only work with this old version of JQuery... this is definitely not the case!
Googling the problem will likely make you more confused. Online, you will see countless varying opinions about which framework is the best. From my experience, there is no such thing as the perfect framework. The framework that you favour might even vary from project to project. When it comes to picking a framework, I think there are several key considerations. This post is written in April 2017 and in a few years time, things will have changed a lot. The purpose of this tutorial isn't to tell you about which framework you should use forevermore. The aim is to give you some understanding of the decision-making process that I use to pick a framework.
Angular 2, released last year is a great framework that is worth considering. With the 5G network coming out in the next few years, running a fast application from mobile is becoming less of an issue. Eventually, technology will be able to transfer data using the same speed to devices to all devices, however, until that happens speed matters. A single-page app (SPA) was originally designed as a way to combat the slowness of data to mobile devices. Angular was built with that in mind which means it is good for building an application within a browser.
The AngularJS framework footprint is pretty big, however, the benefit of this big bundle size is that it does a lot of things for you. Angular deals with routing and all kinds of things that you may, or, may not want. If your website uses Episerver, it is very unlikely that you will build a single–page app from scratch. On most projects that I have worked on, all we really needed was something that will do the model-biding to the API layer in an easy and efficient manner.
Currently, Angular 2 has not had the adoption that AngularJs 1 did, which leaves it in a state of flux at the minute. Angular is also pretty intrusive.. so when you work with Angular you are stuck with i. You can not easily swap out AngularJs later on. There's a steeper learning curve to AngularJs compared to some of the other frameworks like JQuery. This is especially true if you do not need to use many of out-of-the-box features.
The really nice thing about KnockoutJS is the automatic binding. Automatic binding prevents the need for vanilla JS event listeners. Knockout can be thought of as a lightweight version angular. THe bundle size is smaller and lets you work in an HTML manner just less intrusively. KnockoutJS, like AngularJS, is still in active development
BackboneJS is thought of as a complete framework, however, the downside is that there is no more active development on BackboneJS. For me this rules Backbone out as an option. With any new changes in tech, like HTTPS2, you would need to extend the framework yourself. I think it is better to use a framework that will evolve with you, not against you!
If you have limited JS skills and you have a team of .NET developers, then Knockout.js might be more suited for your project. If you have a more HTML focused team and you want to go headless, ReactJS or AngularJS is a good option. The thing to note is that some frameworks like ReactJS and AngularJS are more intrusive. If you use AngulaJS your application will become an angular application, where something like BackboneJS, or KnockoutJS allows you to work with Razor views by enhancing the HTML instead. Happy Coding 🤘