Skip to content

Rename "Recipes" category to "Using Redux" #4118

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

Merged
merged 4 commits into from
Jun 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ For more details, see [the Installation docs page](https://redux.js.org/introduc
The Redux docs are located at **https://redux.js.org**:

- [Introduction](https://redux.js.org/introduction/getting-started)
- [Recipes](https://redux.js.org/recipes/recipe-index)
- [Tutorials](https://redux.js.org/tutorials/index)
- [Usage Guides](https://redux.js.org/usage/index)
- [FAQ](https://redux.js.org/faq)
- [API Reference](https://redux.js.org/api/api-reference)

For PDF, ePub, and MOBI exports for offline reading, and instructions on how to create them, please see: [paulkogel/redux-offline-docs](https://github.com/paulkogel/redux-offline-docs).

For Offline docs, please see: [devdocs](https://devdocs.io/redux/)

## Learn Redux

### Redux Essentials Tutorial
Expand All @@ -62,7 +59,7 @@ The [**Redux Fundamentals tutorial**](https://redux.js.org/tutorials/fundamental

### Other Resources

- The **[Redux FAQ](https://redux.js.org/faq)** answers many common questions about how to use Redux, and the **["Recipes" docs section](https://redux.js.org/recipes/recipe-index)** has information on handling derived data, testing, structuring reducer logic, and reducing boilerplate.
- The **[Redux FAQ](https://redux.js.org/faq)** answers many common questions about how to use Redux, and the **["Using Redux" docs section](https://redux.js.org/usage/index)** has information on handling derived data, testing, structuring reducer logic, and reducing boilerplate.
- Redux maintainer Mark Erikson's **["Practical Redux" tutorial series](https://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](https://redux.js.org/introduction/ecosystem)** lists our recommendations, and also there's a complete listing available in the **[Redux addons catalog](https://github.com/markerikson/redux-ecosystem-links)**.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/createStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ console.log(store.getState())

- Redux state is normally plain JS objects and arrays.

- If your state is a plain object, make sure you never mutate it! For example, instead of returning something like `Object.assign(state, newData)` from your reducers, return `Object.assign({}, state, newData)`. This way you don't override the previous `state`. You can also write `return { ...state, ...newData }` if you enable the [object spread operator proposal](../recipes/UsingObjectSpreadOperator.md).
- If your state is a plain object, make sure you never mutate it! Immutable updates require making copies of each level of data, typically using the object spread operator ( `return { ...state, ...newData }` ).

- For universal apps that run on the server, create a store instance with every request so that they are isolated. Dispatch a few data fetching actions to a store instance and wait for them to complete before rendering the app on the server.

Expand Down
4 changes: 2 additions & 2 deletions docs/faq/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Encapsulating and centralizing commonly used pieces of code is a key concept in

**Documentation**

- [Reducing Boilerplate](../recipes/ReducingBoilerplate.md#actions)
- [Using Redux: Reducing Boilerplate](../usage/ReducingBoilerplate.md#actions)

**Discussion**

Expand All @@ -55,7 +55,7 @@ No. We suggest you write independent small reducer functions that are each respo
**Documentation**

- [Fundamentals: State, Actions, Reducers](../tutorials/fundamentals/part-3-state-actions-reducers.md)
- [Recipes: Structuring Reducers](../recipes/structuring-reducers/StructuringReducers.md)
- [Using Redux: Structuring Reducers](../usage/structuring-reducers/StructuringReducers.md)

**Discussions**

Expand Down
4 changes: 2 additions & 2 deletions docs/faq/DesignDecisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The [curried function signature](https://github.com/reactjs/redux/issues/1744) o

### Why doesn't `combineReducers` include a third argument with the entire state when it calls each reducer?

`combineReducers` is opinionated to encourage splitting reducer logic by domain. As stated in [Beyond `combineReducers`](../recipes/structuring-reducers/BeyondCombineReducers.md),`combineReducers` is deliberately limited to handle a single common use case: updating a state tree that is a plain Javascript object by delegating the work of updating each slice of state to a specific slice reducer.
`combineReducers` is opinionated to encourage splitting reducer logic by domain. As stated in [Beyond `combineReducers`](../usage/structuring-reducers/BeyondCombineReducers.md),`combineReducers` is deliberately limited to handle a single common use case: updating a state tree that is a plain Javascript object by delegating the work of updating each slice of state to a specific slice reducer.

It's not immediately obvious what a potential third argument to each reducer should be: the entire state tree, some callback function, some other part of the state tree, etc. If `combineReducers` doesn't fit your use case, consider using libraries like [combineSectionReducers](https://github.com/ryo33/combine-section-reducers) or [reduceReducers](https://github.com/acdlite/reduce-reducers) for other options with deeply nested reducers and reducers that require access to the global state.

Expand All @@ -103,7 +103,7 @@ If none of the published utilities solve your use case, you can always write a f

**Articles**

- [Beyond `combineReducers`](../recipes/structuring-reducers/BeyondCombineReducers.md)
- [Beyond `combineReducers`](../usage/structuring-reducers/BeyondCombineReducers.md)

**Discussions**

Expand Down
10 changes: 5 additions & 5 deletions docs/faq/ImmutableData.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ In particular, immutability in the context of a Web app enables sophisticated ch

**Documentation**

- [Recipes: Prerequisite Reducer Concepts](../recipes/structuring-reducers/PrerequisiteConcepts.md)
- [Using Redux: Prerequisite Reducer Concepts](../usage/structuring-reducers/PrerequisiteConcepts.md)

**Discussions**

Expand Down Expand Up @@ -274,8 +274,8 @@ The store will still be updated with the new values for the root state, but beca

**Documentation**

- [Recipes: Immutable Update Patterns](../recipes/structuring-reducers/ImmutableUpdatePatterns.md)
- [Troubleshooting: Never mutate reducer arguments](../recipes/Troubleshooting.md#never-mutate-reducer-arguments)
- [Using Redux: Immutable Update Patterns](../usage/structuring-reducers/ImmutableUpdatePatterns.md)
- [Troubleshooting: Never mutate reducer arguments](../usage/Troubleshooting.md#never-mutate-reducer-arguments)

### Why does a reducer mutating the state prevent React-Redux from re-rendering a wrapped component?

Expand Down Expand Up @@ -451,7 +451,7 @@ JavaScript was never designed to provide guaranteed immutable operations. Accord

With JavaScript, you can accidentally mutate an object (such as the Redux state tree) quite easily without realizing it. For example, updating deeply nested properties, creating a new _reference_ to an object instead of a new object, or performing a shallow copy rather than a deep copy, can all lead to inadvertent object mutations, and can trip up even the most experienced JavaScript coder.

To avoid these issues, ensure you follow the recommended [immutable update patterns for ES6](../recipes/structuring-reducers/ImmutableUpdatePatterns.md).
To avoid these issues, ensure you follow the recommended [immutable update patterns for ES6](../usage/structuring-reducers/ImmutableUpdatePatterns.md).

### Verbose Code

Expand All @@ -469,7 +469,7 @@ In contrast, immutable libraries such as Immer can employ structural sharing, wh

**Documentation**

- [Immutable Update Patterns for ES6](../recipes/structuring-reducers/ImmutableUpdatePatterns.md)
- [Immutable Update Patterns for ES6](../usage/structuring-reducers/ImmutableUpdatePatterns.md)

**Articles**

Expand Down
4 changes: 2 additions & 2 deletions docs/faq/OrganizingState.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Data with IDs, nesting, or relationships should generally be stored in a “norm
- [Redux Fundamentals: Async Logic and Data Flow](../tutorials/fundamentals/part-6-async-logic.md)
- [Redux Fundamentals: Standard Redux Patterns](../tutorials/fundamentals/part-7-standard-patterns.md)
- [Examples: Real World example](../introduction/Examples.md#real-world)
- [Recipes: Structuring Reducers - Prerequisite Concepts](../recipes/structuring-reducers/PrerequisiteConcepts.md#normalizing-data)
- [Recipes: Structuring Reducers - Normalizing State Shape](../recipes/structuring-reducers/NormalizingStateShape.md)
- [Using Redux: Structuring Reducers - Prerequisite Concepts](../usage/structuring-reducers/PrerequisiteConcepts.md#normalizing-data)
- [Using Redux: Structuring Reducers - Normalizing State Shape](../usage/structuring-reducers/NormalizingStateShape.md)
- [Examples: Tree View](https://github.com/reduxjs/redux/tree/master/examples/tree-view)

**Articles**
Expand Down
8 changes: 4 additions & 4 deletions docs/faq/Performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ As for architecture, anecdotal evidence is that Redux works well for varying pro

**Documentation**

- [Recipes: Structuring Reducers - Normalizing State Shape](../recipes/structuring-reducers/NormalizingStateShape.md)
- [Using Redux: Structuring Reducers - Normalizing State Shape](../usage/structuring-reducers/NormalizingStateShape.md)

**Articles**

Expand Down Expand Up @@ -103,8 +103,8 @@ However, you _do_ need to create a copied and updated object for each level of n

**Documentation**

- [Recipes: Structuring Reducers - Prerequisite Concepts](../recipes/structuring-reducers/PrerequisiteConcepts.md)
- [Recipes: Structuring Reducers - Immutable Update Patterns](../recipes/structuring-reducers/ImmutableUpdatePatterns.md)
- [Using Redux: Structuring Reducers - Prerequisite Concepts](../usage/structuring-reducers/PrerequisiteConcepts.md)
- [Using Redux: Structuring Reducers - Immutable Update Patterns](../usage/structuring-reducers/ImmutableUpdatePatterns.md)

**Discussions**

Expand Down Expand Up @@ -183,7 +183,7 @@ First, only cache as much data as the user needs. If your application displays a

Second, cache an abbreviated form of a record when possible. Sometimes a record includes data that is not relevant to the user. If the application does not depend on this data, it can be omitted from the cache.

Third, only cache a single copy of a record. This is especially important when records contain copies of other records. Cache a unique copy for each record and replace each nested copy with a reference. This is called normalization. Normalization is the preferred approach to storing relational data for [several reasons](../recipes/structuring-reducers/NormalizingStateShape.md#designing-a-normalized-state), including efficient memory consumption.
Third, only cache a single copy of a record. This is especially important when records contain copies of other records. Cache a unique copy for each record and replace each nested copy with a reference. This is called normalization. Normalization is the preferred approach to storing relational data for [several reasons](../usage/structuring-reducers/NormalizingStateShape.md#designing-a-normalized-state), including efficient memory consumption.

#### Further information

Expand Down
9 changes: 4 additions & 5 deletions docs/faq/ReactRedux.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ Note that “updating data immutably” does _not_ mean that you must use [Immer

**Documentation**

- [Troubleshooting](../recipes/Troubleshooting.md)
- [Troubleshooting](../usage/Troubleshooting.md)
- [React Redux: Troubleshooting](https://react-redux.js.org/troubleshooting)
- [Recipes: Using the Object Spread Operator](../recipes/UsingObjectSpreadOperator.md)
- [Recipes: Structuring Reducers - Prerequisite Concepts](../recipes/structuring-reducers/PrerequisiteConcepts.md)
- [Recipes: Structuring Reducers - Immutable Update Patterns](../recipes/structuring-reducers/ImmutableUpdatePatterns.md)
- [Using Redux: Structuring Reducers - Prerequisite Concepts](../usage/structuring-reducers/PrerequisiteConcepts.md)
- [Using Redux: Structuring Reducers - Immutable Update Patterns](../usage/structuring-reducers/ImmutableUpdatePatterns.md)

**Articles**

Expand Down Expand Up @@ -131,7 +130,7 @@ While React Redux does work to minimize the number of times that your `mapStateT

**Documentation**

- [Recipes: Computed Derived Data](../recipes/ComputingDerivedData.md)
- [Using Redux: Computed Derived Data](../usage/ComputingDerivedData.md)

**Articles**

Expand Down
6 changes: 3 additions & 3 deletions docs/faq/Reducers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In general, remember that reducers are just functions—you can organize them an
**Documentation**

- [API: combineReducers](../api/combineReducers.md)
- [Recipes: Structuring Reducers](../recipes/structuring-reducers/StructuringReducers.md)
- [Using Redux: Structuring Reducers](../usage/structuring-reducers/StructuringReducers.md)

**Discussions**

Expand All @@ -53,8 +53,8 @@ No. You are welcome to use any approach you'd like to respond to an action in a

**Documentation**

- [Recipes: Reducing Boilerplate](../recipes/ReducingBoilerplate.md)
- [Recipes: Structuring Reducers - Splitting Reducer Logic](../recipes/structuring-reducers/SplittingReducerLogic.md)
- [Using Redux: Reducing Boilerplate](../usage/ReducingBoilerplate.md)
- [Using Redux: Structuring Reducers - Splitting Reducer Logic](../usage/structuring-reducers/SplittingReducerLogic.md)

**Discussions**

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ npm install
npm start
```

This is a basic demonstration of [server rendering](../recipes/ServerRendering.md) with Redux and React. It shows how to prepare the initial store state on the server, and pass it down to the client so the client store can boot up from an existing state.
This is a basic demonstration of [server rendering](../usage/ServerRendering.md) with Redux and React. It shows how to prepare the initial store state on the server, and pass it down to the client so the client store can boot up from an existing state.

## Real World

Expand Down
4 changes: 1 addition & 3 deletions docs/introduction/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ description: 'Introduction > Getting Started: Resources to get started learning
import LiteYouTubeEmbed from 'react-lite-youtube-embed';
import 'react-lite-youtube-embed/dist/LiteYouTubeEmbed.css'

# Getting Started with Redux

Redux is a predictable state container for JavaScript apps.

It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as [live code editing combined with a time traveling debugger](https://github.com/reduxjs/redux-devtools).
Expand Down Expand Up @@ -203,7 +201,7 @@ See [the "Learn Modern Redux" show notes page](https://www.learnwithjason.dev/le

### Other Resources

- 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.
- The **[Redux FAQ](../FAQ.md)** answers many common questions about how to use Redux, and the **["Using Redux" docs section](../usage/index.md)** has information on handling derived data, testing, structuring reducer logic, and reducing boilerplate.
- Redux maintainer Mark Erikson's **["Practical Redux" tutorial series](https://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)**.
Expand Down
23 changes: 0 additions & 23 deletions docs/recipes/README.md

This file was deleted.

Loading