|
| 1 | +--- |
| 2 | +date: "2021-11-16" |
| 3 | +version: "4.2.0" |
| 4 | +title: "v4.2 Release Notes" |
| 5 | +--- |
| 6 | + |
| 7 | +Welcome to `[email protected]` release (November 2021 #2) |
| 8 | + |
| 9 | +Key highlights of this release: |
| 10 | + |
| 11 | +- [`gatsby-source-contentful` v7](#gatsby-source-contentful-v7) |
| 12 | +- [`getServerData` improvements](#getserverdata-improvements) |
| 13 | +- [Framework Version Support](#framework-version-support) |
| 14 | + |
| 15 | +Also check out [notable bugfixes](#notable-bugfixes--improvements). |
| 16 | + |
| 17 | +**Bleeding Edge:** Want to try new features as soon as possible? Install `gatsby@next` and let us know |
| 18 | +if you have any [issues](https://github.com/gatsbyjs/gatsby/issues). |
| 19 | + |
| 20 | +[Previous release notes](/docs/reference/release-notes/v4.1) |
| 21 | + |
| 22 | +[Full changelog ](https://github.com/gatsbyjs/gatsby/compare/[email protected]@4.2.0) |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## `gatsby-source-contentful` v7 |
| 27 | + |
| 28 | +We're releasing a new major version of `gatsby-source-contentful` as the support for `gatsby-image` is dropped in favour fo the superior successor [`gatsby-plugin-image`](/docs/reference/built-in-components/gatsby-plugin-image/). Read the [Migrating from gatsby-image to gatsby-plugin-image](/docs/reference/release-notes/image-migration-guide/) guide to learn more. The [PR #33528](https://github.com/gatsbyjs/gatsby/pull/33528) implemented this change. |
| 29 | + |
| 30 | +You can also use `AVIF` images with Contentful now as the [PR #33903](https://github.com/gatsbyjs/gatsby/pull/33903) added support for this image format -- use the new `gatsby-plugin-image` to use it. |
| 31 | + |
| 32 | +## `getServerData` improvements |
| 33 | + |
| 34 | +A couple of improvements were made to the new [Server-Side Rendering API](/docs/reference/rendering-options/server-side-rendering/) inside Gatsby: |
| 35 | + |
| 36 | +- The response headers are now also applied during `gatsby develop`, via [PR #33810](https://github.com/gatsbyjs/gatsby/pull/33810) |
| 37 | +- You can (and should) use `process.env.*` environment variables inside `getServerData`, via [PR #33690](https://github.com/gatsbyjs/gatsby/pull/33690) |
| 38 | +- The status code returned by `getServerData` is respected now, via [PR #33914](https://github.com/gatsbyjs/gatsby/pull/33914). Please use this syntax (see [reference guide](/docs/reference/rendering-options/server-side-rendering/#creating-server-rendered-pages)): |
| 39 | + |
| 40 | + ```js |
| 41 | + export async function getServerData() { |
| 42 | + return { |
| 43 | + status: 200, |
| 44 | + headers: {}, |
| 45 | + props: {}, |
| 46 | + } |
| 47 | + } |
| 48 | + ``` |
| 49 | + |
| 50 | +## Framework Version Support |
| 51 | + |
| 52 | +You can find the support plans for the major versions of Gatsby on the newly created page [Gatsby Framework Version Support](/docs/reference/release-notes/gatsby-version-support/). |
| 53 | + |
| 54 | +## Notable bugfixes & improvements |
| 55 | + |
| 56 | +- A lot of internal dependency updates to each package, e.g. bumping `sharp` to `0.29.2`. You can check the `CHANGELOG.md` file in each package's folder for the details |
| 57 | +- `gatsby`: Test files inside the `src/api` (Gatsby Functions) directory are now excluded by default, via [PR #33834](https://github.com/gatsbyjs/gatsby/pull/33834) |
| 58 | +- `gatsby-source-wordpress`: |
| 59 | + - Fix for `'createRoot' is not exported from 'react-dom' (imported as 'ReactDOM').` warning, via [PR #33991](https://github.com/gatsbyjs/gatsby/pull/33991) |
| 60 | + - Hydrate images in develop on first occurence, via [PR #33989](https://github.com/gatsbyjs/gatsby/pull/33989) |
| 61 | +- `gatsby-core-utils`: Add retry on HTTP status codes to `fetchRemoteFile`, via [PR #33461](https://github.com/gatsbyjs/gatsby/pull/33461) |
| 62 | +- Content Sync: |
| 63 | + - Content Sync is a Gatsby Cloud feature for improving the Preview experience for content authors. You can read more about it in the [conceptual guide](/docs/conceptual/content-sync/) |
| 64 | + - `gatsby-source-drupal` is prepared for Content Sync, via [PR #33683](https://github.com/gatsbyjs/gatsby/pull/33683) |
| 65 | + - Update the [Creating Pages documentation](/docs/creating-and-modifying-pages/#optimizing-pages-for-content-sync), via [PR #33848](https://github.com/gatsbyjs/gatsby/pull/33848) |
| 66 | + |
| 67 | +## Contributors |
| 68 | + |
| 69 | +A big **Thank You ** to [our community who contributed ](https://github.com/gatsbyjs/gatsby/compare/[email protected]@4.2.0) to this release 💜 |
| 70 | + |
| 71 | +- [shreemaan-abhishek](https://github.com/shreemaan-abhishek): chore(docs): fix issues in 0009-telemetry RFC [PR #33829](https://github.com/gatsbyjs/gatsby/pull/33829) |
| 72 | +- [tonyhallett](https://github.com/tonyhallett) |
| 73 | + - fix(gatsby): Reuse readPageData [PR #33595](https://github.com/gatsbyjs/gatsby/pull/33595) |
| 74 | + - chore(gatsby): Update inference-metadata type [PR #33839](https://github.com/gatsbyjs/gatsby/pull/33839) |
| 75 | + - fix(gatsby): TS type for `createTypes` action arrays [PR #33588](https://github.com/gatsbyjs/gatsby/pull/33588) |
| 76 | + - chore(gatsby): Correct fromNode TS type [PR #33912](https://github.com/gatsbyjs/gatsby/pull/33912) |
| 77 | +- [jstramel](https://github.com/jstramel): searcParams missing from urls [PR #33861](https://github.com/gatsbyjs/gatsby/pull/33861) |
| 78 | +- [axe312ger](https://github.com/axe312ger) |
| 79 | + - breaking(gatsby-source-contentful): remove gatsby-image support [PR #33528](https://github.com/gatsbyjs/gatsby/pull/33528) |
| 80 | + - feat(gatsby-core-utils): Add retry on HTTP status codes to `fetchRemoteFile` [PR #33461](https://github.com/gatsbyjs/gatsby/pull/33461) |
| 81 | +- [labifrancis](https://github.com/labifrancis): chore(gatsby-plugin-gatsby-google-analytics): Highlight the plugin we recommend [PR #33901](https://github.com/gatsbyjs/gatsby/pull/33901) |
| 82 | +- [bytrangle](https://github.com/bytrangle): chore(docs): remove slug generation from MDX doc [PR #33915](https://github.com/gatsbyjs/gatsby/pull/33915) |
| 83 | +- [Swarleys](https://github.com/Swarleys): feat(contentful): modifying schemes to add support for AVIF images [PR #33903](https://github.com/gatsbyjs/gatsby/pull/33903) |
| 84 | +- [InfamousStarFox](https://github.com/InfamousStarFox): Fixes incorrect link "programmatically creating pages from data" [PR #33964](https://github.com/gatsbyjs/gatsby/pull/33964) |
| 85 | +- [SaloniThete](https://github.com/SaloniThete): chore: Typo in BUG_REPORT [PR #33971](https://github.com/gatsbyjs/gatsby/pull/33971) |
| 86 | +- [henryjw](https://github.com/henryjw): chore(docs): Update client-only doc [PR #33967](https://github.com/gatsbyjs/gatsby/pull/33967) |
0 commit comments