Node 12 - What Are The New Improvements And Features?

Node 12 - What Are The New Improvements And Features?

Node team added some great features in their v 12 which will definitely help the Node.js Developmentprocess and some features like planning to include Python 3 support, improving startup performance, Core Promise API support, further work on standards and governance

Node has released it's version 12 in late April (codename Erbium) which brings improved support for ECMAScript modules. It implements phase 2 of the plan that was released late last year as it's Node v12 (this is as even-numbered version) which comes under Long term support start from October 2019 & will get support till 2022 it also packed with V8 engine which is maintained by Google so will receive updates in future as well.

Node 12 New Features

Node.js 12 features include faster startup and better default heap limits, updates to V8, llhttp, TLS, new features including diagnostic report, bundled heap dump capability and updates to Worker Threads, N-API and ES6 module support and more let's check what's new in Node js 12.

V8 Engine Updated to V8 7.4

As always a new version of the V8 JavaScript engine brings performance tweaks and improvements to Node. It was initially running on V8 .7.2 (updated in Dec 18) and eventually upgrade to 7.6 in April which included notable improvements with V8 7.4 are performance updates for faster JavaScript execution, better memory management, and broadened ECMAScript syntax support.

Major Features of V8 version 7.4

JIT-less V8

Version 7.4 now allows JavaScript execution without allocating executable memory at runtime it relies heavily on the ability to allocate and modify executable memory at runtime in its the default configuration & creating executable memory at runtime is part of what makes V8 fast.

WebAssembly Threads/Atomics shipped

WebAssembly Threads/Atomics are now enabled on non-Android operating systems which unlocks the usage of multiple cores on a user’s machine via WebAssembly, enabling new, computation-heavy use cases on the web.

Faster calls with arguments mismatch

JavaScript engines must provide a way to get to the actual parameters. In V8 this is done via arguments adaption, which provides the actual parameters in case of under- or over-application. In the latest version, V8 now completely skips arguments adaption, reducing call overhead by up to 60%.

Check out More of the v8.7.4 New Features Below:

  • Improved native accessor performance
  • Parser performance
  • Bytecode flushing in memory
  • Bytecode dead basic block elimination
  • JavaScript language features include Private class fields
  • Hashbang grammar
  • V8 API 

ES6 Module Support

The import/export syntax has become the favorite module syntax for developers since its standardization in ES6, and the Node team has been working on it to enable natively. Mostly all major browsers support ECMAScript modules via

Types of import from ES modules files for phase 3 that will work with all built-in Node packages:

// default exports
import module from 'module'

// named exports
import { namedExport } from 'module'

// namespace exports
import * as module from 'module'

Phase 3 for ECAM Script Modules in Node 12 which correspond to a path to the stability of the modules and the plan is to remove the --experimental-modules flag into LTS version.

Private Class Fields

Node V 12 has shipped with private class fields These variables are only accessible within the class itself and can't be accessed externally & if you try to access it outside of the class, you will receive a syntax error and private class field is initialized with the # symbol.

Improved Startup Performance

Node.js 12 feature brings an updated experimental version of support for ES6 modules. It will generate the code cache for built-in libraries before build time and embed it as a binary. The main thread is able to use this code cache and gives a 30% speedup in startup time for the main thread.

New compiler and platform minimums

Node 12 takes the full advantage of newer compiler optimizations and security enhancements. The codebase requires a minimum of GCC 6 and glibc 2.17 on platforms other than macOS and Windows. The increment in minimum compiler and libc requirements also increments minimums in supported platforms. Node binary uses a new toolchain minimum which provides compile-time performance and security enhancements. Windows minimums remain the same as Node.js version 11, requiring at least Windows 7, 2008 R2 or 2012 R2 and a minimum compiler of Visual Studio 2017 and Mac users needing to compile Node will require a minimum of Xcode 8.

TLS 1.3 and Security

Node added TLS 1.3 support which increases security and reduced the latency. TLS has been a major update and it actively being integrated across the web. TLS 1.0 and 1.1 have been disabled by default, and the crypto library has removed deprecated functions. With TLS 1.3, Node.js apps have increased end-user privacy & also improved the performance of requests by reducing the time required for the HTTPS handshake. 

Heap Dump

Node.js 12 brings integrated heap dump capability out of the box. Previously the default V8 heap sizes were 700MB for 32-bit systems & 1400MB for 64-bit systems, Now it will automatically determine the heap size that it does not use more than the allowed resources.

Native Modules N-API Improvements

N-API provide ABI compatibility across various Node.js versions and also across different Node VMs - allowing N-API enabled native modules to just work across different versions. Node 12 added a feature to improved support for N-API in combination with worker threads.

Diagnostic Reports

Node.js 12 includes an experimental feature named Diagnostic report that allows developers to create a report on demand that will be triggered by specific events.

Recommended Reading

Top 50 Node.js Interview Questions and Answers

Learn full about Crash course on REST, GraphQL and Graphback

React + Node.js - Drag and Drop Multiple Files Upload

Learn how to CI/CD with GitHub Actions and Docker

Creating a REST API with Node, Express and MongoDB

Node.js and RaspberryPI : Step by Step Installation Guide

Node.js Interview Questions and Answers

node-js javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Hire Node.js Developers And How Much Does It Cost?

A Guide to Hire Node.js Developers who can help you create fast and efficient web applications. Also, know how much does it cost to hire Node.js Developers.

Top 7 Most Popular Node.js Frameworks You Should Know

Node.js is an open-source, cross-platform, runtime environment that allows developers to run JavaScript outside of a browser. In this post, you'll see top 7 of the most popular Node frameworks at this point in time (ranked from high to low by GitHub stars).

Hire Node.JS Developers | Skenix Infotech

We are providing robust Node.JS Development Services with expert Node.js Developers. Get affordable Node.JS Web Development services from Skenix Infotech.

Node.js for Beginners - Learn Node.js from Scratch (Step by Step)

Node.js for Beginners - Learn Node.js from Scratch (Step by Step) - Learn the basics of Node.js. This Node.js tutorial will guide you step by step so that you will learn basics and theory of every part. Learn to use Node.js like a professional. You’ll learn: Basic Of Node, Modules, NPM In Node, Event, Email, Uploading File, Advance Of Node.

Hands on with Node.Js Streams | Examples & Approach

The practical implications of having Streams in Node.js are vast. Nodejs Streams are a great way to handle data chunks and uncomplicate development.