The new runtime, enabled by an npm package called @netlify/next, includes the ability to do HTML rewrites and add data by calling serverless functions. Support for Next 12 middleware, which runs functions on the server before a request has finished processing, is in beta.
There are some complications, including that middleware runs best in an edge function, but does not do so by default, as explained here. Netlify Edge functions were introduced in April. The Next.js runtime code is open source under the MIT license.
Long-time web professionals may 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 the web experience. It enables a composable architecture for the web where custom logic and 3rd party services are consumed through APIs.”
In this context, “the edge” is not quite the same as a traditional web server, because the server-side processing takes place on a server closer to the user’s device, though note also the caveat above concerning where the middleware runs. Nevertheless, the model takes the original Jamstack concept and introduces something that looks more like traditional server-side PHP or ASP.NET, even if the company prefers not to call it “server side rendering” (SSR).
This does not mean that Netlify’s new functionality is misguided. On the contrary, the company is offering a modern application platform including CI/CD, scheduled functions, observability and low latency thanks to its edge network, without the burden of managing a lot of infrastructure, though in this regard it has plenty of competition.
It does seem though that the pendulum of application architecture moving from client to server and then back is still swinging.