The idiom “October Surprises” is the best-suited idiom for late October, as it was full of amazement. It was a great time in October, especially for people in the software development field, with a major release and a new LTS version in Node.js.
After conducting an analysis of the current version of the Node.js framework and considering the comfort level of the development team, the Node.js community recently released Node.js 21. The preceding week, it was promoted to Long-Term Support (LTS). This outcome was quite predictable; all cheers go to the community’s well-defined release process and approach.
Application developers will try Node.js to enhance mobile and web applications to boost efficiency and rejoice in the development phase.
Introduction of Node.js 21
Great news! Node.js 21 is now available as a stable release. It’s important to note that Node.js 21 is not promoted to LTS, as the LTS status is typically reserved for even-numbered versions. With 1.3 billion downloads last year, Node.js has further solidified its position as a leading framework.
Furthermore, individuals seeking a stable and well-established JavaScript runtime will undoubtedly continue to choose Node.js 21.
Experienced backend developers are already well-acquainted with the concept of Node.js, so there is no need for a one-to-one introduction. This is because of its exceptional core functionalities and features.
If you are one of those experienced developers and you’re looking to enhance your tech stack by incorporating Node.js 21, I’m pleased to inform you that it is already available. You can install it and upgrade your current version accordingly.
Crucial Update of Node.js 21
According to the source, since the release of Node.js 20, it has been reported that more than 1153 commits have been made by developers. This significant number of commits and changes in the code demonstrates the considerable effort that developers have invested. The entire process of making the release successful includes bug fixing, code refactoring, and enhancements.
Let’s have a look at the crucial update to Node.js 21:
- The Fetch API has been promoted to a stable release.
- Experimental support for the WebSocket API is now available.
- Introducing the new –experimental-default-type Flip Module.
- Node.js now incorporates the latest V8 JavaScript Engine Version, V8 11.8.
- Experimental support for improved default behavior for ECMAScript Modules (ESM).
- The fs.writeFile() functions now include a new “Flush” option.
- An update has been made to the http library, now at Version 9.1.2.
- There has been progress in implementing the Navigator API, albeit partially.
Stability in Fetch/Webstream
In the recent Node.js version 21 update, there is a significant change that affects both the fetch module and WebStreams. Following a recent update, both modules have now been marked as stable.
This update has implications for various components, including WebStreams, FormData, Headers, Request, Response, and the fetch module.
Built-in WebSocket Client
With this version, a browser-compatible experimental WebSocket implementation was added. You can employ the flag –experimental-websocket to activate this capability. Please remember that it might be improved upon and changed in later versions, just like any experimental feature.
All About V8
In the new version of Node.js, the sparkingly new interaction of the V8 engine has been seamlessly integrated. This update is closely related to Chromium 118, and it aims to enhance high-level performance while introducing brand-new features.
Major highlights include:
- Array Grouping
- ArrayBuffer.prototype.transfer
- WebAssembly Extended-const Expressions
It’s noteworthy that the update of the V8 engine is solely the result of Michaël Zasso’s contribution, and acknowledging his efforts is never a wrong statement.
Experimental Support for Enhanced Default in ESM
To provide a better development experience, especially when working with ECMAScript Modules (ESM), in Node.js 21, the Node.js community has designed and introduced new default settings that can be activated using the –experimental-default-type options. This feature is designed to be more suitable for completing ESM implementations seamlessly.