-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release v10
- Loading branch information
Showing
76 changed files
with
2,105 additions
and
913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build, test and deploy examples | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Build on node ${{ matrix.node_version }} and ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [10] | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "10.x" | ||
- uses: actions/checkout@v1 | ||
- name: Cache node modules | ||
id: cache-modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build-${{ env.cache-name }}- | ||
${{ runner.OS }}-build- | ||
${{ runner.OS }}- | ||
- name: Install | ||
if: steps.cache-modules.outputs.cache-hit != 'true' | ||
run: yarn install | ||
- name: Bootstrap | ||
run: yarn bootstrap | ||
- name: Build examples | ||
run: yarn build:examples | ||
- name: Test examples | ||
run: yarn test:examples --maxWorkers=2 | ||
- name: Deploy examples | ||
if: github.ref == 'master' | ||
run: yarn deploy:examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
save-exact=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
module.exports = async ({ config }) => { | ||
delete config.module.rules[0].include | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
presets: [['react-app', { flow: false, typescript: true }]], | ||
}, | ||
}); | ||
config.resolve.extensions.push('.ts', '.tsx'); | ||
return config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
module.exports = { | ||
presets: ["@babel/preset-react"], | ||
plugins: ["@babel/plugin-proposal-object-rest-spread"], | ||
plugins: ["@babel/plugin-proposal-object-rest-spread", "@babel/plugin-proposal-class-properties"], | ||
|
||
env: { | ||
test: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
plugins: ["@babel/plugin-transform-runtime"], | ||
presets: ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], | ||
plugins: ["@babel/plugin-transform-runtime", "@babel/plugin-proposal-class-properties"], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Development | ||
|
||
React Async is a library without visual parts. Only the DevTools have a user interface you can spin up in a browser. | ||
Therefore the development workflow for the core library might be different from what you're used to. Generally, we use a | ||
TDD approach: | ||
|
||
- Write a unit test for the new feature or bug you want to fix. Sometimes you can just extend an existing test. | ||
- Fix the test by implementing the feature or bugfix. Now all tests should pass. | ||
- Optionally refactor the code for performance, readability and style. Probably this will come up during PR review. | ||
|
||
We use the GitHub pull request workflow. In practice this means your workflow looks like this: | ||
|
||
- Fork the repo (or pull the latest upstream) under your own account. | ||
- Make your changes, commit and push them. We don't enforce any commit message format. | ||
- Open a pull request on the main repository against the `next` branch. Make sure to follow the template. | ||
- We'll review your PR and will probably ask for some changes. | ||
- Once ready, we'll merge your PR. | ||
- Your changes will be in the next release. | ||
|
||
## Working with Storybook | ||
|
||
We use Storybook as a development environment for the DevTools. Spin it up using: | ||
|
||
```sh | ||
yarn start:storybook | ||
``` | ||
|
||
This should open up Storybook in a browser at http://localhost:6006/ | ||
Run it side-by-side with `yarn test --watch` during development. See [Testing](#testing). | ||
|
||
## Working with the examples | ||
|
||
In the `examples` folder, you will find sample React applications that use React Async in various ways with various other libraries. Please add a new example when introducing a major new feature. Make sure to add it to `now.json` so it is automatically deployed when merged to `master`. | ||
|
||
To run sample examples on your local environments | ||
|
||
```sh | ||
yarn build:examples | ||
yarn test:examples | ||
yarn start:examples | ||
``` | ||
|
||
## Resolving issues | ||
|
||
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. |
Oops, something went wrong.