Skip to content

release: v12.0.0 major release (approx. Q3 2026)#16391

Draft
kamilmysliwiec wants to merge 166 commits intomasterfrom
v12.0.0
Draft

release: v12.0.0 major release (approx. Q3 2026)#16391
kamilmysliwiec wants to merge 166 commits intomasterfrom
v12.0.0

Conversation

@kamilmysliwiec
Copy link
Copy Markdown
Member

@kamilmysliwiec kamilmysliwiec commented Feb 19, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe: v12.0.0 release

Description

Approximate release window: early Q3 2026

Overview

  1. ESM migration

  2. CLI (ESM/CJS)

    • The NestJS CLI will prompt users to choose whether to generate a CJS or ESM project (ESM projects will use vitest + oxlint by default)
    • Webpack -> Rspack ✅ (webpack is now deprecated)
  3. Testing stack changes

  4. Linter

  1. Website redesign

    • A complete redesign of the NestJS websites is coming soon - we're taking them to the next level.
  2. Minor breaking changes

    • There will be a few minor breaking changes across other NestJS packages, but nothing significant.
  3. Schema support in route decorators

    • All route decorators (e.g., @Body, @Query, etc.) will support a new schema option that accepts a Standard Schema–compatible object. https://standardschema.dev/)
    • This enables the use of modern validation libraries such as Zod, Valibot, ArkType, and others, as an alternative to class-validator.
    • The same capability will also be available in the serializer interceptor.

PRs:

Packages will soon (possibly in Q2) be released under the next tag to let everyone play with them before they make it to the official latest tag.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

glebbash and others added 30 commits March 4, 2025 12:52
feat: standard schema validation pipe, and standard serializer, introduce internal export subpath
sample: migrate all samples to esm and vitest
refactor: migrate from mocha, chai, sinon to vitest
@kamilmysliwiec
Copy link
Copy Markdown
Member Author

@angelhodar yeah we will just use vitest with oxc instead of vitest + swc. For bundling (monorepos) you could use rspack. For regular apps tsc/swc depending on what you prefer

@vaskouk
Copy link
Copy Markdown

vaskouk commented Mar 17, 2026

Hey! In v12 how decorators like @Body will validate such?

@Body() payload: CreateCustomBrandPayloadDto

@kamilmysliwiec
Copy link
Copy Markdown
Member Author

Nothing changes here @vaskouk, you can still use ValidationPipe with class-validator.

@vaskouk
Copy link
Copy Markdown

vaskouk commented Mar 17, 2026

Nothing changes here @vaskouk, you can still use ValidationPipe with class-validator.

Sorry i didn't phrase it correctly, with class-validator yes, but what if someone wants to switch to zod schema validation. ValidationPipe will still do the work?

@kamilmysliwiec
Copy link
Copy Markdown
Member Author

If you want to use zod, you need to use zod schemas, not classes with annotations.

@vaskouk
Copy link
Copy Markdown

vaskouk commented Mar 17, 2026

If you want to use zod, you need to use zod schemas, not classes with annotations.

Yes got it, so the same like @Body() payload: CreateCustomBrandPayloadSchema ? which will be the zod schema

@kamilmysliwiec
Copy link
Copy Markdown
Member Author

See 35-zod-validation sample in this PR

@angelhodar
Copy link
Copy Markdown

@angelhodar yeah we will just use vitest with oxc instead of vitest + swc. For bundling (monorepos) you could use rspack. For regular apps tsc/swc depending on what you prefer

Great! So for bundling its not possible to use Vite too? I was thinking if Vite could be the underlying tool for everything in nest (dev server + bundling + vitest), but as far as I understand from your answer its not possible right now with vite 8?

@wonderbeel
Copy link
Copy Markdown

wonderbeel commented Mar 19, 2026

@angelhodar yeah we will just use vitest with oxc instead of vitest + swc. For bundling (monorepos) you could use rspack. For regular apps tsc/swc depending on what you prefer

Great! So for bundling its not possible to use Vite too? I was thinking if Vite could be the underlying tool for everything in nest (dev server + bundling + vitest), but as far as I understand from your answer its not possible right now with vite 8?

