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!
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!
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.
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!
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!
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
Read more here.
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).
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.
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)!
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.