NestJS v12 Roadmap: Full ESM Migration, Standard Schema Validation and Modernised Toolchain
#Backend

NestJS v12 Roadmap: Full ESM Migration, Standard Schema Validation and Modernised Toolchain

Rust Reporter
3 min read

NestJS v12 introduces a complete migration to ESM, standard schema validation support, and a modernized toolchain featuring Rust-powered alternatives like oxlint and Rspack.

NestJS, the progressive Node.js framework for building server-side applications with TypeScript, has published a draft pull request outlining the scope of its upcoming v12.0.0 major release, targeting early Q3 2026. The release centers on a full migration from CommonJS to ESM across all official packages, native Standard Schema support in route decorators, and a modernized default toolchain that replaces JavaScript-based tools with Rust-powered alternatives for improved performance and safety.

The most significant change in NestJS 12 is the transition of every official package from CommonJS to ESM. Framework creator Kamil Myśliwiec noted that the availability of Node.js require(esm) support was "the missing piece that made the move to ESM practical" and that without it, "the migration wouldn't have made much sense." The team expects this change to introduce minimal friction for existing projects, since Node.js now allows CommonJS code to load ESM modules via require().

Featured image

Alongside the ESM shift, NestJS 12 introduces Standard Schema support in all route decorators such as @Body, @Query, and @Param. These decorators will accept a new schema option compatible with the Standard Schema specification, enabling developers to use modern validation libraries like Zod, Valibot, and ArkType as direct alternatives to class-validator. The same capability will extend to the serializer interceptor.

The testing and linting defaults have also been overhauled, with a particular focus on incorporating Rust-based tools that offer superior performance and safety guarantees:

  1. Testing: All NestJS repositories and sample projects have migrated from Jest to Vitest, with OXC providing TypeScript decorator support. New ESM projects will use Vitest by default, while CJS projects will continue using Jest.

  2. Linting: oxlint replaces ESLint as the default across all projects. This Rust-powered linter aligns with the broader trend of Rust-powered JavaScript tooling delivering faster feedback loops and enhanced safety through memory safety guarantees. Oxlint's implementation in Rust provides significant performance improvements over the JavaScript-based ESLint while maintaining compatibility with existing ESLint configurations and plugins.

  3. Bundling: Webpack has been deprecated in favor of Rspack, which serves as a drop-in replacement with significantly faster build times. Rspack, written in Rust, leverages Rust's memory safety features and concurrent processing capabilities to deliver compilation speeds that can be 5-10x faster than Webpack for large applications.

The adoption of these Rust-based tools reflects a broader industry trend where Rust's performance characteristics and safety guarantees make it an ideal choice for tooling that processes large codebases. By leveraging Rust's zero-cost abstractions and fearless concurrency, the NestJS ecosystem benefits from tooling that not only performs better but also reduces the likelihood of runtime errors and security vulnerabilities.

The release also includes a NATS v3 migration for the microservices package, graceful shutdown support for the Express adapter, WebSocket disconnect reason parameters, improved pipe transform type safety, and a custom errorCode option for HttpExceptionOptions.

On X, the official NestJS announcement gathered over 800 likes and 93 reposts, with one user sharing excitement around ESM support. A Reddit user noted: "Been using vitest and zod with nest. Great news that these tools will be supported natively by nest." Some community members on the roadmap discussion have also requested Bun and Biome as additional CLI options for new projects.

At the time of writing, a v10-to-v11 migration guide is available on the NestJS documentation site, and the team recommends using npm-check-updates to streamline package upgrades. A dedicated v11-to-v12 migration guide has not yet been published, but packages are expected to be released under the next npm tag before the official stable release, giving teams an opportunity to test ahead of the general availability.

NestJS is an open-source, MIT-licensed framework maintained by Kamil Myśliwiec and the NestJS core team. It builds on top of Express or Fastify and provides an extensible, modular architecture for building scalable server-side applications with TypeScript. The framework has over 75,000 stars on GitHub and is widely adopted across enterprise Node.js environments.

Author photo

Comments

Loading comments...