Skip to content

Commit 0f7ea5d

Browse files
authored
chore(docs): 4.9 Release Notes (#34999)
1 parent 84336f9 commit 0f7ea5d

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

docs/docs/how-to/custom-configuration/typescript.md

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ type Person = {
192192
export const sourceNodes: GatsbyNode["sourceNodes"] = async ({
193193
actions,
194194
createNodeId,
195+
createContentDigest,
195196
}) => {
196197
const { createNode } = actions
197198

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
date: "2022-03-01"
3+
version: "4.9.0"
4+
title: "v4.9 Release Notes"
5+
---
6+
7+
Welcome to `[email protected]` release (March 2022 #1)
8+
9+
Key highlights of this release:
10+
11+
- [Support for TypeScript in `gatsby-config` and `gatsby-node`](#support-for-typescript-in-gatsby-config-and-gatsby-node)
12+
13+
Also check out [notable bugfixes](#notable-bugfixes--improvements).
14+
15+
**Bleeding Edge:** Want to try new features as soon as possible? Install `gatsby@next` and let us know
16+
if you have any [issues](https://github.com/gatsbyjs/gatsby/issues).
17+
18+
[Previous release notes](/docs/reference/release-notes/v4.8)
19+
20+
[Full changelog][full-changelog]
21+
22+
---
23+
24+
## Support for TypeScript in `gatsby-config` and `gatsby-node`
25+
26+
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` 🎉
27+
28+
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.
29+
30+
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:
31+
32+
```ts:title=gatsby-config.ts
33+
import type { GatsbyConfig } from "gatsby"
34+
35+
const config: GatsbyConfig = {
36+
siteMetadata: {
37+
title: "Your Title",
38+
},
39+
plugins: [],
40+
}
41+
42+
export default config
43+
```
44+
45+
```ts:title=gatsby-node.ts
46+
import type { GatsbyNode } from "gatsby"
47+
48+
type Person = {
49+
id: number
50+
name: string
51+
age: number
52+
}
53+
54+
export const sourceNodes: GatsbyNode["sourceNodes"] = async ({
55+
actions,
56+
createNodeId,
57+
createContentDigest,
58+
}) => {
59+
const { createNode } = actions
60+
61+
const data = await getSomeData()
62+
63+
data.forEach((person: Person) => {
64+
const node = {
65+
...person,
66+
parent: null,
67+
children: [],
68+
id: createNodeId(`person__${person.id}`),
69+
internal: {
70+
type: "Person",
71+
content: JSON.stringify(person),
72+
contentDigest: createContentDigest(person),
73+
},
74+
}
75+
76+
createNode(node)
77+
})
78+
}
79+
```
80+
81+
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!
82+
83+
## Notable bugfixes & improvements
84+
85+
- `gatsby`
86+
- Cache date formatting in LMDB cache for speed improvements, via [PR #34834](https://github.com/gatsbyjs/gatsby/pull/34834)
87+
- Batch page dependency actions for speed improvements, via [PR #34856](https://github.com/gatsbyjs/gatsby/pull/34856)
88+
89+
## Contributors
90+
91+
A big **Thank You** to [our community who contributed][full-changelog] to this release 💜
92+
93+
- [0xflotus](https://github.com/0xflotus)
94+
- fix: small typo error [PR #34848](https://github.com/gatsbyjs/gatsby/pull/34848)
95+
- chore(gatsby-plugin-image): update readme typo [PR #34847](https://github.com/gatsbyjs/gatsby/pull/34847)
96+
- [jamatz](https://github.com/jamatz): docs(gatsby): GatbsyImage -> GatsbyImage [PR #34914](https://github.com/gatsbyjs/gatsby/pull/34914)
97+
- [brherr](https://github.com/brherr): Update gatsby-config.js [PR #34924](https://github.com/gatsbyjs/gatsby/pull/34924)
98+
- [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)
99+
100+
[full-changelog]: https://github.com/gatsbyjs/gatsby/compare/[email protected]@4.9.0

0 commit comments

Comments
 (0)