ESM in Node has been unflagged! + other node.js updates of this week. #46 / 2019

Below you can find a collection of the most important Node.js updates, tutorials & announcements from this week - curated by RisingStack's Node.js Consultants.

Latest Node.js Updates here: Node v13.0.1 / LTS v12.13.0

Apologies, we've been busy in the previous weeks and missed a few installments, therefore content in this article is not exclusively from the previous week.


The Big News:

ESM in Node has been unflagged!

esm: unflag --experimental-modules

Node 13 is out, here's what it means to you

Learn what's new in 13 and why you should start thinking about migrating to Node.js 12.

Cool new stuff in [email protected]

A feature npm shipped in this version is a new funding property in package.json - in a bid to help the open source community npm decided to add a new command: npm fund that will provide more visibility to npm users on what dependencies are actively looking for ways to fund their work.

As part of that change, npm install will also show a single message at the end in order to let the user aware that dependencies are looking for funding, it looks like this:

$ npm install
3 packages are looking for funding.
Run "npm fund" to find out more.

The Module Ecosystem - The Stress of Success

Slides for the prezentation of Dominykas Blyžė & Michael Dawson who share the challenges and opportunities in trying to ensure a healthy and successful package ecosystem.

What happened to NodeSource

Yes, the company was acquired and is now a part of i2.

Many of you may have been wondering, “What happened to NodeSource?”, a company that seemed so solid in the Node.js ecosystem, suddenly there was a restructuring of the organization and many of the staff were impacted.


Awesome Node.js & JavaScript Tutorials:

Top-level await

Top-level await enables developers to use the await keyword outside of async functions. It acts like a big async function causing other modules who import them to wait before they start evaluating their body.

Great Content from JSConf Budapest 2019

JSConf Budapest is a JSConf family member 2-day non-profit community conference about JavaScript in the beautiful Budapest, Hungary. RisingStack participated in the conf for several years as well as we did this September.

Building Distributed Systems with Node.js

A great prezentation by James Simpson during NordicJS.

Building a native add-on for Node.js in 2019

There are two ways to interface C/C++ code with Node.js:

  • NAN (Native Abstraction for Node.js) – this is a set of tools for making the interface with V8 simpler and more stable across versions of Node.js. Our code could be broken by changes made on V8 API. It needs to be compiled for each major version of Node.js
  • N-API – this is a stable and V8-independent API for building add-ons for Node.js. You compile it once and it will run on all versions of Node.js that support N-API.

Unit and integration testing for Node.js apps

Building tests with your application enables you to:

  • Quickly verify that changes to a project do not break expected behavior
  • Act as pseudo documentation as path flows are documented
  • Easily demonstrate application behaviors
  • Quickly take a review of your application’s health and codebase

What I Learned At GraphQL Summit

From the two days of talks, roundtables, and hallway conversations, some exciting themes emerged at Summit:

  • GraphQL is mature and growing. It’s here to stay, and it’s poised to become the preferred API convention as client-side UI demands grow in complexity.
  • The data graph provides numerous architectural advantages for companies with rich client-side experiences. It simplifies client-side data fetching, ensures a much more pleasant developer experience, and improves developer velocity ⚡.
  • The React Hooks (useQuery) + Apollo stack is solid. And just fun to code with.
  • There’s no free lunch in software. Large-scale GraphQL deployments encounter challenges similar to any other service-based architecture. But teams can mitigate those challenges with tools like 🏘️ federation (to prevent error-prone monoliths and enable the development of separate graphs by cross-cutting teams) and 🔒 schema change validation (to ensure that schema changes don’t break live queries in production).

Interesting JS & Node Discussions:

On private fields proposal: Private fields, public worries

Some of the changes proposed by TC39 Committee (body responsible for EcmaScript standard) arouse more resistance than others. A proposal that recently caused a lot of negative reactions was class fields proposal that — among others — tries to add to the language private class fields.

ESM Unflagged and everyone is happy

As broofa in the thread pointed out: This fixes two huge issues that have plagued the JS ecosystem for 10+ years:

  • Having a consistent module import syntax on all major JS platforms makes it easier for JS devs to work across server/client code bases and, more importantly (imho), module owners no longer have to worry about supporting different module schemes.
  • Because ESM modules are statically resolved, packagers can do tree-shaking, to remove not just unused modules, but unused code within those modules.

In your opinion, what are the topics an advanced Node.js programmer should know?

An active discussion on r/node about being an advanced Node.js dev.

Why do many devs hate Node.js? - "fun" discussion on reddit

There are only two kinds of languages: the ones people complain about and the ones nobody uses. — Bjarne Stroustrup