Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
May 3, 2021

Adventures in Nodeland - Issue #8 - Wecome Mercurius Auth!

Hi Everyone! Last week has been a flurry of activity on all Open Source projects I’m maintaining - check them out!

Mercurius

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

Mercurius is the GraphQL plugin for Fastify that I wrote and spoke in the past quite a lot. Mercurius Auth builds upon Mercurius to provide a contex-aware authorization system that allows you to restrict the access to resolvers and external services in case of gateway. Jonny Green did an amazing implementation that wraps the resolvers with an auth check whenever the @auth directive is specified.

I’m really excited about this new library as I implemented authorisation systems several times and this looks as a massive time saver. Check it out!

Fastify

Every now and then I get asked how Fastify came to be, or why Fastify is having the great adoption it is currently having. The secret sauce is its community. I spoke extensively on the topic at last year OpenJS World.

Build a Community, Not a Framework - Matteo Collina, NearForm
Build a Community, Not a Framework - Matteo Collina, NearForm

Fastify v3.15.1 shipped last Friday that improved the user experience in case of bad configuration values:

  1. https://github.com/fastify/fastify/pull/3049 - do not crash if a route is registered without a url.
  2. https://github.com/fastify/fastify/pull/3035 - reply.hasHeader should include node core res.hasHeader!

Thanks to Simone Sanfratello, we also reached 100% code coverage!

GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
Playing around with async iterators with HTTP servers - lmammino/async-iteration-http-requests
github.com
GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
Playing around with async iterators with HTTP servers - lmammino/async-iteration-http-requests
github.com

Pino

JS Monthly #13 / GraphQL & JS Multithreading / April 2021
JS Monthly #13 / GraphQL & JS Multithreading / April 2021

At the JS Monthly live meetup I spoke about the design of pino.transport() and why it makes all the difference.

I worked a little bit on the topic and crafted a very basic example that demonstrate how to use the new transport API to log with prettyPrint to the stdout and to a file with level warn:

OSS life

Almost 3 years ago I started working on adding support to Async Iterators to Node.js core APIs. One of those is using async iterators to receive events! Yesterday Luciano posted a snippet showing how to process incoming requests using an async iterator… in the end it’s something you should not do, as you might inadvertently force your server to only process one request at a time!

GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
Playing around with async iterators with HTTP servers - lmammino/async-iteration-http-requests
github.com
GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
GitHub - lmammino/async-iteration-http-requests: Playing around with async iterators with HTTP servers
Playing around with async iterators with HTTP servers - lmammino/async-iteration-http-requests
github.com

Undici

GitHub - nodejs/undici: An HTTP/1.1 client, written from scratch for Node.js
GitHub - nodejs/undici: An HTTP/1.1 client, written from scratch for Node.js
An HTTP/1.1 client, written from scratch for Node.js - nodejs/undici
github.com
GitHub - nodejs/undici: An HTTP/1.1 client, written from scratch for Node.js
GitHub - nodejs/undici: An HTTP/1.1 client, written from scratch for Node.js
An HTTP/1.1 client, written from scratch for Node.js - nodejs/undici
github.com

Undici is the new HTTP/1.1 client for Node.js that we are developing outside of Node.js core. We have shipped the first release candidate: you can test it with “npm i undici@4.0.0-rc.1”.

NearForm

I work as a Technical Director at NearForm and I am also responsible to interview candidates. We are still hiring across the board for senior roles, so if you would like to work with me, apply at:

Shaping a better world
Shaping a better world
NearForm is working to shape a better world with open, creative software and we are looking for people to join our team. Contact us for your next career move
www.nearform.com
Shaping a better world
Shaping a better world
NearForm is working to shape a better world with open, creative software and we are looking for people to join our team. Contact us for your next career move
www.nearform.com

Thanks

Thank you very much for enjoying this newsletter and engaging with it over Twitter! I always receive such a warm welcome for all content I produce and I cannot be happier.

Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn