Sign up to Gadget

Gadget projects are now powered by Node 18



Make use of the new capabilities in Node 18 for your apps in Gadget to build with LangChain, web streaming, global fetch, and more.




Gadget projects are now powered by Node 18

Ralf Elfving
May 8, 2023

Node 18 has been promoted to the long term service (LTS) version, and we’re bringing all the latest tools and goodies to your Gadget apps. Start building next-gen Node apps in Gadget, and get access to any modern tooling that requires Node 18, like LangChain, web streaming, global fetch, and more.

Up until now, all apps using Gadget have run Node 16. New Gadget apps will be created using Node 18 by default, and it will soon be available as an option for existing apps as well. This is a peek at how Gadget will allow you to upgrade other platform packages in the future.

What’s new in Node 18?

With the switch to Node 18 come some noteworthy additions, so let’s look at how you might use them. 

Global fetch 

With the addition of global browser APIs like fetch, you can fetch resources from the network without requiring packages like axios or got. The choice between axios, got, or Node fetch is personal, but making a request can be as simple as calling await fetch(url):

Web streams

Until now, if you were looking to build modern tools or work with AI models, you’ve had to download an entire file, wait for it to be deserialized, and then process it once it’s all completed. This is not only time consuming, with the response delays being passed on to users, but also can be a source of stress on memory because the entire payload needs to be loaded up before it is sent to the recipient. With the Web Streams API introduced in Node 18 you can instead process this data in chunks as a ‘stream’. This, along with the detecting when streams start or finish, and error handling, can be used to build some pretty cool experiences.

A practical example of using streaming

If you’ve gotten used to ChatGPT-like experiences where the response is appearing word by word, you already have a sense of what experiences you can build with streaming. 

If you’re looking to try building something using the Web Streams API but you’re not sure where to start, we’ve put together an easy-to-follow tutorial to get started with your first build.

Support for new packages

Speaking of ChatGPT, upgrading to Node18 will also unlock access to newer packages that aren’t supported by Node 16, such as LangChain. The package has quickly become a staple with AI app developers, making it easier to build applications powered by language models.

Our recent tutorial on how to build a product recommendation chatbot is a great place to start if you want to try your hand at building an AI-powered Shopify app.

Version 10.1 of the V8 JavaScript engine

Version 10.1 of the V8 JS engine brings a few new JavaScript features to your Gadget apps. For example, you can now find elements starting at the end of an array using findLast() and findLastIndex(). Read up on these changes in the V8 docs. 

As always, if you have questions, reach out to us on our developer Gadget Discord.

Interested in learning more about Gadget?

Join leading agencies making the switch to Gadget and experience the difference a fullstack platform can make.

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