Skip to content

Commit f4b10c9

Browse files
authored
Merge pull request #275 from async-library/next
Release v10.0.1
2 parents 320222a + 19b1435 commit f4b10c9

File tree

21 files changed

+155
-82
lines changed

21 files changed

+155
-82
lines changed

.all-contributorsrc

+20-1
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,30 @@
231231
"code",
232232
"bug"
233233
]
234+
},
235+
{
236+
"login": "nealeu",
237+
"name": "Neale Upstone",
238+
"avatar_url": "https://avatars1.githubusercontent.com/u/264594?v=4",
239+
"profile": "https://github.com/nealeu",
240+
"contributions": [
241+
"code"
242+
]
243+
},
244+
{
245+
"login": "mbark",
246+
"name": "Martin Barksten",
247+
"avatar_url": "https://avatars1.githubusercontent.com/u/1579384?v=4",
248+
"profile": "https://github.com/mbark",
249+
"contributions": [
250+
"doc"
251+
]
234252
}
235253
],
236254
"contributorsPerLine": 7,
237255
"projectName": "react-async",
238256
"projectOwner": "async-library",
239257
"repoType": "github",
240-
"repoHost": "https://github.com"
258+
"repoHost": "https://github.com",
259+
"skipCi": true
241260
}

.circleci/config.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ jobs:
6969
- checkout
7070
- attach_workspace:
7171
at: .
72-
- run: yarn test:chromatic
72+
- run: |
73+
if [[ "${CIRCLE_BRANCH}" == renovate/* ]]; then
74+
echo "Skipping Chromatic"
75+
elif [ "${CIRCLE_BRANCH}" == "master" ]; then
76+
yarn test:chromatic --auto-accept-changes
77+
else
78+
yarn test:chromatic
79+
fi
7380
7481
workflows:
7582
version: 2

.storybook/config.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { configure } from "@storybook/react"
22

3-
import "storybook-chromatic"
4-
53
const req = require.context("../stories", true, /\.stories\.js$/)
64
configure(() => req.keys().forEach(filename => req(filename)), module)

README.md

+30-30
Large diffs are not rendered by default.

docs/getting-started/installation.md

+27
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,30 @@ yarn add react-async
1414

1515
> This package requires `react` as a peer dependency. Please make sure to install that as well. If you want to use the
1616
> `useAsync` hook, you'll need `[email protected]` or later.
17+
18+
## Transpiling for legacy browsers
19+
20+
This project targets the latest ECMAScript version. Our packages on npm do not contain ES5 code for legacy browsers. If you need to target a browser which does not support the latest version of ECMAScript, you'll have to handle transpilation yourself. Usually this will automatically be handled by the framework you use (CRA, Next.js, Gatsby), but sometimes you may need to tweak your Webpack settings to transpile `react-async` with Babel.
21+
22+
To transpile `node_modules` with Babel you need to use a `babel.config.js`, for more information see [Babel's documentation](https://babeljs.io/docs/en/configuration#whats-your-use-case).
23+
24+
In your `webpack.config.js` make sure that the rule for `babel-loader`:
25+
26+
- doesn't exclude `node_modules` from matching via the `exclude` pattern;
27+
- excludes `core-js` as it shouldn't be transpiled;
28+
- is passed the `configFile` option pointing to the `babel.config.js` file.
29+
30+
```
31+
{
32+
test: /\.(js|jsx)$/,
33+
exclude: /\/node_modules\/core-js\//,
34+
use: [{
35+
loader: 'babel-loader',
36+
options: {
37+
configFile: './babel.config.js',
38+
// Caching is recommended when transpiling node_modules to speed up consecutive builds
39+
cacheDirectory: true,
40+
}
41+
}]
42+
}
43+
```

examples/basic-fetch/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/basic-fetch",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -18,7 +19,7 @@
1819
"react-async": "^10.0.0",
1920
"react-async-devtools": "^10.0.0",
2021
"react-dom": "16.11.0",
21-
"react-scripts": "3.2.0"
22+
"react-scripts": "3.4.1"
2223
},
2324
"devDependencies": {
2425
"relative-deps": "0.2.0"

examples/basic-hook/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/basic-hook",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -18,7 +19,7 @@
1819
"react-async": "^10.0.0",
1920
"react-async-devtools": "^10.0.0",
2021
"react-dom": "16.11.0",
21-
"react-scripts": "3.2.0"
22+
"react-scripts": "3.4.1"
2223
},
2324
"devDependencies": {
2425
"relative-deps": "0.2.0"

examples/custom-instance/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/custom-instance",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -18,7 +19,7 @@
1819
"react-async": "^10.0.0",
1920
"react-async-devtools": "^10.0.0",
2021
"react-dom": "16.11.0",
21-
"react-scripts": "3.2.0"
22+
"react-scripts": "3.4.1"
2223
},
2324
"devDependencies": {
2425
"relative-deps": "0.2.0"

examples/movie-app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/movie-app",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -18,7 +19,7 @@
1819
"react-async": "^10.0.0",
1920
"react-async-devtools": "^10.0.0",
2021
"react-dom": "16.11.0",
21-
"react-scripts": "3.2.0"
22+
"react-scripts": "3.4.1"
2223
},
2324
"devDependencies": {
2425
"relative-deps": "0.2.0"

examples/with-abortcontroller/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/with-abortcontroller",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -18,7 +19,7 @@
1819
"react-async": "^10.0.0",
1920
"react-async-devtools": "^10.0.0",
2021
"react-dom": "16.11.0",
21-
"react-scripts": "3.2.0"
22+
"react-scripts": "3.4.1"
2223
},
2324
"devDependencies": {
2425
"relative-deps": "0.2.0"

examples/with-graphql/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/with-graphql",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -19,7 +20,7 @@
1920
"react-async": "^10.0.0",
2021
"react-async-devtools": "^10.0.0",
2122
"react-dom": "16.11.0",
22-
"react-scripts": "3.2.0"
23+
"react-scripts": "3.4.1"
2324
},
2425
"devDependencies": {
2526
"relative-deps": "0.2.0"

examples/with-nextjs/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"main": "index.js",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"predev": "relative-deps",
910
"prebuild": "relative-deps",

examples/with-react-native/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"main": "node_modules/expo/AppEntry.js",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"preandroid": "relative-deps",

examples/with-react-router/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"main": "index.js",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",

examples/with-suspense/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/with-suspense",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -18,7 +19,7 @@
1819
"react-async": "^10.0.0",
1920
"react-async-devtools": "^10.0.0",
2021
"react-dom": "16.11.0",
21-
"react-scripts": "3.2.0"
22+
"react-scripts": "3.4.1"
2223
},
2324
"devDependencies": {
2425
"relative-deps": "0.2.0"

examples/with-typescript/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": "https://react-async.async-library.now.sh/examples/with-typescript",
66
"scripts": {
7+
"bootstrap": "yarn install",
78
"postinstall": "relative-deps",
89
"prestart": "relative-deps",
910
"prebuild": "relative-deps",
@@ -21,7 +22,7 @@
2122
"react-async": "^10.0.0",
2223
"react-async-devtools": "^10.0.0",
2324
"react-dom": "16.11.0",
24-
"react-scripts": "3.2.0",
25+
"react-scripts": "3.4.1",
2526
"typescript": "3.7.2"
2627
},
2728
"devDependencies": {

package.json

+33-33
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"packages/*"
1111
],
1212
"scripts": {
13-
"bootstrap": "yarn build:packages && yarn workspaces run install",
13+
"bootstrap": "yarn build:packages && yarn workspaces run bootstrap",
1414
"clean": "lerna clean",
1515
"start": "run-p start:*",
1616
"start:examples": "now dev",
@@ -36,49 +36,49 @@
3636
"postbump": "yarn build:packages"
3737
},
3838
"devDependencies": {
39-
"@babel/core": "7.7.2",
40-
"@babel/plugin-proposal-class-properties": "7.7.0",
41-
"@babel/plugin-proposal-object-rest-spread": "7.6.2",
42-
"@babel/plugin-transform-runtime": "7.6.2",
43-
"@babel/preset-env": "7.7.1",
44-
"@babel/preset-react": "7.7.0",
45-
"@babel/preset-typescript": "7.7.2",
39+
"@babel/core": "7.8.6",
40+
"@babel/plugin-proposal-class-properties": "7.8.3",
41+
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
42+
"@babel/plugin-transform-runtime": "7.8.3",
43+
"@babel/preset-env": "7.8.7",
44+
"@babel/preset-react": "7.8.3",
45+
"@babel/preset-typescript": "7.8.3",
4646
"@pika/pack": "0.5.0",
47-
"@pika/plugin-build-node": "0.7.1",
48-
"@pika/plugin-build-types": "0.7.1",
49-
"@pika/plugin-build-umd": "0.7.1",
50-
"@pika/plugin-build-web": "0.7.1",
51-
"@pika/plugin-bundle-types": "0.7.1",
52-
"@pika/plugin-standard-pkg": "0.7.1",
53-
"@pika/plugin-ts-standard-pkg": "0.7.1",
54-
"@storybook/react": "5.2.6",
47+
"@pika/plugin-build-node": "0.9.2",
48+
"@pika/plugin-build-types": "0.9.2",
49+
"@pika/plugin-build-umd": "0.9.2",
50+
"@pika/plugin-build-web": "0.9.2",
51+
"@pika/plugin-bundle-types": "0.9.2",
52+
"@pika/plugin-standard-pkg": "0.9.2",
53+
"@pika/plugin-ts-standard-pkg": "0.9.2",
54+
"@storybook/react": "5.3.14",
5555
"@testing-library/jest-dom": "4.2.4",
56-
"@testing-library/react": "9.3.2",
57-
"@typescript-eslint/eslint-plugin": "2.8.0",
58-
"@typescript-eslint/parser": "2.8.0",
59-
"babel-eslint": "10.0.3",
56+
"@testing-library/react": "9.4.1",
57+
"@typescript-eslint/eslint-plugin": "2.22.0",
58+
"@typescript-eslint/parser": "2.22.0",
59+
"babel-eslint": "10.1.0",
6060
"babel-jest": "24.9.0",
6161
"babel-loader": "8.0.6",
62-
"copyfiles": "2.1.1",
63-
"eslint": "6.6.0",
64-
"eslint-config-prettier": "6.7.0",
65-
"eslint-plugin-jest": "23.0.4",
66-
"eslint-plugin-prettier": "3.1.1",
62+
"copyfiles": "2.2.0",
63+
"eslint": "6.8.0",
64+
"eslint-config-prettier": "6.10.0",
65+
"eslint-plugin-jest": "23.8.1",
66+
"eslint-plugin-prettier": "3.1.2",
6767
"eslint-plugin-promise": "4.2.1",
68-
"eslint-plugin-react": "7.16.0",
69-
"eslint-plugin-react-hooks": "2.3.0",
68+
"eslint-plugin-react": "7.18.3",
69+
"eslint-plugin-react-hooks": "2.5.0",
7070
"jest": "24.9.0",
71-
"lerna": "3.19.0",
71+
"lerna": "3.20.2",
7272
"node-jq": "1.11.0",
73-
"now": "16.6.0",
73+
"now": "16.7.3",
7474
"npm-run-all": "4.1.5",
7575
"prettier": "1.19.1",
7676
"prop-types": "15.7.2",
77-
"react": "16.12.0",
77+
"react": "16.13.0",
7878
"react-async": "10.0.0-alpha.0",
79-
"react-dom": "16.12.0",
80-
"storybook-chromatic": "3.1.0",
81-
"typescript": "3.7.2"
79+
"react-dom": "16.13.0",
80+
"storybook-chromatic": "3.5.2",
81+
"typescript": "3.8.3"
8282
},
8383
"resolutions": {
8484
"@types/react": "16.9.13"

packages/react-async-devtools/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"main": "src",
1919
"scripts": {
20+
"bootstrap": "yarn install",
2021
"build": "pika build",
2122
"postbuild": "copyfiles -f ../../LICENSE ../../README.md pkg",
2223
"publish": "npm publish pkg"

packages/react-async/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"main": "src",
2121
"scripts": {
22+
"bootstrap": "yarn install",
2223
"build": "pika build",
2324
"postbuild": "copyfiles -f ../../LICENSE ../../README.md pkg",
2425
"publish": "npm publish pkg"

packages/react-async/src/Async.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ import {
2222
ReducerAsyncState,
2323
} from "./types"
2424

25-
interface InitialProps<T> {
25+
export interface InitialProps<T> {
2626
children?: InitialChildren<T>
2727
persist?: boolean
2828
}
29-
interface PendingProps<T> {
29+
export interface PendingProps<T> {
3030
children?: PendingChildren<T>
3131
initial?: boolean
3232
}
33-
interface FulfilledProps<T> {
33+
export interface FulfilledProps<T> {
3434
children?: FulfilledChildren<T>
3535
persist?: boolean
3636
}
37-
interface RejectedProps<T> {
37+
export interface RejectedProps<T> {
3838
children?: RejectedChildren<T>
3939
persist?: boolean
4040
}
41-
interface SettledProps<T> {
41+
export interface SettledProps<T> {
4242
children?: SettledChildren<T>
4343
persist?: boolean
4444
}
@@ -54,7 +54,7 @@ type GenericAsync = typeof Async & {
5454
Settled<T>(props: SettledProps<T>): JSX.Element
5555
}
5656

57-
type AsyncConstructor<T> = React.ComponentClass<AsyncProps<T>> & {
57+
export type AsyncConstructor<T> = React.ComponentClass<AsyncProps<T>> & {
5858
Initial: React.FC<InitialProps<T>>
5959
Pending: React.FC<PendingProps<T>>
6060
Loading: React.FC<PendingProps<T>>

0 commit comments

Comments
 (0)