Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
January 10, 2022

Back to work with COLORS endless loop and other Adventures in Nodeland - Issue #42

Hi Everyone,

In this back-to-work edition we feature only a few releases and Open Source work as I had some days off. However it covers quite a few interesting article ranging from some npm drama to GraphQL and web3.

See you next week!

The big shoutout this week goes to the hyperid module that got a new bug found and fixed… and I learned that RFC4648 covers how to encode base64 data in a url safe manner. Read more at:

Change urlSafe to be RFC4648 compliant by michaelrommel · Pull Request #29 · mcollina/hyperid · GitHub
Change urlSafe to be RFC4648 compliant by michaelrommel · Pull Request #29 · mcollina/hyperid · GitHub
This encodes now + to - and / to _ as stated in the RFC. Sadly now one more replace() call had to be added which will impact the performance of the urlSafe benchmarks. Closes #28
github.com
Change urlSafe to be RFC4648 compliant by michaelrommel · Pull Request #29 · mcollina/hyperid · GitHub
Change urlSafe to be RFC4648 compliant by michaelrommel · Pull Request #29 · mcollina/hyperid · GitHub
This encodes now + to - and / to _ as stated in the RFC. Sadly now one more replace() call had to be added which will impact the performance of the urlSafe benchmarks. Closes #28
github.com

Fastify

We are progressing in our journey towards Fastify v4, and this week is the turn of fast-json-stringify that bumped its major version

Release v3.0.0 · fastify/fast-json-stringify · GitHub
Release v3.0.0 · fastify/fast-json-stringify · GitHub
2x faster than JSON.stringify(). Contribute to fastify/fast-json-stringify development by creating an account on GitHub.
github.com
Release v3.0.0 · fastify/fast-json-stringify · GitHub
Release v3.0.0 · fastify/fast-json-stringify · GitHub
2x faster than JSON.stringify(). Contribute to fastify/fast-json-stringify development by creating an account on GitHub.
github.com

We shipped fastify-passport v0.5.0 with support for the new @fastify/session module. Check it out:

Release v0.5.0 · fastify/fastify-passport · GitHub
Release v0.5.0 · fastify/fastify-passport · GitHub
Use passport strategies for authentication within a fastify application - Release v0.5.0 · fastify/fastify-passport
github.com
Release v0.5.0 · fastify/fastify-passport · GitHub
Release v0.5.0 · fastify/fastify-passport · GitHub
Use passport strategies for authentication within a fastify application - Release v0.5.0 · fastify/fastify-passport
github.com

Have you ever checked out fastify-vite? If you are curious on how you can use Vite with Fastify to build your frontend, read the article from my colleague Jonas - he rebuilt his blog using fastify-vite (his creation).

Blogging with Fastify, Vite and Vue 3
Blogging with Fastify, Vite and Vue 3
I’ve always been incredibly envious of Amos Wenger’s blogging setup, and the amazing write-up covering it. Amos of course wrote ridiculous amounts of Rust code to a) crawl Markdown entries from the filesystem, b) sync them to a SQLite database for maximum efficiency and c) compile the entries into HTML with a number of transformations to patch up things like image paths and syntax highlighting for code blocks.
hire.jonasgalvez.com.br
Blogging with Fastify, Vite and Vue 3
Blogging with Fastify, Vite and Vue 3
I’ve always been incredibly envious of Amos Wenger’s blogging setup, and the amazing write-up covering it. Amos of course wrote ridiculous amounts of Rust code to a) crawl Markdown entries from the filesystem, b) sync them to a SQLite database for maximum efficiency and c) compile the entries into HTML with a number of transformations to patch up things like image paths and syntax highlighting for code blocks.
hire.jonasgalvez.com.br

Events

I will be speaking about Fastify at JS Poland (remotely)!

JS Poland - International JavaScript Conference – 26 January 2022 – Warsaw, PL
JS Poland - International JavaScript Conference – 26 January 2022 – Warsaw, PL
1 days - 1 tracks - 25 speakers - 1000+ developers
js-poland.pl

Article & News

This weekend has been busy for the Node.js community. Marak, who is a maintainer with millions of downloads per month, decided to introduce a Denial of Service attack to one of its most popular module, colors. This new episode is another chapter on one of most challenging problem of Open Source: how do we fund it? Read up:

Open source maintainer pulls the plug on npm packages colors and faker, now what? | Snyk
Open source maintainer pulls the plug on npm packages colors and faker, now what? | Snyk
On January 8th, 2022, open source maintainer of the wildly popular npm package colors, published colors@1.4.1 and colors@1.4.44-liberty-2 in which they intentionally introduced an offending commit that adds an infinite loop to the source code.
snyk.io

