Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the Redux Essentials page, take 2 #3740

Merged
merged 61 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
440b92e
Port admonition and code block CSS from RTK site
markerikson Mar 29, 2020
df95c14
Restructure sidebars to add "Tutorials" section
markerikson Mar 29, 2020
5d3b507
Add empty "Quick Start" tutorial page
markerikson Mar 29, 2020
bfedc21
Bump Docusaurus to alpha.48
markerikson Mar 29, 2020
e9c893a
Fix text color in admonitions
markerikson Mar 29, 2020
70c6cdb
Add blockquote styling for other pages
markerikson Mar 29, 2020
4cfe763
Add DetailedExplanation component
markerikson Mar 29, 2020
75776e6
Initial Quick Start intro content
markerikson Mar 29, 2020
efb22ad
Quick Start: add "What is Redux" and "Terms" sections
markerikson Mar 29, 2020
0fc4460
Quick Start: add "play with app" content
markerikson Mar 30, 2020
deebd28
Quick Start: create nested folder and rename file
markerikson Mar 30, 2020
c58d44f
Store setup
markerikson Mar 30, 2020
fcb618d
Quick Start: add slice, reducer, immutability, and thunk sections
markerikson Mar 31, 2020
072a1cc
Quick start: Add React-Redux section
markerikson Mar 31, 2020
b2114ba
Quick start: emphasize immutability, highlight JSX
markerikson Mar 31, 2020
44dfab0
Tweak "know more?" and explanation styles
markerikson Mar 31, 2020
c7ed4c6
Fix typo and add thunk usage mention
markerikson Mar 31, 2020
c8671fa
Bump Docusaurus to alpha.50
markerikson Apr 5, 2020
da4b3eb
Temporarily rename files to .md to work around DS bug
markerikson Apr 5, 2020
0a98572
Add border color for highlight lines
markerikson Apr 10, 2020
2cd2173
Add code block titles and test line highlights
markerikson Apr 10, 2020
b9712d8
Initial project setup section
markerikson Apr 10, 2020
381810f
Add reducer and data flow explanations
markerikson Apr 10, 2020
7f05fba
Tweak wording
markerikson Apr 19, 2020
3c32808
Link example repo and sandbox
markerikson May 3, 2020
d47a38c
Update Docusaurus
markerikson May 3, 2020
d9bad00
Fill out "Basic Data Flow" page
markerikson May 3, 2020
c6b8500
Add additional phrasing
markerikson May 4, 2020
b3476d4
Add intro and summary content for part 3
markerikson May 4, 2020
80eddd7
Shrink code block file header padding
markerikson May 29, 2020
16773b3
Finish writing Part 3
markerikson May 29, 2020
e6a65a7
Link to Immer docs
markerikson May 29, 2020
ed38f62
Add initial Part 4 content
markerikson Jun 14, 2020
ff02396
Finish Quick Start part 4
markerikson Jun 19, 2020
87c4edd
Remove unnecessary uses of "just"
markerikson Jun 19, 2020
2a04314
Add Part 5 outline
markerikson Jun 28, 2020
1270b67
Update page titles
markerikson Jun 28, 2020
d8dbd4a
Half of part 5
markerikson Jun 28, 2020
91c2fb6
Finish Quick Start content. Yay!!!!!!
markerikson Jun 28, 2020
4e48ac5
Clean up tutorial part 1 based on review feedback
markerikson Jul 11, 2020
47bdf95
Add "What You've Learned" to part 1
markerikson Jul 11, 2020
f06c8e5
Rename part 5 -> 6
markerikson Jul 11, 2020
9eb4374
Rename part 4 -> 5
markerikson Jul 11, 2020
ecdb7f8
Rename part 3 -> 4
markerikson Jul 11, 2020
7ef37ca
Rename part 2 -> 3
markerikson Jul 11, 2020
606cc40
Add new Part 2
markerikson Jul 11, 2020
5067734
Fix up TODO comments and broken links
markerikson Jul 11, 2020
cd52472
Swap to new dataflow diagram
markerikson Jul 12, 2020
1fb3eaa
Assorted edits and link fixes
markerikson Jul 12, 2020
d44fd67
Rename "Quick Start" to "Redux Essentials"
markerikson Jul 13, 2020
f911c7f
Fix links and rename images
markerikson Jul 13, 2020
a53fb7a
Update example app repo/sandbox links
markerikson Jul 13, 2020
cd14e03
Clarify random seed behavior
markerikson Jul 13, 2020
002e69a
Rework introduction content
markerikson Jul 13, 2020
6a7bc5a
Merge branch 'master' into docs/create-quick-start-take-2
markerikson Jul 13, 2020
974553e
Remove unwanted colors from pagination buttons
markerikson Jul 13, 2020
e3cf2c6
Emphasize recommended tutorial
markerikson Jul 13, 2020
85a811e
Clean up README
markerikson Jul 13, 2020
9604ad3
Fix PR preview redirect
markerikson Jul 13, 2020
9fe04c4
Clarify "smallest amount" wording
markerikson Jul 13, 2020
16fcb8f
Try to fix redirects
markerikson Jul 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 29 additions & 137 deletions README.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/components/DetailedExplanation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'

