v3.7 Release Notes
Welcome to gatsby@3.7.0
release (June 2021 #1)
Key highlights of this release:
- Functions - Now generally available
- webpack caching - Starting gradual rollout
- Yarn 2 (PNP) support
- New API for source plugins:
createNodeManifest
- Experimental: Node persistence in LMDB - Lower peak memory usage
gatsby-remark-images
: async image decoding by default
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.
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.
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.
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.
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.
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
: FixedMaximum call stack size exceeded
error, via PR #31547gatsby-source-contentful
: Fix blinking progress bar, via PR #31467gatsby-source-wordpress
: Prevent “EADDRINUSE: address already in use 127.0.0.1” error, via PR #31710gatsby-remark-katext
: Fix compatibility with remark 13, via PR #31596
Contributors
A big Thank You to our community who contributed to this release 💜
Marco-Daniel: feat(gatsby-source-wordpress): auto-alias any field named
fields
to prevent conflicts with Gatsby core PR #31526njbmartin: fix(gatsby-source-contentful): use correct name for crop parameter in query string PR #31492
wafflepie: fix(gatsby): better detection of Babel rules for HMR when customizing the Webpack config PR #31477
pindjur: fix(gatsby): prevent infinite loop in fast-refresh-overlay PR #31594
TommasoAmici: Fixed syntax error in example PR #31636
dhoko: feat(gatsby-source-wordpress): Fix false positive error if the URL and the responsePath are the same PR #31612
sj-rai: chore(docs): Update Jest instructions for v27 PR #31649
kevinfoerster: chore(docs): Correct nginx spelling PR #31651
viralganatra: feat(gatsby-remark-images): Add decoding prop to img elements PR #31558
BurkovBA: fix(gatsby-remark-katex): fix compatibility with remark 13 PR #31596