Skip to content

Commit 055c425

Browse files
ghengeveldgitbook-bot
authored andcommittedOct 5, 2019
GitBook: [master] 25 pages modified
1 parent 5d6ac7e commit 055c425

21 files changed

+344
-447
lines changed
 

‎.github/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# .github
2+

‎.github/pull_request_template.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Description
1+
# pull\_request\_template
22

3-
Describe the feature / improvement / bugfix you did. This will be in the release notes.
4-
Please refer to an issue number if there is one.
3+
## Description
54

6-
## Breaking changes
5+
Describe the feature / improvement / bugfix you did. This will be in the release notes. Please refer to an issue number if there is one.
76

8-
Does this include any (potentially) breaking API changes?
7+
### Breaking changes
98

10-
# Checklist
9+
Does this include any \(potentially\) breaking API changes?
10+
11+
## Checklist
1112

1213
Make sure you check all the boxes. You can omit items that are not applicable.
1314

14-
- [ ] Implementation for both `<Async>` and `useAsync()`
15-
- [ ] Added / updated the unit tests
16-
- [ ] Added / updated the documentation
17-
- [ ] Updated the PropTypes
18-
- [ ] Updated the TypeScript type definitions
15+
* [ ] Implementation for both `<Async>` and `useAsync()`
16+
* [ ] Added / updated the unit tests
17+
* [ ] Added / updated the documentation
18+
* [ ] Updated the PropTypes
19+
* [ ] Updated the TypeScript type definitions
20+

‎README.md

+247-363
Large diffs are not rendered by default.

‎SUMMARY.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Table of contents
2+
3+
* [README](README.md)
4+
* [examples](examples/README.md)
5+
* [README](examples/with-react-router.md)
6+
* [React Async with Next.js](examples/with-nextjs.md)
7+
* [Movie app using React Async](examples/movie-app.md)
8+
* [Using React Async with TypeScript](examples/with-typescript.md)
9+
* [Basic fetch with useAsync hook](examples/basic-hook.md)
10+
* [Custom React Async instance](examples/custom-instance.md)
11+
* [Abortable fetch with React Async](examples/with-abortcontroller.md)
12+
* [Basic fetch with React Async](examples/basic-fetch.md)
13+
* [React Async codemods](codemods.md)
14+
* [Contributing to React Async](contributing.md)
15+
* [.github](.github/README.md)
16+
* [pull\_request\_template](.github/pull_request_template.md)
17+
+7-12
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
# React Async codemods
22

3-
These codemods enable you to automatically upgrade your codebase to handle breaking changes in
4-
React Async's API.
3+
These codemods enable you to automatically upgrade your codebase to handle breaking changes in React Async's API.
54

65
## Warning
76

8-
Be aware: **codemods transform your source code in place**. Make sure that your files are in
9-
version control before running a codemod.
7+
Be aware: **codemods transform your source code in place**. Make sure that your files are in version control before running a codemod.
108

11-
These codemods come without warranty. They will work fine most of the time, but you should always
12-
verify their output. Also, **do not run a codemod more than once.**
9+
These codemods come without warranty. They will work fine most of the time, but you should always verify their output. Also, **do not run a codemod more than once.**
1310

1411
## Running a codemod
1512

