<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anton Chapala</title>
    <description>The latest articles on DEV Community by Anton Chapala (@worknbuyconsumendie).</description>
    <link>https://dev.to/worknbuyconsumendie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1026041%2Fc0d4fe62-c8e1-4cc0-ab6d-0daa5e78ccf9.png</url>
      <title>DEV Community: Anton Chapala</title>
      <link>https://dev.to/worknbuyconsumendie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/worknbuyconsumendie"/>
    <language>en</language>
    <item>
      <title>Nest.js 12 preview is here!</title>
      <dc:creator>Anton Chapala</dc:creator>
      <pubDate>Thu, 04 Jun 2026 20:41:51 +0000</pubDate>
      <link>https://dev.to/worknbuyconsumendie/nestjs-12-preview-is-here-4jdf</link>
      <guid>https://dev.to/worknbuyconsumendie/nestjs-12-preview-is-here-4jdf</guid>
      <description>&lt;p&gt;The next major version of NestJS is officially knocking on our doors, and it brings one of the most anticipated architectural shifts in the Node.js ecosystem: Full, first-class Native ESM support.&lt;br&gt;
For years, developers have been trapped in the CommonJS (CJS) vs ECMAScript Modules (ESM) limbo. NestJS 12 aims to fix this.&lt;/p&gt;

&lt;p&gt;I decided to put NestJS 12's capabilities to the test. I set up a small benchmark comparing a Native ESM setup against a classic CJS setup to see if expectations match reality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spoiler alert&lt;/strong&gt;: The results might surprise you.&lt;/p&gt;
&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;For this benchmark, I created a typical NestJS application under the new v12 architecture. I prepared two environments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Classic Setup:&lt;/strong&gt; NestJS v11 running on traditional CommonJS (CJS).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Modern Setup:&lt;/strong&gt; NestJS v12 running on Native ESM (with &lt;code&gt;"type": "module"&lt;/code&gt; in &lt;code&gt;package.json&lt;/code&gt; and strict &lt;code&gt;.js&lt;/code&gt; import extensions).
You can find the full source code and verify the benchmarks in my GitHub repository: &lt;a href="https://github.com/wrknbuycnsmndie/nestjs-11-12-benchmark/tree/main" rel="noopener noreferrer"&gt;nestjs-11-12-benchmark&lt;/a&gt;. 
The template code for each environment is split into the &lt;code&gt;nestjs-11&lt;/code&gt; and &lt;code&gt;nestjs-12&lt;/code&gt; branches.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I measured the following metrics: Cold Startup Time, Memory Footprint, and Heap usage at boot.&lt;/p&gt;

&lt;p&gt;To make the measurements, I hooked into the bootstrap process using the native performance API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;BootstrapBenchmark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;NestFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;AppModule&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;startupTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;memoryUsage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toMb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Startup time: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;startupTime&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ms`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`RAM (RSS): &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;toMb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rss&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt; MB`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Result: Performance numbers
&lt;/h3&gt;

&lt;p&gt;When we hear "Native ESM and modern architecture," our inner engineer immediately expects a free 20% or more performance boost.&lt;/p&gt;

&lt;p&gt;However, after running multiple iterations on Node.js 26, the raw performance metrics showed... virtually no difference.&lt;/p&gt;

&lt;p&gt;Startup Time: Both setups initialized within a margin of error (varying by only a few milliseconds).&lt;/p&gt;

&lt;p&gt;RAM Consumption: The memory footprint at idle stayed identical. The V8 engine parses ESM differently under the hood, but for a standard NestJS dependency tree, it doesn't give you an instant reduction in megabytes.&lt;/p&gt;

&lt;p&gt;If you are migrating to NestJS 12 expecting your server bills to drop by half just because of ESM, you might want to adjust your expectations. In terms of raw runtime performance, it’s exactly the same.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Then Why is NestJS 12 ESM still a Game Changer?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If the raw performance is identical, why care? Because it finally unblocks access to the modern JavaScript backend ecosystem, which has pivoted entirely to ESM. &lt;br&gt;
NestJS 12 removes the friction of maintaining split compiler configs and fully opens the door to next-gen, ESM-first development tooling. It ensures that your entire stack—from frontend to backend in a monorepo—can finally run seamlessly on a single, native module language without redundant compatibility layers.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion: Should You Upgrade?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;NestJS 12 ESM is not about making your controllers execute faster or cutting down infrastructure costs. It is a massive cleanup of tooling and configuration debt. If you want a clean, future-proof codebase that integrates predictably with modern development pipelines, it is absolutely worth it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about you?
&lt;/h3&gt;

&lt;p&gt;Are you planning to migrate your NestJS projects to ESM once it is officially released?&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>node</category>
      <category>javascript</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
