Features
- common: refactor the built-in console logger class #6142 #5353, separate out
Logger
wrapper class andConsoleLogger
class, add buffering logs feature (buffer init logs and flush them out when a custom logger is assigned), add log level output #6172, support log levels feature nestjs/docs.nestjs.com#1613 - common: add
StreamableFile
class for streaming files from controller routes (cross-platform) #5278 - common: add
ParseFloatPipe
andParseEnumPipe
classes #6232 - core: add lazy module loader class #6386
- core: add
RouterModule
for defining per-module controller prefixes - core: add the ability to exclude certain routes from the global prefix #5291
- core: API versioning feature #6278
- microservices: support multiple event subscribers (
@EventPattern()
can be applied to multiple methods) #6334 - microservices: support passing a property key to the
@Payload()
decorator #5975 - websockets: support passing a property key to the
@MessageBody()
decorator - websockets: (
WsAdapter
) support registering gateways on different paths and let them share the same HTTP server #6321
Improvements
- core: sort modules topologically when invoking lifecycle hooks #6236
- core: use class references as providers/controllers/injectables keys instead of their names
- #6141 fixes #5591 and #789
- core:
BaseExceptionFilter
supportshttp-errors
(and any other error objects that have thestatusCode
property specified) out of the box now cdd51b0 - core: set
Error.name
property to the name of the class (all exceptions that inherit from the built-inHttpException
) #5859
Bug fixes
- common: add a missing type argument to
mixin()
function #6216 - core: use
router.all()
method for routes annotated with the@All()
decorator (instead ofrouter.use()
) #6237 - core: reject on server bind failures (
listen()
) #3360 - websockets: specify
@nestjs/platform-socket.io
as an optional peer dependency to support PnP mode #6217
Dependencies
- microservices: update to use
@grpc/grpc-js
package (instead ofgrpc
) #4806 - microservices: upgrade NATS to v2 🙌
- platform-socket.io: upgrade Socket.io to v4 🙌
Deprecations
- common: deprecate
HttpModule
to remove hard dependency on theaxios
library.HttpModule
is published as a new@nestjs/axios
package now - core: deprecate the
listenAsync()
(uselisten()
) andstartAllMicroservicesAsync()
(usestartAllMicroservices()
) methods - microservices: deprecate the
listenAsync()
method (uselisten()
instead)