Next.js 10.1
Key Points
- Fast Refresh 3x faster
- Image optimization via WebAssembly (M1 support)
- 58% smaller install size
Summary
Next.js 10.1 focuses on developer experience and performance: Fast Refresh is ~3x faster (≈200ms), install size and dependency count are significantly reduced, and next/image now uses WebAssembly with Apple Silicon (M1) support plus new layouts and custom loader capability. The release also adds a provider-agnostic Commerce starter with Shopify support, better error page customization, TypeScript and PostCSS improvements, preview detection, and consistent router scrolling behavior.
Key Points
- Fast Refresh: edits re-render faster (~200ms improvement) with no code changes. Opt-in to Webpack 5 with
module.exports = { future: { webpack5: true } }for further improvements. - Install & deps: average install time reduced (~15s → ~5s), install size down ~58% (96.5MB → 39.9MB), dependencies cut ~56%.
- next/image: image optimization now powered by WebAssembly (smaller install, M1 support). New layouts:
fill,fixed,responsive,intrinsic, andobjectFitsupport. Add custom loaders via theloaderprop to integrate any CDN/provider. - Commerce: Next.js Commerce UI is provider-agnostic; swapping providers (e.g., Shopify) is a single-line config change and includes feature flags for toggling capabilities.
- Error pages: add a static
pages/500.jsto customize server error pages (same pattern aspages/404.js). - PostCSS & caching: enable strict PostCSS loading when using Webpack 5 with
future.strictPostcssConfiguration = trueto improve caching. - TypeScript:
tsconfig.jsonsupportsextends(e.g.,{"extends": "./tsconfig.base.json"}) for large projects. - Preview mode: detect preview rendering via
const { isPreview } = useRouter()to conditionally render editor-only UI. - Router behavior:
router.pushandrouter.replacenow auto-scroll to top to matchnext/link; opt out with thescrolloption. - Docs: added migration guides (Gatsby, CRA, React Router), Docker deployment, incremental adoption, and auth resources.
Practical notes
- To opt-in to Webpack 5 and strict PostCSS: set
future.webpack5andfuture.strictPostcssConfigurationinnext.config.js. - To customize image loading, implement a
loaderfunction and pass it to theImagecomponent. - To opt-out of automatic scroll behavior, call router methods with
{ scroll: false }.
For engineers: upgrade to 10.1 to get faster local feedback, smaller CI installs, improved image handling (WASM/M1), and easier commerce integrations with minimal code changes.