Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
April 11, 2022

Fastify v3.28.0, Pino v7.10.0 and other Adventures in Nodeland - Issue #55

Hi Folks, in this edition we cover a new release of Fastify and Pino as well as TypeScript support for ESM modules. Check it out!

Two weeks ago I went to London for CityJS! You can watch my first talk on stage after 2 years at:

GraphQL caching demystified - Matteo Collina
GraphQL caching demystified - Matteo Collina

Fastify

This week I shipped Fastify v3.28.0 that included a few improvements on the v3 types, better handling for invalid URLs, and trailers support! Check it out

Release v3.28.0 · fastify/fastify · GitHub
Release v3.28.0 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com
Release v3.28.0 · fastify/fastify · GitHub
Release v3.28.0 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com

In January we run a survey on the status of Fastify community? The major result was surprising but not unexpected: 75% of our users use TypeScript! Read more on the OpenJS Foundation blog:

Insights from the 2022 Fastify Survey - OpenJS Foundation
As the name of the framework implies, Fastify is fast and performant. Respondents overwhelmingly cited this as the reason why they enjoy using Fastify in their projects
openjsf.org

We keep working on Fastify v4 by improving our dependencies. Ivan has been working hard for the last few months on improving then support for route constraints! Check it out:

Release 5.4.0 · delvedor/find-my-way · GitHub
This new version of find-my-way ships a major improvement in how we parse multi-parametric paths, resolving some old incompatibilities with path-to-regexp!
github.com

The improvements on @fastify/session continue steadily, in v8.1.0 we only save the session on storage when it changes, greatly reducing latency and improving performance.

Release v8.1.0 · fastify/session · GitHub
Release v8.1.0 · fastify/session · GitHub
Session plugin for fastify. Contribute to fastify/session development by creating an account on GitHub.
github.com

Pino

pino@v7.10.0 ships many improvements, including fixing some test flakiness and bugs that where found during the Node.js CITGM. Check it out, it should be significantly more stable:

Release v7.10.0 · pinojs/pino · GitHub
Release v7.10.0 · pinojs/pino · GitHub
🌲 super fast, all natural json logger. Contribute to pinojs/pino development by creating an account on GitHub.
github.com
Release v7.10.0 · pinojs/pino · GitHub
Release v7.10.0 · pinojs/pino · GitHub
🌲 super fast, all natural json logger. Contribute to pinojs/pino development by creating an account on GitHub.
github.com

Thanks to Robert Nagy we were able to solve one of the problems that had been plaguing pino for a while: log truncation under heavy load. Apparently docker logs truncated every single “write” that goes over 16 KB. If your log line is longer than this, it would get truncated. Therefore we lowered the limit to 16KB!

fix: limit writes to 16k by ronag · Pull Request #137 · pinojs/sonic-boom · GitHub
fix: limit writes to 16k by ronag · Pull Request #137 · pinojs/sonic-boom · GitHub
Docker has a 16k limit. Refs: https://github.com/moby/moby/blob/513ec73831269947d38a644c278ce3cac36783b2/daemon/logger/copier.go#L13 Fixes: #136
github.com
fix: limit writes to 16k by ronag · Pull Request #137 · pinojs/sonic-boom · GitHub
fix: limit writes to 16k by ronag · Pull Request #137 · pinojs/sonic-boom · GitHub
Docker has a 16k limit. Refs: https://github.com/moby/moby/blob/513ec73831269947d38a644c278ce3cac36783b2/daemon/logger/copier.go#L13 Fixes: #136
github.com

News

TypeScript v4.7 Beta ships a significant update: it will support Node.js ESM implementation. This is set to resolve one of the major hiccups when using TS with ESM, check it out:

Announcing TypeScript 4.7 Beta
Announcing TypeScript 4.7 Beta
Today we are excited to announce the beta release of TypeScript 4.7! To get started using the beta, you can use npm with the following command: npm install typescript@beta
devblogs.microsoft.com

I believe in the microfrontend pattern and I’ve found this a

Micro frontends: my lessons learned - DEV Community
Micro frontends: my lessons learned - DEV Community
Hello there! For the past 6 months at work, I have been busy analyzing, experimenting, testing and s… Tagged with microservices, frontend, microfrontends, architecture.
dev.to
Micro frontends: my lessons learned - DEV Community
Micro frontends: my lessons learned - DEV Community
Hello there! For the past 6 months at work, I have been busy analyzing, experimenting, testing and s… Tagged with microservices, frontend, microfrontends, architecture.
dev.to

The BBC migrated to serverless last year. In the following article they draw some conclusions of their migrations!

BBC Online — A year with serverless
Its been a little over a year since I published my last two blog posts, in which I outlined the process we went through to choose the technology for BBC online and the steps we took to optimise serverless for our use.
medium.com

After last year seed funding round, Rome Tools Inc. released their new JavaScript formatter, built on Rust! Check it out:

Announcing Rome Formatter
We began a full rewrite of Rome in Rust last year, and we’re excited to announce our first release as a part of this effort with the Rome Formatter, a new formatter for JavaScript and TypeScript. It perfectly expresses our goals of excellent performance, ease-of-use, and first-class IDE integration.
rome.tools

Should you use Fastify for your next Node.js project? Will it lead to significant latency improvement? Read this independent blog post describing their journey from Apollo Server to Fastify.

GraphQL Fastify vs Apollo Server — Learnings from the real world
GraphQL Fastify vs Apollo Server — Learnings from the real world
In this article, we’ll be discussing a problem that we faced when using Apollo GraphQL in a production environment and how we managed to solve it.
medium.com

The most-awaited and important news of this week edition is the announcement of the AWS Lambda Function URLs. Why would you have to use an API Gateway if you only needed to expose a single lambda? Now you can avoid it!

Announcing AWS Lambda Function URLs: Built-in HTTPS Endpoints for Single-Function Microservices | Amazon Web Services
Announcing AWS Lambda Function URLs: Built-in HTTPS Endpoints for Single-Function Microservices | Amazon Web Services
Organizations are adopting microservices architectures to build resilient and scalable applications using AWS Lambda. These applications are composed of multiple serverless functions that implement the business logic.
aws.amazon.com

Partners

  • This Week in React: the best of React & React Native news. Sebastien filters the noise, and you save time!
Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn