We've been working on improving next export ◆ App Router compatible ◆ Server Components…
- User
We've been working on improving
next export◆ App Router compatible ◆ Server Components compatible ◆ Route Handlers compatible ◆ Built-in to
next build◆ Ensures development matches static exportShipped on canary, stable soon!
https://app-router-export.vercel.app
App Router compatible: Full static export when using the
appdirectory.All routes are opted in to
export const dynamic = 'error'giving you early errors for e.g. callingheaders()/cookies()as there is no server.https://beta.nextjs.org/docs/api-reference/segment-config#dynamic
Server Components compatible: Server Component could already be rendered as static html for initial load and static payload for client navigation. There are no additional changes to make it work for output: export.
https://beta.nextjs.org/docs/rendering/static-and-dynamic-rendering#static-rendering-default
Route Handlers compatible: Route handlers (route.js / route.ts) can be rendered to a static response at build time if you it only exports GET and doesn't read values from
request.Route handlers that use static rendering are supported in output: export.
Built-in to
next build: You no longer have to runnext export. The output ofnext buildwill have theoutdirectory.next exporthas mostly been a copying operation, it copies the result from next build static rendering to theoutdirectory. Now it's fully built-in.Ensures development matches static export: Since Next.js allows you to use both static and dynamic rendering next export had to warn/error when you used features that need a server, this led to finding out the application couldn't export later on.
output: export bridges this gap in functionality by giving you feedback during development that a certain feature can't be used when you want to build an application without dynamic rendering.
This is just the beginning, we're working on additional improvements for output: 'export'. e.g. improvements for images.
Turn the tweets above delimited by --- into a blogpost
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.