Today I am thrilled to announce the official release of Nest 6: A progressive Node.js framework for building efficient and enterprise-grade, server-side applications.

Last year was great for our community. We experienced an almost 300% growth in popularity, rising four times faster than any existing HTTP library. Nest was presented at many conferences all over the world, and many amazing articles & videos were created. 2018 was amazing and we expect 2019 to be even better!

What’s new?

This new major release brings lots of amazing features. There are far too many to list, but let’s take a high-level look at some of the most exciting ones!

Injection scopes

In previous versions of Nest, every provider was shared among subsequent requests. Using singletons leads to lower memory consumption and thus to better performance of the application.

However, in some cases, you may need more control over each providers lifecycle. For instance, when you want to implement a per-request cache for your GraphQL application or when building a multi-tenant system. To handle scenarios like these, IoC container now has another granularity level which allows us to create new injection scopes —Transient Scope, and Request Scope.

Read more about the new Injection Scopes here.

Platforms

Nest is a fully-fledged, platform-agnostic framework. Platform independence makes it possible to create reusable logical parts that developers can use within different types of applications. With Nest, you can easily build a web application, CLI, a jobs queue or anything else you can think of! Hence, we have extracted all platform-specific functionalities into separate packages, such as @nestjs/platform-express . This gives developers the ability to ship ⛴ as little code as possible. Simply install what you need for your system!

Events

Previously, every micro service transporter was using a request-response paradigm behind the scenes. This communication mechanism is useful when you have to exchange messages between various, external services. This helped you be sure that the service has actually received the message thanks to the acknowledgment.

Nonetheless, some systems don’t actually need creating bi-directional channels. It brings too much unnecessary overhead that is completely useless when you just want to publish events (without the need for a response). Thus, we have introduced event-based messaging. With this paradigm, you can simply notify different service (by emitting a message) that, for example, a certain situation has happened in another part of the system.

Also, it turned out that this change gives us the capability to integrate more sophisticated messaging platforms in the future. Stay tuned!

GraphQL ❤️ TypeScript

One of the most common problems with GraphQL applications is a types redundancy. In order to solve this problem, in the previous version of Nest, we have added a compiler that allows you to compile definitions written in SDL to the TypeScript interfaces (or classes).

With 6.0.0, Nest has been integrated with an amazing type-graphql package which lets you generate your GraphQL files using only TypeScript decorators! Now you can choose which approach is a better fit for your requirements — they are both available in the @nestjs/graphql package.

Read more here.

CLI

The underlying Angular DevKit package has been updated, which means that the CLI will now support prompts. Moreover, we have added initial nest g lib support that should lead to an easier monorepo development (even better code modularization).

Documentation

Lastly, our official documentation has been revamped and is now fully written in Markdown syntax. We believe that this change will significantly simplify contributing, so we can make docs even better over time.

Community & Partners

I’m excited to announce that the Angular Console (UI for the Angular CLI) supports Nest now!

Nest framework has now become the main solution to create structured, scalable Node applications within an Angular repo.

Also, we have recently launched the official Discord channel. Join us to talk about Nest (and other funny topics)!

Migration from Nest 5

In order to migrate your existing project, follow the guidelines that are available here. Also, make sure to get rid of all deprecation messages that may appear in your console.