Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
March 14, 2022

Untangling GraphQL and other Adventures in Nodeland - Issue #51

Hi Everyone! It’s time for another edition of Adventures in Nodeland, telling the latest stories of the Fastify & Node.js communities. Today we have quite a bit of news and articles, a new event we are launching, and a “fun” experiment with TypeScript targets. As usual, let me know what you think!

We are launching a new event on GraphQL! Check it out:

Untangling GraphQL
Untangling GraphQL
Come watch Josh Goldberg, Max Stoiber, Ebenezer Don, Arisa Fukuzaki, Jason Kuhrt, Uri Goldshtein and myself at “Untangling GraphQL” a free, remote event by NearForm, taking place 06/04/2022 to 07/04/2022.
hopin.com
Untangling GraphQL
Untangling GraphQL
Come watch Josh Goldberg, Max Stoiber, Ebenezer Don, Arisa Fukuzaki, Jason Kuhrt, Uri Goldshtein and myself at “Untangling GraphQL” a free, remote event by NearForm, taking place 06/04/2022 to 07/04/2022.
hopin.com

Fastify

Last week I released v3.27.3 and v3.27.4 to fix all compatibilities problems between Fastify v3 and the (upcoming) Node.js v18. Fixes were required in the the test suite - false positives started to show up due to changes in the runtime and they started to show up in Node.js CITGM.

Meanwhile in another branch the development of Fastify v4.0.0 is progressing steadily. This includes a deprecation of the variadic .listen() implementation. Check out the PR and the discussion at:

