Skip to content

Commit

Permalink
Merge pull request #2001 from reduxjs/feature/docs-umami
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed May 22, 2023
2 parents ab72ce1 + f9e5f9e commit 24d2a34
Show file tree
Hide file tree
Showing 9 changed files with 6,711 additions and 6,587 deletions.
873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.4.1.cjs

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-berry.cjs

This file was deleted.

6 changes: 3 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-compat.cjs
spec: '@yarnpkg/plugin-compat'
spec: "@yarnpkg/plugin-compat"

yarnPath: .yarn/releases/yarn-berry.cjs
yarnPath: .yarn/releases/yarn-3.4.1.cjs
6 changes: 2 additions & 4 deletions docs/tutorials/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ hide_title: true

## Introduction

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

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).

Both React-Redux and Redux Toolkit are already written in TypeScript, so their TS type definitions are built in.

[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.
[React Redux](https://react-redux.js.org) is also written in TypeScript as of version 8, and also includes its own type definitions.

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.

Expand Down
28 changes: 21 additions & 7 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const siteConfig = {
require.resolve('./static/css/codeblock.css'),
],
},
googleAnalytics: {
trackingID: 'UA-130598673-2',
},
},
],
],
Expand All @@ -52,8 +55,7 @@ const siteConfig = {
'/scripts/sidebarScroll.js',
'/scripts/codeblock.js',
{
src:
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
src: 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
async: true,
},
],
Expand All @@ -63,7 +65,7 @@ const siteConfig = {
repoUrl: 'https://github.com/reduxjs/react-redux',
},
themeConfig: {
metadatas: [{ name: 'twitter:card', content: 'summary' }],
metadata: [{ name: 'twitter:card', content: 'summary' }],
prism: {
theme: require('./static/scripts/monokaiTheme.js'),
},
Expand Down Expand Up @@ -184,14 +186,26 @@ const siteConfig = {
],
},
algolia: {
apiKey: '2d058d216b7fd5d68d481fd48ee72c06',
appId: 'G15KG9HEMQ',
apiKey: '3a19f2b0974a8fdde5e8eee758059ba4',
indexName: 'react-redux',
algoliaOptions: {},
},
googleAnalytics: {
trackingID: 'UA-130598673-2',
},
},
plugins: [
[
'@dipakparmar/docusaurus-plugin-umami',
/** @type {import('@dipakparmar/docusaurus-plugin-umami').Options} */
({
websiteID: 'e81a2686-96f3-4557-9c03-f584b7e8ab6b',
analyticsDomain: 'redux-docs-umami.vercel.app',
scriptName: 'script.js',
dataAutoTrack: true,
dataDoNotTrack: true,
dataCache: true,
}),
],
],
}

module.exports = siteConfig
5 changes: 3 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"serve": "docusaurus serve"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.7",
"@docusaurus/preset-classic": "2.0.0-beta.7",
"@dipakparmar/docusaurus-plugin-umami": "^2.0.6",
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"classnames": "^2.2.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
17 changes: 8 additions & 9 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Layout from '@theme/Layout'
import Link from '@docusaurus/Link'
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
import useBaseUrl from '@docusaurus/useBaseUrl'
import useThemeContext from '@theme/hooks/useThemeContext'
import styles from './styles.module.css'

const features = [
Expand All @@ -20,7 +19,7 @@ const features = [
),
image: <img src="img/noun_Certificate_1945625.svg" />,
imageAlign: 'top',
title: 'Official'
title: 'Official',
},
{
content: (
Expand All @@ -32,7 +31,7 @@ const features = [
),
image: <img src="img/noun_Check_1870817.svg" />,
imageAlign: 'top',
title: 'Predictable'
title: 'Predictable',
},
{
content: (
Expand All @@ -44,7 +43,7 @@ const features = [
),
image: <img src="img/noun_Box_1664404.svg" />,
imageAlign: 'top',
title: 'Encapsulated'
title: 'Encapsulated',
},
{
content: (
Expand All @@ -56,8 +55,8 @@ const features = [
),
image: <img src="img/noun_Rocket_1245262.svg" />,
imageAlign: 'top',
title: 'Optimized'
}
title: 'Optimized',
},
]

const otherLibraries = [
Expand All @@ -75,7 +74,7 @@ const otherLibraries = [
>
<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>
</svg>
)
),
},
{
content:
Expand All @@ -92,8 +91,8 @@ const otherLibraries = [
>
<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>
</svg>
)
}
),
},
]

function Home() {
Expand Down
Loading

0 comments on commit 24d2a34

Please sign in to comment.