Announcing NestJS 6: What’s New? 🍷
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!
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
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.
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.
Nest is an MIT-licensed open source project with its ongoing development made possible thanks to the support by the community, our principal sponsor — Valor Software, and many other companies. Recently, two new base sponsors decided to support us with the monthly donation, Blueanchor, and NovoLogic, thank you!
This framework is a result of the long way, full of sleepless nights, working after hours, and busy weekends. And I fully rely on the goodness ❤️ of the people. If you want to join them, you can read more here.
Our goal is to help elevate teams — giving them the push they need to truly succeed in today’s ever-changing tech world. Contact us to find out more about expertise consulting, code reviews, architectural support, on-site enterprise workshops, trainings, and private sessions: firstname.lastname@example.org
There is still room for a bunch of improvements in the whole ecosystem.
That’s why I have already started writing down plans for the next couple of months.
- We are about to rewrite the Swagger module to use TypeScript AST to enable tons of new, great features. Read more here.
- More sophisticated, real-world authentication examples with various providers.
- Serverless, deployment, and more DevOps!
- Official video courses 🎙
- Articles and tutorials.
To all backers, sponsors, contributors, and community, thank you once again! This product is for you. And this is only the beginning of the long 🚀 story.
Become a Backer or Sponsor to Nest by donating to our open collective.❤