Skip to content

Commit 9f33293

Browse files
authored
docs(guides): grammar and spelling fixes (fastify#5947)
* docs(guides): grammar and spelling fixes * docs(guides): stop note being treated as header
1 parent 0367c8c commit 9f33293

12 files changed

+41
-41
lines changed

docs/Guides/Benchmarking.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<h1 align="center">Fastify</h1>
22

33
## Benchmarking
4-
Benchmarking is important if you want to measure how a change can affect the
5-
performance of your application. We provide a simple way to benchmark your
4+
Benchmarking is important if you want to measure how a change can affect your
5+
application's performance. We provide a simple way to benchmark your
66
application from the point of view of a user and contributor. The setup allows
77
you to automate benchmarks in different branches and on different Node.js
88
versions.
99

1010
The modules we will use:
11-
- [Autocannon](https://github.com/mcollina/autocannon): A HTTP/1.1 benchmarking
11+
- [Autocannon](https://github.com/mcollina/autocannon): An HTTP/1.1 benchmarking
1212
tool written in node.
1313
- [Branch-comparer](https://github.com/StarpTech/branch-comparer): Checkout
14-
multiple git branches, execute scripts and log the results.
14+
multiple git branches, execute scripts, and log the results.
1515
- [Concurrently](https://github.com/kimmobrunfeldt/concurrently): Run commands
1616
concurrently.
1717
- [Npx](https://github.com/npm/npx): NPM package runner used to run scripts

docs/Guides/Contributing.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ receive your support and knowledge. This guide is our attempt to help you help
66
us.
77

88
> ## Note
9-
> This is an informal guide. Please review the formal [CONTRIBUTING
10-
> document](https://github.com/fastify/fastify/blob/main/CONTRIBUTING.md) for
11-
> full details and our [Developer Certificate of
9+
> This is an informal guide. For full details, please review the formal
10+
> [CONTRIBUTING
11+
> document](https://github.com/fastify/fastify/blob/main/CONTRIBUTING.md)
12+
> our [Developer Certificate of
1213
> Origin](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin).
1314
1415
## Table Of Contents
@@ -50,7 +51,7 @@ should expect from others):
5051
* We have a [Code of
5152
Conduct](https://github.com/fastify/fastify/blob/main/CODE_OF_CONDUCT.md). You
5253
must adhere to it to participate in this project.
53-
* If you open a pull request, please ensure that your contribution passes all
54+
* If you open a pull request, please ensure your contribution passes all
5455
tests. If there are test failures, you will need to address them before we can
5556
merge your contribution.
5657

@@ -79,7 +80,7 @@ https://github.com/github/opensource.guide/blob/2868efbf0c14aec821909c19e210c360
7980

8081
Please adhere to the project's code and documentation style. Some popular tools
8182
that automatically "correct" code and documentation do not follow a style that
82-
conforms to the styles this project uses. Notably, this project uses
83+
conforms to this project's styles. Notably, this project uses
8384
[StandardJS](https://standardjs.com) for code formatting.
8485

8586
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/fastify/fastify)

docs/Guides/Database.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ for Postgres, MySQL, SQL Server and SQLite. For MongoDB migrations, please check
245245
#### [Postgrator](https://www.npmjs.com/package/postgrator)
246246

247247
Postgrator is Node.js SQL migration tool that uses a directory of SQL scripts to
248-
alter the database schema. Each file in a migrations folder need to follow the
248+
alter the database schema. Each file in a migrations folder needs to follow the
249249
pattern: ` [version].[action].[optional-description].sql`.
250250

251251
**version:** must be an incrementing number (e.g. `001` or a timestamp).

docs/Guides/Delay-Accepting-Requests.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ server.get('/ping', function (request, reply) {
7777
})
7878

7979
server.post('/webhook', function (request, reply) {
80-
// It's good practice to validate webhook requests really come from
81-
// whoever you expect. This is skipped in this sample for the sake
80+
// It's good practice to validate webhook requests come from
81+
// who you expect. This is skipped in this sample for the sake
8282
// of simplicity
8383

8484
const { magicKey } = request.body
@@ -448,10 +448,10 @@ have the possibility of giving the customer meaningful information, like how
448448
long they should wait before retrying the request. Going even further, by
449449
issuing a [`503` status
450450
code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) we're
451-
signaling to our infrastructure components (namely load balancers) we're still
452-
not ready to take incoming requests and they should redirect traffic to other
453-
instances, if available, besides in how long we estimate that will be solved.
454-
All of that in a few simple lines!
451+
signaling to our infrastructure components (namely load balancers) that we're
452+
still not ready to take incoming requests and they should redirect traffic to
453+
other instances, if available. Additionally, we are providing a `Retry-After`
454+
header with the time in milliseconds the client should wait before retrying.
455455

456456
It's noteworthy that we didn't use the `fastify-plugin` wrapper in the `delay`
457457
factory. That's because we wanted the `onRequest` hook to only be set within
@@ -524,14 +524,14 @@ Retry-After: 5000
524524
}
525525
```
526526

527-
Then we attempt a new request (`req-2`), which was a `GET /ping`. As expected,
527+
Then we attempted a new request (`req-2`), which was a `GET /ping`. As expected,
528528
since that was not one of the requests we asked our plugin to filter, it
529-
succeeded. That could also be used as means of informing an interested party
529+
succeeded. That could also be used as a means of informing an interested party
530530
whether or not we were ready to serve requests (although `/ping` is more
531531
commonly associated with *liveness* checks and that would be the responsibility
532532
of a *readiness* check -- the curious reader can get more info on these terms
533533
[here](https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-setting-up-health-checks-with-readiness-and-liveness-probes))
534-
with the `ready` field. Below is the response for that request:
534+
with the `ready` field. Below is the response to that request:
535535

536536
```sh
537537
HTTP/1.1 200 OK
@@ -547,7 +547,7 @@ Keep-Alive: timeout=5
547547
}
548548
```
549549

550-
After that there were more interesting log messages:
550+
After that, there were more interesting log messages:
551551

552552
<!-- markdownlint-disable -->
553553
```sh

docs/Guides/Fluent-Schema.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fastify.post('/the/url', { schema }, handler)
5555

5656
### Reuse
5757

58-
With `fluent-json-schema` you can manipulate your schemas more easily and
58+
With `fluent-json-schema`, you can manipulate your schemas more easily and
5959
programmatically and then reuse them thanks to the `addSchema()` method. You can
6060
refer to the schema in two different manners that are detailed in the
6161
[Validation and

docs/Guides/Getting-Started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ of your code.
106106
Fastify offers an easy platform that helps to solve all of the problems outlined
107107
above, and more!
108108

109-
> ## Note
109+
> **Note**
110110
> The above examples, and subsequent examples in this document, default to
111111
> listening *only* on the localhost `127.0.0.1` interface. To listen on all
112112
> available IPv4 interfaces the example should be modified to listen on
@@ -417,7 +417,7 @@ In this way, you will always have access to all of the properties declared in
417417
the current scope.
418418

419419
As discussed previously, Fastify offers a solid encapsulation model, to help you
420-
build your application as single and independent services. If you want to
420+
build your application as independent services. If you want to
421421
register a plugin only for a subset of routes, you just have to replicate the
422422
above structure.
423423
```
@@ -552,7 +552,7 @@ an amazing [ecosystem](./Ecosystem.md)!
552552
<a id="test-server"></a>
553553

554554
Fastify does not offer a testing framework, but we do recommend a way to write
555-
your tests that use the features and architecture of Fastify.
555+
your tests that uses the features and architecture of Fastify.
556556

557557
Read the [testing](./Testing.md) documentation to learn more!
558558

docs/Guides/Index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This table of contents is in alphabetical order.
1919
practical guide on detecting if and when a client aborts a request.
2020
+ [Ecosystem](./Ecosystem.md): Lists all core plugins and many known community
2121
plugins.
22-
+ [Fluent Schema](./Fluent-Schema.md): Shows how writing JSON Schema can be
22+
+ [Fluent Schema](./Fluent-Schema.md): Shows how JSON Schema can be
2323
written with a fluent API and used in Fastify.
2424
+ [Getting Started](./Getting-Started.md): Introduction tutorial for Fastify.
2525
This is where beginners should start.

docs/Guides/Migration-Guide-V4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fastify.get('/posts/:id?', (request, reply) => {
210210
The [variadic signature](https://en.wikipedia.org/wiki/Variadic_function) of the
211211
`fastify.listen()` method is now deprecated.
212212
213-
Prior to this release, the following invocations of this method were valid:
213+
Before this release, the following invocations of this method were valid:
214214
215215
- `fastify.listen(8000)`
216216
- `fastify.listen(8000, ‘127.0.0.1’)`

docs/Guides/Plugins-Guide.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ order of plugins. *How?* Glad you asked, check out
7171
[`avvio`](https://github.com/mcollina/avvio)! Fastify starts loading the plugin
7272
__after__ `.listen()`, `.inject()` or `.ready()` are called.
7373

74-
Inside a plugin you can do whatever you want, register routes, utilities (we
75-
will see this in a moment) and do nested registers, just remember to call `done`
74+
Inside a plugin you can do whatever you want, register routes and utilities (we
75+
will see this in a moment), and do nested registers, just remember to call `done`
7676
when everything is set up!
7777
```js
7878
module.exports = function (fastify, options, done) {
@@ -117,7 +117,7 @@ Now you can access your utility just by calling `fastify.util` whenever you need
117117
it - even inside your test.
118118

119119
And here starts the magic; do you remember how just now we were talking about
120-
encapsulation? Well, using `register` and `decorate` in conjunction enable
120+
encapsulation? Well, using `register` and `decorate` in conjunction enables
121121
exactly that, let me show you an example to clarify this:
122122
```js
123123
fastify.register((instance, opts, done) => {
@@ -137,7 +137,7 @@ Inside the second register call `instance.util` will throw an error because
137137
`util` exists only inside the first register context.
138138

139139
Let's step back for a moment and dig deeper into this: every time you use the
140-
`register` API, a new context is created which avoids the negative situations
140+
`register` API, a new context is created that avoids the negative situations
141141
mentioned above.
142142

143143
Do note that encapsulation applies to the ancestors and siblings, but not the
@@ -202,7 +202,7 @@ a utility that also needs access to the `request` and `reply` instance,
202202
a function that is defined using the `function` keyword is needed instead
203203
of an *arrow function expression*.
204204

205-
In the same way you can do this for the `request` object:
205+
You can do the same for the `request` object:
206206
```js
207207
fastify.decorate('getHeader', (req, header) => {
208208
return req.headers[header]
@@ -395,7 +395,7 @@ As we mentioned earlier, Fastify starts loading its plugins __after__
395395
have been declared. This means that, even though the plugin may inject variables
396396
to the external Fastify instance via [`decorate`](../Reference/Decorators.md),
397397
the decorated variables will not be accessible before calling `.listen()`,
398-
`.inject()` or `.ready()`.
398+
`.inject()`, or `.ready()`.
399399

400400
In case you rely on a variable injected by a preceding plugin and want to pass
401401
that in the `options` argument of `register`, you can do so by using a function

docs/Guides/Serverless.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ const { onRequest } = require("firebase-functions/v2/https")
280280
### Creation of Fastify instance
281281

282282
Create the Fastify instance and encapsulate the returned application instance
283-
in a function which will register routes, await the server's processing of
284-
plugins, hooks and other settings. As follows:
283+
in a function that will register routes, await the server's processing of
284+
plugins, hooks, and other settings. As follows:
285285

286286
```js
287287
const fastify = require("fastify")({
@@ -299,7 +299,7 @@ const fastifyApp = async (request, reply) => {
299299

300300
Firebase Function's HTTP layer already parses the request
301301
and makes a JSON payload available. It also provides access
302-
to the raw body, unparsed, which is useful in order to calculate
302+
to the raw body, unparsed, which is useful for calculating
303303
request signatures to validate HTTP webhooks.
304304

305305
Add as follows to the `registerRoutes()` function:
@@ -384,7 +384,7 @@ familiar with gcloud or just follow their
384384
385385
### Adjust Fastify server
386386
387-
In order for Fastify to properly listen for requests within the container, be
387+
For Fastify to properly listen for requests within the container, be
388388
sure to set the correct port and address:
389389
390390
```js

docs/Guides/Style-Guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Result:
8383

8484
Make sure you avoid copying other people's work. Keep it as original as
8585
possible. You can learn from what they have done and reference where it is from
86-
if you used a particular quote from their work.
86+
if you use a particular quote from their work.
8787

8888

8989
## Word Choice
@@ -217,7 +217,7 @@ Styles](https://medium.com/better-programming/string-case-styles-camel-pascal-sn
217217

218218
### Hyperlinks
219219

220-
Hyperlinks should have a clear title of what it references. Here is how your
220+
Hyperlinks should have a clear title of what they reference. Here is how your
221221
hyperlink should look:
222222

223223
```MD

docs/Guides/Write-Plugin.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ suggestion"](https://github.com/fastify/fastify/issues?q=is%3Aissue+is%3Aopen+la
1414
in our issue tracker!*
1515

1616
## Code
17-
Fastify uses different techniques to optimize its code, many of them are
17+
Fastify uses different techniques to optimize its code, many of which are
1818
documented in our Guides. We highly recommend you read [the hitchhiker's guide
1919
to plugins](./Plugins-Guide.md) to discover all the APIs you can use to build
2020
your plugin and learn how to use them.
@@ -53,8 +53,7 @@ Always put an example file in your repository. Examples are very helpful for
5353
users and give a very fast way to test your plugin. Your users will be grateful.
5454

5555
## Test
56-
It is extremely important that a plugin is thoroughly tested to verify that is
57-
working properly.
56+
A plugin **must** be thoroughly tested to verify that is working properly.
5857

5958
A plugin without tests will not be accepted to the ecosystem list. A lack of
6059
tests does not inspire trust nor guarantee that the code will continue to work

0 commit comments

Comments
 (0)