Releases: gatsbyjs/gatsby
Tests!, bug fixes, DX improvements
New tests!
@benstepp waded into the center of Gatsby and refactored one of the core functions AND setup a test framework AND added a number of tests. Awesome! #232
Bug fixes
- @BerkeleyTrue fixed route => template matching which was broken for some edge cases #230
- @BerkeleyTrue pointed out that errors in
gatsby-node.js
were being swallowed. @KyleAMathews fixed that in 859e412 - The Autoprefixer plugin was being added to the Postcss multiple times which @KyleAMathews fixed in dd2e960
Developer Experience (DX) improvements
- @michaeljdeeb added a check that hard-coded paths in pages have a path prefix. This is a problem that's bit several people as it's easy to miss #223. Invariants are awesome!
- @alehlopeh added a new cli command
gatsby serve-build
so you can easily check that your built site is working as expected. #237
Thanks everyone!
Babel 6! Require local install of Gatsby! 2500 stars!
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 :-)
Add support for JSON/YAML/TOML files + option to disable bundle.js for production build
- @KyleAMathews added support for creating pages from JSON/YAML/TOML files. This can be incredibly useful if you're integrating Gatsby with a 3rd-party system. Write out the data as JSON files and they'll be auto-converted into Gatsby pages. YAML & TOML are very handy for maintaining complex data for a page by hand.
- @scottnonnenberg added an option to disable building a
bundle.js
for production. This is helpful to minimize the amount of data people download for your site and for very large sites (e.g. 1000+ pages), not compiling the JS can save a considerable amount of time.
Small dev improvements
- @scottnonnenberg added code to catch and throw errors while compiling the
html.js
file during dev #176 - @tleunen suggested that when an unknown subcommand is run to show the help. Fixed in 938d9f0
Add support for a 404 page
Small fixes — improve default host on Windows + compile mode for html.js
- @jquense changed the default host on Windows to
localhost
6543ece - @KyleAMathews changed the compilation mode for the
html.js
file to development. f9ae585
Better Windows support & Font Loaders
Noted fixer of NPM packages for Windows @NogsMPLS submitted a PR to get Gatsby (hopefully) completely working on Windows! 🎉 🎉 🎉
@gesposito added support to Webpack for requiring fonts #162
@KyleAMathews made a few miscallaneous changes
- Replace remaining uses of Underscore with Lodash 486bd29
- Integrate the
scroll-behavior
package so clicking between links with react-router is more browser-like b4122db - Add
parentTemplateFile
to routes for use in theming 8620488
Thanks everyone!
Major release upgrading to React-Router 2.0 + full support for Less/Sass/PostCSS
Hi folks,
Finished off a major new release of Gatsby in time for ReactConf 🎉
New features
- Support Less/Sass/Postcss out of the box. CSS files are processed using the excellent cssnext.
- Support extracting and minifying css on production builds to an external
styles.css
file. - React-Router 2.0 🎉
Internals work
- We're using Webpack Hot Middleware + react-transform-hmr now instead of react-hot-loader.
- All remaining Coffeescript files have been converted to JS.
Breaking changes.
React Router has made two major releases since Gatsby was first built with a ton of nice improvements. But as Gatsby uses React Router heavily, its breaking changes often cause breaking changes within Gatsby.
The main change is what props are passed to _template
and wrapper components. Previously each component was passed the current page
data and a pages
array of all pages. Now this information is put onto the route
prop passed in by React Router.
Also where previously React Router provided a <RouteHandler/>
component which rendered the children components in _template
files, you should now replace those with {this.props.children}
.
Upgrading
- Install new packages:
npm install --save react-router@latest lodash@latest
&&npm install --save-dev [email protected] react-transform-catch-errors react-transform-hmr redbox-react
- Adjust templates and wrappers (and other components as necessary) to account for the React Router changes.
onRouteChange
is now passed thelocation
object from History.
Internals cleanup
- @KyleAMathews added an .eslintrc config to keep our code tidy and consistent.
- @fson fixed both some problems with NPM 3 installs as well as made builds throw errors so automated builds will fail properly.
- @ChristopherBiscardi added integration with the debug module to give you insight into what Gatsby is doing.
> DEBUG=gatsby:* gatsby build
Can now easily override default Webpack config
@ChristopherBiscardi added a PR to make it simple to override or extend the default Gatsby Webpack configuration. Gatsby tries to anticipate most needs out of the box but many projects will need some customizations to Webpack.
See the PR and new documentation.