InfoQ Homepage News Fastify 3.0 Improves Performance, Logging, Schema, and TypeScript Support
Fastify 3.0 Improves Performance, Logging, Schema, and TypeScript Support
This item in japanese
Jul 19, 2020 2 min read
Write for InfoQ
Feed your curiosity. Help 550k+ globalsenior developers
each month stay ahead.Get in touch
Fastify is an open-source, low-performance overhead Node.js web framework. Fastify version 3 introduces support for running Express applications inside Fastify, adds improvements to logging serialization and schema substitution, and provides better TypeScript definition support.
Fastify remains focused on lightweight performance. According to Fastify's most recent performance metrics, Fastify serves more requests per second than other Node.js frameworks, including Koa, Restify, hapi, Express, and the built-in http.Server. The 3.0 release more than doubles Fastify's requests per second compared to early 2.x versions.
Fastify version 3 improves its type system to support generic constraining and defaulting and more efficient definitions for schema types.
The fastify-express package provides full Express compatibility inside Fastify to ease the transition from Express to Fastify over time.
Validation and serialization receive a significant upgrade in Fastify 3. The setSchemaCompiler and setSchemaResolver options get replaced with the setValidatorCompiler enabling future tooling improvements. Further changes to preParsing and other hooks improve performance and consistency and leverage more of Fastify's internal APIs such as Fastify requests. Similarly, the Fastify logging serializers now use Fastify Request and Reply objects instead of native objects. Existing Fastify users should review the Fastify 3.0 migration guide for a complete list of updates.
Fastify now includes 136 official plugins ranging from features like Next.js server-side rendering, WebSockets, Webpack, and much more. Immediate support for all plugins was a significant priority for the 3.0 release. As explained by Tomas Della Vedova, software engineer at Elastic and Fastify contributor,
I’m very happy about how the @fastifyjs v3 release went. As you might know by now, we have a rather big plugin ecosystem. With v2 we didn’t have a specific plan for the upgrade, so we just released Fastify v2 and then slowly updated all the plugins. This year we started doing prereleases of all plugins, so a user was able to test Fastify v3 by installing the @.next version of every component of their application. Then on the release day, we published the final release of Fastify v3 and @matteocollina and me bumped all the plugins, so old and new users would not experience gaps or unwanted bugs while upgrading. Improvement for next year: automate this step as well!
Learn more about the Fastify 3.0 release from Matteo Collina, technical director at NearForm, Node.js Technical Steering Committee member, and Fastify project lead.
[フレーム]
Or watch a more in-depth introduction to Fastify 3.
[フレーム]
Fastify is open source software available under the MIT license and is part of the OpenJS Foundation. Contributions are welcome and should follow the Fastify contribution guidelines and code of conduct.
This content is in the Web Development topic
Related Topics:
-
Related Editorial
-
Related Sponsors
-
Popular across InfoQ
-
Microsoft Patches Critical ASP.NET Core Vulnerability with 9.9 Severity Score
-
GitHub Expands Copilot Ecosystem with AgentHQ
-
Redis Critical Remote Code Execution Vulnerability Discovered after 13 Years
-
Monzo’s Real-Time Fraud Detection Architecture with BigQuery and Microservices
-
AWS Launches Capabilities by Region Tool
-
Architecture Should Model the World as it Really is: a Conversation with Randy Shoup
-
Related Content
The InfoQ Newsletter
A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example