We’re excited to announce that today we shipped the first beta for Gatsby v2! 36 contributors have made over 300 commits to v2 since Gatsby v1 was released in July 2017.
What’s coming in v2?
Gatsby v2 builds on the foundations of v1 to introduce a range of improvements:
Out With Gatsby Layout Components, In With StaticQuery
Gatsby’s special layout components were a common source of confusion in v1. After an RFC and informative community discussion, we decided to remove them and create
StaticQuery
which allows GraphQL queries to be added to any component. For more information on migrating your layouts, check out our Life After Layouts post.Improve APIs
We’ve renamed
sizes
andresolutions
tofluid
andfixed
,boundActionCreators
toactions
, as well as other changes intended to make API names more consistent and prevent common gotchas.To see the full list of renamings, take a look at the upgrade guide for image queries, actions and the babel and webpack API hooks.
Hotter Hot Reloading
Previously, hot reloading of code and data had been dependent on new webpack builds. On larger sites, that could take ten or fifteen seconds — more like lukewarm reloading, really. With ludicrous mode we’ve decoupled data updates from webpack so changes you make to your content show up on your site at blistering speeds.
Upgraded Dependencies
Gatsby is built on top of amazing JavaScript libraries. In this beta, we’re delighted to ship the latest improvements from webpack, Babel, and React to you.
Key upgrades include:
These updates allow Gatsby to take advantage of the performance improvements and new features of these tools.
Can I upgrade now to v2?
Yes! We’ve built gatsbyjs.com with v2 and the Gatsby community is converting over the example sites. While the effort to migrate individual sites may vary, we’ve noticed significant build speedups in Gatsby v2 versus v1 and would love you to dig in and try it. We’re working hard on refining Gatsby v2 for full release and would love your help!
What’s coming next?
The v2 roadmap details everything else we’re planning for v2. Improvements include:
- Additional build optimisations
- Better error messaging
- PostCSS configuration updates
Getting involved
We ❤️ your feedback. Try out the migration guide and let us know how you get on. Issues and pull requests are welcome (for real).
Finally a big thank you to all of Gatsby’s contributors for their time and effort on every version of Gatsby. Special thanks in particular to everyone who’s helped with v2 so far: @ajayns @brizzoli @calcsam @CanRau @chmac @danielfarrell @davidluhr @daydream05 @dennari @Drew-Slagter @dvonlehman @flipactual @hsribei @jlengstorf @jquense @Khaledgarbaya @kkemple @kripod @KyleAMathews @LeKoArts @lettertwo @m-allanson @mathieudutour @mottox2 @mquandalle @nihgwu @noelebrun @pieh @piotrkwiecinski @resir014 @ryanditjia @syndia @ThatOtherPerson @thebigredgeek @thescientist13 @tsriram