John Nguyen

Oh CommonJS! Why are you mESMing with me?

That `SyntaxError` in your tests isn't a bug. It's a signal to abandon legacy tools and embrace the smaller, faster bundles of pure ESM.

Oh CommonJS! Why are you mESMing with me?
#1about 6 minutes

A real-world conflict between CommonJS and ESM packages

An NPM package upgrade causes Jest tests to fail with a syntax error because an ESM-only dependency conflicts with Jest's CommonJS environment.

#2about 3 minutes

Understanding the origins of CommonJS and ESM modules

JavaScript module systems like CommonJS and ESM were created to manage growing codebases by allowing code to be split, shared, and reused.

#3about 1 minute

Examining the current landscape of module adoption

Statistics show that while CommonJS packages are still dominant, there is a clear and growing trend towards ESM adoption in the ecosystem.

#4about 3 minutes

Comparing unbundled CommonJS and ESM performance

An initial benchmark using the AWS SDK shows that the unbundled CommonJS implementation runs faster than its ESM counterpart.

#5about 2 minutes

How bundling reveals ESM's performance advantage

After bundling with esbuild, the ESM version is nearly half the size and runs significantly faster due to superior tree-shaking capabilities.

#6about 6 minutes

Why you should embrace an ESM-only future

ESM is the future due to smaller bundles, better performance, and its status as a web standard, making it a signal to modernize legacy dependencies.

Related jobs
Jobs that call for the skills explored in this talk.

test

Milly
Vienna, Austria

Intermediate

test

Milly
Vienna, Austria

Intermediate

Featured Partners

Related Articles

View all articles
CH
Chris Heilmann
Dev Digest 136 - No JS(on) of mine
News and ArticlesDouglas Crockford is our featured video, so let's talk about evolving JavaScript and all things JSON. Judicious JSON explains all the weird things in it, you can learn why it can be incredibly slow, people wonder what even is a JSON ...
Dev Digest 136 - No JS(on) of mine
CH
Chris Heilmann
Dev Digest 111 - npm i -g issues
In last Friday's Dev Digest we looked at some global tech issues, took a deep dive into code assistants, we have a great video about NPM security and want you to tell us your favourite code questions to use in CODE100. News and ArticlesLet's start th...
Dev Digest 111 - npm i -g issues
CH
Chris Heilmann
Dev Digest 131 - AI'm not sure about OSS
News and ArticlesRust and Typescript are rising stars in programming languages 2024 survey, the State of CSS 2024 survey is open and here is what's new in ECMAScript.In security news, a Microsoft update bricks Linux dual-boot systems, they patched a ...
Dev Digest 131 - AI'm not sure about OSS
CH
Chris Heilmann
All the videos of Halfstack London 2024!
Last month was Halfstack London, a conference about the web, JavaScript and half a dozen other things. We were there to deliver a talk, but also to record all the sessions and we're happy to share them with you. It took a bit as we had to wait for th...
All the videos of Halfstack London 2024!

From learning to earning

Jobs that call for the skills explored in this talk.