Earlier this year, we began migrating customers to Incremental CMS Preview to help content editors more reliably preview content before publishing. This was automatically enabled for most sites on Gatsby Cloud. However, some CMSs and source plugins require a manual upgrade.
Incremental Preview is over 50% more reliable than before and enables Preview UI to help editors understand the status of Preview builds.
With Incremental Preview, Gatsby Cloud no longer supports watch mode for gatsby-source-sanity. From talking with customers over the last year, we learned that while watch mode works well for individual editors or small teams, it does not scale well to larger teams or larger sites. Incremental Previews was largely inspired by these challenges. Throughout 2022, we plan to optimize every step of the Preview build process to recreate performance similar to watch mode.
To complete this upgrade, you'll need to complete the following:
- Upgrade gatsby
- Upgrade gatsby-source-sanity
- Upgrade gatsby-plugin-gatsby-cloud
- Configure webhooks for CMS Preview
1. Upgrade gatsby
2. Upgrade gatsby-source-sanity
Upgrade gatsby-source-sanity to version 7.3.1 or later.
npm install gatsby-source-sanity@latest
3. Upgrade gatsby-plugin-gatsby-cloud
Upgrade gatsby-plugin-gatsby-cloud to the latest version.
npm install gatsby-plugin-gatsby-cloud@latest
4. Configure webhooks for CMS Preview
Sanity has a new system for webhooks which is required for Incremental Preview. Quick Connect for Sanity has been upgraded to support this. To add the correct webhooks, go through the Quick Connect flow:
You're all set!
With these upgrades, CMS Preview will be a lot more reliable for content editors.