export const DetailedExplanation = ({
children,
title = 'Detailed Explanation'
}) => {
return (
<details className="detailed-explanation">
<summary>
<h4>{title}</h4>
</summary>
{children}
</details>
)
}
93 changes: 41 additions & 52 deletions docs/introduction/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: getting-started
title: Getting Started with Redux
description: 'Introduction : Getting Started: Resources to get started learning and using Redux'
description: 'Introduction > Getting Started: Resources to get started learning and using Redux'
hide_title: true
---

Expand All @@ -15,25 +15,9 @@ You can use Redux together with [React](https://reactjs.org), or with any other

## Installation

Redux is available as a package on NPM for use with a module bundler or in a Node application:
### Redux Toolkit

```bash
# NPM
npm install redux

# Yarn
yarn add redux
```

It is also available as a precompiled UMD package that defines a `window.Redux` global variable. The UMD package can be used as a [`<script>` tag](https://unpkg.com/redux/dist/redux.js) directly.

For more details, see the [Installation](Installation.md) page.

## Redux Toolkit

Redux itself is small and unopinionated. We also have a separate addon package called **[Redux Toolkit](https://redux-toolkit.js.org/)**,
which includes some opinionated defaults that help you use Redux more effectively. It's our official recommended approach
for writing Redux logic.
[**Redux Toolkit**](https://redux-toolkit.js.org) is our official recommended approach for writing Redux logic. It wraps around the Redux core, and contains packages and functions that we think are essential for building a Redux app. Redux Toolkit builds in our suggested best practices, simplifies most Redux tasks, prevents common mistakes, and makes it easier to write Redux applications.

RTK includes utilities that help simplify many common use cases, including [store setup](https://redux-toolkit.js.org/api/configureStore),
[creating reducers and writing immutable update logic](https://redux-toolkit.js.org/api/createreducer),
Expand All @@ -43,14 +27,40 @@ Whether you're a brand new Redux user setting up your first project, or an exper
simplify an existing application, **[Redux Toolkit](https://redux-toolkit.js.org/)** can help you
make your Redux code better.

## Create a React Redux App
Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application:

```bash
# NPM
npm install @reduxjs/toolkit

# Yarn
yarn add @reduxjs/toolkit
```

### Create a React Redux App

The recommended way to start new apps with React and Redux is by using the [official Redux+JS template](https://github.com/reduxjs/cra-template-redux) for [Create React App](https://github.com/facebook/create-react-app), which takes advantage of **[Redux Toolkit](https://redux-toolkit.js.org/)** and React Redux's integration with React components.

```sh
npx create-react-app my-app --template redux
```

### Redux Core

The Redux core library is available as a package on NPM for use with a module bundler or in a Node application:

```bash
# NPM
npm install redux

# Yarn
yarn add redux
```

It is also available as a precompiled UMD package that defines a `window.Redux` global variable. The UMD package can be used as a [`<script>` tag](https://unpkg.com/redux/dist/redux.js) directly.

For more details, see the [Installation](Installation.md) page.

## Basic Example

The whole state of your app is stored in an object tree inside a single _store_.
Expand Down Expand Up @@ -111,49 +121,28 @@ In a typical Redux app, there is just a single store with a single root reducing

This architecture might seem like an overkill for a counter app, but the beauty of this pattern is how well it scales to large and complex apps. It also enables very powerful developer tools, because it is possible to trace every mutation to the action that caused it. You can record user sessions and reproduce them just by replaying every action.

## Example Projects

The Redux repository contains several example projects demonstrating various aspects of how to use Redux. Almost all examples have a corresponding CodeSandbox sandbox. This is an interactive version of the code that you can play with online.

See the complete list of examples in the **[Examples page](./Examples.md)**.

## Learn Redux

We have a variety of resources available to help you learn Redux, no matter what your background or learning style is.

### Just the Basics

If you're brand new to Redux and want to understand the basic concepts, see:

- The **[Motivation](./Motivation.md)** behind building Redux, the **[Core Concepts](./CoreConcepts.md)**, and the **[Three Principles](./ThreePrinciples.md)**.
- The **[basic tutorial in the Redux docs](../basics/README.md)**
- Redux creator Dan Abramov's **free ["Getting Started with Redux" video series](https://egghead.io/series/getting-started-with-redux)** on Egghead.io
- Redux co-maintainer Mark Erikson's **["Redux Fundamentals" slideshow](http://blog.isquaredsoftware.com/2018/03/presentation-reactathon-redux-fundamentals/)** and **[list of suggested resources for learning Redux](http://blog.isquaredsoftware.com/2017/12/blogged-answers-learn-redux/)**
- If you learn best by looking at code and playing with it, check out our list of **[Redux example applications](./Examples.md)**, available as separate projects in the Redux repo, and also as interactive online examples on CodeSandbox.
- The **[Redux Tutorials](https://github.com/markerikson/react-redux-links/blob/master/redux-tutorials.md)** section of the **[React/Redux links list](https://github.com/markerikson/react-redux-links)**. Here's a top list of our recommended tutorials:
- Dave Ceddia's posts [What Does Redux Do? (and when should you use it?)](https://daveceddia.com/what-does-redux-do/) and [How Redux Works: A Counter-Example](https://daveceddia.com/how-does-redux-work/) are a great intro to the basics of Redux and how to use it with React, as is this post on [React and Redux: An Introduction](http://jakesidsmith.com/blog/post/2017-11-18-redux-and-react-an-introduction/).
- Valentino Gagliardi's post [React Redux Tutorial for Beginners: Learning Redux in 2018](https://www.valentinog.com/blog/react-redux-tutorial-beginners/) is an excellent extended introduction to many aspects of using Redux.
- The CSS Tricks article [Leveling Up with React: Redux](https://css-tricks.com/learning-react-redux/) covers the Redux basics well.
- This [DevGuides: Introduction to Redux](http://devguides.io/redux/) tutorial covers several aspects of Redux, including actions, reducers, usage with React, and middleware.
We have a variety of resources available to help you learn Redux.

### Intermediate Concepts
### Redux Essentials Tutorial

Once you've picked up the basics of working with actions, reducers, and the store, you may have questions about topics like working with asynchronous logic and AJAX requests, connecting a UI framework like React to your Redux store, and setting up an application to use Redux:
The [**Redux Essentials tutorial**](../tutorials/essentials/part-1-overview-concepts.md) is a "top-down" tutorial that teaches how to use Redux the right way, using our latest recommended APIs and best practices. We recommend starting there.

- The **["Advanced" docs section](../advanced/README.md)** covers working with async logic, middleware, routing.
- The Redux docs **["Learning Resources"](./LearningResources.md)** page points to recommended articles on a variety of Redux-related topics.
- Sophie DeBenedetto's 8-part **[Building a Simple CRUD App with React + Redux](http://www.thegreatcodeadventure.com/building-a-simple-crud-app-with-react-redux-part-1/)** series shows how to put together a basic CRUD app from scratch.
### Additional Tutorials

### Real-World Usage
- The Redux docs [**Basic tutorial**](../basics/README.md) and [**Advanced tutorial**](../advanced/README.md) are a "bottom-up" tutorial that teaches how Redux works, starting from first principles.
- The Redux repository contains several example projects demonstrating various aspects of how to use Redux. Almost all examples have a corresponding CodeSandbox sandbox. This is an interactive version of the code that you can play with online. See the complete list of examples in the **[Examples page](./Examples.md)**.
- Redux creator Dan Abramov's **free ["Getting Started with Redux" video series](https://egghead.io/series/getting-started-with-redux)** and **[Building React Applications with Idiomatic Redux](https://egghead.io/courses/building-react-applications-with-idiomatic-redux)** video courses on Egghead.io
- Redux maintainer Mark Erikson's **["Redux Fundamentals" conference talk](http://blog.isquaredsoftware.com/2018/03/presentation-reactathon-redux-fundamentals/)** and [**"Redux Fundamentals" workshop slides**](https://blog.isquaredsoftware.com/2018/06/redux-fundamentals-workshop-slides/)
- Dave Ceddia's post [**A Complete React Redux Tutorial for Beginners**](https://daveceddia.com/redux-tutorial/)

Going from a TodoMVC app to a real production application can be a big jump, but we've got plenty of resources to help:
### Other Resources

- Redux creator Dan Abramov's **[free "Building React Applications with Idiomatic Redux" video series](https://egghead.io/courses/building-react-applications-with-idiomatic-redux)** builds on his first video series and covers topics like middleware, routing, and persistence.
- The **[Redux FAQ](../FAQ.md)** answers many common questions about how to use Redux, and the **["Recipes" docs section](../recipes/README.md)** has information on handling derived data, testing, structuring reducer logic, and reducing boilerplate.
- Redux co-maintainer Mark Erikson's **["Practical Redux" tutorial series](http://blog.isquaredsoftware.com/series/practical-redux/)** demonstrates real-world intermediate and advanced techniques for working with React and Redux (also available as **[an interactive course on Educative.io](https://www.educative.io/collection/5687753853370368/5707702298738688)**).
- Redux maintainer Mark Erikson's **["Practical Redux" tutorial series](http://blog.isquaredsoftware.com/series/practical-redux/)** demonstrates real-world intermediate and advanced techniques for working with React and Redux (also available as **[an interactive course on Educative.io](https://www.educative.io/collection/5687753853370368/5707702298738688)**).
- The **[React/Redux links list](https://github.com/markerikson/react-redux-links)** has categorized articles on working with [reducers and selectors](https://github.com/markerikson/react-redux-links/blob/master/redux-reducers-selectors.md), [managing side effects](https://github.com/markerikson/react-redux-links/blob/master/redux-side-effects.md), [Redux architecture and best practices](https://github.com/markerikson/react-redux-links/blob/master/redux-architecture.md), and more.
- Our community has created thousands of Redux-related libraries, addons, and tools. The **["Ecosystem" docs page](./Ecosystem.md)** lists our recommendations, and there's a complete listing available in the **[Redux addons catalog](https://github.com/markerikson/redux-ecosystem-links)**.
- If you're looking to learn from actual application codebases, the addons catalog also has a list of **[purpose-built examples and real-world applications](https://github.com/markerikson/redux-ecosystem-links/blob/master/apps-and-examples.md)**.

## Help and Discussion

Expand Down
24 changes: 22 additions & 2 deletions docs/introduction/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,33 @@ hide_title: true

# Installation

## Redux Toolkit

Redux Toolkit includes the Redux core, as well as other key packages we feel are essential for building Redux applications (such as Redux Thunk and Reselect).

It's available as a package on NPM for use with a module bundler or in a Node application:

```bash
# NPM
npm install @reduxjs/toolkit

# Yarn
yarn add @reduxjs/toolkit
```

It's also available as a UMD build, which can be loaded from [the `dist` folder on unpkg](https://unpkg.com/@reduxjs/toolkit/dist/). The UMD builds make Redux Toolkit available as a `window.RTK` global variable.

## Redux Core

To install the stable version:

```bash
# NPM
npm install redux
```

This assumes you are using [npm](https://www.npmjs.com/) as your package manager.
# Yarn
yarn add redux
```

If you're not, you can [access these files on unpkg](https://unpkg.com/redux/), download them, or point your package manager to them.

Expand Down
1 change: 1 addition & 0 deletions docs/style-guide/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: style-guide
title: Style Guide
description: 'Redux Style Guide: recommended patterns and best practices for using Redux'
hide_title: true
sidebar_label: 'Style Guide: Best Practices'
---

<div class="style-guide">
Expand Down
Loading