Hacker News new | ask | show | jobs
by dmerks 2233 days ago
For those unfamiliar with the the general subject, the author is CEO of Vercel (Zeit until recent VC funding), a company that provides "serverless" hosting, especially for Nextjs, an open source Reactjs (Facebook) framework. Among other things, Nextjs makes it easy to segment a React app at build time into parts that are either server side rendered (SSR) or static (which can be "hoisted" onto a CDN). In the same declarative fashion, data can either be fetched from the server for the SSR components, from the browser client (e.g. to reduce server load and useless hops), or "prefetched" at build time for components that can be static like blog posts, documentation, a top 10, etc. Interestingly, the Vercel Nextjs and Google Chrome teams have collaborated... from memory: to reduce bundle sizes and to stream assets after initial render for better performance.
3 comments

> an open source Reactjs (Facebook) framework

Isn't React itself already a giant JS framework? They've made a framework-for-a-framework?

So the idea is to let developers write as though it's all one big React SPA (single page app) but then actually the static bits of it get compiled into vanilla HTML/CSS and served from a CDN?

Yes, Next.js is "hybrid" framework for React. It allow you to incrementally adopt React, as well as evolve your application over time. Static pages, server-rendered, serverless functions––all within the same project.

For larger React projects, it's impractical to use the same rendering strategy for every page. Your marketing page can be static and your dashboard can be client-side rendered.

Same effect as hosting your static stuff on a CDN, like basically everyone does already.
It's not the same as a CDN.

"Static Hoisting" is pushing data to the edge and replicating it ahead of time. Legacy CDNs are just in time. The approach discussed in this article has a performance and availability advantage.

There are CDNs out there that allow me to push my content "ahead of time", like Akamai. Besides, the speed advantage vanishes after the first request.
Good context thanks