Another release with two nice DX improvements.
Also we hit 2500 stars as I was writing this review 🎉
Babel 6
Gatsby started its life on Babel 5 but Babel 6 is out and stable so we'll upgrade along with the rest of the ecosystem and take advantage of its improved performance and awesome new plugin api.
Gatsby must now be installed as a dependency of the site
The global Gatsby install now defers to the local install of Gatsby (and throws if it can't find one). This means you can build a site and not worry about needing to upgrade it again as Gatsby accumulates breaking changes. This also helps ensure Gatsby works in environments where you don't want a global install e.g. build servers.
Upgrade instructions
- Install Gatsby —
npm install --save gatsby
- Install new Babel 6 dependencies (they must be installed locally) —
npm install --save babel-plugin-add-module-exports babel-preset-es2015 babel-preset-react babel-preset-stage-1
andnpm install --save-dev babel-preset-react-hmre
. - Uninstall old Babel 5 dependencies (if you added any).
- The
link
function fromgatsby-helpers.js
was renamed toprefixLink
to clarify its purpose. - Your
.babelrc
file needs to be upgraded to look like:
{
"presets": ['react', 'es2015', 'stage-1'],
"plugins": ['add-module-exports']
}
- If you modified the default Webpack config in
gatsby.config.js
, this functionality is now moved togatsby-node.js
and instead of using module.exports, export your config modification function asmodifyWebpackConfig
. See the updated instructions in the README. - If you were differentiating between pages with content (like .md files) and pages without (like pages/profile.js) by looking for truthy
page.data
, you'll now need check for truthypage.data.body
. - If your site is under version control, you might want to ignore the new auto-written module
.gatsby-context.js
. - rare if you used the
rewritePath
,onRouteChange
hooks in your app.js — app.js is now not supported. Instead you should exportrewritePath
ingatsby-node.js
andonRouteChange
ingatsby-browser.js
. The function signatures didn't change. These new files will be gaining more functionality in future releases.
That's it! See you in the issue queues :-)