Skip to content

Commit a1a8fbb

Browse files
docs(migration-guide): minor tweaks to terminus migration guide
1 parent 899e30f commit a1a8fbb

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

content/migration.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ To learn more about the new features we've added in the v8, check out this [link
88
The `HttpModule` exported from the `@nestjs/common` package has been deprecated and will be removed in the next major release.
99
Instead, please use the `@nestjs/axios` package (otherwise, there are no API differences).
1010

11-
#### Terminus
12-
13-
##### HttpHealthIndicator
14-
15-
`HttpHealthIndicator` requires `@nestjs/axios` to be installed as well as `HttpModule` to be imported. Otherwise, there are no API differences.
16-
17-
##### TerminusModule.forRoot{Async}
18-
19-
The deprecated `TerminusModule.forRootAsync` has been removed. To migrate, check out the `@nestjs/terminus` v7.x.x [upgrade guide](https://docs.nestjs.com/v7/migration-guide#terminus)
20-
2111
#### gRPC strategy
2212

2313
The original Node gRPC library (`grpc`) has been deprecated and will no longer receive feature updates.
@@ -32,20 +22,26 @@ To upgrade, make sure to install the latest version of the `nats` package (`npm
3222

3323
```typescript
3424
// Before
35-
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
36-
transport: Transport.NATS,
37-
options: {
38-
url: 'nats://localhost:4222',
25+
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
26+
AppModule,
27+
{
28+
transport: Transport.NATS,
29+
options: {
30+
url: 'nats://localhost:4222',
31+
},
3932
},
40-
});
33+
);
4134

4235
// Now
43-
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
44-
transport: Transport.NATS,
45-
options: {
46-
servers: ['nats://localhost:4222'],
36+
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
37+
AppModule,
38+
{
39+
transport: Transport.NATS,
40+
options: {
41+
servers: ['nats://localhost:4222'],
42+
},
4743
},
48-
});
44+
);
4945
```
5046

5147
#### `@All()` decorator
@@ -62,7 +58,6 @@ Instead, simply use the `listen()` and `startAllMicroservices()` methods (they a
6258
The `@nestjs/platform-socket.io` package was upgraded to use the `[email protected]` version (Nest v7 was based on the `socket.io` v2).
6359
To learn more, check out these articles: [Socket.io 3 Release](https://socket.io/blog/socket-io-3-release/) and [Socket.io 4 Release](https://socket.io/blog/socket-io-4-release/).
6460

65-
6661
#### Logger breaking changes
6762

6863
For better extensibility, we separated out the `Logger` and `ConsoleLogger` classes ([PR](https://github.com/nestjs/nest/pull/6221), learn more in the [Logging](/techniques/logger) chapter). If your application uses a custom logger class that extends the built-in `Logger`, you should update it to extend the `ConsoleLogger` now.
@@ -79,7 +74,6 @@ Now:
7974
export class MyLogger extends ConsoleLogger {}
8075
```
8176

82-
8377
#### `@nestjs/config` package
8478

8579
There was a minor breaking change in the `registerAs` function (typings), you can see what has changed in [this PR](https://github.com/nestjs/config/pull/173).
@@ -90,6 +84,10 @@ There might be some small differences in how your auto-generated schema file loo
9084

9185
Also, all `HttpException` errors thrown from your resolvers will be now automatically mapped to the corresponding `ApolloError` instances, unless you set the `autoTransformHttpErrors` configuration property (in the options object you pass into the `GraphQLModule#forRoot()` method) to `false`.
9286

87+
#### `@nestjs/terminus` package
88+
89+
`HttpHealthIndicator` requires `@nestjs/axios` to be installed as well as `HttpModule` to be imported. Also, the deprecated `TerminusModule.forRootAsync` has been removed. To migrate, check out the `@nestjs/terminus` v7.x.x [upgrade guide](https://docs.nestjs.com/v7/migration-guide#terminus).
90+
9391
#### RxJS
9492

9593
Make sure to upgrade to the latest version of the `rxjs` package (v7).

src/app/homepage/pages/microservices/custom-transport/custom-transport.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ <h4 appAnchor id="message-serialization"><span>Message serialization</span></h4>
197197
<p>If you need to add some custom logic around the serialization of responses on the client side, you can use a custom class that extends the <code>ClientProxy</code> class or one of its child classes. For modifying successful requests you can override the <code>serializeResponse</code> method, and for modifying any errors that go through this client you can override the <code>serializeError</code> method. To make use of this custom class, you can pass the class itself to the <code>ClientsModule.register()</code> method using the <code>customClass</code> property. Below is an example of a custom <code>ClientProxy</code> that serializes each error into an <code>RpcException</code>.</p>
198198

199199
<span class="filename">
200-
{{ 'error-handling.proxy' | extension: app6d39c222a0bedd88c115e6126918ef05b8d10064.isJsActive }}
201-
<app-tabs #app6d39c222a0bedd88c115e6126918ef05b8d10064></app-tabs>
200+
{{ 'error-handling.proxy' | extension: app6cfb1a7ffd89db0636851e47b45f946d1913a4ef.isJsActive }}
201+
<app-tabs #app6cfb1a7ffd89db0636851e47b45f946d1913a4ef></app-tabs>
202202
</span><pre><code class="language-typescript">
203203
import &#123; ClientTcp, RpcException &#125; from &#39;@nestjs/microservices&#39;;
204204

@@ -210,8 +210,8 @@ <h4 appAnchor id="message-serialization"><span>Message serialization</span></h4>
210210
</code></pre><p>and then use it in the <code>ClientsModule</code> like so:</p>
211211

212212
<span class="filename">
213-
{{ 'app.module' | extension: app58713f1e88f57e0ba10a9f3a0fbda5dfee0f3b97.isJsActive }}
214-
<app-tabs #app58713f1e88f57e0ba10a9f3a0fbda5dfee0f3b97></app-tabs>
213+
{{ 'app.module' | extension: appa6c68c9ced980f6c3b4d7063dcf2e7e304b20254.isJsActive }}
214+
<app-tabs #appa6c68c9ced980f6c3b4d7063dcf2e7e304b20254></app-tabs>
215215
</span><pre><code class="language-typescript">
216216
@Module(&#123;
217217
imports: [

0 commit comments

Comments
 (0)