Skip to content

Commit c2ed766

Browse files
mendaomnsidharthachatterjee
authored andcommitted
chore(docs): u-files - minor punctuation and grammar fixes (#18762)
1 parent 6abadb9 commit c2ed766

14 files changed

+41
-34
lines changed

docs/docs/graphql-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ For examples, refer to the [query recipes](/docs/recipes/#6-querying-data) and [
225225

226226
Fragments allow you to reuse parts of GraphQL queries. They also allow you to split up complex queries into smaller, easier to understand components.
227227

228-
For more information, check out the docs guide on [using fragments in Gatsby](/docs/using-fragments/).
228+
For more information, check out the docs guide on [using fragments in Gatsby](/docs/using-graphql-fragments/).
229229

230230
### List of Gatsby fragments
231231

docs/docs/recipes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ return (
19811981
)
19821982
```
19831983
1984-
b. using a [GraphQL fragment](/docs/using-fragments/), to query for the necessary fields more tersely
1984+
b. using a [GraphQL fragment](/docs/using-graphql-fragments/), to query for the necessary fields more tersely
19851985
19861986
```jsx
19871987
const data = useStaticQuery(graphql`

docs/docs/unit-testing.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ title: Unit Testing
44

55
Unit testing is a great way to protect against errors in your code before you
66
deploy it. While Gatsby does not include support for unit testing out of the
7-
box, it only takes a few steps to get up and running. However there are a few
7+
box, it only takes a few steps to get up and running. However, there are a few
88
features of the Gatsby build process that mean the standard Jest setup doesn't
99
quite work. This guide shows you how to set it up.
1010

1111
## Setting up your environment
1212

1313
The most popular testing framework for React is [Jest](https://jestjs.io/),
14-
which was created by Facebook. While Jest is a general purpose JavaScript unit
14+
which was created by Facebook. While Jest is a general-purpose JavaScript unit
1515
testing framework, it has lots of features that make it work particularly well
1616
with React.
1717

@@ -20,7 +20,7 @@ concepts should be the same or very similar for your site._
2020

2121
### 1. Installing dependencies
2222

23-
First you need to install Jest and some more required packages. Install babel-jest and babel-preset-gatsby to ensure that the babel preset(s) that are used match what are used internally for your Gatsby site.
23+
First, you need to install Jest and some more required packages. Install babel-jest and babel-preset-gatsby to ensure that the babel preset(s) that are used match what are used internally for your Gatsby site.
2424

2525
```shell
2626
npm install --save-dev jest babel-jest react-test-renderer babel-preset-gatsby identity-obj-proxy
@@ -66,12 +66,12 @@ module.exports = require("babel-jest").createTransformer(babelOptions)
6666
```
6767

6868
- The next option is `moduleNameMapper`. This
69-
section works a bit like webpack rules, and tells Jest how to handle imports.
69+
section works a bit like webpack rules and tells Jest how to handle imports.
7070
You are mainly concerned here with mocking static file imports, which Jest can't
7171
handle. A mock is a dummy module that is used instead of the real module inside
7272
tests. It is good when you have something that you can't or don't want to test.
7373
You can mock anything, and here you are mocking assets rather than code. For
74-
stylesheets you need to use the package `identity-obj-proxy`. For all other assets
74+
stylesheets you need to use the package `identity-obj-proxy`. For all other assets,
7575
you need to use a manual mock called `file-mock.js`. You need to create this yourself.
7676
The convention is to create a directory called `__mocks__` in the root directory
7777
for this. Note the pair of double underscores in the name.
@@ -83,7 +83,7 @@ module.exports = "test-file-stub"
8383
- The next config setting is `testPathIgnorePatterns`. You are telling Jest to ignore
8484
any tests in the `node_modules` or `.cache` directories.
8585

86-
- The next option is very important, and is different from what you'll find in other
86+
- The next option is very important and is different from what you'll find in other
8787
Jest guides. The reason that you need `transformIgnorePatterns` is because Gatsby
8888
includes un-transpiled ES6 code. By default Jest doesn't try to transform code
8989
inside `node_modules`, so you will get an error like this:
@@ -121,7 +121,7 @@ global.___loader = {
121121

122122
#### Mocking `gatsby`
123123

124-
Finally it's a good idea to mock the `gatsby` module itself. This may not be
124+
Finally, it's a good idea to mock the `gatsby` module itself. This may not be
125125
needed at first, but will make things a lot easier if you want to test
126126
components that use `Link` or GraphQL.
127127

@@ -184,7 +184,7 @@ describe("Header", () => {
184184
```
185185

186186
This is a very simple snapshot test, which uses `react-test-renderer` to render
187-
the component, and then generates a snapshot of it on first run. It then
187+
the component, and then generates a snapshot of it on the first run. It then
188188
compares future snapshots against this, which means you can quickly check for
189189
regressions. Visit [the Jest docs](https://jestjs.io/docs/en/getting-started) to
190190
learn more about other tests that you can write.

docs/docs/upgrade-gatsby-and-dependencies.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To keep up with the latest bug fixes, security patches, and minor releases from
66

77
## Semantic versioning
88

9-
As many other packages, Gatsby uses [semantic versioning](https://semver.org/) to tag new versions and indicate what kind of changes are introduced in every new release.
9+
Like many other packages, Gatsby uses [semantic versioning](https://semver.org/) to tag new versions and indicate what kind of changes are introduced in every new release.
1010

1111
This guide is meant to teach you how to upgrade Gatsby for minor or patch releases. For major changes you can refer to the [Release and Migrations](/docs/releases-and-migration/) reference guide overview for the corresponding guide to upgrade.
1212

@@ -99,7 +99,7 @@ Then add the corresponding script to your package.json file:
9999
}
100100
```
101101

102-
And finally run the recently added command:
102+
And finally, run the recently added command:
103103

104104
```shell
105105
npm run upgrade-interactive

docs/docs/upgrading-node-js.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This example shows Node.js version 10, specifically v10.16.0.
2525

2626
Node.js version 6 reached _End-of-life_ status on 30th April 2019. Many of Gatsby's dependencies are updating to Node.js version 8 and above. Gatsby must also update in order to deliver new features and bug fixes more quickly.
2727

28-
Generally it's recommend to use [the Node version whose status is _Active LTS_](https://github.com/nodejs/Release#nodejs-release-working-group) (Node 10 at time of writing). However, in this document you'll learn how to update from Node 6 to Node 8 as this is likely to be the least disruptive upgrade for you.
28+
Generally, it's recommended to use [the Node version whose status is _Active LTS_](https://github.com/nodejs/Release#nodejs-release-working-group) (Node 10 at time of writing). However, in this document, you'll learn how to update from Node 6 to Node 8 as this is likely to be the least disruptive upgrade for you.
2929

3030
> What about Node.js 7? Stable versions of Node.js are evenly numbered releases - Node.js 6, Node.js 8, Node.js 10 etc. Only use uneven release numbers if you'd like to try cutting-edge and experimental features.
3131
@@ -116,4 +116,4 @@ Gatsby takes backwards compatibility seriously and aims to support older version
116116

117117
Gatsby also relies on a huge ecosystem of JavaScript dependencies. As the ecosystem moves away from older, unsupported Node.js versions we have to keep pace to ensure that bugs can be fixed and new features can be released.
118118

119-
In this document you learned how you upgrade from Node.js version 6 (which has reached _End of Life_ status), to Node.js version 8 (which has reached _Maintenance_) status.
119+
In this document, you learned how you upgrade from Node.js version 6 (which has reached _End of Life_ status) to Node.js version 8 (which has reached _Maintenance_) status.

docs/docs/using-a-plugin-in-your-site.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Using a Plugin in Your Site
44

55
Gatsby plugins are Node.js packages, so you can install them like other packages in node using NPM.
66

7-
For example, `gatsby-transformer-json` is a package which adds support for JSON files to the Gatsby data layer.
7+
For example, `gatsby-transformer-json` is a package that adds support for JSON files to the Gatsby data layer.
88

99
To install it, in the root of your site you run:
1010

docs/docs/using-client-side-only-packages.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Using Client-Side Only Packages
33
---
44

5-
On occasion, you may need to use a function or library that only works client side. This usually is because the library in question accesses something that isn't available during server-side rendering (SSR), like [browser DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) methods.
5+
On occasion, you may need to use a function or library that only works client-side. This usually is because the library in question accesses something that isn't available during server-side rendering (SSR), like [browser DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) methods.
66

77
You'll need to use one of the workarounds outlined below if your project fails to compile with `gatsby develop` or `gatsby build` with an error like:
88

@@ -21,7 +21,7 @@ In the component where you need it, load the package via CDN using a [`<script /
2121
To embed your script, you can:
2222

2323
- Include it in a custom component as needed using [`react-helmet`](https://github.com/nfl/react-helmet).
24-
- Add the script tag directly in your base html using Gatsby's [html.js](/docs/custom-html/)
24+
- Add the script tag directly in your base HTML using Gatsby's [html.js](/docs/custom-html/)
2525

2626
You should then follow React's guidelines for [Integrating with DOM Manipulation Plugins](https://reactjs.org/docs/integrating-with-other-libraries.html#integrating-with-dom-manipulation-plugins), using the methods available in the [React Component Lifecycle](https://reactjs.org/docs/react-component.html#the-component-lifecycle) to interact with the library you're using.
2727

@@ -52,7 +52,7 @@ class MyComponent extends Component {
5252

5353
## Workaround 3: Load client-side dependent components with react-loadable
5454

55-
Install [loadable-components](https://github.com/smooth-code/loadable-components) and use it as a wrapper for a component that wants to use a client side only package.
55+
Install [loadable-components](https://github.com/smooth-code/loadable-components) and use it as a wrapper for a component that wants to use a client-side only package.
5656

5757
```bash
5858
npm install @loadable/component
@@ -80,10 +80,10 @@ const LoadableBuyButton = Loadable(() => import("./ShopifyBuyButton"))
8080
export default LoadableBuyButton
8181
```
8282

83-
## Workaround 4: Use React.lazy and Suspense on client side only
83+
## Workaround 4: Use React.lazy and Suspense on client-side only
8484

85-
React.lazy and Suspense are still not ready for server side rendering, but they can still be used by checking that the code is executed only on the client.
86-
While this solution is inferior to `loadable-components`, that works both on server side and client, it still provides an alternative for dealing with client side only packages, without an added dependency.
85+
React.lazy and Suspense are still not ready for server-side rendering, but they can still be used by checking that the code is executed only on the client.
86+
While this solution is inferior to `loadable-components`, that works both on server side and client, it still provides an alternative for dealing with client-side only packages, without an added dependency.
8787
Remember that the following code could break if executed without the `isSSR` guard.
8888

8989
```jsx

docs/docs/using-gatsby-image.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Using Gatsby Image to Prevent Image Bloat
44

55
`gatsby-image` is a React component designed to work seamlessly with Gatsby’s GraphQL queries ([`gatsby-image` plugin README](/packages/gatsby-image/)). It combines [Gatsby’s native image processing](https://image-processing.gatsbyjs.org/) capabilities with advanced image loading techniques to easily and completely optimize image loading for your sites. `gatsby-image` uses [gatsby-plugin-sharp](/packages/gatsby-plugin-sharp/) to power its image transformations.
66

7-
> _Warning: gatsby-image is **not** a drop-in replacement for `<img />`. It’s optimized for fixed width/height images and images that stretch the full-width of a container. Some ways you can use `<img />` won’t work with gatsby-image._
7+
> _Warning: gatsby-image is **not** a drop-in replacement for `<img />`. It’s optimized for fixed width/height images and images that stretch the full width of a container. Some ways you can use `<img />` won’t work with gatsby-image._
88
99
[Demo](https://using-gatsby-image.gatsbyjs.org/)
1010

@@ -20,16 +20,16 @@ _For more complete API information, check out the [Gatsby Image API](/docs/gatsb
2020

2121
Large, unoptimized images dramatically slow down your site.
2222

23-
But creating optimized images for websites has long been a thorny problem. Ideally you would:
23+
But creating optimized images for websites has long been a thorny problem. Ideally, you would:
2424

2525
- Resize large images to the size needed by your design
2626
- Generate multiple smaller images so smartphones and tablets don’t download desktop-sized images
2727
- Strip all unnecessary metadata and optimize JPEG and PNG compression
2828
- Efficiently lazy load images to speed initial page load and save bandwidth
2929
- Use the “blur-up” technique or a “traced placeholder” SVG to show a preview of the image while it loads
30-
- Hold the image position so your page doesn’t jump while images load
30+
- Hold the image position so your page doesn’t jump while the images load
3131

32-
Doing this consistently across a site feels like sisyphean labor. You manually optimize your images and then… several images are swapped in at the last minute or a design-tweak shaves 100px of width off your images.
32+
Doing this consistently across a site feels like Sisyphean labor. You manually optimize your images and then… several images are swapped in at the last minute or a design-tweak shaves 100px of width off your images.
3333

3434
Most solutions involve a lot of manual labor and bookkeeping to ensure every image is optimized.
3535

docs/docs/using-gatsby-professionally.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ As a Gatsby developer and enthusiast, you may be interested in how you can spend
77

88
You may see problems happen around you that you know Gatsby could solve, and want others to adopt Gatsby so they don't encounter them in the future. You may be interested in driving business goals, such as growing your organization or increasing revenue. Or, you may simply love building with Gatsby and want to do it more.
99

10-
This section of the documentation is aimed to help you spend more time as a Gatsby developer by giving you the tools to spread Gatsby within your organization, or convince clients that Gatsby is the right tool for them.
10+
This section of the documentation is aimed to help you spend more time as a Gatsby developer by giving you the tools to spread Gatsby within your organization or convince clients that Gatsby is the right tool for them.
1111

12-
It includes resources for how to explain Gatsby to different stakeholders, such as other developers, engineering leaders, marketers, executives and clients.
12+
It includes resources for how to explain Gatsby to different stakeholders, such as other developers, engineering leaders, marketers, executives, and clients.
1313

14-
It also includes resources that help your teams develop more effectively at scale -- when there are multiple developers on a project, or multiple projects in the organization.
14+
It also includes resources that help your teams develop more effectively at scale -- when there are multiple developers on a project or multiple projects in the organization.
1515

1616
Finally, it includes resources for you about how Gatsby can help you advance professionally within your career -- whatever your goals and ambitions are.
1717

docs/docs/using-gatsby-without-graphql.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Most examples in the Gatsby docs and on the web at large focus on leveraging sou
66

77
> Note: For our purposes here, “unstructured data” means data “handled outside of Gatsby’s data layer” (we’re using the data directly, and not transforming the data into Gatsby nodes).
88
9-
## The approach: Fetch data and use Gatsby's `createPages` API
9+
## The approach: fetch data and use Gatsby's `createPages` API
1010

1111
> _Note_: This example is drawn from an example repo built specifically to model how to use this "unstructured data" approach. [View the full repo on GitHub](https://github.com/jlengstorf/gatsby-with-unstructured-data).
1212

docs/docs/using-fragments.md renamed to docs/docs/using-graphql-fragments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Using Fragments
2+
title: Using GraphQL Fragments
33
---
44

55
Fragments allow you to reuse parts of GraphQL queries. It also allows you to split up complex queries into smaller, easier to understand components.

docs/docs/using-graphql-playground.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Using the GraphQL Playground
44

55
## Intro
66

7-
In this page we want to introduce you to an alternative to the current IDE for your GraphQL queries: [GraphQL Playground](https://github.com/prisma/graphql-playground).
7+
This page will introduce you to an alternative to the current IDE for your GraphQL queries: [GraphQL Playground](https://github.com/prisma/graphql-playground).
88

99
## What is Prisma's GraphQL Playground?
1010

www/gatsby-node.js

+7
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ exports.createPages = ({ graphql, actions, reporter }) => {
383383
toPath: `/docs/awesome-gatsby-resources/`,
384384
isPermanent: true,
385385
})
386+
387+
createRedirect({
388+
fromPath: `/docs/using-fragments/`,
389+
toPath: `/docs/using-graphql-fragments/`,
390+
isPermanent: true,
391+
})
392+
386393
Object.entries(startersRedirects).forEach(([fromSlug, toSlug]) => {
387394
createRedirect({
388395
fromPath: `/starters${fromSlug}`,

www/src/data/sidebars/doc-links.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@
129129
- title: Using Gatsby Without GraphQL
130130
link: /docs/using-gatsby-without-graphql/
131131
breadcrumbTitle: Gatsby Without GraphQL
132-
- title: Sourcing From the Filesystem
132+
- title: Sourcing from the Filesystem
133133
link: /docs/sourcing-from-the-filesystem/
134134
breadcrumbTitle: From the Filesystem
135-
- title: Sourcing From Databases
135+
- title: Sourcing from Databases
136136
link: /docs/sourcing-from-databases/
137137
breadcrumbTitle: From Databases
138138
- title: Sourcing from Hosted Services
@@ -187,7 +187,7 @@
187187
link: /docs/use-static-query/
188188
breadcrumbTitle: The useStaticQuery Hook
189189
- title: Using GraphQL Fragments
190-
link: /docs/using-fragments/
190+
link: /docs/using-graphql-fragments/
191191
- title: Creating Slugs for Pages
192192
link: /docs/creating-slugs-for-pages/
193193
- title: Creating Pages from Data Programmatically

0 commit comments

Comments
 (0)