You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/unit-testing.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ title: Unit Testing
4
4
5
5
Unit testing is a great way to protect against errors in your code before you
6
6
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
8
8
features of the Gatsby build process that mean the standard Jest setup doesn't
9
9
quite work. This guide shows you how to set it up.
10
10
11
11
## Setting up your environment
12
12
13
13
The most popular testing framework for React is [Jest](https://jestjs.io/),
14
-
which was created by Facebook. While Jest is a generalpurpose JavaScript unit
14
+
which was created by Facebook. While Jest is a general-purpose JavaScript unit
15
15
testing framework, it has lots of features that make it work particularly well
16
16
with React.
17
17
@@ -20,7 +20,7 @@ concepts should be the same or very similar for your site._
20
20
21
21
### 1. Installing dependencies
22
22
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.
24
24
25
25
```shell
26
26
npm install --save-dev jest babel-jest react-test-renderer babel-preset-gatsby identity-obj-proxy
Copy file name to clipboardExpand all lines: docs/docs/upgrade-gatsby-and-dependencies.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ To keep up with the latest bug fixes, security patches, and minor releases from
6
6
7
7
## Semantic versioning
8
8
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.
10
10
11
11
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.
12
12
@@ -99,7 +99,7 @@ Then add the corresponding script to your package.json file:
Copy file name to clipboardExpand all lines: docs/docs/upgrading-node-js.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ This example shows Node.js version 10, specifically v10.16.0.
25
25
26
26
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.
27
27
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.
29
29
30
30
> 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.
31
31
@@ -116,4 +116,4 @@ Gatsby takes backwards compatibility seriously and aims to support older version
116
116
117
117
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.
118
118
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.
Copy file name to clipboardExpand all lines: docs/docs/using-client-side-only-packages.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Using Client-Side Only Packages
3
3
---
4
4
5
-
On occasion, you may need to use a function or library that only works clientside. 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.
6
6
7
7
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:
8
8
@@ -21,7 +21,7 @@ In the component where you need it, load the package via CDN using a [`<script /
21
21
To embed your script, you can:
22
22
23
23
- 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/)
25
25
26
26
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.
27
27
@@ -52,7 +52,7 @@ class MyComponent extends Component {
52
52
53
53
## Workaround 3: Load client-side dependent components with react-loadable
54
54
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 clientside 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.
## Workaround 4: Use React.lazy and Suspense on clientside only
83
+
## Workaround 4: Use React.lazy and Suspense on client-side only
84
84
85
-
React.lazy and Suspense are still not ready for serverside 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 clientside 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.
87
87
Remember that the following code could break if executed without the `isSSR` guard.
Copy file name to clipboardExpand all lines: docs/docs/using-gatsby-image.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Using Gatsby Image to Prevent Image Bloat
4
4
5
5
`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.
6
6
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 fullwidth of a container. Some ways you can use `<img />` won’t work with gatsby-image._
8
8
9
9
[Demo](https://using-gatsby-image.gatsbyjs.org/)
10
10
@@ -20,16 +20,16 @@ _For more complete API information, check out the [Gatsby Image API](/docs/gatsb
20
20
21
21
Large, unoptimized images dramatically slow down your site.
22
22
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:
24
24
25
25
- Resize large images to the size needed by your design
26
26
- Generate multiple smaller images so smartphones and tablets don’t download desktop-sized images
27
27
- Strip all unnecessary metadata and optimize JPEG and PNG compression
28
28
- Efficiently lazy load images to speed initial page load and save bandwidth
29
29
- 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
31
31
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.
33
33
34
34
Most solutions involve a lot of manual labor and bookkeeping to ensure every image is optimized.
Copy file name to clipboardExpand all lines: docs/docs/using-gatsby-professionally.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ As a Gatsby developer and enthusiast, you may be interested in how you can spend
7
7
8
8
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.
9
9
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.
11
11
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.
13
13
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.
15
15
16
16
Finally, it includes resources for you about how Gatsby can help you advance professionally within your career -- whatever your goals and ambitions are.
Copy file name to clipboardExpand all lines: docs/docs/using-gatsby-without-graphql.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Most examples in the Gatsby docs and on the web at large focus on leveraging sou
6
6
7
7
> 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).
8
8
9
-
## The approach: Fetch data and use Gatsby's `createPages` API
9
+
## The approach: fetch data and use Gatsby's `createPages` API
10
10
11
11
> _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).
Copy file name to clipboardExpand all lines: docs/docs/using-graphql-playground.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Using the GraphQL Playground
4
4
5
5
## Intro
6
6
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).
0 commit comments