You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
5
4
6
5
## Warning
7
6
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.
10
8
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.**
13
10
14
11
## Running a codemod
15
12
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.
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.
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 \(`.`\).
We use Storybook as a development environment, particularly for the DevTools. Spin it up using:
27
27
28
-
```sh
28
+
```bash
29
29
yarn storybook
30
30
```
31
31
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).
34
33
35
34
### Linting
36
35
37
36
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:
38
37
39
-
```plaintext
38
+
```text
40
39
"eslint.autoFixOnSave": true,
41
40
"eslint.packageManager": "yarn",
42
41
"eslint.options": {
@@ -59,15 +58,15 @@ This should enable auto-fix for all source files, and give linting warnings and
59
58
60
59
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.
61
60
62
-
```sh
61
+
```bash
63
62
yarn test --watch
64
63
```
65
64
66
65
In general, this is sufficient during development. Travis CI will apply a more rigorous set of tests.
67
66
68
67
#### Testing for compatibility
69
68
70
-
```sh
69
+
```bash
71
70
yarn test:compat
72
71
```
73
72
@@ -79,7 +78,7 @@ In the `examples` folder, you will find sample React applications that use React
79
78
80
79
To run sample examples on your local environments
81
80
82
-
```sh
81
+
```bash
83
82
yarn build:examples
84
83
yarn test:examples
85
84
yarn start:examples
@@ -88,3 +87,4 @@ yarn start:examples
88
87
### Resolving issues
89
88
90
89
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.
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.
Copy file name to clipboardExpand all lines: examples/with-abortcontroller.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,5 @@
2
2
3
3
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.
0 commit comments