Adventures in Nodeland by Matteo Collina - Issue #2
Hi Everyone! I’ve started a newsletter to share my thoughts on technology, the advancements of Node.js and to keep all of you up-to-date of what I’m working on. This newsletter might be weekly, biweekly or monthly… we’ll see how it evolves in the coming months.
My usual/weekly rant about companies not wanting to contribute to Node.js continues. Node.js does not have a company behind it, but it’s volunteer-based from interested companies. There is no “Node.js product” to buy. If you are a company and would like to allocate either one of your engineers (even part time) or some funds, feel free to contact me.
I’ve recently been fascinated by the possibilities of WebAssembly and this week and using it inside my projects is starting to become a go-to strategy to increase performance. What do you think of AssemblyScript?
As a bonus, calling into WASM is going to get faster in V8 v9.0!
Did you know...
Did you know that when you create an Error in V8/Node.js/Chrome, all the closures are retained until .stack is called? If you end up caching a promise that could potentially error, make sure to call .stack - otherwise it could cause a leak. See https://bugs.chromium.org/p/v8/issues/detail?id=4714 and https://bugs.chromium.org/p/v8/issues/detail?id=2340 for more details.
Upcoming Talk on Redis Autopipelining
I have been preparing a new talk on the concept of Auto Pipelining which I prototyped in https://github.com/mcollina/ioredis-auto-pipeline and my colleague Paolo Insogna added to ioredis in https://github.com/luin/ioredis/pull/1201. You can see it explained in the following picture:
Fastify
I fixed a nasty bug in Fastify where a developer error would have led to a swallowed exception and an end user timeout: https://github.com/fastify/fastify/pull/2942. Lesson learned in OSS: “if a developer could make a mistake, they will. Code defensively.” This fix will be released soon!
As something new, you can check out the new release of fastify-jwt and a module called get-jwks that we have been working on at NearForm.
I would like to thank Simon for this nice video on Fastify!
fastify-multipart got a new release (v4.0.3), improving the test coverage.
Module of the week!
A bloom filter is a probabilistic data structure: after training with a set of data, it can tell if an element is definitely not part of that set, or possibly so. I had some fun with https://www.npmjs.com/package/bloom-filters and it works wonders. I used this to speed up a proof-of-concept by 10x.
Conferences
This week I will be speaking at two events! Next Wednesday I will be speaking at https://cityjsconf.org/ about Undici, new HTTP client for Node.js. On Thursday, I’ll be keynoting at Codemotion Italy with a title “Be the Glue”!
Thanks!
I would like to thank you all for the warm support of this newsletter! Thank you all. As usual, let me know if there are things you’d like us to improve!