Node.js 12 is here, Let check out, Whats there under the hood.

Node.js, the popular Javascript runtime that relies on chrome V8 javascript engines, released version 12 on 23 April. The Version Comes with a handful of features and capabilities, let’s check them out.

===> V8 got Upgraded to v8 7.4
V8 new JavaScript engine brings performance tweaks and improvements as well as keeping Node.js up with the ongoing improvements in the language and runtime. Highlights include:

– Async stack traces: https://v8.dev/blog/v8-release-72#async-stack-traces
– Faster calls with arguments mismatch: https://v8.dev/blog/v8-release-74#faster-calls-with-arguments-mismatch
– Faster await: https://v8.dev/blog/v8-release-73#faster-await
– Faster javascript parsing: https://v8.dev/blog/v8-release-72#javascript-parsing

You can check more about V8 at their official blog.

TLS 1.3 Support :
Node.Js 1.3 introduced TLS1.3 support with many security enhancements and making it the default max protocol, while also supporting CLI/NODE_OPTIONS switches to disable it if necessary.

TLS1.3 is different enough that even though the OpenSSL APIs are technically API/ABI compatible when TLS1.3 is negotiated, changes in the timing of protocol records and of callbacks broke assumptions hard-coded into the ‘tls’ module. This change introduces no API incompatibilities when TLS1.2 is negotiated. It is the intention that it be backported to current and LTS release lines with the default maximum TLS protocol reset to ‘TLSv1.2’. This will allow users of those lines to explicitly enable TLS1.3 if they want. If you want to read more you can check out these related articles:https://developer.ibm.com/blogs/openssl-111-has-landed-in-nodejs-master-and-why-its-important-for-nodejs-lts-releases/, https://developer.ibm.com/blogs/tls13-is-coming-to-nodejs/

Properly configuring default heap limits:-
In earlier releases, default max heap size was 700 MB or 1400MB on 32 and 64-bit platforms respectively, Whereas in this update JavaScript heap size is configured based on available memory instead of using defaults that were set by V8 for use with browsers. This will ensure that Node.Js won’t try to use more memory than is available and terminating when memory exhausted.

Default http parser is switched to llhttp :-
In this update, default http parser is switched to llhttp, which will make testing and comparing the new llhttp-based implementation easier
For more please follow: https://github.com/nodejs/node/pull/24059

Making Native Modules Easier — progress continues
This update continues the process of making building and supporting native modules easier. Changes include better support for native modules in combination with Worker threads, as well as N-API … fOR MORE INFO please follow this link https://medium.com/the-node-js-collection/new-features-bring-native-add-ons-close-to-being-on-par-with-js-modules-cd4f9b8e4b4

Worker Threads no longer requires the use of a flag: For Quick introduction on Worker Threads, Please Check out this article: https://medium.com/@Trott/using-worker-threads-in-node-js-80494136dbb6.

Diagnostic Reports Introduced: This update brings a new experimental feature “Diagnostic report.” Which allows you to generate a report on demand or when certain events including crashes, slow performance, memory leaks, high CPU usage, unexpected errors and more.
For more info, you can refer to this article: https://medium.com/the-node-js-collection/easily-identify-problems-in-node-js-applications-with-diagnostic-report-dc82370d8029

Heap Dumps
Node.js 12 brings integrated heap dump capability out of the box. You can check out the documentation in https://github.com/nodejs/node/pull/27133 and https://github.com/nodejs/node/pull/26501 to learn more.

Startup Improvements
Now in Node.js 12 we can generate the code cache for built-in libraries in advance at build time, and embed it in the binary, so in the final release, the main thread can use the code cache to start up the initial load of any built-in library written in JavaScript. This gives a ~30% speedup in startup time for the main thread.

ES6 Module Support
This update brings updated experimental version of support for ES6. For more info please check this article
https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff

New compiler and platform minimums
With the release of Node.js 12, the codebase now requires a minimum of GCC 6 and glibc 2.17 on platforms other than macOS and Windows. Binaries released at Node.js org use this new toolchain minimum and therefore include new compile-time performance and security enhancements. For more info please refer: https://github.com/nodejs/node/blob/v12.x/BUILDING.md#platform-list

Node.js 12 is here, Let check out, Whats there under the hood.
Scroll to top