From 261286a01fb04d4421ab77cc5b23ac3656bc10fc Mon Sep 17 00:00:00 2001 From: Nicky Meuleman Date: Thu, 28 Jun 2018 11:18:13 +0200 Subject: [PATCH] docs: add typography changes to migration guide (#6151) * docs: add typography changes to migration guide * style: format of toc in migration guide * Minor edit --- docs/docs/migrating-from-v1-to-v2.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/docs/migrating-from-v1-to-v2.md b/docs/docs/migrating-from-v1-to-v2.md index 921e5d825fa22..a8b60eb026021 100644 --- a/docs/docs/migrating-from-v1-to-v2.md +++ b/docs/docs/migrating-from-v1-to-v2.md @@ -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. @@ -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 }; +```