Next.js 6: zero-config static exports, _app.js, Babel 7, and nextjs.org
Key Points
- zero-config static export
- top-level _app.js for page transitions
- babel 7 with fragments and TypeScript support
Summary
Next.js 6 (2018-05-16) is a production-ready release focused on easier static exports, a new app-level extension point, modernized JS tooling, and a dedicated docs/home site at nextjs.org. Key developer-facing changes include automatic route-map generation for static exports (no default next.config.js edits), a new top-level component _app.js for page transitions/error boundaries and easier global integrations (Apollo/Redux), Babel 7 with JSX fragment syntax and nested .babelrc support, and first-class TypeScript support via @zeit/next-typescript. The new site consolidates docs, the Learn tutorial, and a showcase.
Run static export:
next buildthennext export
Key Points
- Zero-configuration static export: route map auto-generated from
pages/, so simple apps rarely neednext.config.js. - New
_app.jstop-level component: wrap pages, implement client-side page transitions, add global providers (Redux/Apollo), and define error boundaries withcomponentDidCatch. - Pre-rendering modes clarified: server rendering (per-request) and static rendering (output files served without server code).
- Babel 7 upgrade: supports JSX fragment syntax (
<>...</>) and enables built-in TypeScript transforms; nested.babelrcfiles are supported per-directory. - TypeScript: use
@zeit/next-typescriptor the example repo for easy integration. - nextjs.org: unified docs at
/docs, integrated/learntutorial, and a/showcaseof sites built with Next.js.
Practical notes for engineers
- For static sites: check
pages/layout and runnext build && next exportbefore deploying. - To add global providers or page transitions, create
_app.jsat the project root (replaces many_document.jsuse-cases for runtime behavior). - If using TypeScript, add
@zeit/next-typescriptand verify Babel config; scoped.babelrcworks for nested directories.