Node 23 fixes the worst thing about JavaScript

preview_player
Показать описание

Become a TypeScript Wizard with my free beginners TypeScript Course:

Follow Matt on Twitter

Join the Discord:

Рекомендации по теме
Комментарии
Автор

Thank god for competitor runtimes like Bun pushing this feature forward. It seems like the Node team has finally decided to ACTUALLY work on something useful—without the competition, we probably wouldn’t have seen this from them anytime soon.

nehua
Автор

Am I the only one who completely dropped CJS from all my projects back in like 2020? There is literally no reason to hold onto the old way of doing it, since the great ES6 support on all platforms.

ivanjermakov
Автор

Personally I think the most common error in all of JavaScript is the worst one:

Cannot read property "someMethod" of undefined.

Why can't JavaScript (or node) say instead: Cannot read property "someMethod" on "config" because it's undefined? That would be a much nicer error message IMO.

thomasini
Автор

Everyone switch to ESM, then problem solved, this fragmented module system is madness

Pazuno
Автор

The only other system I can recall that used ‘odd number versions are less stable’ numbering was the Linux kernel back in the day. For example 2.2 and 2.4 were stable versions and 2.1 and 2.3 were development versions. However they stopped doing that with 2.6

gordonjohnston
Автор

I love how we know, if everything goes terribly wrong, you could safely get a job directing aircrafts with those little red sticks..
Your arm movements were NEXT LEVEL in this video..

Keep up the great work Matt!

ColinRichardson
Автор

Great now we just need to wait one or two years until you can use it in production. Or switch to Bun today.

dasten
Автор

Node is trying to catch up on what other runtimes have already achieved

BlackAsLight
Автор

Love the wooden bookshelves in the background! Very nice homely touch

jtw-r
Автор

Why are there efforts/resources being spent on maintaining two module systems? Shouldn't the community and tooling just move forward with ESM?

randyt
Автор

how did you do that little magic file-switching trick at 0:24? :O

kyrregjerstad
Автор

3:39 - The Linux Kernel does this; a few others that I don’t recall atm too. This is very old school.

AutisticThinker
Автор

Would this support be available for building web apps with some dependencies no longer supporting common js imports in new versions?

ajv
Автор

Whats the situation in Deno for this? can we use esm in cjs in deno?

ashuvssut
Автор

on another note: i think a painful thing about the JS module system is that the module paths depend on what the filesystem paths are (at least when using relative paths). whereas for example in C# they are completely independent, so you can move and rename files without the import paths having to change at all. this is such a freaking pain because the tooling is never perfect and you always have to correct a path manually when doing massive refactors.

weirdwordcombo
Автор

After more than 25 years Javascript dev is still a mess. Thank goodness we have people such as you to guide us through the forest.

dazraf
Автор

When we want to include node modules in our js bundle with import statements like import { foo } from "./bar.js";
How can bundler like webpack know if we need to bundle "bar.js" or just leave these statement as is because browsers support imporing ESM modules?
Only absolute urls are fixed so that no one should interpret it in different way.

SirusStarTV
Автор

Hi Matt, thanks for the great updates on stuff like this. One quick question: Is there a reason to not use instead of --experimental-strip-types? To me it just sounds like the superior version as it implies the strip-types flag too :o

Gakai
Автор

the even/odd release/dev pattern started with the kernel during the v2 era, iirc

Novascrub
Автор

So odd version of node has odd behavior

twilightdev