Universal JavaScript Frameworks

Submitted by dryer on Wed, 01/10/2018 - 12:15

Universal JavaScript Frameworks are a trending technology, which is useful especially in cases where you need best possible performance and best SEO visibility. Universal (or Isomorphic) JavaScript that runs both on a Node.js powered server and on the users' browser or another machine, like GoogleBot, rendering HTML.

In many cases, like business applications ran in-house, investing in Universal Rendering has not been worth the overhead. This kind of applications are still not the best target for solutions, but decoupled content driven applications powered by GraphQL or RESTful APIs are ideal applications for Universal JavaScript. This is exactly where Drupal is.

Technology in this field has rapidly matured and there are now many interesting options for JavaScript developers looking to implement a solution like this. Instead of rolling a custom implementation, developers can now rely on opinionated Universal JavaScript Frameworks that lower cost and allow rapid development of decoupled Drupal sites.

The best choice for such a framework depends mostly on your choice of UI library. Declarative UI libraries have been widely adopted by the Drupal community, with React.js being the one chosen for the core. In practise this translates to a React.js Universal Framework being the best option. There is no official option from the React developer team as they focus on keeping it as a UI library.

Next.js is a popular framework that enables creating universal applications with ease. It is powered by React underneath, so it is a no-brainer selection for developers familiar with it. In addition to React.js, Vue.js has stabilised as a popular option for JavaScript UI development. Vue developers can look forward to working with a Next.js equivalent called Nuxt.js.

If you have not selected a technology yet, then it is worth exploring both React and Vue before making a decision, and then selecting Nuxt.js or Next.js depending on that choice. The most important part is to make a choice and prepare for the rising popularity of Universally rendered JavaScript in the Decoupled CMS space.