vercel / next-react-server-components

Demo repository for Next.js + React Server Components
https://next-rsc-hn.vercel.app
MIT License
979 stars 158 forks source link

Is `next export` supported? #1

Closed adammockor closed 1 year ago

adammockor commented 2 years ago

I tried to add next export to package.json like so "build": "yarn next build && yarn next export", but non of the pages (other then 404) is generated. Why so? Not even when I add getStaticProps to some pages, like index.js, csr.js or rsc.server.js.

shuding commented 2 years ago

Currently, next export is not supported with RSC. You probably don't need RSC if you want all your content to be fully static.

adammockor commented 2 years ago

Well, not all content should be static. That's the point of RSC if I understand it correctly. If we forget about streaming, colocation of data instead of having getStaticProps and less code in bundle due exclusion of server components and partial hydratation could be very useful for SSG too. But maybe I don't understand it correctly and RSC is not there yet.

hippotastic commented 2 years ago

If I understand correctly how next export works, all prerendered HTML will still be hydrated on the client. I‘d love to remove this unnecessary hydration step for static components, which make up most of my pages, and hope that RSC can become a way to make that work.

leerob commented 1 year ago

Hey all! next export support is planned for the app directory, but is not implemented. We won't be adding next export to this demo specifically, but will be talking more about this once support has landed. You can view the roadmap here: https://beta.nextjs.org/docs/app-directory-roadmap