Paul Krill
Editor at Large

Next.js 8 now supports serverless apps

news
Feb 14, 20192 mins

The JavaScript and React framework also reduces build-time memory usage and speeds static export

React - an open-source JavaScript library for building user interfaces
Credit: Thinkstock

Next.js, a framework for building server-rendered apps with JavaScript and the React UI library, adds serverless computing capabilities as part of its new Version 8.

Next.js 8 enables serverless deployment, in which applications are split into smaller parts, or lambdas, that let code be run on demand and scale automatically. In Next.js Version 8, each page in the pages directory becomes a serverless lambda. A low-level API is available for serverless deployment.

Other new and improved features in Next.js Version 8 include:

  • Build-time memory usage reduction, made via contributions to the Webpack module bundler. This has resulted in 16 times better memory usage without any degradation in performance, according to developer Zeit.
  • Prefetch performance improvements, with the Next.js router enabling prefetching of pages for quicker navigation.
  • Smaller HTML size, with the initial payload size reduced.
  • Faster static export, in which static rendering through next export will be faster on multi-CPU machines. Static rendering is done to output files that can be served directly without code execution on the server. The number of CPU cores will be detected automatically and pages distributed accordingly.
  • An inline JavaScript tag for passing data has been changed to a JSON tag for safe transfer to the client. With previous versions of Next.js, enabling the Content Security Policy security layer required enabling script-src unsafe-inline in their policy, with Next.js creating an inline <script> tag. The change means there are no more inline scripts included by Next.js.
  • An API authentication example is included to show how to authenticate against an external API in any programming language.

Where to download Next.js

You can find Next.js setup instructions at Nextjs.org.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author