Skip to content

Commit 24d2a34

Browse files
authored
Merge pull request #2001 from reduxjs/feature/docs-umami
2 parents ab72ce1 + f9e5f9e commit 24d2a34

File tree

9 files changed

+6711
-6587
lines changed

9 files changed

+6711
-6587
lines changed

.yarn/releases/yarn-3.4.1.cjs

+873
Large diffs are not rendered by default.

.yarn/releases/yarn-berry.cjs

-55
This file was deleted.

.yarnrc.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ nodeLinker: node-modules
22

33
plugins:
44
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
5-
spec: '@yarnpkg/plugin-workspace-tools'
5+
spec: "@yarnpkg/plugin-workspace-tools"
66
- path: .yarn/plugins/@yarnpkg/plugin-compat.cjs
7-
spec: '@yarnpkg/plugin-compat'
7+
spec: "@yarnpkg/plugin-compat"
88

9-
yarnPath: .yarn/releases/yarn-berry.cjs
9+
yarnPath: .yarn/releases/yarn-3.4.1.cjs

docs/tutorials/typescript.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ hide_title: true
2525

2626
## Introduction
2727

28-
Welcome to the React Redux TypeScript Quick Start tutorial! **This tutorial will briefly show how to use TypeScript with Redux Toolkit**.
28+
Welcome to the React Redux TypeScript Quick Start tutorial! **This tutorial will briefly show how to use TypeScript with Redux Toolkit and React-Redux**.
2929

3030
This page focuses on just how to set up the TypeScript aspects . For explanations of what Redux is, how it works, and full examples of how to use Redux, see [the Redux core docs tutorials](https://redux.js.org/tutorials/index).
3131

32-
Both React-Redux and Redux Toolkit are already written in TypeScript, so their TS type definitions are built in.
33-
34-
[React Redux](https://react-redux.js.org) has its type definitions in a separate [`@types/react-redux` typedefs package](https://npm.im/@types/react-redux) on NPM. In addition to typing the library functions, the types also export some helpers to make it easier to write typesafe interfaces between your Redux store and your React components.
32+
[React Redux](https://react-redux.js.org) is also written in TypeScript as of version 8, and also includes its own type definitions.
3533

3634
The [Redux+TS template for Create-React-App](https://github.com/reduxjs/cra-template-redux-typescript) comes with a working example of these patterns already configured.
3735

website/docusaurus.config.js

+21-7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const siteConfig = {
3131
require.resolve('./static/css/codeblock.css'),
3232
],
3333
},
34+
googleAnalytics: {
35+
trackingID: 'UA-130598673-2',
36+
},
3437
},
3538
],
3639
],
@@ -52,8 +55,7 @@ const siteConfig = {
5255
'/scripts/sidebarScroll.js',
5356
'/scripts/codeblock.js',
5457
{
55-
src:
56-
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
58+
src: 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
5759
async: true,
5860
},
5961
],
@@ -63,7 +65,7 @@ const siteConfig = {
6365
repoUrl: 'https://github.com/reduxjs/react-redux',
6466
},
6567
themeConfig: {
66-
metadatas: [{ name: 'twitter:card', content: 'summary' }],
68+
metadata: [{ name: 'twitter:card', content: 'summary' }],
6769
prism: {
6870
theme: require('./static/scripts/monokaiTheme.js'),
6971
},
@@ -184,14 +186,26 @@ const siteConfig = {
184186
],
185187
},
186188
algolia: {
187-
apiKey: '2d058d216b7fd5d68d481fd48ee72c06',
189+
appId: 'G15KG9HEMQ',
190+
apiKey: '3a19f2b0974a8fdde5e8eee758059ba4',
188191
indexName: 'react-redux',
189192
algoliaOptions: {},
190193
},
191-
googleAnalytics: {
192-
trackingID: 'UA-130598673-2',
193-
},
194194
},
195+
plugins: [
196+
[
197+
'@dipakparmar/docusaurus-plugin-umami',
198+
/** @type {import('@dipakparmar/docusaurus-plugin-umami').Options} */
199+
({
200+
websiteID: 'e81a2686-96f3-4557-9c03-f584b7e8ab6b',
201+
analyticsDomain: 'redux-docs-umami.vercel.app',
202+
scriptName: 'script.js',
203+
dataAutoTrack: true,
204+
dataDoNotTrack: true,
205+
dataCache: true,
206+
}),
207+
],
208+
],
195209
}
196210

