Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add typography changes to migration guide #6151

Merged
merged 3 commits into from
Jun 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/docs/migrating-from-v1-to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Read on for a detailed guide on what's new in version 2!
- [Only allow defined keys on node.internal object](#only-allow-defined-keys-on-the-node-internal-object)
- [Import `graphql` types from `gatsby/graphql`](#import-graphql-types-from-gatsbygraphql)
- [Move Babel Configuration`](#move-babel-configuration)
- [Plugin specific changes](#plugin-specific-changes)

You can start with a few of the most important steps - install Gatsby v2 dependencies and update your layout components.

Expand Down Expand Up @@ -503,3 +504,19 @@ The latest version of Gatsby uses Babel 7, which introduced [a new behavior for
[This GitHub comment](https://github.com/facebook/jest/issues/1468#issuecomment-361260279) documents the steps needed to do that.

More information on Gatsby and Babel configuration available [here](/docs/babel/#how-to-use-a-custom-babelrc-file).

## Plugin specific changes

Some plugins require additional changes before your site will compile.
For example, if you use [`gatsby-plugin-typography`](https://www.gatsbyjs.org/packages/gatsby-plugin-typography/), you now need to explicitly export `scale` and `rhythm` as named exports from your typography config module.

`src/utils/typography.js`

```diff
- const typography = new Typography();
- export default typography;

+ const typography = new Typography();
+ const { rhythm, scale } = typography;
+ export { rhythm, scale, typography as default };
```