Which JavaScript library would you use

Choosing the “right” JavaScript library

The choice between library or framework

Are you looking for specific library functions (such as rendering the user interface and / or data binding) or do you want a full-fledged framework that contains many functions immediately ready for use? Libraries usually target a few very specific functions, while frameworks cover a wide variety of functions.

If your team is already using a framework (e.g. on the server side) it may make sense to switch to a JavaScript framework to keep things as consistent as possible between the client and server. On the other hand, if you prefer to put different libraries together (much like choosing what to eat at a buffet) so that you have the flexibility to swap out different functions as needed, then one or more libraries may be what you're looking for. As with anything, there are pros and cons to both approaches.

I was initially drawn to AngularJS (and now Angular) because they offer framework functionality. I have a Java and .NET background and have published many successful web applications with frameworks over the years. I like the consistency that frameworks typically bring for team developers. Functions such as UI rendering, data binding, routing, form validation, testing and much more are available out-of-the-box in frameworks such as Angular.

Libraries like React and others can offer a lot of functionality without the "overhead" of a framework. They can make it easier to get started (certainly a very subjective statement) and are generally easier to use depending on the functionality your application requires. So which is better - a library or a framework? If you talk to 100 developers, you will get 100 different answers. Here is my look at some of the popular libraries and frameworks out there. Those are certainly not the only options, but they are today's big players (in my opinion anyway). Here are 3 that I have personally examined, edited directly, or used in companies that I work with successfully.

Vue.js

Vue.js is a "progressive JavaScript framework" (although I've always thought of it as a library). With additional scripting, you can create both large and small applications with Vue. In addition to being easy to use, it is also very fast and very easy to put into operation. If you are familiar with AngularJS (the 1.x version), you will understand Vue very quickly. It is an open source project that is growing rapidly. It has a CLI to help you get started with your first project: npm install -g vue-cli

React

React is a UI library that has a lot of additional functionality (and third party libraries) that can be added. It offers great performance, is easy to use, and is very popular. A full-time team at Facebook and a robust open source community support the project. A smaller variant of React called Preact is also available. It's used by Facebook, which is a bonus when it comes to longevity. React provides a CLI that makes it easy to get started: npm install -g create-react-app

Angular

If you prefer a framework then give Angular a try. It offers a range of robust, out-of-the-box features, all of which are built-in. It also offers ahead-of-time (AOT) compilation for builds and has a robust CLI. It is operated by a full-time team at Google and it also has a robust open source community. It's used by many major apps within Google, which is a bonus when it comes to longevity. Note that if you are new, “AngularJS” refers to version 1.x while “Angular” refers to version 2+. Start using the CLI with the following command: npm install -g @ angular / cli

There are certainly a few more libraries / frameworks that could be listed and the list will definitely change over time. I have decided to only list those with which I have gained my own experience, either through development or working with a company.