The Frontend Hitchhiker's Guide: JavaScript Frameworks
Tags: codenewbie, webdev, javascript, react
Published: 2021-07-04 00:58:44


# Introduction 

Every now and then a developer has an idea to simplify building web apps and hence another framework is born. JS Frameworks bridge the gap between what standard JS provides and modern web app concerns.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wn7ksbek22ytn9xd2pfb.png)

[Image Credit](https://community.devexpress.com/blogs/wpf/archive/2014/04/23/devexpress-mvvm-framework-coming-soon-in-v14-1.aspx) 

Frameworks often provide features such as:

| Feature          | Definition                                                                                          |
|------------------|-----------------------------------------------------------------------------------------------------|
| [Composable UI](https://dev.to/snickdx/the-frontend-hitchhiker-s-guide-ui-libraries-59cm)   | Syntax for defining custom components with encapsulated styling and functionality                   |
| Routing          | Lets you define different parts of the app for the user to navigate without page loads.            |
| [State Management](https://dev.to/snickdx/the-frontend-hitchhikers-guide-state-management-30ji) | Syntax for allowing data sharing, syncing between components.                                        |
| Databinding      | Binding form controls to the state of the app.                                                      |
| Templating       | Syntax for mixing templates and data to render dynamic content eg scrollable list of UI components. |
| [Testing](https://dev.to/snickdx/the-frontend-hitchhikers-guide-testing-311k)          | Tooling for performing unit and integration testing.                                                |
| [Build Tool](https://dev.to/snickdx/the-frontend-hitchhiker-s-guide-build-tools-3bj2) | A CLI tool that converts the source code written with the framework into minified HTML/CSS/JS fit for production. |

Note that many of these features have dedicated libraries which were covered at previous stops in the series. Frameworks tend include these libraries or provide their own implementation.

# JavaScript Frameworks

The following are some popular and not so popular JavaScript Frameworks.

* Frontend Frameworks
  * [Svelte](#svelte)
  * [Stencil](#stencil)
  * [Alpine JS](#apline-js)
  * [Ember JS](#ember-js)
* Isomorphic Frameworks
  * [Aurelia](#aurelia)
  * [Next JS](#next-js)
  * [Nuxt JS](#nuxt-js)
 
## [Svelte](https://svelte.dev/)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ik8bt0wnwewv2qyertx2.png)
 
Svelte describes itself as 'a radical new approach to building user interfaces'. It favours doing its heavy lifting in a compilation step as opposed to in the browser at runtime. It is steadily growing in usage and popularity.

## [Stencil](https://stenciljs.com/docs/introduction)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cwa24x547mo2ajrxzaqj.png)
 
Stencil was created by the Ionic team, they describe it as a compiler for generating web components. Stencil was designed to for high performance and building on top of Web Standards. 

## [Alpine JS](https://alpinejs.dev/)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ygx2y0yc1686nqpz9c9.png)
 
Alpine JS seems to be another sleeper hit ranking 4th in the [State of JS 2020 Front-end Frameworks](https://2020.stateofjs.com/en-US/technologies/front-end-frameworks/). Alpine is another lightweight framework with a very appealing minimal syntax. All you need to know are 14 attributes, 6 properties and 2 methods!

## [Ember JS](https://emberjs.com/)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t660l8qnf2il0el2v391.png)
 
Ember JS was created in 2011 and hence is (probably) the oldest on this list. The fact that it is still relevant ([ranked 9th State of JS 2020](https://2020.stateofjs.com/en-US/technologies/front-end-frameworks/)) is an accomplishment in itself. Ember is an all in one framework providing all the features mentioned in the intro as well as an entire [marketplace of community addons](https://www.emberobserver.com/lists/top-addons).

## Isomorphic Frameworks

The remaining frameworks are categorized as [Isomorphic](https://en.wikipedia.org/wiki/Isomorphic_JavaScript) because they support a feature called [Server Side Rendering](https://www.smashingmagazine.com/2020/07/differences-static-generated-sites-server-side-rendered-apps/#:~:text=Server%2Dside%20rendering%20(SSR)%20is%20the%20process%20of%20rendering,the%20SPA%20framework%20to%20operate.).

{% details SSR Explainer %}

The web apps built with the previously mentioned frameworks are said to be **Client Side Rendered**. This means they are deployed as static HTML/JS/CSS files and the dynamic content of the page (eg table, timeline, gallery) are rendered entirely by JavaScript running in the browser without any server side code. 

A **Server Side Rendered** web application does most, if not all of its rendering on the server. This feature is supported by the remaining frameworks in this list. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pa1qe3axvjv3nujbtbiw.jpg)
[Image Credit](https://itclub.com.au/next-js-framework)

{% enddetails %}

Because SSR requires server side code, the following frameworks can be seen as both frontend and backend (hence the term isomorphic). I have a more in depth look of CSR vs SSR in another post series: 

{% post https://dev.to/snickdx/understanding-rendering-in-web-apps-ssr-1h83 %}

## [Aurelia](https://aurelia.io/home)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpcxby78c3e1g5pb9zj3.png)
 
Aurelia is another lesser known framework that appears to be gaining some traction and describes itself as simple, powerful and unobtrusive. Aurelia boasts unmatched extensibility in terms of creating and customizing elements.

## [Next JS](https://nextjs.org/)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0x5ns7gxncuns78sv8e.png)
 
Meta-framework are frameworks that are built on top of other libraries/frameworks. In the case of Next JS, it is built on top of [React JS](https://reactjs.org/). In addition to Server Side Rendering, next boasts features such build tooling, internationalization, and image optimization. Next is a hugely popular framework that is making waves in the space. 

## [Nuxt JS](https://nuxtjs.org/)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7ba4u2bth5srfh77hau.png) 

Whenever there is something for react you can almost bet there is an equivalent for [Vue JS](https://vuejs.org/). Like Next, Nuxt supports Server Side Rendering, data fetching and configuration for Search Engine Optimization. Nuxt also has options for transitioning and showing progress bars between page navigations.

# Conclusion

At this point you may be wondering why a certain popular framework was not mentioned. This is because it actually resides at the next stop on this series. Stay tuned next week for stop #7.

# Resources
* [The State of JS Survey](https://2020.stateofjs.com/en-US/technologies/front-end-frameworks/)