top | item 26651201

(no title)

migueloller | 4 years ago

I know the HN comments section is notorious for criticizing solutions they don't like because they seem too complex or unnecessary for them [1] but I'm honestly surprised that's happening with Next.js/Vercel here.

So many are saying that this could've been a static site distributed by a CDN. That's what a Next.js app on Vercel does by default! Unless you use `getServerSideProps`, Next.js will create a static site at build time and when deployed to Vercel it will be hosted on their CDN. Spending just a bit of time to understand why Next.js is so popular would've made that clear to most people here. But I guess that's not as easy as just criticizing it for bloat without knowing how it works and moving on?

[1] https://news.ycombinator.com/item?id=9224

discuss

order

sneak|4 years ago

Javascript aside, more things can and should be static sites.

(More things should render their basic, static-site content without having to exec js, too.)

The web would be a lot better if this were the case.

migueloller|4 years ago

I believe you can still do this in Next.js with some extra work to exclude the JS bundle. For example, you can use a custom `_document` page and exclude the `NextScript` component [1]. It would be nice if this was supported as a first-class concept, though.

[1] https://nextjs.org/docs/advanced-features/custom-document