Create an _Upgrading to Gatsby v2_ guide.
@jquense created this file to collect breaking changes which I've adding to as well https://github.com/gatsbyjs/gatsby/blob/v2/Breaking%20Changes.md
Once the first beta is out, I'm going to solicit public v1 sites to upgrade and start writing a upgrading docs page from that.
I found this post helpful for an overview:
https://www.gatsbycentral.com/getting-started-with-gatsby-v2
Hi guys, is there currently a RouterContext sort of thing, that exposes history, location, and match props?
While upgrading Gatsby’s www to v2, as well as a client site, I found having to pass history or location to Layout to be somewhat a pain, a sentiment shared by @jquense here.
I’m not sure of the implications of such an API, but being able to do this:
import { RouterContext } from 'gatsby'
const Layout = ({ children }) => (
<RouterContext.Consumer>
{({ location, history, match }) => (
// ...rest of code
)}
</RouterContext.Consumer>
)
will help a lot of people migrate faster.
Another question I have: should sizes and resolutions’ change to fluid and fixed be documented as breaking instead of deprecation? From what I saw, gatsby-source-contentful will be moving to fluid and fixed exclusively.
I believe you could just wrap your layout component with withRouter https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/withRouter.md
fluid/fixed isn't a breaking change. If sizes/resolutions were removed from gatsby-source-contentful, we should restore them.
I'm going to close this as the bulk of the work is done. I don't think the remaining item should block releasing a v2 beta. I've created a new issue for docs on updating pages with layouts for larger sites: #5753
Most helpful comment
@jquense created this file to collect breaking changes which I've adding to as well https://github.com/gatsbyjs/gatsby/blob/v2/Breaking%20Changes.md
Once the first beta is out, I'm going to solicit public v1 sites to upgrade and start writing a upgrading docs page from that.