Node.js Digest #13: TypeScript in Node.js, Goodbye Corepack, Make JS Great Again, Node.js Slightly Broke the Internet, Porffor

Node.js Digest #13: TypeScript in Node.js, Goodbye Corepack, Make JS Great Again, Node.js Slightly Broke the Internet, Porffor

Hello, community! Oleksandr Zinevych, Engineering Director at Avenga, here. This time, I was down with COVID, so the new digest is coming out a bit later than usual ??

Highlights

  • Deno v1.45.5: A new batch of fixes and improvements has been released on the Deno track.
  • ESLint v9.9.0: ESLint now has experimental support for TypeScript configuration files.
  • Node.js v22.6.0, v20.16.0: Traditional Node.js updates that, this time, don’t seem to break anything ??.
  • Best Practices for Node.js Development by Yoni Goldberg have been updated.
  • Bun v1.1.23: Despite the hype around Bun slowly fading, the team is actively working on new versions and hiring more people. The new release includes many fixes to improve compatibility with Node.js.
  • TypeScript 5.6 Beta: The beta version of the new TypeScript is already available for those who can afford to try it. While this update isn’t as massive as the previous one, it does have some interesting new features.
  • Protobuf-ES 2.0: It’s out and ready to use in TypeScript.


Another StackOverflow Survey Results

The annual StackOverflow survey results were released a while back (but we need to mention them). The survey didn’t have as many participants as one might have hoped—only 65,437 developers from 180 countries participated. This represents a very small percentage of StackOverflow users, which is something to remember when interpreting the results.

As always, JavaScript remains the leader among programming languages among existing professionals and those just entering our beloved IT field.

Node.js continues to compete with React for popularity among web development technologies.

One interesting and somewhat unexpected finding for me is the popularity of Full-stack positions among developers, which surpasses both Back-end and Front-end combined. Of course, we need to consider the small sample size. The results might have been different in a larger-scale survey, but the high demand for Full-stack developers is observable in today's market.

And, of course, there’s a huge growth in the use of various AI tools—how could it be otherwise these days? You can check out the full list of results here.

Corepack Drama

Who would have thought that raising the question of enabling Corepack as a default setting in November 2023 would lead to the decision to remove Corepack from the main Node.js build altogether?

For those unfamiliar, Corepack is an experimental Node.js feature that allows the use of various package managers without the need to install them. Due to its relative popularity, there was a discussion about making it a standard feature and even making npm an optional choice, thereby removing it from the main build.

However, the discussions initially concluded that npm would not be removed. Then, a roadmap was developed outlining how Corepack would be removed from the main Node.js build. The corresponding PR that starts this process is still open at the time of writing. It seems that strong negative feedback from the community has somewhat slowed down this process. We’ll keep an eye on the news. Those using Corepack should start preparing for changes in the standard ??

Node.js Slightly Broke the Internet

Even in well-established communities like Node.js, with well-defined processes and numerous safeguards, issues can still slip through the cracks and only get noticed once they’re in production ??

The new Node.js release broke nearly all applications using v22.5.0. The author explained why this happened in the corresponding PR with the fixes.

There were two problems: First, in

lib/internal/fs/read/context.js        

A destructor was used incorrectly, making the instance inaccessible and causing an error. Second, using the V8 Fast API in fs.closeSync() caused an error even in NPM.

Subsequent versions have fixed these issues. Let’s hope this doesn’t happen again (but it probably will…).

Typescript + Node.js = ??

As I mentioned in previous digests, the emergence of all these new, trendy JavaScript runtimes is primarily good for the Node.js community. It allows us to see what competitors have created, how developers have responded, and potentially implement those ideas in Node.js if technically feasible.

Because both Deno and Bun support TypeScript out of the box, something that would have seemed like a fantasy before happened in July—TypeScript support was added to Node.js. Of course, it’s still not a default setting, and to execute a .ts file, you need to use the

--experimental-strip-types         

flag.

Overall, this is just the beginning, and expecting full-fledged support immediately would be overly optimistic. You can check the roadmap to see where this feature is headed and how it will evolve. I know that not many readers are working with the latest version of Node.js, where this feature is available, so here’s a link to Codesandbox, where you can already try it out.

EcmaScript 2024

Back in June (and I somehow missed it), the new ECMAScript 2024 standard was approved. Not much has changed compared to ES 2023, with just a few new features that were agreed upon over the past year ??

