v3.4 (April 2021 #2)

Welcome to gatsby@3.4.0 release (April 2021 #2)

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


Experimental: Enable webpack persistent caching for production builds

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

To use it, add a flag to your gatsby-config.js:

Details and discussion.

Experimental: Functions

We’re making our initial alpha release of serverless functions in Gatsby!

New Aggregation Resolvers

The PR #30789 added new aggregation resolvers similar to the already existing group and distinct resolvers. You now can use min(), max(), and sum(). They support numeric fields, but also attempt to cast non-numeric fields and includes them if the value is not NaN.

An example query:

Better Fast Refresh handling for styling libraries

Since the introduction of Fast Refresh changes to theme files both in Theme UI and Chakra UI didn’t result in correct hot-reloading behavior as the user had to manually reload the page to see their changes. The PR #30901 added better Fast Refresh handling for components that don’t satisfy the constraints set by Fast Refresh but it didn’t completely fix the incorrect behavior in both plugins. Upstream PRs from us to Theme UI and Chakra UI fixed the behavior! Install theme-ui@^0.7.1 or @chakra-ui/gatsby-plugin@^2.0.0 to get the updates.

Notable bugfixes & improvements

  • Fixed page context changes not triggering query rerunning PR #28590
  • Fixed not being able to disable DEV_SSR flag when FAST_DEV is enabled PR #30992
  • Speed up createPages by ~10% by memoizing process.env access PR #30768
  • You now can define the --host option of gatsby-cli with env.HOST PR #26712
  • Allow CI AWS lamba builds PR #30653
  • File System Route API: De-dupe collection pages PR #31016

Contributors

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