Of all the technologies to emerge in the web development industry in recent years, perhaps none has generated as much attention and excitement as Gatsby, a static site generator based on React. Though Gatsby is touted for its ease of use, performance benefits, and versatility for use cases both simple and complex, it’s equally vaunted for its developer experience advantages thanks to its use of GraphQL and high degree of extensibility.
I also have a personal connection to Gatsby, having joined the core framework team and company in 2019 to lead product management for Gatsby Cloud, the hosting infrastructure underpinning many Gatsby sites. As of this writing, Gatsby has one of the most active and knowledgeable open source communities in existence, and I’m excited to see what’s ahead in Gatsby’s future. By the end of this book, you will be too!
Gatsby: The Definitive Guide is a book that is intended to serve not only as an introduction to beginning, intermediate, and advanced use cases for developers working with Gatsby but also as a holistic reference to use while building Gatsby sites. To that end, it aims to be both edifying and exhaustive without veering too far to either extreme.
Gatsby: The Definitive Guide isn’t just the first book from O’Reilly on the topic of the Gatsby framework; it’s also the first comprehensive guide to Gatsby, covering the foundations of what makes Gatsby great and the full range of what developers can achieve with Gatsby. It’s the first-ever book that will give you a full understanding of both key elements of the Jamstack world and everything you need to equip yourself for success with Gatsby development.
As someone with a passion for both content management and modern web development, I authored this book with an eye toward enabling those who work at the intersection of cutting-edge digital experiences and leading frontend technologies. My own personal site has been powered by Gatsby for several years now, and both colleagues and casual observers have commented on its speed, despite the fact that it handles data originating from a variety of sources.
Gatsby: The Definitive Guide is also my second book focused entirely on web development, following in the footsteps of my debut Decoupled Drupal in Practice (Apress), which was the first comprehensive guide to decoupled Drupal. Just like that work, I wrote this book to provide others with the encyclopedic reference and comprehensive coverage I wish I had when I kicked off my own journey.
The following typographical conventions are used in this book:
Constant width bold
Constant width italic
This element signifies a tip or suggestion.
This element signifies a general note.
This element indicates a warning or caution.
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/oreillymedia/title_title.
If you have a technical question or a problem using the code examples, please email [email protected].
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Gatsby: The Definitive Guide, by Preston So. Copyright 2021 Preston So, 978-1-492-08751-9.”
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at [email protected].
For more than 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed.
Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit http://oreilly.com.
Please address comments and questions concerning this book to the publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at https://oreil.ly/gatsby-guide.
Email [email protected] to comment or ask technical questions about this book.
For news and information about our books and courses, visit http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Without the Gatsby community and my former colleagues at Gatsby, as well as personal connections around the world, this book would never have made it past the drawing board.
First and foremost, my fond thanks to my editor Jeff Bleiel, who has been a steadfast resource and sounding board throughout the entire writing process, even at the nadir of the still-ongoing coronavirus pandemic.
My gratitude also goes to Alexander Nnakuwe and David Mackey, the book’s technical reviewers, whose comments have helped it attain a high level of quality and lasting relevance. In addition, Amanda Quinn was a spectacular resource at O’Reilly in working with me on the initial steps of this book, Katie Tozer has been fantastic to collaborate with as production editor, and Rachel Head gave this text an incredibly thorough review as copyeditor.
Second, I’d be remiss not to thank my colleagues and friends at Gatsby, who made my time there edifying along multiple dimensions and helped me grow as a writer and a product leader. Big thanks must go to Sid Chatterjee, without whom this book would never have made it past the planning stage—his ideas and suggestions were instrumental to getting this process off the ground.
I also offer my profound gratitude to the Product and Design organization at Gatsby, who were among the finest teams I’ve ever had the privilege to work for and learn from: especially Marisa Morby, Florian Kissling, and Shannon Soper. Thanks also to my other colleagues at Gatsby, particularly Nat Alison, David Bailey, Chris Biscardi, Aisha Blake, Caitlin Cashin, Obinna Ekwuno, Kurt Kemple, Jason Lengstorf, Madalyn Parker, Amberley Romo, Marcy Sutton, and Hashim Warren, all of whom deeply inspired this project with their own work and left Gatsby in a better place in ways both human and technical.
Finally, thanks to all my former and current colleagues at companies like Time Inc., Acquia, and now Oracle who have been encouraging and understanding throughout this writing process. And a fond word of support to those, like me, who have felt excluded from many aspects of the technology industry due to systemic oppression in various forms—it’s my hope that this work inspires you to contribute your important and much-needed voice to the discourse as well.