View profile

WeakRef, WeakMap and FinalizationRegistry and other Adventures in Nodeland - Issue #18

Matteo Collina
Matteo Collina
Hi Folks, this edition is packed with news from new modules & releases to must-read articles in the JavaScript and Node.js scene.

New week new module: this week I used WeakRef, WeakMap and FinalizationRegistry to build a leak-proof process.on(‘exit’) event listener. Thanks to this new logic I could build some nice and useful developer experience for pino v7, without worrying of leaking memory.
GitHub - mcollina/on-exit-leak-free: Execute a function on exit without leaking memory, allowing all objects to be garbage collected
I think this approach could be generalized to work on any EventEmitter. Would anyone like to explore this concept? In case, drop me an email.
New Releases
We got two new releases this week:
  1. mercurius, the fastify GraphQL server & gateway, turn v8.0.0 as it lands a few semver-major changes in Undici (now v4.0.0) and GraphiQL
  2. fastify turns v3.19.0 and very quickly to v3.19.1 as we had to revert a change.
Release v8.0.0 · mercurius-js/mercurius · GitHub
Release v3.19.0 · fastify/fastify · GitHub
Release v3.19.1 · fastify/fastify · GitHub
The must-read article on Node.js core this week is Joyee’s long explanation on how Node.js load its built-in and native modules. Joyee has been working for years to improve the Node.js startup times and she is one of the major expert in this area of Node.js:
QUIC is coming (back) to Node.js with a refreshed API and impressive results. Follow James process at:
quic: add quic by jasnell · Pull Request #38233 · nodejs/node · GitHub
In case you are interested to work on Node.js core, NearForm is hiring a Node.js Core Developer in the U.S.. Would you like to work on Node.js Core?
Must Reads
Let’s start our must read articles for this week with a critique of Dan Abramov to npm audit. How would you change npm audit?
The second article is even better: STOP LYING TO CANDIDATES. Most companies tell lies to all candidates they interview, from which technologies they will be using to the time they will have to dedicate to Open Source. Read up both if you are hiring or looking for a job:
There Is No Pot Of Gold At The End Of The Rainbow - DEV Community
Have you ever wondered how to write a Kubernetes Operator using Node.js? You can!
Developing OpenShift Operators in JavaScript/TypeScript
Last but not least a really good article on how to develop Hexagonal Architectures with AWS Lambda. This include a ready-to-use example as well which you can take as the basis of your next application. Will you use this pattern?
Developing evolutionary architecture with AWS Lambda | Amazon Web Services
We are are still hiring at NearForm, we have plenty of vacancies on all roles of the company.. if you are interested give me a shout!
Shaping a better world
…and that’s all folks! I really liked assembling this edition as it was really full of content! Did you like it as well?
Thanks to every single one of you that partecipate in the discussions around these topics. I’m stunned by your support.
Did you enjoy this issue? Yes No
Matteo Collina
Matteo Collina @matteocollina

I write about my journey as a core contributor of Node.js, as an author and a maintainer of many modules - including Fastify and Pino. In addition, I speak at conferences, and I will add links to all my talks in case you missed one.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.