Turbopack: What's New in Next.js 16.3
Key Points
- Up to 90% dev-server memory reduction
- Persistent filesystem cache speeds builds
- Experimental Rust React compiler (20–50% faster)
Summary
Next.js 16.3 (Preview) advances Turbopack with focused compiler and dev-server performance work: large reductions in dev memory usage, persistent filesystem caching for builds, experimental native Rust React compiler support, import.meta.glob support, HMR improvements, and smaller runtime bundles. The preview is published under the @preview npm tag; a stable release is expected soon.
Key Points
- Memory: Dev-server memory usage reduced significantly (examples show up to ~90% improvement). Turbopack now supports memory eviction of in-memory cache and compresses data structures to avoid unbounded growth. Memory eviction and the dev filesystem cache are enabled by default in 16.3. You can disable eviction with the experimental flag:
turbopackMemoryEviction: false. - Persistent build cache: Turbopack can persist its cache to disk for
next build, speeding cached builds. Enable withexperimental.turbopackFileSystemCacheForBuild: true. CI can reuse the.nextdirectory between runs. - Experimental Rust React compiler: Native Rust port of the React Compiler is available as an opt-in experimental feature. Enable the compiler and the Rust backend with
reactCompiler: trueandexperimental.turbopackRustReactCompiler: true(early results show ~20–50% compile wins on large apps). - import.meta.glob: Adds Vite-compatible
import.meta.globwith eager loading, negative patterns, TypeScript types, and live invalidation via Turbopack's file watcher. Note: only available when using Turbopack (not--webpack). Example usage:const posts = import.meta.glob('./posts/*.mdx', { eager: true }). - HMR and runtime: HMR subscriptions and chunk tracking were optimized to reduce cold start and memory; runtime code is now tree-shaken so only needed features (WASM, workers, async modules) are shipped per-route.
- Local PostCSS: Monorepo support via
experimental.turbopackLocalPostcssConfig: trueso PostCSS resolves closest config to each CSS file. - Reliability fixes: Multiple fixes across module resolution, tracing, worker and import.meta.url handling on Windows, chunk retry behavior, better errors for loader crashes, and CSS HMR fixes (Safari).
Practical notes for engineers
- Try the preview from npm under the
@previewtag and file feedback on GitHub. - To reproduce build speedups in CI, cache and restore the
.nextdirectory between runs. - Toggle experimental features in
next.config.js/next.config.tsunder theexperimentalobject to compare behavior (e.g.,turbopackRustReactCompiler,turbopackFileSystemCacheForBuild,turbopackMemoryEviction,turbopackLocalPostcssConfig). - import.meta.glob can simplify loading collections (MDX/posts) and will trigger dev recompiles when files change.