Nest.js recently announced the release of version 6 of their TypeScript framework. Nest.js 6 improves support for GraphQL and also decouples the platform-specific portions of their framework to support applications beyond their traditional Express and Node.js based architecture.
Kamil Mysliwiec, creator of Nest.js and co-founder of Trilon.io, explains the changes in Nest.js 6 with GraphQL:
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
amazingtype-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.
Another significant change with version 6 is Nest.js’ move beyond its primary focus as a server-side framework to being a more flexible and general purpose framework. Mysliwiec explains:
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!
Current plans for the next major of Nest.js include rewriting the Nest.js Swagger module to leverage the TypeScript AST to reduce decorator support and add support for generics, interfaces, circular-dependencies, and the generation of auto-response schemas. The Nest.js team also plans to improve the DevOps workflow for supporting and deploying to serverless environments.
For server-side applications, Nest.js leverages HTTP Server frameworks like Express and Fastify and provides easy integration with a variety of third-party modules such as TypeORM. Nest.js provides a wide variety of architecture patterns and decorators including controllers, routing, providers, middleware, guards, and interceptors. Nest.js provides an inversion of controller (IoC) container architecture.
Users of Nest.js looking to migrate to version 6 should follow the Nest.js migration guide. Developers new to Nest.js should follow the Nest.js getting started guide.
Nest.js is open source software available under the MIT license. Contributions and feedback are encouraged via the Nest.js GitHub project and should follow the Nest.js contribution guidelines.