The new runtime, enabled by an npm package called @netlify/next, includes the ability to perform HTML rewrites and append data by calling serverless functions. Support for Next 12 middleware, which performs functions on the server before a request has completed processing, is in beta.
There are some complications, including the fact that the middleware works best in an edge function, but doesn’t by default, as explained here. Netlify Edge features were introduced in April. The Next.js runtime code is open source under the MIT license.
Long-time web professionals can smile at some of the publicity for the new Next.js runtime. Matt Biilmann, co-founder and CEO of Netlify, is known as a pioneer of the Jamstack architecture, which, in the words of its official website, “removes the need for business logic to dictate web experience. It enables a composable architecture for the web where custom logic and third-party services are consumed through APIs.
In this context, “the edge” is not quite the same as a traditional web server, as server-side processing takes place on a server closer to the user’s device, but also note the caveat above about where the middleware runs. Nonetheless, the template takes Jamstack’s original concept and introduces something more like traditional server-side PHP or ASP.NET, even though the company prefers not to call it “server-side rendering” (SSR).
That doesn’t mean Netlify’s new feature is wrong. On the contrary, the company offers a modern application platform including CI/CD, planned functions, observability and low latency thanks to its edge network, without the burden of managing a lot of infrastructure, although in this respect , it has a lot of competition.
It seems, however, that the application architecture pendulum swinging from client to server and back again continues to swing.