Skip to content

Releases: gatsbyjs/gatsby

React Router V4 upgrade, static directory, bug fixes, tests, etc.

16 May 09:14
Compare
Choose a tag to compare

Added

  • Update version of React Router to v4 #940
  • API proxy for use during development #957
  • "static" directory for files to be copied directly into the "public"
    directory #956
  • Add toFormat argument to the ImageSharp GraphQL type so can change
    format of image e.g. from png to jpg.
  • React Docgen transformer plugin for parsing propType info from React
    components #928

Changed

  • Change node format to hide most node-specific fields under an "internal"
    key. Any code referencing node.type and others will need changed to
    node.internal.type #960
  • Changed the id for the root <div> used by Gatsby to mount React to ___gatsby
  • The default layout component should be at layouts/index.js not layouts/default.js #940 (comment)
  • this.props.children in layout components is now a function #940 (comment)
  • Change the default port for serve-build to 9000
  • Change the path to GraphiQL to /___graphql

Chore

  • Upgrade Jest to v20 #935

New GraphQL compiler!

15 May 17:16
Compare
Choose a tag to compare

Added

  • Use the Relay Modern compiler for extracting GraphQL queries from components.
    This allows us to now support components being added to all components. This
    means you can now write queries next to the views that use them. #912
  • Hook for modifying pages #863
  • New Drupal source plugin and example site #890
  • Detect if a site's plugins have changed and when they do, delete the site
    cache as it might now be invalid #927
  • New way to make connections between nodes e.g. article --> author #902

Changed

  • Combine transformer and typegen plugins. The distinction between the two
    types of plugins has proved somewhat artificial so they were combined. Any
    typegen plugins in your package.json and gatsby-config.js need to be
    removed. #918
  • Gatsby now garbage collects old nodes. Source plugins should now "touch"
  • nodes that haven't changed #861
  • Due to adopting the Relay compiler, GraphQL query template strings need
    named "graphql" plus must be named. So if previously you wrote:
export const pageQuery = `
{
  allMarkdownMark {
    edges {
      node {
        id
      }
    }
  }
}
`

You must now write:

export const pageQuery = graphql`
query IndexQuery {
  allMarkdownMark {
    edges {
      node {
        id
      }
    }
  }
}
`

Smarter faster data processing (oh and data hot reloading!)

24 Apr 22:35
Compare
Choose a tag to compare

Gatsby v1's data layer is starting to feel quite solid.

For this latest alpha, I did a almost complete refactor of the data layer adding in Redux and ideas from event sourcing and modern build tools like Buck and Bazel from Facebook and Google respectively.

Now all data processing is incremental and completely cached. On booting, Gatsby looks at your data contents to decide if new processing is needed and only processes data that's actually changed. One large site built on 1.0 saw it's bootstrap time drop from nearly a minute to under 5 seconds!

And as part of this work, Gatsby's data system now automatically watches all your data sources for changes and reprocesses data on the fly. Remote or local data, if you change it, the change will be automatically pushed to the development version of your site. This is handy for editing a local markdown file but also a gatsby plugin can be monitoring a remote API for changes and automatically pull down data and update your site when something is updated.

Imagine a small team working on a site with a developer and two people working on content hosted on a CMS. Every time content is updated, the developer sees the changes in near real-time on the development site.

This was the last big piece blocking 1.0.0 from being released. There are a number of smaller tasks to complete but these should be more predictable in scope. There's plenty of smaller tasks to do! Please come help out!

Breaking changes

  • All site source code is moved under a /src subdirectory #802
  • Rename parse plugins to transformer #818

Add support to JS frontmatter for named exports

22 Apr 22:02
Compare
Choose a tag to compare

@NMinhNguyen added this very nice PR adding support for named exports to JS frontmatter #838

So this is now supported:

export const data = {
  titles: ['My title', 'My other title'],
}

Fix sourcemaps, templating logic, and updates for React 0.15.5

17 Apr 17:21
Compare
Choose a tag to compare
  • @0x80 noticed that source maps weren't working in Chrome in development and asked about it. That, combined with a serendipitous tweet by @gaearon, led to #812 where we swapped out using the eval source-maps technique for cheap-module-source-maps.
  • @donysukardi got us React 16 ready by removing our uses of React.createClass and the built-in proptypes #809
  • @danperkins fixed a logic bug in our router generation where nested templates weren't being tied to their parent templates correctly #808
  • @KyleAMathews replaced the old default starter with a much simpler one to make it simpler to understand Gatsby when new plus easier to use the starter as a base for building new sites #806

Use the default PostCSS browserlist config for autoprefixing

10 Apr 20:57
Compare
Choose a tag to compare

@kennethormandy fixed a problem with our PostCSS webpack config where because of how it was setup, you couldn't override the browserlist using a custom .browserslist file in your site. And by removing our custom option, we can now rely on the PostCSS default browserlist which is preferable as Gatsby doesn't have unique needs here so better to rely on the community maintaining a standard than us. #787

Use Yarn by default and add support for array values in JS frontmatter

10 Apr 17:01
Compare
Choose a tag to compare

Our 40th patch release on the 0.12 minor series! Woot!

Two nice feature additions from two new Gatsby contributors.

  • @donysukardi added support for using Yarn over NPM when creating a new Gatsby site using gatsby new #782
  • @Tom-Bonnike extended our JavaScript frontmatter code to support array values. #784 So now the parsing code can extract values in this form:
exports.data = {
  titles: ['My title', 'My other title'],
}

Do shallow clone when creating new Gatsby sites

21 Mar 22:37
Compare
Choose a tag to compare
  • @ahonn noticed we were doing a full clone of Gatsby starters when running gatsby new which is wasteful as we just throw away the git repo. So in #730 he fixed that to just do a shallow clone.
  • @dbismut fixed the default markdown loader to add in a site's prefix/basename to links within markdown. #710

Correct wording to 'listening'

04 Mar 19:21
Compare
Choose a tag to compare

@lb- corrected a miswording in a terminal warning in #702 thanks!

Add gatsby-ssr.js for lifecycle APIs during server rendering

27 Feb 20:22
Compare
Choose a tag to compare
  • #695 @mtt87 needed to support rendering translations correctly for his site during the static HTML build so added support for SSR APIs through a new gatsby-ssr.js file which can be added to your site similar to gatsby-browser.js and gatsby-node.js. He added a wrapRootComponent API similar to what was recently added to the browser but the method is now available if we need to add additional SSR APIs.
  • @mjesuele added support for extracting data from JS frontmatter when using template literal strings in additional to normal strings in #656

Thanks everyone!