16-
These codemods are based on [jscodeshift](https://github.com/facebook/jscodeshift). Refer to their
17-
docs for specifics.
13+
These codemods are based on [jscodeshift](https://github.com/facebook/jscodeshift). Refer to their docs for specifics.
1814

1915
```bash
2016
npx jscodeshift <target_dir> -t <transform_script>
2117
```
2218

23-
Where `<target_dir>` should be replaced with the path to your project's source directory and
24-
`<transform_script>` should be replaced by the URL of the codemod.
19+
Where `<target_dir>` should be replaced with the path to your project's source directory and `<transform_script>` should be replaced by the URL of the codemod.
2520

2621
For example:
2722

2823
```bash
2924
npx jscodeshift . -t https://raw.githubusercontent.com/async-library/react-async/master/codemods/v6.js
3025
```
3126

32-
This will apply the codemod for [v6](https://github.com/async-library/react-async/blob/master/codemods/v6.js)
33-
to the current working directory (`.`).
27+
This will apply the codemod for [v6](https://github.com/async-library/react-async/blob/master/codemods/v6.js) to the current working directory \(`.`\).
28+

‎CONTRIBUTING.md renamed to ‎contributing.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ This repo relies on Yarn workspaces, so you should [install](https://yarnpkg.com
66

77
## Development guide
88

9-
Please have the **_latest_** stable versions of the following on your machine
9+
Please have the _**latest**_ stable versions of the following on your machine
1010

11-
- node
12-
- yarn
11+
* node
12+
* yarn
1313

1414
### Initial setup
1515

1616
To start working on React Async, clone the repo and bootstrap the project:
1717

18-
```sh
18+
```bash
1919
git clone https://github.com/async-library/react-async.git
2020
cd react-async
2121
yarn && yarn bootstrap && yarn test
@@ -25,18 +25,17 @@ yarn && yarn bootstrap && yarn test
2525

2626
We use Storybook as a development environment, particularly for the DevTools. Spin it up using:
2727

28-
```sh
28+
```bash
2929
yarn storybook
3030
```
3131

32-
This should open up Storybook in a browser at http://localhost:6006/
33-
Run it side-by-side with `yarn test --watch` during development. See [Testing](#testing).
32+
This should open up Storybook in a browser at [http://localhost:6006/](http://localhost:6006/) Run it side-by-side with `yarn test --watch` during development. See [Testing](contributing.md#testing).
3433

3534
### Linting
3635

3736
Use `yarn lint` to verify your code style before committing. It's highly recommended to install the Prettier and ESLint plugins for your IDE. Travis CI will fail your build on lint errors. Configure VS Code with the following settings:
3837

39-
```plaintext
38+
```text
4039
"eslint.autoFixOnSave": true,
4140
"eslint.packageManager": "yarn",
4241
"eslint.options": {
@@ -59,15 +58,15 @@ This should enable auto-fix for all source files, and give linting warnings and
5958

6059
Use the following command to test all packages in watch mode. Refer to the [Jest CLI options](https://jestjs.io/docs/en/cli#options) for details.
6160

62-
```sh
61+
```bash
6362
yarn test --watch
6463
```
6564

6665
In general, this is sufficient during development. Travis CI will apply a more rigorous set of tests.
6766

6867
#### Testing for compatibility
6968

70-
```sh
69+
```bash
7170
yarn test:compat
7271
```
7372

@@ -79,7 +78,7 @@ In the `examples` folder, you will find sample React applications that use React
7978

8079
To run sample examples on your local environments
8180

82-
```sh
81+
```bash
8382
yarn build:examples
8483
yarn test:examples
8584
yarn start:examples
@@ -88,3 +87,4 @@ yarn start:examples
8887
### Resolving issues
8988

9089
Sometimes your dependencies might end up in a weird state, causing random issues, especially when working with the examples. In this case it often helps to run `yarn clean -y && yarn bootstrap`. This will delete `node_modules` from all packages/examples and do a clean install.
90+

‎examples/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# examples
2+

‎examples/basic-fetch.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Basic fetch with React Async
2+
3+
This demonstrates a very simple HTTP GET using `fetch`, wrapped with React Async.
4+
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/basic-fetch)
6+

‎examples/basic-fetch/README.md

-7
This file was deleted.

‎examples/basic-hook.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Basic fetch with useAsync hook
2+
3+
This demonstrates how to use the `useAsync` hook.
4+
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/basic-hook)
6+

‎examples/basic-hook/README.md

-7
This file was deleted.

‎examples/custom-instance.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Custom React Async instance
2+
3+
Demonstrates how to use a preconfigured React Async instance.
4+
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/custom-instance)
6+

‎examples/custom-instance/README.md

-7
This file was deleted.

‎examples/movie-app.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Movie app using React Async
2+
3+
This is a rebuild of the [React Suspense IO demo](https://reactjs.org/blog/2018/03/01/sneak-peek-beyond-react-16.html) by Dan Abramov at JSConf Iceland 2018, using React Async instead of Suspense.
4+
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/movie-app)
6+

‎examples/movie-app/README.md

-8
This file was deleted.

‎examples/with-abortcontroller/README.md renamed to ‎examples/with-abortcontroller.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
This demonstrates a very simple HTTP GET using `fetch`, which gets the AbortSignal passed in to actually abort the HTTP request when the promise is canceled.
44

5-
<a href="https://react-async.async-library.now.sh/examples/with-abortcontroller">
6-
<img src="https://img.shields.io/badge/live-demo-blue.svg" alt="live demo">
7-
</a>
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/with-abortcontroller)
6+

‎examples/with-nextjs.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# React Async with Next.js
2+
3+
This demonstrates how React Async integrates with Next.js.
4+
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/with-nextjs)
6+

‎examples/with-nextjs/README.md

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## An example of using `react-async` with `react-router` (built with parcel)
1+
# README
22

3-
The idea is to make fetching data for pages (components) configurable in a declarative way.
3+
## An example of using `react-async` with `react-router` \(built with parcel\)
44

5-
```
5+
The idea is to make fetching data for pages \(components\) configurable in a declarative way.
6+
7+
```text
68
<Router>
79
...
810
<ApiRouter path="/repositories" fetchUrl="https://api.github.com/repositories" component={RepositoriesComponent} />
@@ -11,9 +13,10 @@ The idea is to make fetching data for pages (components) configurable in a decla
1113

1214
## Running the example
1315

14-
```
16+
```text
1517
npm install
1618
npm start
1719
```
1820

1921
Then visit [http://localhost:1234](http://localhost:1234).
22+

‎examples/with-typescript.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Using React Async with TypeScript
2+
3+
This demonstrates how React Async integrates with TypeScript.
4+
5+
[![](https://img.shields.io/badge/live-demo-blue.svg)](https://react-async.async-library.now.sh/examples/with-typescript)
6+

‎examples/with-typescript/README.md

-7
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.