Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
November 30, 2021

GraphQL Caching, Auth and a bunch of releases on Adventures in Nodeland - Issue #37

Hi Everyone! This edition of Adventures in Nodeland is packed with new releases - last week was very productive as I caught up with my OSS duties. Thanks for reading and let me know if you have any question!

GraphQL Galaxy – The biggest GraphQL conference in the cloud
GraphQL Galaxy – The biggest GraphQL conference in the cloud
Want to know the future of the GraphQL ecosystem and get in touch with its stellar pros? Attend a 2-day conference on all things GQL, gathering thousands of international software engineers in the cloud.
graphqlgalaxy.com
GraphQL Galaxy – The biggest GraphQL conference in the cloud
GraphQL Galaxy – The biggest GraphQL conference in the cloud
Want to know the future of the GraphQL ecosystem and get in touch with its stellar pros? Attend a 2-day conference on all things GQL, gathering thousands of international software engineers in the cloud.
graphqlgalaxy.com

I’m very excited to be speaking at GraphQL Galaxy about my implementation of GraphQL caching. It is still a work in progress but we have already seen massive performance improvements in a few production cases! Watch the talk!

Fastify

We are starting to assemble Fastify v4! Here is an hard-but-tiny PR that improves performance by about 10%.

Skip encapsulation of Request and Reply when not needed by mcollina · Pull Request #3479 · fastify/fastify · GitHub
Skip encapsulation of Request and Reply when not needed by mcollina · Pull Request #3479 · fastify/fastify · GitHub
This is an optimization that drops the encapsulation if decorateRequest and decorateReply has not been called. In common scenarios where most of the decorations happen top-level it can guarantee an improvement of 10% of throughput. Fixes #3341
github.com
Skip encapsulation of Request and Reply when not needed by mcollina · Pull Request #3479 · fastify/fastify · GitHub
Skip encapsulation of Request and Reply when not needed by mcollina · Pull Request #3479 · fastify/fastify · GitHub
This is an optimization that drops the encapsulation if decorateRequest and decorateReply has not been called. In common scenarios where most of the decorations happen top-level it can guarantee an improvement of 10% of throughput. Fixes #3341
github.com

We have just released a new version of fastify-jwt! This new version moves away from the old-and-tested jsonwebtoken module and start using fast-jwt. By providing utilities for JWT caching, servers could become significantly faster. Check it out:

Release v4.0.0 · fastify/fastify-jwt · GitHub
Release v4.0.0 · fastify/fastify-jwt · GitHub
JWT utils for Fastify. Contribute to fastify/fastify-jwt development by creating an account on GitHub.
github.com
Release v4.0.0 · fastify/fastify-jwt · GitHub
Release v4.0.0 · fastify/fastify-jwt · GitHub
JWT utils for Fastify. Contribute to fastify/fastify-jwt development by creating an account on GitHub.
github.com

Here is also a new release of Fastify, including several bugfixes and doc updates. What makes this release incredibly special is that 14 different people contributed to it - 9 of them being new to the project. I’m enthusiastic about this. Thanks folks!

Release v3.24.1 · fastify/fastify · GitHub
Release v3.24.1 · 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 v3.24.1 · fastify/fastify · GitHub
Release v3.24.1 · 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 been incredibly active in Mercurius last week. A new version of mercurius-auth has a new option to avoid displaying the authorization directives during inspection queries. Check it out:

Release v1.4.0 · mercurius-js/auth · GitHub
Release v1.4.0 · mercurius-js/auth · GitHub
Mercurius Auth Plugin. Contribute to mercurius-js/auth development by creating an account on GitHub.
github.com
Release v1.4.0 · mercurius-js/auth · GitHub
Release v1.4.0 · mercurius-js/auth · GitHub
Mercurius Auth Plugin. Contribute to mercurius-js/auth development by creating an account on GitHub.
github.com

This change was enabled by v8.10.0 of Mercurius, which added a couple of new hooks to able to intercept those changes:

Release v8.10.0 · mercurius-js/mercurius · GitHub
Release v8.10.0 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.10.0 · mercurius-js/mercurius
github.com
Release v8.10.0 · mercurius-js/mercurius · GitHub
Release v8.10.0 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.10.0 · mercurius-js/mercurius
github.com

…but the work on Mercurius did not stop there, and thanks to Giacomo we got a significant improvement on the Gateway, enabling a significant increase in performance is the target service supports request batching.

