Skip to content

Commit

Permalink
Merge branch 'master' into subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Aug 28, 2021
2 parents 4fb8c95 + 9da2615 commit ebfdb06
Show file tree
Hide file tree
Showing 134 changed files with 3,390 additions and 3,475 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
},
"rules": {
"func-names": [2, "as-needed"],
"no-shadow": 2,
"no-shadow": 0,
"@typescript-eslint/no-shadow": 2,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/ban-ts-ignore": 0,
Expand All @@ -42,6 +43,7 @@
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/ban-types": 0,
"react-hooks/rules-of-hooks": 2,
"react-hooks/exhaustive-deps": 1,
"react/prop-types": 0
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- next
pull_request:

jobs:
Expand All @@ -20,7 +19,7 @@ jobs:
- run: yarn install
- run: yarn types:check
- run: yarn lint
- run: yarn build:core
- run: yarn build
- run: yarn test
env:
CI: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ esm
.vscode
examples/**/yarn.lock
package-lock.json
playground/**
41 changes: 25 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SWR Contribution Guidelines

Thank you for reading this guide and we appreciate any contribution.
Thank you for reading this guide and we appreciate any contribution.

## Ask a Question

Expand All @@ -20,28 +20,37 @@ If possible, you can add other additional context like how this feature can be i

## Open a PR for Bugfix or Feature

### Local Development
### Local Development with Examples

To develop SWR locally, you can use the Vite SWR playground to play with the source code inside the browser. You can follow these steps:
To run SWR locally, you can start it with any example in `examples` folder. You need to setup the example and run command in the root directory for overriding SWR and its dependencies to local assets.

```bash
yarn install
yarn register
First of all, build SWR assets

```sh
# or `yarn watch`
yarn build
yarn prepare:vite
yarn dev:vite
```

To test SSR related features, you need to use the Next.js SWR playground instead:
Install dependency of the target example, for instance `examples/basic`:

```bash
yarn install
yarn register
yarn build
yarn prepare:next
yarn dev:next
```sh
cd examples/basic && yarn
```

After setup, back to the root directory and run:

```sh
# by default it will run next dev for the example
yarn dev-next basic
```

All examples are built with Next.js, so Next.js commands are all supported:

```sh
# if you want to build and start
yarn dev-next basic build
yarn dev-next basic start
```
## Update Documentation

To update the [SWR Documentation](https://swr.vercel.app), you can contribute to the [website repository](https://github.com/vercel/swr-site).
To update the [SWR Documentation](https://swr.vercel.app), you can contribute to the [website repository](https://github.com/vercel/swr-site).

0 comments on commit ebfdb06

Please sign in to comment.