NPM / Github intervened and they suspended Marak account while reverting to a previous version of the module.

Why did they do it? I think because it violated their “acceptable content” policy. However I would like to read a full postportem about this situation:

npm Open-Source Terms | npm Docs
npm Open-Source Terms | npm Docs
Documentation for the npm registry, website, and command-line interface
docs.npmjs.com

One of the most interesting news in Nodeland is the ability to run EcmaScript modules in your AWS Lambdas! They also include one of the smartest use of Top-Level-Await that I have seen: boot your application before any Lambda event are received, greatly reducing the cost of cold start when using reserved capacity. We’ll soon be using this feature inside https://github.com/fastify/aws-lambda-fastify.

Using Node.js ES modules and top-level await in AWS Lambda | Amazon Web Services
Using Node.js ES modules and top-level await in AWS Lambda | Amazon Web Services
This post is written by Dan Fox, Principal Specialist Solutions Architect, Serverless. AWS Lambda now enables the use of ECMAScript (ES) modules in Node.js 14 runtimes. This feature allows Lambda customers to use dependency libraries that are configured as ES modules, or to designate their own function code as an ES module.
aws.amazon.com
Using Node.js ES modules and top-level await in AWS Lambda | Amazon Web Services
Using Node.js ES modules and top-level await in AWS Lambda | Amazon Web Services
This post is written by Dan Fox, Principal Specialist Solutions Architect, Serverless. AWS Lambda now enables the use of ECMAScript (ES) modules in Node.js 14 runtimes. This feature allows Lambda customers to use dependency libraries that are configured as ES modules, or to designate their own function code as an ES module.
aws.amazon.com

During my studies at the University of Bologna I had the chance to study the architecture of several chips (from the 8086 to the Pentium and then the Intel core) in great detail. I found the amount of research and explanation needed to write a precise article on architecture challenging - so I was delighted to read such a presentation about the Graviton 3. If you wonder were AWS superiority comes, you should not look any further.

Inside Amazon’s Graviton3 Arm Server Processor
Inside Amazon’s Graviton3 Arm Server Processor
The Graviton family of Arm server chips designed by the Annapurna Labs division of Amazon Web Services is arguably the highest volume Arm server chips the datacenter market today, and they have precisely one – and only one – customer.
www.nextplatform.com
Inside Amazon’s Graviton3 Arm Server Processor
Inside Amazon’s Graviton3 Arm Server Processor
The Graviton family of Arm server chips designed by the Annapurna Labs division of Amazon Web Services is arguably the highest volume Arm server chips the datacenter market today, and they have precisely one – and only one – customer.
www.nextplatform.com

Are you a GraphQL Server at scale? Check out the following article that explains how they reduced latency by 70%. Guess what technology they used - it’s a really description of their journey that they summarised as “aggregation of marginal gains”. Read up:

Lessons learned from running GraphQL at scale | by Dream11 Engineering | Dream11 Engineering
Lessons learned from running GraphQL at scale | by Dream11 Engineering | Dream11 Engineering
At Dream11, we have experienced tremendous growth from just 300,000 users in 2015 to over 110 million users at present. To grow at this blazingly fast pace, we moved to a microservice architecture…
blog.dream11engineering.com
Lessons learned from running GraphQL at scale | by Dream11 Engineering | Dream11 Engineering
Lessons learned from running GraphQL at scale | by Dream11 Engineering | Dream11 Engineering
At Dream11, we have experienced tremendous growth from just 300,000 users in 2015 to over 110 million users at present. To grow at this blazingly fast pace, we moved to a microservice architecture…
blog.dream11engineering.com

You probably have heard about all the hype about web3. The following article criticises a significant part of it - some are good observations, others not so. Independently of what you think of web3, it’s a must read.

My first impressions of web3
Despite considering myself a cryptographer, I have not found myself particularly drawn to “crypto.” I don’t think I’ve ever actually said the words “get off my lawn,” but I’m much more likely to click on Pepperidge Farm Remembers flavored memes about how “crypto” used to mean “cryptography” than I am the latest NFT drop.
moxie.org

This follow-up article is good counterargument of the details that Moxie did not get right. Check it out:

In Response to My first impressions of web3 | Skerritt.blog
This a response to Moxie Marlinspike’s “My First Impression of Web3” Both gave me a feeling for how the space works. To be clear, there is nothing particularly “distributed” about the apps themselves: they’re just normal react websites. The “distributedness” refers to where the state and the logic/permissions for updating the state lives: on the blockchain instead of in a “centralized” database. Just to clarify, this is what the author wanted to do.
skerritt.blog
Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn