The new general-purpose JavaScript framework, next.js, is now open source and provides a new alternative for React and server-based Web applications.

The team from Zeit built next.js on top of the React base and component model, along with a key extension: by using a component lifecycle hook method called getInitialProps(), the framework was able to do initial rendering on the server and continue rendering on the client if needed. However, this advanced feature is an addition to a small but powerful framework.

With its minimal feature set, next.js provides a convenient way to create new Web applications without requiring a lot of toolset configuration. Similar to create-React-app, installing this framework sets up a build process based on React, Webpack, and Babel. Developers who used to write React components would create pages based on the React syntax, with each page providing a render function:

import React from 'react' export default () => Hello world!

Next.js uses Filesystem as the API, so each component placed in the Pages folder will be automatically mapped to a server-based route. For example, the pages/about.js component on disk will automatically serve the /about URL.

Unlike projects like Express-React-Views, which is a view engine built on top of Express, next.js is a top-level service layer that renders only the results of JavaScript functions. To achieve this, the project uses Glamor to work with CSS, rather than relying on a separate CSS file.

In next.js, each route is a simple ES6 module that exports a function or class that extends from React.component.js.

One of the subtle advantages of this intrinsic orientation of next.js is that developers don’t have to spend time setting up Webpack or Babel configurations. In the past, these two steps would have consumed a lot of developer time. To run a development version of a site, simply run NPM run dev.

Universal JavaScript is still a more advanced technology for some development teams, and many frameworks have their own implementations. Angular 2 has Universal Angular 2, Ember has Fastboot. In the React space, there are plenty of alternatives, such as Walmart’s Electrode and Redfin’s React Server. Right now, Next. Js has a lot of potential as a very simple alternative. The project is open source on GitHub.