BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

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

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

Listen to this article -  0:00

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 centres on a full migration from CommonJS to ESM across all official packages, native Standard Schema support in route decorators, and a modernised default toolchain that replaces Jest with Vitest, ESLint with oxlint, and Webpack with Rspack.

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(). The updated CLI will prompt developers to choose between generating a CJS or ESM project, with ESM projects defaulting to Vitest and oxlint out of the box.

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. 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 to use Jest. For linting, oxlint replaces ESLint as the default across all projects, aligning with the broader trend of Rust-powered JavaScript tooling delivering faster feedback loops. On the bundler side, Webpack has been deprecated in favour of Rspack, which serves as a drop-in replacement with significantly faster build times.

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:

Need bun and biome selection option from cli when creating new nestjs project.

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.

About the Author

Rate this Article

Adoption
Style

BT