Node.js v12 improves startup times and adds experimental diagnostic reports
According to their self-administered survey in 2018, web development is the number one type of developement work Node.js users spend their time on. (Followed by enterprise and hobbyist usage.) The survey asked users to predict the future, and 75% of developers expect Node.js usage to increase.
Take a look at the long-term release schedule. The current active LTS is v10, however v12 begins its active LTS phase on October 22, 2019.
V8 version 7.2
On April 23, 2019, the Node.js foundation posted an announcement blog introducing the new features and updates.
From the blog:
Highlighted updates and features include faster startup and better default heap limits, updates to V8, TLS, llhttp, new features including diagnostic report, bundled heap dump capability and updates to Worker Threads, N-API and ES6 module support and more.
await implementation, enabled by default and improves spread elements’ performance.
This version of V8 also brings a new feature: async stack traces. It is currently behind the
--async-stack-traces command-line flag.
A new experimental feature, “Diagnostic reports” allows for users to generate an on-demand report when certain events occur.
With the information provided from this report, users can diagnose problems concurring in production.
An article from the Node.js Foundation explains how the Diagnostic Report utility works and goes over some example use cases. According to the article, it helps identity anomalies in production including “abnormal termination such as crash, slow performance, memory leak, high CPU, unexpected errors, incorrect output, and more.”
SEE ALSO: 3 tips for serverless success in 2019
Bear in mind that this feature currently comes with some challenges, as listed in the above article. It also requests user feedback for this experimental feature.
Some other key features included in v12:
- TLS1.3 adds new security enhancements to the TLS protocol. For added security, The Node.js Foundation recommends using it over its previous version whenever possible since it is a major protocol update.
- V12 adds a new way to configure JS heap sizes. Now, default heap limits base their size on available memory. Previously, this was set to a default used by V8 and its size was fairly limited. The release blog by Bethany Griggs and Michael Dawson notes that this new feature will be useful for processing large data-sets. “As before, it will still be possible to set — max-old-space-size to use a different limit if the default is not appropriate for your application.”
- New changes for building and supporting native modules. This article explains how this new feature brings native add-ons close to being on par with JS modules.
- Worker Threads progress closer to a release.
- Integrated heap dump capability. See the documentation on GitHub here and here.
See the full release notes here for all changes and additions.
The latest binaries and installers available for download here.