Here’s what’s new:

  • Promise.withResolvers(): It only works in Node.js when using the --js-promise-withresolvers flag.
  • Array grouping: Already available in Node.js for a while.
  • Atomics.waitAsync: Supported in V8 for about three years now.
  • A few other features, which you can read about here.

We hope that the 2025 version of ECMAScript will standardize even more interesting features.

Porffor. Finally, Something Interesting

Not too long ago, I mentioned LLRT—an AWS runtime optimized for fast and efficient operation on AWS Lambda. Recently, LLRT gained a competitor through an experimental project called Porffor. "Experimental" might not be the right word anymore; as soon as the author shared a few details about their creation, the project was funded by a GitHub co-founder. This means it’s now a full-time job for Oliver Medhurst.

The project is truly fascinating. Not only does Porffor compile everything into WebAssembly, but it also uses Ahead Of Time (AOT) compilation. The resulting build doesn’t include additional tools to get everything running—just the native code. Of course, a tool like this won’t dethrone the king of web development, Node.js, but defunkt wouldn’t finance this project without good reason ;) More discussion can be found here.

Make JavaScript Great Again

After reading the responses from developers in the State of JavaScript 2024 survey, which I mentioned in the previous digest, the community decided it was time to Make JS Great Again.

As a result, the e18e initiative was created to address existing problems in the JavaScript ecosystem and pull developers out of a "depressive pit." Among the main goals of the e18e community are fixing dependencies, improving performance, and making updates.

The community seems quite active now, so if you have some free time, you should join in to help make our beloved JavaScript a place of joy and strength again.

Something to Read

I love reading case studies from big companies. Here, you can read about how Stripe scaled their database. There aren’t too many details, but it’s still an interesting read.

If you enjoy the game Elden Ring as much as I do, you’ll understand the pain of someone who planned a gaming night but ended up dealing with production issues on one of their services. That’s how this story from Zalando begins, detailing an interesting problem they had with workers.

What should you choose: Node.js, Deno, or Bun? Besides community support and ecosystem size, a bit of benchmarking always helps. The results where real performance, not marketing strategies and bold claims, come out on top are particularly interesting.

Artificial intelligence continues to be the rage and is entering the development world. The Docker team is exploring generating Docker files using generative AI.

How many spam packages ruined a good initiative or a bit about security in npm? This time, Tea was the target, bombarded with a huge number of fake npm packages.

The Node.js team shared how they automated the security fix release process to increase the number of releases per month. They’ve also started reviewing experimental Node.js features that have been inactive for a long time or need better support.

Do you need a refresher on a common interview question about memory leaks in JavaScript? Trevor Indrek Lasn’s article will help.

The native Node.js Test Runner might seem suitable for simple tasks only, but that’s not true. Here, you can check out more complex usage examples.

The developers of Bun promise to introduce cluster support, as always, at incredible speed.

Ryan Dahl talks about the mistakes made in the initial design of HTTP imports.

Something to Watch

Antony Shew shares his thoughts on how to properly structure a Monorepo:


Haven’t heard about Static Hermes yet? If not, you should check out Neil Dhar’s talk on this topic. It will give you a sense of the craziness happening in the world of JavaScript runtimes:


Videos from the NodeTLV conference are also available. Not all talks are in English, but those that are particularly caught my attention:




Additionally, you can check out videos from Gitnation TechLeadConf: Gitnation TechLeadConf

And JSNation: JSNation

Library of the Month

This month, I’m sharing a library that I’ve fallen in love with due to its syntax and the ability to make requests logically and as concisely as possible. Meet Ky. Under the hood, it’s still the same fetch, but it offers a much more pleasant syntax and various extras (timeouts, retries, prefixes, etc.).

That’s all for now. Leave your comments, share the digest with friends, and ask questions if you have any. See you in the next episodes! ??


Anmoll Upadhyay

Transforming Industries through Innovation & Talent Fusion ??

2 周

Great insights, Oleksandr! The updates on Node.js and TypeScript support are really exciting, and I’m intrigued by the Porffor WebAssembly runtime project. Looking forward to seeing how these developments shape the future of web development! ??

Andrea Baccega

Back End Developer at D-EDGE Hospitality Solutions

2 周

Love this. Just one note: the monorepo video points at the wrong video :) besides that great writeup

要查看或添加评论,请登录

社区洞察

其他会员也浏览了