v4.7 Release Notes
firstname.lastname@example.org release (February 2022 #1)
Key highlights of this release:
trailingSlashOption (Beta) - Now built into the Framework itself
- Faster Schema Creation &
createPages- Speed improvements of at least 30%
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.
Currently in Public Beta
Through the RFC Integrated handling of trailing slashes in Gatsby we’ve worked on making the trailing slashes feature a first-class citizen in Gatsby. We’re happy to announce that
gatsby-config now supports a
trailingSlash configuration with these three main options:
always: Always add trailing slashes to each URL, e.g.
never: Remove all trailing slashes on each URL, e.g.
ignore: Don’t automatically modify the URL
You can set it like this:
Throughout Gatsby 4 the default setting for
trailingSlash will be
legacy (to keep the current behavior) but with Gatsby 5 we’ll remove the
legacy setting and make
always the default. Please note that these plugins are considered deprecated now: gatsby-plugin-force-trailing-slashes and gatsby-plugin-remove-trailing-slashes.
Gatsby Cloud supports this new setting out of the box and also uses
301 redirects to bring visitors to the right location. Locally you can use
gatsby serve to see the behavior. Any other hosting provider (or if you’re managing this on your own) should follow the “Redirects, and expected behavior from the hosting provider” section on the initial RFC.
If you’re unit testing
gatsby-link you’ll need to update the
moduleNameMapper option to include
gatsby-page-utils, see Unit Testing documentation for more details.
Please share your feedback and any issues you encounter directly into the corresponding discussion.
We’ve seen a handful of sites struggling with long
schema building and
createPages steps. In this release, we’ve upgraded our external
graphql-compose dependency to v9 to improve these steps by at least 30-50% for schemas/queries with many relationships. For example, one of our customers has seen improvements for
createPages of 786s to 20s. This update is recommended to everyone and doesn’t necessitate any changes on your end.
More information can be found in the PR #34504.
gatsby-plugin-fullstory: Updated snippet, via PR #34583
gatsby-core-utils: Remote file downloads are now queued properly for all cases, via PR #34414
gatsby-plugin-preact: Fix alias for
react-dom/server, via PR #34694
- Added a
vanilla-extractexample project, via PR #34667
A big Thank You to our community who contributed to this release 💜
- millette: chore(gatsby-source-wordpress): Add WPGraphQL WPML PR #34609
- jeffreyvdhondel: feat(gatsby-plugin-google-gtag): add selfHostedOrigin option PR #34352
- Rutam21: fix(gatsby): fixes stacktraces from async functions break error reporting PR #33712
- rschristian: fix(gatsby-plugin-preact): Adding missing alias for
- tamaosa: fix(gatsby-plugin-preact): Fix alias for react-dom/server PR #34694- ollybenson: chore(docs): Update gatsby-plugin-image to mention local data source PR #34426
- rileyjshaw: chore(docs): update PurgeCSS instructions for Tailwind 3 PR #34726
- xaviemirmon: chore(docs): Update “Debugging HTML builds” to include
- marceloverdijk: chore(docs): Added required
typeattribute to resolver PR #34716
- cameronbraid: chore(docs): Update
transformOptionsdefaults PR #34713%