Skip to content

Commit 9bfd6f2

Browse files
committed
Updated readme
Updated readme Updated readme Updated readme
1 parent d006d81 commit 9bfd6f2

File tree

2 files changed

+66
-88
lines changed

2 files changed

+66
-88
lines changed

README.md

+33-44
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
## React & Redux in TypeScript - Static Typing Guide
22

3-
_"This guide is a **living compendium** documenting the most important patterns and recipes on how to use **React** (and its Ecosystem) in a **functional style with TypeScript** and to make your code **completely type-safe** while focusing on a **conciseness of type annotations** so it's a minimal effort to write and to maintain types in the long run."_
3+
_"This guide is a **living compendium** documenting the most important patterns and recipes on how to use **React** (and its Ecosystem) in a **functional style** using **TypeScript**. It will help you make your code **completely type-safe** while focusing on **inferring the types from implementation** so there is less noise coming from excessive type annotations and it's easier to write and maintain correct types in the long run."_
44

55
[![Join the chat at https://gitter.im/react-redux-typescript-guide/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/react-redux-typescript-guide/Lobby)
6+
> #### _Found it useful? Want more updates?_ [**Show your support by giving a :star:**](https://github.com/piotrwitek/react-redux-typescript-guide/stargazers)
67
7-
> #### _Found it useful? Want more updates?_ [**Show your support by giving a :star:**](https://github.com/piotrwitek/react-redux-typescript-patterns/stargazers)
8+
:tada: _Now updated to be compatible with **TypeScript v3.1.6**_ :tada:
89

9-
> _[The Mighty Tutorial](https://github.com/piotrwitek/typesafe-actions#behold-the-mighty-tutorial) for completely typesafe Redux Architecture_ :book:
10-
11-
> _Reference implementation of Todo-App with `typesafe-actions`: https://codesandbox.io/s/github/piotrwitek/typesafe-actions-todo-app_ :computer:
12-
13-
> _Now compatible with **TypeScript v2.8.3** (rewritten using conditional types)_ :tada:
10+
:computer: _Reference implementation of Todo-App with `typesafe-actions`: https://codesandbox.io/s/github/piotrwitek/typesafe-actions-todo-app_ :computer:
1411

1512
### Goals
1613
- Complete type safety (with [`--strict`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) flag) without losing type information downstream through all the layers of our application (e.g. no type assertions or hacking with `any` type)
1714
- Make type annotations concise by eliminating redundancy in types using advanced TypeScript Language features like **Type Inference** and **Control flow analysis**
1815
- Reduce repetition and complexity of types with TypeScript focused [complementary libraries](#complementary-libraries)
1916

20-
### Complementary Projects
21-
- Typesafe Action Creators for Redux / Flux Architectures [typesafe-actions](https://github.com/piotrwitek/typesafe-actions)
22-
- Utility Types for TypeScript: [utility-types](https://github.com/piotrwitek/utility-types)
23-
- Reference implementation of Todo-App: [typesafe-actions-todo-app](https://github.com/piotrwitek/typesafe-actions-todo-app)
17+
### Complementary Libraries
18+
- [utility-types](https://github.com/piotrwitek/utility-types) - Collection of generic types for TypeScript, complementing built-in mapped types and aliases - think lodash for reusable types.
19+
- [typesafe-actions](https://github.com/piotrwitek/typesafe-actions) - Typesafe utilities for "action-creators" in Redux / Flux Architecture
2420

2521
### Playground Project
2622
[![Build Status](https://semaphoreci.com/api/v1/piotrekwitek/react-redux-typescript-guide/branches/master/shields_badge.svg)](https://semaphoreci.com/piotrekwitek/react-redux-typescript-guide)
@@ -29,46 +25,45 @@ You should check out Playground Project located in the `/playground` folder. It
2925
> Playground was created in such a way that you can simply clone the repository locally and immediately play around on your own. It will help you to learn all the examples from this guide in a real project environment without the need to create some complicated environment setup by yourself.
3026
3127
## Contributing Guide
32-
If you're planning to contribute please make sure to read the contributing guide: [CONTRIBUTING.md](/CONTRIBUTING.md)
28+
We are open for contributions. If you're planning to contribute please make sure to read the contributing guide: [CONTRIBUTING.md](/CONTRIBUTING.md)
3329

3430
## Sponsor
35-
If you like what we're doing here, you can help us by funding the work on specific issues that you choose by using IssueHunt.io!
31+
This is an independent open-source project created by people investing their free time for the benefit of our community.
3632

37-
This gives you the power to prioritize our work and support the project contributors. Moreover it'll guarantee the project will be updated and maintained in the long run.
33+
If you are using it please consider donating as this will guarantee the project will be updated and maintained in the long run.
3834

39-
> Sponsors are listed in the contributors section at the bottom. If you want to be removed please contact me at: [email protected]
35+
Issues can be funded by anyone and the money will be transparently distributed to the contributors handling a particular issue.
4036

41-
[![issuehunt-image](https://github.com/BoostIO/issuehunt-materials/blob/master/issuehunt-[email protected]?raw=true)](https://issuehunt.io/repos/76996763)
37+
[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/76996763)
4238

4339
---
4440

4541
## Table of Contents
46-
- [Type Definitions & Complementary Libraries](#type-definitions--complementary-libraries)
47-
- [React Types Cheatsheet](#react-types-cheatsheet) 🌟 __NEW__
48-
- [Component Typing Patterns](#component-typing-patterns)
42+
- [Introduction](#introduction)
43+
- [React - Type-Definitions Cheatsheet](#react---type-definitions-cheatsheet)
44+
- [React - Typing Patterns](#react---typing-patterns)
4945
- [Function Components - FC](#function-components---fc)
50-
- [Class Components ](#class-components) 📝 __UPDATED__
46+
- [Class Components ](#class-components)
5147
- [Generic Components](#generic-components)
52-
- [Render Props](#render-props) 🌟 __NEW__
53-
- [Higher-Order Components](#higher-order-components) 📝 __UPDATED__
48+
- [Render Props](#render-props)
49+
- [Higher-Order Components](#higher-order-components)
5450
- [Redux Connected Components](#redux-connected-components)
55-
- [Context](#context)
56-
- [Hooks](#hooks)
57-
- [Redux](#redux)
58-
- [Action Creators](#action-creators) 📝 __UPDATED__
59-
- [Reducers](#reducers) 📝 __UPDATED__
51+
- [Context](#context) 🌟 __NEW__
52+
- [Hooks](#hooks) 🌟 __NEW__
53+
- [Redux - Typing Patterns](#redux---typing-patterns)
54+
- [Action Creators](#action-creators)
55+
- [Reducers](#reducers)
6056
- [State with Type-level Immutability](#state-with-type-level-immutability)
6157
- [Typing reducer](#typing-reducer)
6258
- [Testing reducer](#testing-reducer)
63-
- [Store Configuration](#store-configuration) 📝 __UPDATED__
64-
- [Async Flow](#async-flow) 📝 __UPDATED__
59+
- [Store Configuration](#store-configuration)
60+
- [Async Flow](#async-flow)
6561
- [Selectors](#selectors)
66-
- [Typing connect](#typing-connect) 🌟 __NEW__
62+
- [Typing connect](#typing-connect)
6763
- [Tools](#tools)
6864
- [TSLint](#tslint)
6965
- [Jest](#jest)
70-
- [Enzyme](#enzyme)
71-
- [Living Style Guide](#living-style-guide) 🌟 __NEW__
66+
- [Living Style Guide](#living-style-guide)
7267
- [Common Npm Scripts](#common-npm-scripts)
7368
- [Recipes](#recipes)
7469
- [Baseline tsconfig.json](#baseline-tsconfigjson)
@@ -81,9 +76,9 @@ This gives you the power to prioritize our work and support the project contribu
8176

8277
---
8378

84-
# Type Definitions & Complementary Libraries
79+
# Introduction
8580

86-
### Type Definitions for React & Redux
81+
### Type-Definitions for React & Redux
8782
```
8883
npm i -D @types/react @types/react-dom @types/react-redux
8984
```
@@ -93,19 +88,13 @@ npm i -D @types/react @types/react-dom @types/react-redux
9388
"redux" - (types included with npm package)*
9489
"react-redux" - `@types/react-redux`
9590

96-
> *NB: Guide is based on types from Redux v4.x.x (Beta). To make it work with Redux v3.x.x please refer to [this config](https://github.com/piotrwitek/react-redux-typescript-guide/blob/master/playground/tsconfig.json#L5))
97-
98-
### Complementary Libraries
99-
> Utility libraries **with focus on type-safety** providing a light functional abstractions for common use-cases
100-
101-
- ["utility-types"](https://github.com/piotrwitek/utility-types) - Utility Types for TypeScript (think lodash for types, moreover provides migration from Flow's Utility Types)
102-
- ["typesafe-actions"](https://github.com/piotrwitek/typesafe-actions) - Typesafe Action Creators for Redux / Flux Architectures (in TypeScript)
91+
> *NB: Guide is based on types for Redux >= v4.x.x. To make it work with Redux v3.x.x please refer to [this config](https://github.com/piotrwitek/react-redux-typescript-guide/blob/master/playground/tsconfig.json#L5))
10392
10493
[⇧ back to top](#table-of-contents)
10594

10695
---
10796

108-
# React Types Cheatsheet
97+
# React - Type-Definitions Cheatsheet
10998

11099
#### `React.FunctionComponent<P>` or `React.FC<P>`
111100
Type representing a functional component
@@ -173,7 +162,7 @@ const handleChange = (ev: React.MouseEvent<HTMLDivElement>) => { ... }
173162
174163
---
175164
176-
# Component Typing Patterns
165+
# React - Typing Patterns
177166
178167
## Function Components - FC
179168
@@ -970,7 +959,7 @@ export default function ThemeToggleButton(props: Props) {
970959
971960
---
972961
973-
# Redux
962+
# Redux - Typing Patterns
974963
975964
## Action Creators
976965

README_SOURCE.md

+33-44
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
## React & Redux in TypeScript - Static Typing Guide
22

3-
_"This guide is a **living compendium** documenting the most important patterns and recipes on how to use **React** (and its Ecosystem) in a **functional style with TypeScript** and to make your code **completely type-safe** while focusing on a **conciseness of type annotations** so it's a minimal effort to write and to maintain types in the long run."_
3+
_"This guide is a **living compendium** documenting the most important patterns and recipes on how to use **React** (and its Ecosystem) in a **functional style** using **TypeScript**. It will help you make your code **completely type-safe** while focusing on **inferring the types from implementation** so there is less noise coming from excessive type annotations and it's easier to write and maintain correct types in the long run."_
44

55
[![Join the chat at https://gitter.im/react-redux-typescript-guide/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/react-redux-typescript-guide/Lobby)
6+
> #### _Found it useful? Want more updates?_ [**Show your support by giving a :star:**](https://github.com/piotrwitek/react-redux-typescript-guide/stargazers)
67
7-
> #### _Found it useful? Want more updates?_ [**Show your support by giving a :star:**](https://github.com/piotrwitek/react-redux-typescript-patterns/stargazers)
8+
:tada: _Now updated to be compatible with **TypeScript v3.1.6**_ :tada:
89

9-
> _[The Mighty Tutorial](https://github.com/piotrwitek/typesafe-actions#behold-the-mighty-tutorial) for completely typesafe Redux Architecture_ :book:
10-
11-
> _Reference implementation of Todo-App with `typesafe-actions`: https://codesandbox.io/s/github/piotrwitek/typesafe-actions-todo-app_ :computer:
12-
13-
> _Now compatible with **TypeScript v2.8.3** (rewritten using conditional types)_ :tada:
10+
:computer: _Reference implementation of Todo-App with `typesafe-actions`: https://codesandbox.io/s/github/piotrwitek/typesafe-actions-todo-app_ :computer:
1411

1512
### Goals
1613
- Complete type safety (with [`--strict`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) flag) without losing type information downstream through all the layers of our application (e.g. no type assertions or hacking with `any` type)
1714
- Make type annotations concise by eliminating redundancy in types using advanced TypeScript Language features like **Type Inference** and **Control flow analysis**
1815
- Reduce repetition and complexity of types with TypeScript focused [complementary libraries](#complementary-libraries)
1916

20-
### Complementary Projects
21-
- Typesafe Action Creators for Redux / Flux Architectures [typesafe-actions](https://github.com/piotrwitek/typesafe-actions)
22-
- Utility Types for TypeScript: [utility-types](https://github.com/piotrwitek/utility-types)
23-
- Reference implementation of Todo-App: [typesafe-actions-todo-app](https://github.com/piotrwitek/typesafe-actions-todo-app)
17+
### Complementary Libraries
18+
- [utility-types](https://github.com/piotrwitek/utility-types) - Collection of generic types for TypeScript, complementing built-in mapped types and aliases - think lodash for reusable types.
19+
- [typesafe-actions](https://github.com/piotrwitek/typesafe-actions) - Typesafe utilities for "action-creators" in Redux / Flux Architecture
2420

2521
### Playground Project
2622
[![Build Status](https://semaphoreci.com/api/v1/piotrekwitek/react-redux-typescript-guide/branches/master/shields_badge.svg)](https://semaphoreci.com/piotrekwitek/react-redux-typescript-guide)
@@ -29,46 +25,45 @@ You should check out Playground Project located in the `/playground` folder. It
2925
> Playground was created in such a way that you can simply clone the repository locally and immediately play around on your own. It will help you to learn all the examples from this guide in a real project environment without the need to create some complicated environment setup by yourself.
3026
3127
## Contributing Guide
32-
If you're planning to contribute please make sure to read the contributing guide: [CONTRIBUTING.md](/CONTRIBUTING.md)
28+
We are open for contributions. If you're planning to contribute please make sure to read the contributing guide: [CONTRIBUTING.md](/CONTRIBUTING.md)
3329

3430
## Sponsor
35-
If you like what we're doing here, you can help us by funding the work on specific issues that you choose by using IssueHunt.io!
31+
This is an independent open-source project created by people investing their free time for the benefit of our community.
3632

37-
This gives you the power to prioritize our work and support the project contributors. Moreover it'll guarantee the project will be updated and maintained in the long run.
33+
If you are using it please consider donating as this will guarantee the project will be updated and maintained in the long run.
3834

39-
> Sponsors are listed in the contributors section at the bottom. If you want to be removed please contact me at: [email protected]
35+
Issues can be funded by anyone and the money will be transparently distributed to the contributors handling a particular issue.
4036

41-
[![issuehunt-image](https://github.com/BoostIO/issuehunt-materials/blob/master/issuehunt-[email protected]?raw=true)](https://issuehunt.io/repos/76996763)
37+
[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/76996763)
4238

4339
---
4440

4541
## Table of Contents
46-
- [Type Definitions & Complementary Libraries](#type-definitions--complementary-libraries)
47-
- [React Types Cheatsheet](#react-types-cheatsheet) 🌟 __NEW__
48-
- [Component Typing Patterns](#component-typing-patterns)
42+
- [Introduction](#introduction)
43+
- [React - Type-Definitions Cheatsheet](#react---type-definitions-cheatsheet)
44+
- [React - Typing Patterns](#react---typing-patterns)
4945
- [Function Components - FC](#function-components---fc)
50-
- [Class Components ](#class-components) 📝 __UPDATED__
46+
- [Class Components ](#class-components)
5147
- [Generic Components](#generic-components)
52-
- [Render Props](#render-props) 🌟 __NEW__
53-
- [Higher-Order Components](#higher-order-components) 📝 __UPDATED__
48+
- [Render Props](#render-props)
49+
- [Higher-Order Components](#higher-order-components)
5450
- [Redux Connected Components](#redux-connected-components)
55-
- [Context](#context)
56-
- [Hooks](#hooks)
57-
- [Redux](#redux)
58-
- [Action Creators](#action-creators) 📝 __UPDATED__
59-
- [Reducers](#reducers) 📝 __UPDATED__
51+
- [Context](#context) 🌟 __NEW__
52+
- [Hooks](#hooks) 🌟 __NEW__
53+
- [Redux - Typing Patterns](#redux---typing-patterns)
54+
- [Action Creators](#action-creators)
55+
- [Reducers](#reducers)
6056
- [State with Type-level Immutability](#state-with-type-level-immutability)
6157
- [Typing reducer](#typing-reducer)
6258
- [Testing reducer](#testing-reducer)
63-
- [Store Configuration](#store-configuration) 📝 __UPDATED__
64-
- [Async Flow](#async-flow) 📝 __UPDATED__
59+
- [Store Configuration](#store-configuration)
60+
- [Async Flow](#async-flow)
6561
- [Selectors](#selectors)
66-
- [Typing connect](#typing-connect) 🌟 __NEW__
62+
- [Typing connect](#typing-connect)
6763
- [Tools](#tools)
6864
- [TSLint](#tslint)
6965
- [Jest](#jest)
70-
- [Enzyme](#enzyme)
71-
- [Living Style Guide](#living-style-guide) 🌟 __NEW__
66+
- [Living Style Guide](#living-style-guide)
7267
- [Common Npm Scripts](#common-npm-scripts)
7368
- [Recipes](#recipes)
7469
- [Baseline tsconfig.json](#baseline-tsconfigjson)
@@ -81,9 +76,9 @@ This gives you the power to prioritize our work and support the project contribu
8176

8277
---
8378

84-
# Type Definitions & Complementary Libraries
79+
# Introduction
8580

86-
### Type Definitions for React & Redux
81+
### Type-Definitions for React & Redux
8782
```
8883
npm i -D @types/react @types/react-dom @types/react-redux
8984
```
@@ -93,19 +88,13 @@ npm i -D @types/react @types/react-dom @types/react-redux
9388
"redux" - (types included with npm package)*
9489
"react-redux" - `@types/react-redux`
9590

96-
> *NB: Guide is based on types from Redux v4.x.x (Beta). To make it work with Redux v3.x.x please refer to [this config](https://github.com/piotrwitek/react-redux-typescript-guide/blob/master/playground/tsconfig.json#L5))
97-
98-
### Complementary Libraries
99-
> Utility libraries **with focus on type-safety** providing a light functional abstractions for common use-cases
100-
101-
- ["utility-types"](https://github.com/piotrwitek/utility-types) - Utility Types for TypeScript (think lodash for types, moreover provides migration from Flow's Utility Types)
102-
- ["typesafe-actions"](https://github.com/piotrwitek/typesafe-actions) - Typesafe Action Creators for Redux / Flux Architectures (in TypeScript)
91+
> *NB: Guide is based on types for Redux >= v4.x.x. To make it work with Redux v3.x.x please refer to [this config](https://github.com/piotrwitek/react-redux-typescript-guide/blob/master/playground/tsconfig.json#L5))
10392
10493
[⇧ back to top](#table-of-contents)
10594

10695
---
10796

108-
# React Types Cheatsheet
97+
# React - Type-Definitions Cheatsheet
10998

11099
#### `React.FunctionComponent<P>` or `React.FC<P>`
111100
Type representing a functional component
@@ -173,7 +162,7 @@ const handleChange = (ev: React.MouseEvent<HTMLDivElement>) => { ... }
173162
174163
---
175164
176-
# Component Typing Patterns
165+
# React - Typing Patterns
177166
178167
## Function Components - FC
179168
@@ -363,7 +352,7 @@ Hook for state management like Redux in a function component.
363352
364353
---
365354
366-
# Redux
355+
# Redux - Typing Patterns
367356
368357
## Action Creators
369358

0 commit comments

Comments
 (0)