Skip to content

Commit

Permalink
chore(docs): 4.9 Release Notes (#34999)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Mar 1, 2022
1 parent 84336f9 commit 0f7ea5d
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/docs/how-to/custom-configuration/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ type Person = {
export const sourceNodes: GatsbyNode["sourceNodes"] = async ({
actions,
createNodeId,
createContentDigest,
}) => {
const { createNode } = actions

Expand Down
100 changes: 100 additions & 0 deletions docs/docs/reference/release-notes/v4.9/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
date: "2022-03-01"
version: "4.9.0"
title: "v4.9 Release Notes"
---

Welcome to `gatsby@4.9.0` release (March 2022 #1)

Key highlights of this release:

- [Support for TypeScript in `gatsby-config` and `gatsby-node`](#support-for-typescript-in-gatsby-config-and-gatsby-node)

Also check out [notable bugfixes](#notable-bugfixes--improvements).

**Bleeding Edge:** Want to try new features as soon as possible? Install `gatsby@next` and let us know
if you have any [issues](https://github.com/gatsbyjs/gatsby/issues).

[Previous release notes](/docs/reference/release-notes/v4.8)

[Full changelog][full-changelog]

---

## Support for TypeScript in `gatsby-config` and `gatsby-node`

In the last release we added [support for TypeScript in `gatsby-browser` and `gatsby-ssr`](/docs/reference/release-notes/v4.8/#support-for-typescript-in-gatsby-browser-and-gatsby-ssr) and as a follow-up we're introducing a much requested feature: Support for TypeScript in `gatsby-config` and `gatsby-node` 🎉

When you try it out in your project, please give us feedback in the [accompanying RFC](https://github.com/gatsbyjs/gatsby/discussions/34613) on what you like, what doesn't work, and what you like to see in the future. **Note:** There are currently [some limitations](/docs/how-to/custom-configuration/typescript/#current-limitations) that you'll need to be aware of. In the [RFC](https://github.com/gatsbyjs/gatsby/discussions/34613) you can also read why we chose [Parcel](https://parceljs.org/) for this feature and how we did it.

You can learn everything about this new feature on the [TypeScript and Gatsby documentation page](/docs/how-to/custom-configuration/typescript/) but here are two small examples of `gatsby-config` and `gatsby-node` with TypeScript:

```ts:title=gatsby-config.ts
import type { GatsbyConfig } from "gatsby"

const config: GatsbyConfig = {
siteMetadata: {
title: "Your Title",
},
plugins: [],
}

export default config
```

```ts:title=gatsby-node.ts
import type { GatsbyNode } from "gatsby"

type Person = {
id: number
name: string
age: number
}

export const sourceNodes: GatsbyNode["sourceNodes"] = async ({
actions,
createNodeId,
createContentDigest,
}) => {
const { createNode } = actions

const data = await getSomeData()

data.forEach((person: Person) => {
const node = {
...person,
parent: null,
children: [],
id: createNodeId(`person__${person.id}`),
internal: {
type: "Person",
content: JSON.stringify(person),
contentDigest: createContentDigest(person),
},
}

createNode(node)
})
}
```

You can also check out the [using-typescript](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-typescript) and [using-vanilla-extract](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-vanilla-extract) examples!

## Notable bugfixes & improvements

- `gatsby`
- Cache date formatting in LMDB cache for speed improvements, via [PR #34834](https://github.com/gatsbyjs/gatsby/pull/34834)
- Batch page dependency actions for speed improvements, via [PR #34856](https://github.com/gatsbyjs/gatsby/pull/34856)

## Contributors

A big **Thank You** to [our community who contributed][full-changelog] to this release 💜

- [0xflotus](https://github.com/0xflotus)
- fix: small typo error [PR #34848](https://github.com/gatsbyjs/gatsby/pull/34848)
- chore(gatsby-plugin-image): update readme typo [PR #34847](https://github.com/gatsbyjs/gatsby/pull/34847)
- [jamatz](https://github.com/jamatz): docs(gatsby): GatbsyImage -> GatsbyImage [PR #34914](https://github.com/gatsbyjs/gatsby/pull/34914)
- [brherr](https://github.com/brherr): Update gatsby-config.js [PR #34924](https://github.com/gatsbyjs/gatsby/pull/34924)
- [benackles](https://github.com/benackles): chore(docs): Update link to "How to create a Gatsby Starter" [PR #34937](https://github.com/gatsbyjs/gatsby/pull/34937)

[full-changelog]: https://github.com/gatsbyjs/gatsby/compare/gatsby@4.9.0-next.0...gatsby@4.9.0

0 comments on commit 0f7ea5d

Please sign in to comment.