v3.7 Release Notes

v3.7 (June 2021 #1)

Welcome to gatsby@3.7.0 release (June 2021 #1)

Key highlights of this release:

Also check out notable bugfixes.

Bleeding Edge: Want to try new features as soon as possible? Install gatsby@next and let us know if you have any issues.

Previous release notes

Full changelog


Functions

Functions, first class support for serverless functions is now generally available in this version of Gatsby. Learn more about functions in the documentation and examples.

If you’ve been using it as an experimental feature for a while, you no longer need to include the experimental FUNCTIONS flag to use it after this update.

webpack caching

webpack 5 introduced built-in persistent caching. It allows webpack to reuse results of previous compilations and significantly speed up compilation steps.

We’ve added this feature in 3.4 release behind a flag. Now we are starting a gradual rollout for everyone. This release enables it for 20% of users.

If you encounter any issues, please let us know in the umbrella discussion.

New API for source plugins: createNodeManifest

This new API will be used to write out information that ties the state of some CMS content to a finally built page. Useful for routing to previews or even production content once they’re built.

This release adds a new public action unstable_createNodeManifest which is used to tie a manifest ID (a CMS id that maps to a unique revision state of some content) to a page that was built from a specific node.

To make the mapping from node to page more accurate, this release introduces a new argument to the createPage helper, ownerNodeId so that a user can specify that a page is owned by a specific node.

In the case that no ownerNodeId is provided, the logic checks for a page with an id variable in page context that matches to the node id of the node manifest. If neither of those exist the logic maps the manifest to the first page the node is found on in query tracking.

The result is that a source plugin can allow a CMS to create a manifest file using a CMS ID that maps to a finally built page in Gatsby, allowing for a service to redirect to the right page after a build is complete.

Original PR.

Experimental: Node persistence in LMDB

This release introduces a new experimental data storage option: LMDB (via the excellent lmdb-store package).

Instead of keeping nodes in memory (as it’s in Redux), they are instantly saved to this persistent embeddable storage. This will be beneficial for larger sites that can run into OOMs when persisting redux state to disk. Several other performance improvements using this new data store will follow.

We encourage you to try it and let us know if you encounter any issues!

Installation instructions are in the Umbrella Discussion.

Original PR

gatsby-remark-images: async image decoding by default

Added new plugin option decoding that adds corresponding attribute to all img tags produced by the plugin. Default value is async (other allowed values are: sync or auto).

The decoding property allows you to control if the browser is allowed to try to parallelize loading your image. If doing so would cause problems, you can specify sync to disable asynchronous loading.

Original PR

Read more about the decode property.

Yarn 2 (PNP) support

Yarn 2 with Plug’n’Play (Pnp) is available again. With the upgrade of Webpack v4-v5 during our Gatsby v3 release, PnP support broke. We’ve added an e2e-test to make sure this won’t happen again in the future. With yarn 2, you’ll notice faster NPM installs and less data usage as yarn2 is aggresivily caching node_modules.

Original PR

Notable bugfixes & improvements

  • Better detection of Babel rules for HMR when customizing the webpack config, via PR #31477
  • Correct config for svgo plugins, via PR #31620
  • gatsby-plugin-gatsby-cloud: Fixed Maximum call stack size exceeded error, via PR #31547
  • gatsby-source-contentful: Fix blinking progress bar, via PR #31467
  • gatsby-source-wordpress: Prevent “EADDRINUSE: address already in use 127.0.0.1” error, via PR #31710
  • gatsby-remark-katext: Fix compatibility with remark 13, via PR #31596

Contributors

A big Thank You to our community who contributed to this release 💜