Fastify 5.10.0
The Fastify team has released version 5.10.0, the latest update to the popular Node.js web framework. The release introduces a new log controller layer, delivers meaningful performance improvements, and resolves several edge-case bugs.
What Changed
- Log Controller Layer — A new abstraction for controlling log output at the framework level, giving developers finer-grained control over what gets logged and when. This lays groundwork for per-route log level configuration and dynamic log routing.
- Reduced Per-Request Overhead — Internal optimizations in the request lifecycle cut per-request processing overhead, resulting in measurable throughput gains for high-traffic applications. Early benchmarks show a noticeable reduction in CPU time per request.
request.portDerivation — The framework now correctly derivesrequest.portfromrequest.hostwhen no explicit port is provided, fixing inconsistent behavior with reverse proxies and forwarded headers.- Content-Type Detection Fix — The
reply.send()method now uses Content-Type headers to correctly detectjsonandcharsetparameters, eliminating encoding-related edge cases in mixed-content responses. - Socket Cleanup on Hijack — Fixed a bug where
socket._metawas not cleared whenreply.hijack()was called after anonTimeoutregistration, preventing potential memory leaks in long-lived connections.
Why It Matters
Version 5.10.0 represents a maintenance-focused release that demonstrates Fastify's commitment to stability and performance. The log controller layer, while subtle, signals the direction of future observability improvements in the framework.
Upgrade Notes
The upgrade from 5.9.x to 5.10.0 is seamless, with no breaking changes reported. Users can update via their package manager of choice. As always, running your test suite after upgrading is recommended before deploying to production.