feat: optimize gateway by batching queries by giacomorebonato · Pull Request #667 · mercurius-js/mercurius · GitHub
feat: optimize gateway by batching queries by giacomorebonato · Pull Request #667 · mercurius-js/mercurius · GitHub
Batch queries when resolving references from the Gateway. This lead to a significant performance increase.
github.com
feat: optimize gateway by batching queries by giacomorebonato · Pull Request #667 · mercurius-js/mercurius · GitHub
feat: optimize gateway by batching queries by giacomorebonato · Pull Request #667 · mercurius-js/mercurius · GitHub
Batch queries when resolving references from the Gateway. This lead to a significant performance increase.
github.com

I also did another fix, enabling our loaders implementation to have access to the info object when the individual loader cache is disabled:

Include the info object in loaders when the loader cache is off by mcollina · Pull Request #671 · mercurius-js/mercurius · GitHub
Include the info object in loaders when the loader cache is off by mcollina · Pull Request #671 · mercurius-js/mercurius · GitHub
github.com
Include the info object in loaders when the loader cache is off by mcollina · Pull Request #671 · mercurius-js/mercurius · GitHub
Include the info object in loaders when the loader cache is off by mcollina · Pull Request #671 · mercurius-js/mercurius · GitHub
github.com

Both those changes shipped in v8.11.0:

Release v8.11.0 · mercurius-js/mercurius · GitHub
Release v8.11.0 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.11.0 · mercurius-js/mercurius
github.com
Release v8.11.0 · mercurius-js/mercurius · GitHub
Release v8.11.0 · mercurius-js/mercurius · GitHub
Implement GraphQL servers and gateways with Fastify - Release v8.11.0 · mercurius-js/mercurius
github.com

Pino

Even pino packed a couple of releases for this edition of Adventures in Nodeland. They bring improved types, better developer experience and a improved docs.

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

Interesting Modules

As I do security triaging in Node.js, we often closereports as out-of-scope or informative because the vm module does not offer any security guarantees. What does? Isolated-vm! Check it out:

GitHub - laverdet/isolated-vm: Secure & isolated JS environments for nodejs
GitHub - laverdet/isolated-vm: Secure & isolated JS environments for nodejs
Secure & isolated JS environments for nodejs. Contribute to laverdet/isolated-vm development by creating an account on GitHub.
github.com
GitHub - laverdet/isolated-vm: Secure & isolated JS environments for nodejs
GitHub - laverdet/isolated-vm: Secure & isolated JS environments for nodejs
Secure & isolated JS environments for nodejs. Contribute to laverdet/isolated-vm development by creating an account on GitHub.
github.com

Interesting articles

Once upon a time, I studied CRDT and Operational Transformation in great detail. Thus I couldn’t resist in presenting to you Peritext. I have found the research on this topic extremely compelling - I can’t wait to see what this new algorithm and library will enable:

Peritext: A CRDT for Rich-Text Collaboration
Peritext: A CRDT for Rich-Text Collaboration
In this article we present Peritext, an algorithm for rich-text collaboration that provides greater flexibility: it allows users to edit independent copies of a document, and it provides a mechanism for automatically merging those versions back together in a way that preserves the users’ intent as much as possible.
www.inkandswitch.com

Redis shipped a new developer tool built on Electron! Hurray - I’m so glad that we enable this amazing usecase for all companies around the globe.

Introducing RedisInsight 2.0: A Whole New Redis Developer Experience | Redis
Introducing RedisInsight 2.0: A Whole New Redis Developer Experience | Redis
The Redis manifesto states, “We’re against complexity,” followed by, “One of the main Redis goals is to remain understandable.” Although mainly referring to the Redis underlying code, we took these beliefs to heart when we worked on the brand new version of RedisInsight. 
redis.com
Introducing RedisInsight 2.0: A Whole New Redis Developer Experience | Redis
Introducing RedisInsight 2.0: A Whole New Redis Developer Experience | Redis
The Redis manifesto states, “We’re against complexity,” followed by, “One of the main Redis goals is to remain understandable.” Although mainly referring to the Redis underlying code, we took these beliefs to heart when we worked on the brand new version of RedisInsight. 
redis.com

Have you received a raise in 2021? If not, you might be losing out. A significant number of tech companies are doing off-cycle adjustments in 2021:

Exceptional Off-Cycle Compensation Adjustments for Software Engineers in 2021
Exceptional Off-Cycle Compensation Adjustments for Software Engineers in 2021
The data is in: many companies have taken a drastic step to adjust compensation during the year, responding to a beyond heated tech hiring market and attrition numbers for senior engineers rarely seen before.
blog.pragmaticengineer.com
Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn