|
| 1 | +## 1.0.0 (Final - 01.05.2017) |
| 2 | + |
| 3 | +- Added **Gateway Middlewares** support: |
| 4 | + |
| 5 | +``` |
| 6 | +@WebSocketGateway({ |
| 7 | + port: 2000, |
| 8 | + middlewares: [ChatMiddleware], |
| 9 | +}) |
| 10 | +``` |
| 11 | +Gateway Middleware example: |
| 12 | +``` |
| 13 | +@Middleware() |
| 14 | +export class ChatMiddleware implements GatewayMiddleware { |
| 15 | + public resolve(): (socket, next) => void { |
| 16 | + return (socket, next) => { |
| 17 | + console.log('Authorization...'); |
| 18 | + next(); |
| 19 | + }; |
| 20 | + } |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +- New Gateway lifecycle interfaces `OnGatewayInit`, `OnGatewayConnection`, `OnGatewayDisconnect` |
| 25 | +- `@SubscribeMessage()` now accepts also plain strings: |
| 26 | + |
| 27 | +``` |
| 28 | +@SubscribeMessage('event') |
| 29 | +``` |
| 30 | + |
| 31 | +- `@Controller()` now accepts also plain strings: |
| 32 | + |
| 33 | +``` |
| 34 | +@Controller('users') |
| 35 | +``` |
| 36 | + |
| 37 | +- `HttpStatus` (`HttpStatus.OK` etc.) enumerator |
| 38 | +- **Route params decorators** support |
| 39 | + |
| 40 | +``` |
| 41 | +Request: () => ParameterDecorator |
| 42 | +Response: () => ParameterDecorator |
| 43 | +Next: () => ParameterDecorator |
| 44 | +Query: (property?: string) => ParameterDecorator |
| 45 | +Body: (property?: string) => ParameterDecorator |
| 46 | +Param: (property?: string) => ParameterDecorator |
| 47 | +Session: () => ParameterDecorator |
| 48 | +Headers: (property?: string) => ParameterDecorator |
| 49 | +``` |
| 50 | + |
| 51 | +- `MiddlewaresBuilder` -> `MiddlewaresConsumer` |
| 52 | +- **Exception Filters** support |
| 53 | + |
| 54 | +``` |
| 55 | +@ExceptionFilters(CustomExceptionFilter, NextExceptionFilter) |
| 56 | +export class UsersController {} |
| 57 | +``` |
| 58 | +Exception filter example: |
| 59 | + |
| 60 | +``` |
| 61 | +export class CustomException {} |
| 62 | +
|
| 63 | +@Catch(CustomException) |
| 64 | +export class CustomExceptionFilter implements ExceptionFilter { |
| 65 | + public catch(exception, response) { |
| 66 | + response.status(500).json({ |
| 67 | + message: 'Custom exception message.', |
| 68 | + }); |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | +- Module injection support: |
| 73 | + |
| 74 | +``` |
| 75 | +export class UsersController { |
| 76 | + constructor(private module: UsersModule) {} |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +- `ModuleRef` support |
| 81 | + |
1 | 82 | ## 1.0.0-RC7 (08.04.2017) |
2 | 83 |
|
3 | 84 | - MiddlewareBuilder: `use()` deprecated, use `apply()` instead |
4 | 85 | - MiddlewareBuilder: new `apply()` method |
5 | 86 |
|
6 | 87 | ## 1.0.0-RC4 (08.04.2017) |
7 | 88 |
|
8 | | -- Support for @Post, @Get, @Delete, @Put, @All decorators |
| 89 | +- Support for `@Post`, `@Get`, `@Delete`, `@Put`, `@All` decorators |
9 | 90 | - Added ability to pass data to middleware metatypes |
10 | 91 |
|
11 | 92 | ## 1.0.0-BETA-1 (23.03.2017) |
12 | 93 |
|
13 | | -- @Inject -> @Dependencies |
14 | | -- @Inject decorator for custom constructor parameters |
| 94 | +- `@Inject` -> `@Dependencies` |
| 95 | +- `@Inject` decorator for custom constructor parameters |
15 | 96 | - Custom providers support (useClass, useValue, useFactory) |
16 | 97 |
|
17 | 98 | ## 1.0.0-ALPHA-23 (19.03.2017) |
|
20 | 101 | - NestRunner -> NestFactory |
21 | 102 | - Simplify application initialization & configuration |
22 | 103 | - Added abillity to pass custom express instance |
23 | | -- @Inject decorator for ES6+ |
| 104 | +- `@Inject` decorator for ES6+ |
24 | 105 | - SocketGateway -> WebSocketGateway |
25 | 106 | - GatewayServer -> WebSocketServer |
0 commit comments