In theory yes it is possible (I tried it a couple of months ago and for an hello world app it worked) using the environment API at least for production bundling, the big problem is the dev server because it is tailor made for the browser and always expect to inject into an html page, you can probably do something with a script that runs build in watch mode + nodemon or something similar to restart the server every time but it sounds hackish to me.

It would be great to have a consistent environment for everything indeed (another nice thing would be to be able to create a single executable for distroless containers) but probably it is up to Kamil if he wants to try to reach to voidzero and figure out if it would indeed be possible to use Vite for everything in the nest cli.

@kamilmysliwiec
Copy link
Copy Markdown
Member Author

Vite is great but i dont think it's really necessary for a Nest app.

  • vitest - sure it makes perfect sense (that's why we migrated)
  • oxc - can be integrated with the Nest CLI but i dont see much benefit given that we already have swc builder available
  • bundling - you don't really need it for a Node app. Might be useful in a monorepo (to have a "single deployable artifact" and to bundle local libs), but that's why we have Rspack integrated (in v12, originally Webpack).

@anotheri
Copy link
Copy Markdown

@kamilmysliwiec it's definitely not necessary and both swc and rspack are amazing tools! But it'd be great addition to have a chose between swc and oxc for @nestjs/cli, as well as vite or rspack for bundling a monorepo, not necessary for v12.0 but maybe worth to consider it later.

Nevertheless i'm quite excited about v12 and looking forward to try it, thanks a lot for your effort improving Nestjs!

@vaskouk
Copy link
Copy Markdown

vaskouk commented Mar 19, 2026

Vite is great but i dont think it's really necessary for a Nest app.

  • vitest - sure it makes perfect sense (that's why we migrated)
  • oxc - can be integrated with the Nest CLI but i dont see much benefit given that we already have swc builder available
  • bundling - you don't really need it for a Node app. Might be useful in a monorepo (to have a "single deployable artifact" and to bundle local libs), but that's why we have Rspack integrated (in v12, originally Webpack).

So rspack will be come integated in v12? For example i am using rspack with my own config in v11, this will become obsolete or i missunderstood?

@kamilmysliwiec
Copy link
Copy Markdown
Member Author

@vaskouk
image

@pasha-vuiko
Copy link
Copy Markdown

As I see you NestJS is going to use Vite and Oxc stuff by default for ESM, wasn't you thinking about integration with Vite+ somehow?

@kamilmysliwiec
Copy link
Copy Markdown
Member Author

@pasha-vuiko
image

@kraikov
Copy link
Copy Markdown

kraikov commented Mar 21, 2026

Amazing. What would be the best way to migrate a large codebase to v12?
Are we getting a migration guide?

@13RTK
Copy link
Copy Markdown

13RTK commented Mar 21, 2026

Amazing. What would be the best way to migrate a large codebase to v12? Are we getting a migration guide?

You should find solutions in the ORM's official docs that depend on the ORM you are using

@vaskouk
Copy link
Copy Markdown

vaskouk commented Mar 24, 2026

Hey! When can we have alpha version for all packages (specially swagger etc) to test the new versions?

@AndrewBoklashko
Copy link
Copy Markdown

AndrewBoklashko commented Mar 26, 2026

Hi there

Excited to see lots of great things coming in NestJS v12 🚀

For bundling (monorepos) you could use rspack.

Wanted to share use case of our monorepo and NestJS-related issue with it. In a hope that things become smoother in v12 or future releases.

Our monorepo uses pnpm workspaces + Turborepo(NestJS monorepo library mode is not used). We have a couple of internal packages referenced by NextJS frontend and NestJS backend apps. A difficulty is that while NextJS supports direct transpilation using transpilePackages config, NestJS does not have anything like that so we cannot use Turborepo Just-In-Time packages and have to fallback to Compiled Packages.

Not a blocker as Compiled Packages serve good enough but still our monorepo setup would be even simpler if NestJS supported some equivalent to NextJS transpilePackages.

P.S. I'm not very familiar with rspack, could be that it supports such configuration

Apologize upfront if this is a wrong place to post my feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.