Skip to content

Commit

Permalink
chore: Format assets (#8622)
Browse files Browse the repository at this point in the history
  • Loading branch information
lipis authored and pieh committed Nov 6, 2018
1 parent e1f1a98 commit d5b137e
Show file tree
Hide file tree
Showing 53 changed files with 767 additions and 476 deletions.
42 changes: 22 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,41 @@
## [2.0.0] - 2018-09-13

### Added

- Improve Gatsby's routing accessibility by integrating @reach/router (#6918) @KyleAMathews
- Add new onPreRenderHTML SSR API to manage head components in html.js (#6760) @octalmage
- Improve build speeds on larger sites (HulkSmash!) (#6226) @KyleAMathews
- Add multi-process HTML rendering support(#6417) @KyleAMathews
- Add babel-plugin-macros for custom babel config (#7129) @porfirioribeiro
- Improve build speeds on larger sites (HulkSmash!) (#6226) @KyleAMathews
- Add multi-process HTML rendering support(#6417) @KyleAMathews
- Add babel-plugin-macros for custom babel config (#7129) @porfirioribeiro
- Upgrade webpack to v3, improve webpack utils (#3126) @jquense
- Add gatsby-remark-graphviz plugin to render dot (graphviz) code blocks to SVG (#7341) @Moocar
- Add gatsby-remark-graphviz plugin to render dot (graphviz) code blocks to SVG (#7341) @Moocar
- Improve support for non-latin language content in gatsby-transformer-remark (#6992) @youngboy
- Improve support for Drupal relationships in gatsby-source-drupal (#5020) @pieh
- Add support for extra connection string params in gatsby-source-mongodb (#5972) @lcostea
- Add support for extra connection string params in gatsby-source-mongodb (#5972) @lcostea
- Add support for additional options supplied to gatsby-plugin-styled-components (#5240) @nihgwu
- Add guide on debugging the Gatsby build process (#6369) @pieh
- Add docs on unit testing, Cypress, react-testing-library and testing CSS-in-JS (#6678, #6708) @ascorbic, @LeKoArts
- Redesigned docs navigation and expanded docs topics (#6245, #6610) @shannonbux, @fk
- Allow plugins to override core prefetching behavior (#5320) @KyleAMathews
- Add gatsby-codemods package to assist v1 -> v2 transition (#6122) @jquense
- Add gatsby-plugin-layout package to allow use of v1 layout components in v2 (#7204) @pieh
- Add support for service worker caching of prefetched resources in gatsby-plugin-offline (#6566) @kkemple
- Add guide on debugging the Gatsby build process (#6369) @pieh
- Add docs on unit testing, Cypress, react-testing-library and testing CSS-in-JS (#6678, #6708) @ascorbic, @LeKoArts
- Redesigned docs navigation and expanded docs topics (#6245, #6610) @shannonbux, @fk
- Allow plugins to override core prefetching behavior (#5320) @KyleAMathews
- Add gatsby-codemods package to assist v1 -> v2 transition (#6122) @jquense
- Add gatsby-plugin-layout package to allow use of v1 layout components in v2 (#7204) @pieh
- Add support for service worker caching of prefetched resources in gatsby-plugin-offline (#6566) @kkemple
- Add critical scripts and links to static file globs in service worker in gatsby-plugin-offline (#6316) @kkemple
- Add snapshot testing for gatsby-link (#7090) @alexandernanberg
- Introduce REPL command to gatsby-cli (#7262) @kkemple
- Add support for webpackPrefetch (#5901) @pistachiology
- Introduce REPL command to gatsby-cli (#7262) @kkemple
- Add support for webpackPrefetch (#5901) @pistachiology
- Explicitly export graphql tag from Gatsby (#5415) @pieh
- Add eslint-loader and eslint configuration (#4893) @kkemple
- Improve loading graphql query results ("ludicrous mode!") (#4555) @m-allanson
- Improve error messaging when Gatsby is not installed (#7106) @KyleAMathews
- Improve modifyWebpackConfig error messaging (#7152) @m-allanson
- Improve error messaging when Gatsby is not installed (#7106) @KyleAMathews
- Improve modifyWebpackConfig error messaging (#7152) @m-allanson
- Add support for open tracing with zipkin (#6347) @Moocar
- Improve error messaging when plugin can't be loaded (#7023) @KyleAMathews
- Display formatted message for graphql resolver errors (#6142) @pieh
- Improve error formatting on HTML build errors (#6188) @pieh
- Improve error messaging when plugin can't be loaded (#7023) @KyleAMathews
- Display formatted message for graphql resolver errors (#6142) @pieh
- Improve error formatting on HTML build errors (#6188) @pieh

### Fixed

- Fix out of memory error by saving state to after bootstrap is complete (#6636) @KyleAMathews
- Fix out of memory error by flattening entry values (#6797) @chuntley
- Fix code syntax formatting bug which highlighted keywords in plaintext (#7342) @tryzniak
Expand All @@ -44,7 +46,7 @@
- Fix service worker bug originating from inlining webpack-runtime (#5540) @KyleAMathews
- Fix bug producing duplicates when naming GraphQL queries (#6765) @fusepilot
- Fix typo in type annotation (#6288) @sudodoki
- Fix showing 404 page in development (#7140) @KyleAMathews
- Fix showing 404 page in development (#7140) @KyleAMathews
- Tighten externals matching to prevent code imports from causing build errors (#7325) @m-allanson

## [1.5.0] - 2017-07-27
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2018-10-09-hacktoberfest-kickoff/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You may also want to check out [the main issue](https://github.com/gatsbyjs/gats

Through the month, we’ll be continuously curating and adding “Hacktoberfest” labeled issues targeting many different facets of the Gatsby ecosystem (docs, core, packages, etc). If everything is claimed, don’t worry! More issues are being added regularly. (And of course feel free to peruse [other open issues](https://github.com/gatsbyjs/gatsby/issues) in the queue). This is our first time actively organizing around Hacktoberfest, and we aim to be as responsive and supportive as possible.

If you’re considering contributing to Gatsby for the first time -- or if you've already contributed -- we’re so glad you’re here!
If you’re considering contributing to Gatsby for the first time -- or if you've already contributed -- we’re so glad you’re here!

## Still have questions?

Expand Down
14 changes: 7 additions & 7 deletions docs/blog/2018-10-15-beyond-static-intro/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ showImageInArticle: false
tags: ["apps", "beyond static", "webinar"]
---

We hear it regularly. Gatsby is for static sites, Next.js (or similar) is for when your data changes regularly and/or you need an "app." This raises a question... what actually _is_ an app?
We hear it regularly. Gatsby is for static sites, Next.js (or similar) is for when your data changes regularly and/or you need an "app." This raises a question... what actually _is_ an app?

If this question interests you, consider attending [the upcoming webinar][webinar] where we'll focus on shedding some light on this very question as well as talk about how to build dynamic web apps with Gatsby.
If this question interests you, consider attending [the upcoming webinar][webinar] where we'll focus on shedding some light on this very question as well as talk about how to build dynamic web apps with Gatsby.

Until then, I’d like to offer some brief teasers of some of the content we’ll be discussing during the webinar and some introductory information in _how_ Gatsby enables app development.

Expand All @@ -19,11 +19,11 @@ Until then, I’d like to offer some brief teasers of some of the content we’l
## What is an app?

It's surprisingly challenging to define what separates an app from a static site.
It's surprisingly challenging to define what separates an app from a static site.

- Authentication?
- Reacting to remote data changes?
- A shopping cart?
- Authentication?
- Reacting to remote data changes?
- A shopping cart?

It's surprisingly murky where that line is drawn and why exactly many seem to clearly delineate the two _separate_ concepts.

Expand All @@ -43,7 +43,7 @@ One of the central ideas of Gatsby is that we statically generate our HTML conte
1. Invoke [ReactDOM.hydrate method][hydrate] to pick up just where we left our static HTML
1. Transfer rendering to the [React reconciler][reconciler]

It's this last phase that bridges the gap between static sites and full-fledged applications. In this phase you can make data calls, authenticate users, and perform all the app-like functionality you desire.
It's this last phase that bridges the gap between static sites and full-fledged applications. In this phase you can make data calls, authenticate users, and perform all the app-like functionality you desire.

It's really that easy.

Expand Down
1 change: 0 additions & 1 deletion docs/docs/adding-website-functionality.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ This is a stub. Help our community expand it.
Please use the [Gatsby Style Guide](/docs/gatsby-style-guide/) to ensure your
pull request gets accepted.


[[guidelist]]
2 changes: 1 addition & 1 deletion docs/docs/behind-the-scenes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Behind the Scenes
---

Curious how Gatsby works under the hood? The pages in this section describe how a Gatsby build works from an internal code/architecture point of view. It should be useful for anyone who needs to work on the internals of Gatsby, or for those who are simply curious how it all works, or perhaps you're a plugin author and need to understand how core works to track down a bug? Come one, come all!
Curious how Gatsby works under the hood? The pages in this section describe how a Gatsby build works from an internal code/architecture point of view. It should be useful for anyone who needs to work on the internals of Gatsby, or for those who are simply curious how it all works, or perhaps you're a plugin author and need to understand how core works to track down a bug? Come one, come all!

If you're looking for information on how to _use_ Gatsby to write your own site, or create a plugin, check out the rest of the Gatsby docs. This section is quite low level.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/creating-slugs-for-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Open refresh Graph_i_QL, then run this GraphQL query to see all your slugs:
}
}
}
```
```
1 change: 1 addition & 0 deletions docs/docs/deploying-to-aerobatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ plugins:
```

## Other resources

- Learn more about Gatsy and Aerobatic on [Aerobatic's site](https://www.aerobatic.com/docs/static-site-generators/#react).
5 changes: 5 additions & 0 deletions docs/docs/deploying-to-heroku.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: Deploying to Heroku
---

You can use the [heroku buildpack static](https://github.com/heroku/heroku-buildpack-static) to handle the static files of your site.

Set the `heroku/node.js` and `heroku-buildpack-static` buildpacks on your application creating an `app.json` file on the root of your project.

app.json:

```
{
"buildpacks": [
Expand All @@ -24,6 +26,7 @@ Sometimes specifying buildpacks via the `app.json` file doesn’t work. If this
Add a `heroku-postbuild` script in your `package.json`:

package.json:

```
{
// ...
Expand All @@ -35,7 +38,9 @@ package.json:
// ...
}
```

Finally, add a `static.json` file in the root of your project to define the directory where your static assets will be. You can check all the options for this file in the [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static#configuration) configuration.

```
{
"root": "public/",
Expand Down
1 change: 1 addition & 0 deletions docs/docs/deploying-to-s3-cloudfront.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Here, we'll be prompted for what we would like to change about the project confi
> To learn more about AWS Amplify, check out the [Getting Started](https://aws-amplify.github.io/media/get_started) page.
## References:

- [Publishing Your Next Gatsby Site to AWS With AWS Amplify](https://www.gatsbyjs.org/blog/2018-08-24-gatsby-aws-hosting/)
- [Escalade Sports: From $5000 to $5/month in Hosting With Gatsby](https://www.gatsbyjs.org/blog/2018-06-14-escalade-sports-from-5000-to-5-in-hosting/)
- [Deploy your Gatsby.js Site to AWS S3](https://benenewton.com/deploy-your-gatsby-js-site-to-aws-s-3)
22 changes: 12 additions & 10 deletions docs/docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ title: "Environment Variables"

## Environments and Environment Variables

You can provide environment variables to your site to customise it's behaviour in different environments.
You can provide environment variables to your site to customise it's behaviour in different environments.

Note that we need to distinguish in this discussion between variables which have been defined in
special places in order to be used in different deployment environments, and true OS-level
special places in order to be used in different deployment environments, and true OS-level
environment variables that could be used in, for example, command-line calls.
We'll call the former "Project Env Vars" and the latter "OS Env Vars".
In both cases we want to be able to access the relavant value of these variable for the environment
we're in.

By default gatsby supports only 2 environments:

* If you run `gatsby develop`, then you will be in the 'development' environment.
* If you run `gatsby build` + `gatsby serve`, then you will be in the 'production' environment.
- If you run `gatsby develop`, then you will be in the 'development' environment.
- If you run `gatsby build` + `gatsby serve`, then you will be in the 'production' environment.

If you want to define other environments then you'll need to do a little more work. See 'Additional Environments' below.

## Accessing Environment Variables in JavaScript
Expand Down Expand Up @@ -55,12 +55,14 @@ normal ways e.g. by adding environment variables through your hosting/build tool
calling Gatsby on the command line.

In Linux terminals this can be done with:

```
MY_ENV_VAR=foo gatsby develop
```

In Windows it's a little more complex. [Check out this Stack Overflow article for some options](https://stackoverflow.com/questions/1420719/powershell-setting-an-environment-variable-for-a-single-command-only documents some options.)

However, the Project Env Vars that you defined in the `.env.*` files will *NOT* be immediately available
However, the Project Env Vars that you defined in the `.env.*` files will _NOT_ be immediately available
in your Node.js scripts. To use those variables, use NPM package [dotenv](https://www.npmjs.com/package/dotenv) to
examine the active `.env.*` file and attached those values,
It's already a dependency of Gatsby, so you can require it in your `gatsby-config.js` or `gatsby-node.js` like this:
Expand Down Expand Up @@ -100,8 +102,8 @@ render() {
}
```


## Reserved Environment Variables:

> You can not override certain environment variables as some are used internally
> for optimizations during build
Expand All @@ -126,9 +128,9 @@ API_URL="http://foo.bar"
```

```javascript:title=gatsby-config.js
let activeEnv = process.env.ACTIVE_ENV || process.env.NODE_ENV || 'development'
let activeEnv = process.env.ACTIVE_ENV || process.env.NODE_ENV || "development"

console.log(`Using environment config: '${activeEnv}'`);
console.log(`Using environment config: '${activeEnv}'`)

require("dotenv").config({
path: `.env.${activeEnv}`,
Expand All @@ -137,7 +139,7 @@ require("dotenv").config({
module.exports = {
siteMetadata: {
title: "Gatsby Default Starter",
apiUrl: process.env.GA_TRACKING_ID
apiUrl: process.env.GA_TRACKING_ID,
},
plugins: [
{
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/gatsby-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ the site for testing.

#### Options

| Option | Description |
| :--------------: | ------------------------------------------------------------------------------- |
| `-H`, `--host` | Set host. Defaults to localhost |
| `-p`, `--port` | Set port. Defaults to 8000 |
| `-o`, `--open` | Open the site in your (default) browser for you |
| Option | Description |
| :--------------: | ---------------------------------------------------------------------------------------- |
| `-H`, `--host` | Set host. Defaults to localhost |
| `-p`, `--port` | Set port. Defaults to 8000 |
| `-o`, `--open` | Open the site in your (default) browser for you |
| `--prefix-paths` | Serve site with link paths prefixed (if built with pathPrefix in your gatsby-config.js). |

### Info
Expand Down
1 change: 0 additions & 1 deletion docs/docs/gatsby-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,4 @@ You can similarly check for file downloads:
</GatsbyLink>
)
}
```
2 changes: 1 addition & 1 deletion docs/docs/linking-between-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export default () => (

## Other resources

- For the complete example of how to link between pages, see [Part One](/tutorial/part-one/#linking-between-pages/) in the Tutorial
- For the complete example of how to link between pages, see [Part One](/tutorial/part-one/#linking-between-pages/) in the Tutorial
- Check out more detail on routing in Gatsby in the [API doc for Gatsby Link](/docs/gatsby-link/).
2 changes: 1 addition & 1 deletion docs/docs/node-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Let's say you create the following node by passing it to `createNode`

The value for `baz` is itself an object. That value's parent is the top level object. In this case, Gatsby simply saves the top level node as is to redux. It doesn't attempt to extract `baz` into its own node. It does however track the subobject's root NodeID using [Node Tracking](/docs/node-tracking/)

During schema compilation, Gatsby will infer the sub object's type while [creating the gqlType](/docs/schema-gql-type#plain-object-or-value-field).
During schema compilation, Gatsby will infer the sub object's type while [creating the gqlType](/docs/schema-gql-type#plain-object-or-value-field).

## Fresh/stale nodes

Expand Down
7 changes: 3 additions & 4 deletions docs/docs/node-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ You may see calls to `trackInlineObjectsInRootNode()` and `findRootNodeAncestor(
let nodeA = {
id: `id2`,
internal: {
type: `footype`
type: `footype`,
},
foo: {
myfile: "blog/my-blog.md",
b: 2
b: 2,
},
bar: 7,
parent: `id1`,
baz: [ { x: 8 }, 9 ]
baz: [{ x: 8 }, 9],
}
```

Expand Down Expand Up @@ -59,4 +59,3 @@ Now, where do we use this information? In 2 places.

1. In the `File` type resolver. It is used to lookup the node's root, which should be of type `File`. We can then use that root node's base directory attribute to create the full path of the resolved field's value, and therefore find the actual `File` node that the string value is describing. See [File GqlType inference](/docs/schema-gql-type/#file-types) for more info.
1. To recursively look up node descriptions in [type-conflict-reporter.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/type-conflict-reporter.js)

2 changes: 1 addition & 1 deletion docs/docs/page-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `pages` redux namespace is a map of page `path` to page object. The [pages r

## Update Components redux namespace

The `components` redux namespace is a map of [componentPath](/docs/behind-the-scenes-terminology/#component) (file with React component) to the Component object. A Component object is simply the Page object but with an empty query string (that will be set during [Query Extraction](/docs/query-extraction/#store-queries-in-redux)).
The `components` redux namespace is a map of [componentPath](/docs/behind-the-scenes-terminology/#component) (file with React component) to the Component object. A Component object is simply the Page object but with an empty query string (that will be set during [Query Extraction](/docs/query-extraction/#store-queries-in-redux)).

## onCreatePage API

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/post-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This guide assumes that you have a Gatsby project set up. If you need to set up

1. Install the Gatsby plugin [**gatsby-plugin-postcss**](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-postcss).

`npm install --save gatsby-plugin-postcss`
`npm install --save gatsby-plugin-postcss`

2. Include the plugin in your `gatsby-config.js` file.

```javascript:title=gatsby-config.js
plugins: [`gatsby-plugin-postcss`],
```
```javascript:title=gatsby-config.js
plugins: [`gatsby-plugin-postcss`],
```

3. Write your stylesheets using PostCSS (.css files) and require or import them as normal.

Expand All @@ -28,7 +28,7 @@ If you need to pass options to PostCSS use the plugins options; see postcss-load
@custom-media --med (width <= 50rem);

@media (--med) {
a {
a {
&:hover {
color: color-mod(black alpha(54%));
}
Expand Down Expand Up @@ -71,4 +71,4 @@ module.exports = () => ({

### Other resources

* [Introduction to postcss](https://www.smashingmagazine.com/2015/12/introduction-to-postcss/)
- [Introduction to postcss](https://www.smashingmagazine.com/2015/12/introduction-to-postcss/)
Loading

0 comments on commit d5b137e

Please sign in to comment.