197211
module.exports = siteConfig

website/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
"serve": "docusaurus serve"
1010
},
1111
"dependencies": {
12-
"@docusaurus/core": "2.0.0-beta.7",
13-
"@docusaurus/preset-classic": "2.0.0-beta.7",
12+
"@dipakparmar/docusaurus-plugin-umami": "^2.0.6",
13+
"@docusaurus/core": "2.4.1",
14+
"@docusaurus/preset-classic": "2.4.1",
1415
"classnames": "^2.2.6",
1516
"react": "^17.0.2",
1617
"react-dom": "^17.0.2",

website/src/pages/index.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Layout from '@theme/Layout'
44
import Link from '@docusaurus/Link'
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
66
import useBaseUrl from '@docusaurus/useBaseUrl'
7-
import useThemeContext from '@theme/hooks/useThemeContext'
87
import styles from './styles.module.css'
98

109
const features = [
@@ -20,7 +19,7 @@ const features = [
2019
),
2120
image: <img src="img/noun_Certificate_1945625.svg" />,
2221
imageAlign: 'top',
23-
title: 'Official'
22+
title: 'Official',
2423
},
2524
{
2625
content: (
@@ -32,7 +31,7 @@ const features = [
3231
),
3332
image: <img src="img/noun_Check_1870817.svg" />,
3433
imageAlign: 'top',
35-
title: 'Predictable'
34+
title: 'Predictable',
3635
},
3736
{
3837
content: (
@@ -44,7 +43,7 @@ const features = [
4443
),
4544
image: <img src="img/noun_Box_1664404.svg" />,
4645
imageAlign: 'top',
47-
title: 'Encapsulated'
46+
title: 'Encapsulated',
4847
},
4948
{
5049
content: (
@@ -56,8 +55,8 @@ const features = [
5655
),
5756
image: <img src="img/noun_Rocket_1245262.svg" />,
5857
imageAlign: 'top',
59-
title: 'Optimized'
60-
}
58+
title: 'Optimized',
59+
},
6160
]
6261

6362
const otherLibraries = [
@@ -75,7 +74,7 @@ const otherLibraries = [
7574
>
7675
<path d="M448 80v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h352c26.51 0 48 21.49 48 48zm-88 16H248.029c-21.313 0-32.08 25.861-16.971 40.971l31.984 31.987L67.515 364.485c-4.686 4.686-4.686 12.284 0 16.971l31.029 31.029c4.687 4.686 12.285 4.686 16.971 0l195.526-195.526 31.988 31.991C358.058 263.977 384 253.425 384 231.979V120c0-13.255-10.745-24-24-24z"></path>
7776
</svg>
78-
)
77+
),
7978
},
8079
{
8180
content:
@@ -92,8 +91,8 @@ const otherLibraries = [
9291
>
9392
<path d="M448 80v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h352c26.51 0 48 21.49 48 48zm-88 16H248.029c-21.313 0-32.08 25.861-16.971 40.971l31.984 31.987L67.515 364.485c-4.686 4.686-4.686 12.284 0 16.971l31.029 31.029c4.687 4.686 12.285 4.686 16.971 0l195.526-195.526 31.988 31.991C358.058 263.977 384 253.425 384 231.979V120c0-13.255-10.745-24-24-24z"></path>
9493
</svg>
95-
)
96-
}
94+
),
95+
},
9796
]
9897

9998
function Home() {

0 commit comments

Comments
 (0)