Deprecate variadic listen method (closes #3652) by jsumners · Pull Request #3712 · fastify/fastify · GitHub
Deprecate variadic listen method (closes #3652) by jsumners · Pull Request #3712 · fastify/fastify · GitHub
Resolves #3652. As I am going through the process of getting this PR together, I am more convinced that this is the right path. I have had to jump through several hoops to cover cases of “was this signature provided? That one? This one?”
github.com
Deprecate variadic listen method (closes #3652) by jsumners · Pull Request #3712 · fastify/fastify · GitHub
Deprecate variadic listen method (closes #3652) by jsumners · Pull Request #3712 · fastify/fastify · GitHub
Resolves #3652. As I am going through the process of getting this PR together, I am more convinced that this is the right path. I have had to jump through several hoops to cover cases of “was this signature provided? That one? This one?”
github.com

v4.0.0-alpha.2 is out including that fix and many others:

Release v4.0.0-alpha.2 · fastify/fastify · GitHub
Release v4.0.0-alpha.2 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com
Release v4.0.0-alpha.2 · fastify/fastify · GitHub
Release v4.0.0-alpha.2 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com

Mercurius

We have found (another) bad bug in the Gateway implementation of Mercurius. Jonny promptly fixed it!

Correctly handle reference types at the same path in the gateway by jonnydgreen · Pull Request #754 · mercurius-js/mercurius · GitHub
Correctly handle reference types at the same path in the gateway by jonnydgreen · Pull Request #754 · mercurius-js/mercurius · GitHub
Fixes: #751
github.com
Correctly handle reference types at the same path in the gateway by jonnydgreen · Pull Request #754 · mercurius-js/mercurius · GitHub
Correctly handle reference types at the same path in the gateway by jonnydgreen · Pull Request #754 · mercurius-js/mercurius · GitHub
Fixes: #751
github.com

The fix was released as v9.3.4 and v8.12.1.

Pino

Release v7.8.1 · pinojs/pino · GitHub
Release v7.8.1 · pinojs/pino · GitHub
🌲 super fast, all natural json logger. Contribute to pinojs/pino development by creating an account on GitHub.
github.com
Release v7.8.1 · pinojs/pino · GitHub
Release v7.8.1 · pinojs/pino · GitHub
🌲 super fast, all natural json logger. Contribute to pinojs/pino development by creating an account on GitHub.
github.com

Node.js

There are quite a few moments that you noticed you made a mistake: Dave and myself developed 0x to help build performant libraries for Node.js. The first of those libraries was pino, our JSON logger. Anyway the latest release of pino was not compatible with 0x, because of a bug inside 0x - that Rafael promptly fixed!

Release v5.2.1 · davidmarkclements/0x · GitHub
Release v5.2.1 · davidmarkclements/0x · GitHub
🔥 single-command flamegraph profiling 🔥. Contribute to davidmarkclements/0x development by creating an account on GitHub.
github.com

Last week I have done quite a bit of research to verify that using async/await with TypeScript could lead to massive overhead… unless it’s configured correctly. Specifically, you’ll need to target at least es2017 to avoid any additional overhead. This unfortunately applies also to some of yours dependencies (be careful in what you chose to use!):

GitHub - mcollina/typescript-async-await-target-cost
GitHub - mcollina/typescript-async-await-target-cost
Contribute to mcollina/typescript-async-await-target-cost development by creating an account on GitHub.
github.com
GitHub - mcollina/typescript-async-await-target-cost
GitHub - mcollina/typescript-async-await-target-cost
Contribute to mcollina/typescript-async-await-target-cost development by creating an account on GitHub.
github.com

News

The complexity behind modern authentication system is unique. while the technology might be simple to use, understanding what is actually happening is fundamental for a safe implementation of every solution. Check out this illustrated guide to know more:

An Illustrated Guide to OAuth and OpenID Connect
An Illustrated Guide to OAuth and OpenID Connect
In the “stone age” days of the Internet, sharing information between services was easy. You simply gave your username and password for one service to another so they could login to your account and grab whatever information they wanted!
developer.okta.com
An Illustrated Guide to OAuth and OpenID Connect
An Illustrated Guide to OAuth and OpenID Connect
In the “stone age” days of the Internet, sharing information between services was easy. You simply gave your username and password for one service to another so they could login to your account and grab whatever information they wanted!
developer.okta.com

What is Open Policy Agent? How could you leverage it to implement a Cloud Governance solution using AWS CDK? Check out NearForm latest blog:

Cloud Governance with CDK using Aspects - NearForm
Cloud Governance with CDK using Aspects - NearForm
Nowadays with the established concepts of cloud computing, infrastructure as code, and automation; the volume and complexity of environments are increasing exponentially. This landscape makes it necessary to implement a clear set of rules and policies regarding the lifecycle of cloud resources, otherwise known as Cloud Governance.
www.nearform.com

A new proposal hit TC39, the standard body that govern JavaScript, to standardize how we we can augment JavaScript with types.. just by using comments. Hopefully this will get standardized soon.

GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
ECMAScript proposal for type syntax that is erased - Stage 0 - GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
github.com
GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
ECMAScript proposal for type syntax that is erased - Stage 0 - GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
github.com

What happen when you enable your customers to run code inside your infra? They can easily sniff each other secrets if you are not careful. Last week a “fun” vulnerability was released targeting Azure. Read up:

AutoWarp Microsoft Azure Automation Vulnerability - Orca Security
AutoWarp Microsoft Azure Automation Vulnerability - Orca Security
orca.security
AutoWarp Microsoft Azure Automation Vulnerability - Orca Security
AutoWarp Microsoft Azure Automation Vulnerability - Orca Security
orca.security

At the beginning there was HTTP/2 push. However that did not really work out as planned. Then 103 Early Hints came for the rescue. I have been watching the advancement of this new feature of the Web with interest: currently it is at origin trial status in Chrome:

103 Early Hints for Navigation - Chrome Platform Status
Support 103 Early Hints informational responses for navigation. When a 103 response includes or other link headers Chromium tries to preload (and/or preconnect, prefetch) specified resources even before the final response is received. This gives Web developers a way to optimize Core Web Vitals such as Largest Contentful Paint (LCP).
chromestatus.com

How much should you rely on services of your Cloud provider? How much should you tie your business to one single vendor? Those are the fundamental question of every software architect in 2022. Here is the opinion of ThoughWorks:

Don't get locked up into avoiding lock-in
Don't get locked up into avoiding lock-in
Shades of lock-in Lock-in isn’t an all-or-nothing affair. Elevator Architects (those who ride the Architect Elevator up and down) see shades of gray where many only see black and white.
martinfowler.com

Do you know what are the key metrics to measure your team performance? If you don’t, you are missing out. Read up at:

Use Four Keys metrics like change failure rate to measure your DevOps performance | Google Cloud Blog
Use Four Keys metrics like change failure rate to measure your DevOps performance | Google Cloud Blog
Dina Graves Portman Developer Programs Engineer
cloud.google.com

I’m so happy to announce that Isaacs finally shipped the new version of tap that removed quite a few deprecations at install time:

Node Tap v16.0.0 is out!
A Test-Anything-Protocol library for JavaScript
node-tap.org
Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn