Re:Next.js 13.4
by kylehotchkiss on Thursday May 04, 2023 @12:40PM
(#35818225)
A big benefit of the pages folder is the ability to statically generate content on build time and deploy, then getting the performance benefit of being a static site. Does/will the app folder allow for the same static generation capability? Seeing `Is the pages directory going away?` in the release notes to me seems like a hint that the pages directory may be going away.
[ Parent
| on HN ]
Re:Next.js 13.4
by MalseMattie on Thursday May 04, 2023 @12:50PM
(#35818442)
Yes, the app router allows for the same static generation.[0] It is the default rendering strategy, and the page only becomes "dynamic" (rendered at request time) if the page has a "dynamic function". (functions that use URL search params etc.)
[0] https://nextjs.org/docs/app/building-your-application/render...
Further, you can statically export your application to HTML, CSS, and JS files and host without a server: https://nextjs.org/docs/app/building-your-application/deploy...
Re:Next.js 13.4
by kylehotchkiss on Thursday May 04, 2023 @02:18PM
(#35819833)
This is one of my favorite ways to build Next.js sites, and adding in Dynamic when needed is Next's superpower. Thanks for noting the the new app/ folder supports it!