Close

Sign up to Gadget

Get instant access to Fastify v4 and Node.js 20 when you upgrade to the new Gadget framework v0.3

-

About

The latest version of the framework is more performant and offers easy migration, version management, and better access to the latest tools

Problem

Solution

Result

Get instant access to Fastify v4 and Node.js 20 when you upgrade to the new Gadget framework v0.3

Emma Hyde
November 30, 2023

TL;DR: Get access to Fastify V4 and Node 20 with the newest Gadget framework version.

Gadget gives developers the performant, scalable infrastructure and framework to build their apps, while abstracting all of the annoying parts out of the code. With this upgrade, that means eliminating the headache of upgrading to the latest version.

Starting today, every new Gadget app will have instant access to Gadget framework version v0.3 making Fastify v4 and Node.js 20 available, so you can build with the latest tech, without the hassle of upgrading and existing projects will have a one-click migration flow to easily upgrade. 

A new versioning system

Framework versions bottle up all of Gadget’s thoroughly tested software versions into one simple number. Instead of spending time fighting with upgrade processes for each little component, or lagging behind and introducing security vulnerabilities, Gadget apps can upgrade to blessed, tested node.js software stacks at the click of a button.

We’re also introducing the option to manage which version of the Gadget framework your app is running. No one wants to worry about running a migration only to find out it broke something. Now, you have the ability to upgrade to new versions, or downgrade to an older version.

To manage which version of Gadget your app is running, you can select the framework version on the app settings page. For more information check out our documentation here.

Better performance with Fastify v4

Fastify is the high-performance JS framework powering all Gadget apps, Gadget v0.3 includes Fastify v4, which has improved throughput, simpler error handling, and many general enhancements.. Previously, plugins were named using <inline-code>fastify-something<inline-code>, but with the new version, they have all been renamed to <inline-code>@fastify/something<inline-code>. To upgrade a plugin version, check out that plugin’s readme to identify the new plugin name.

The composition of error handlers has also changed. Custom error handlers are now encapsulated, allowing for more granular control. If a custom error handler within a plugin encounters an issue, the parent handler catches and manages the error seamlessly. This streamlined approach enhances error handling, creating a more stable and performant development environment.

The other major change in the new v4 shows up in routes. With this update, it is mandatory for routes to return a reply if they intend to send a response asynchronously. Simply include <inline-code>return reply<inline-code> if you want to call <inline-code>reply.send<inline-code> after the route handler has completed its execution. Routes will also automatically expose a HEAD route by default, and the <inline-code>reply.res<inline-code> has been migrated to <inline-code>reply.raw<inline-code>.

You can read about all of the Fastify improvements in the Fastify announcement blog.

What’s new with Node?

The new Gadget framework version will allow you to upgrade your apps from Node.js 18 to the new Node.js 20, setting the stage for more efficient and powerful app development. The biggest improvement is the improvements to the WebCrypto APIs, for browser-matching cryptography and interoperability with other JavaScript environments.

And, of course, Node.js 20 comes equipped with V8 version 11.3, promising improved overall performance with things like WebAssembly Tail Call.

Find all the details on what’s changed in Node.js 20 over on their blog.

If you have any questions or comments about the new Gadget framework version, hop over to our Discord to share your feedback and connect with a community of developers.

Keep reading

No items found.
Keep reading to learn about how it's built

Under the hood

We're on Discord, drop in and say hi!
Join Discord
Bouncing Arrow