Skip to content

Commit e88eede

Browse files
Merge branch 'nestjs:master' into cookieMonsterDev/prisma-recipe
2 parents cf6b477 + 9c4ef36 commit e88eede

File tree

11 files changed

+30
-16
lines changed

11 files changed

+30
-16
lines changed

content/discover/who-uses.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
"https://devitjobs.com",
181181
"https://formation.tech",
182182
"https://gofirmex.com",
183-
"https://vbdhub.org"
183+
"https://vbdhub.org",
184+
"https://www.arven-tech.com"
184185
]
185186
}

content/graphql/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Start by installing the required packages:
1212

1313
```bash
1414
# For Express and Apollo (default)
15-
$ npm i @nestjs/graphql @nestjs/apollo @apollo/server graphql
15+
$ npm i @nestjs/graphql @nestjs/apollo @apollo/server@^4.12.2 graphql
1616

1717
# For Fastify and Apollo
18-
# npm i @nestjs/graphql @nestjs/apollo @apollo/server @as-integrations/fastify graphql
18+
# npm i @nestjs/graphql @nestjs/apollo @apollo/server@^4.12.2 @as-integrations/fastify graphql
1919

2020
# For Fastify and Mercurius
2121
# npm i @nestjs/graphql @nestjs/mercurius graphql mercurius

content/microservices/kafka.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ client: ClientKafkaProxy;
171171

172172
#### Message pattern
173173

174-
The Kafka microservice message pattern utilizes two topics for the request and reply channels. The `ClientKafkaProxy#send()` method sends messages with a [return address](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ReturnAddress.html) by associating a [correlation id](https://www.enterpriseintegrationpatterns.com/patterns/messaging/CorrelationIdentifier.html), reply topic, and reply partition with the request message. This requires the `ClientKafkaProxy` instance to be subscribed to the reply topic and assigned to at least one partition before sending a message.
174+
The Kafka microservice message pattern utilizes two topics for the request and reply channels. The `ClientKafkaProxy.send()` method sends messages with a [return address](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ReturnAddress.html) by associating a [correlation id](https://www.enterpriseintegrationpatterns.com/patterns/messaging/CorrelationIdentifier.html), reply topic, and reply partition with the request message. This requires the `ClientKafkaProxy` instance to be subscribed to the reply topic and assigned to at least one partition before sending a message.
175175

176176
Subsequently, you need to have at least one reply topic partition for every Nest application running. For example, if you are running 4 Nest applications but the reply topic only has 3 partitions, then 1 of the Nest applications will error out when trying to send a message.
177177

@@ -183,7 +183,7 @@ To prevent the `ClientKafkaProxy` consumers from losing response messages, a Nes
183183

184184
#### Message response subscription
185185

186-
> warning **Note** This section is only relevant if you use [request-response](/microservices/basics#request-response) message style (with the `@MessagePattern` decorator and the `ClientKafkaProxy#send` method). Subscribing to the response topic is not necessary for the [event-based](/microservices/basics#event-based) communication (`@EventPattern` decorator and `ClientKafkaProxy#emit` method).
186+
> warning **Note** This section is only relevant if you use [request-response](/microservices/basics#request-response) message style (with the `@MessagePattern` decorator and the `ClientKafkaProxy.send` method). Subscribing to the response topic is not necessary for the [event-based](/microservices/basics#event-based) communication (`@EventPattern` decorator and `ClientKafkaProxy.emit` method).
187187
188188
The `ClientKafkaProxy` class provides the `subscribeToResponseOf()` method. The `subscribeToResponseOf()` method takes a request's topic name as an argument and adds the derived reply topic name to a collection of reply topics. This method is required when implementing the message pattern.
189189

content/recipes/cqrs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export class KillDragonCommand extends Command<{
8989
constructor(
9090
public readonly heroId: string,
9191
public readonly dragonId: string,
92-
) {}
92+
) {
93+
super();
94+
}
9395
}
9496
@@switch
9597
export class KillDragonCommand extends Command {

content/recipes/terminus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Terminus integration provides you with **readiness/liveness** health checks. Healthchecks are crucial when it comes to complex
44
backend setups. In a nutshell, a health check in the realm of web development usually consists of a special address, for example, `https://my-website.com/health/readiness`.
5-
A service or a component of your infrastructure (e.g., [Kubernetes](https://kubernetes.io/) checks this address continuously. Depending on the HTTP status code returned from a `GET` request to this address the service will take action when it receives an "unhealthy" response.
5+
A service or a component of your infrastructure (e.g., [Kubernetes](https://kubernetes.io/) checks this address continuously). Depending on the HTTP status code returned from a `GET` request to this address the service will take action when it receives an "unhealthy" response.
66
Since the definition of "healthy" or "unhealthy" varies with the type of service you provide, the **Terminus** integration supports you with a
77
set of **health indicators**.
88

content/security/authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export enum Action {
220220
}
221221
```
222222

223-
> warning **Notice** `manage` is a special keyword in CASL which represents "any" action.
223+
> warning **Notice** `manage` is a special keyword in CASL which represents "any action".
224224
225225
To encapsulate CASL library, let's generate the `CaslModule` and `CaslAbilityFactory` now.
226226

content/techniques/caching.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To interact with the cache manager instance, inject it to your class using the `
3838
constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache) {}
3939
```
4040

41-
> info **Hint** The `Cache` class is imported from the `cache-manager`, while `CACHE_MANAGER` token from the `@nestjs/cache-manager` package.
41+
> info **Hint** The `Cache` class and the `CACHE_MANAGER` token are both imported from the `@nestjs/cache-manager` package.
4242
4343
The `get` method on the `Cache` instance (from the `cache-manager` package) is used to retrieve items from the cache. If the item does not exist in the cache, `null` will be returned.
4444

@@ -236,7 +236,7 @@ With this in place, you can register the `CacheModule` with multiple stores as s
236236
import { Module } from '@nestjs/common';
237237
import { CacheModule } from '@nestjs/cache-manager';
238238
import { AppController } from './app.controller';
239-
import { createKeyv } from '@keyv/redis';
239+
import KeyvRedis from '@keyv/redis';
240240
import { Keyv } from 'keyv';
241241
import { CacheableMemory } from 'cacheable';
242242

@@ -249,7 +249,7 @@ import { CacheableMemory } from 'cacheable';
249249
new Keyv({
250250
store: new CacheableMemory({ ttl: 60000, lruSize: 5000 }),
251251
}),
252-
createKeyv('redis://localhost:6379'),
252+
new KeyvRedis('redis://localhost:6379'),
253253
],
254254
};
255255
},

content/techniques/compression.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ $ npm i --save @fastify/compress
3333

3434
Once the installation is complete, apply the `@fastify/compress` middleware as global middleware.
3535

36+
> warning **Warning** Please ensure, that you use the type `NestFastifyApplication` when creating the application. Otherwise, you cannot use `register` to apply the compression-middleware.
37+
3638
```typescript
39+
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
40+
3741
import compression from '@fastify/compress';
38-
// somewhere in your initialization file
42+
43+
// inside bootstrap()
44+
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
3945
await app.register(compression);
4046
```
4147

content/techniques/queues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class AudioConsumer extends WorkerHost {
230230

231231
The process method is called whenever the worker is idle and there are jobs to process in the queue. This handler method receives the `job` object as its only argument. The value returned by the handler method is stored in the job object and can be accessed later on, for example in a listener for the completed event.
232232

233-
`Job` objects have multiple methods that allow you to interact with their state. For example, the above code uses the `progress()` method to update the job's progress. See [here](https://api.docs.bullmq.io/classes/v4.Job.html) for the complete `Job` object API reference.
233+
`Job` objects have multiple methods that allow you to interact with their state. For example, the above code uses the `updateProgress()` method to update the job's progress. See [here](https://api.docs.bullmq.io/classes/v4.Job.html) for the complete `Job` object API reference.
234234

235235
In the older version, Bull, you could designate that a job handler method will handle **only** jobs of a certain type (jobs with a specific `name`) by passing that `name` to the `@Process()` decorator as shown below.
236236

content/techniques/sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class User {
113113
}
114114
```
115115

116-
> info **Hint** Learn more about entities in the [TypeORM documentation](https://typeorm.io/#/entities).
116+
> info **Hint** Learn more about entities in the [TypeORM documentation](https://typeorm.io/docs/entity/entities/).
117117
118118
The `User` entity file sits in the `users` directory. This directory contains all files related to the `UsersModule`. You can decide where to keep your model files, however, we recommend creating them near their **domain**, in the corresponding module directory.
119119

0 commit comments

Comments
 (0)