Skip to content

Commit

Permalink
chore: peerDep react version compatible 17.x (#132)
Browse files Browse the repository at this point in the history
* chore: peerDep react version compatible 17.x

commit c11cef5
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 21:06:01 2021 +0800

    chore: version

commit 5444efc
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 21:03:15 2021 +0800

    chore: add dingding notify

commit df44514
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 21:00:37 2021 +0800

    chore: add dingding notify

commit 43bb31e
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 20:56:15 2021 +0800

    chore: add dingding notify

commit 9893cdf
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 20:28:14 2021 +0800

    chore: add publish

commit d4ce841
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 20:26:18 2021 +0800

    chore: add publish

commit de1ee63
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 20:17:38 2021 +0800

    chore: add publish

commit 0d6daab
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:48:04 2021 +0800

    chore: add publish

commit 5f117f0
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:43:10 2021 +0800

    chore: add publish

commit 6c03a98
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:30:28 2021 +0800

    chore: add publish

commit ed328f7
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:27:52 2021 +0800

    chore: add publish

commit 4dcc1ae
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:20:40 2021 +0800

    chore: add publish

commit 2e2d452
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:18:09 2021 +0800

    chore: add publish

commit 14951c9
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:15:28 2021 +0800

    chore: add publish

commit 222681b
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 17:12:46 2021 +0800

    chore: add publish

commit ca8c36c
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 15:50:19 2021 +0800

    chore: react-scripts -> icejs

commit 62d81ae
Author: liuxiong.lx <[email protected]>
Date:   Wed Jun 16 15:20:29 2021 +0800

    chore: ts error

commit 31fa1b7
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 18:07:12 2021 +0800

    chore: upgrade ts to 4

commit 6391127
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 17:28:38 2021 +0800

    chore: fix ci

commit 808922e
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 17:21:15 2021 +0800

    chore: node_modules cache

commit db1dbcb
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 17:19:00 2021 +0800

    chore: node_modules cache

commit 1140ccc
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 17:17:31 2021 +0800

    chore: node_modules cache

commit 7fd326a
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 16:56:30 2021 +0800

    chore: add lock file to git

commit 2518dbf
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 16:48:05 2021 +0800

    chore: travis -> github actions

commit cca281f
Author: liuxiong.lx <[email protected]>
Date:   Tue Jun 15 15:51:24 2021 +0800

    chore: peerDep react version compatible 17.x

* chore: link

* chore: version

* chore: use prettier replace editorconfig

* chore: bump version
  • Loading branch information
imsobear authored Jun 21, 2021
1 parent 15d1052 commit de76ab8
Show file tree
Hide file tree
Showing 21 changed files with 173 additions and 143 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ci
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: https://registry.npmjs.org
- name: Set branch name
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
- name: Output branch name
run: echo ${BRANCH_NAME}
- run: npm install
- run: npm run lint:nofix
- run: npm run build
- run: npm run test
- name: Generate coverage
run: npm run coverage
- name: Publish And Notify
run: npm run publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
DING_WEBHOOK: ${{secrets.DING_WEBHOOK}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ lib
package-lock.json

yarn.lock

.ice
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
printWidth: 120,
tabWidth: 2,
semi: true,
singleQuote: true,
trailingComma: 'all',
};
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

79 changes: 30 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ English | [简体中文](./README.zh-CN.md)

icestore is a simple and friendly state management library for React. It has the following core features:

* **Minimal & Familiar API**: No additional learning costs, easy to get started with the knowledge of Redux && React Hooks.
* **Built in Async Status**: Records loading and error status of effects, simplifying the rendering logic in the view layer.
* **Class Component Support**: Make old projects enjoying the fun of lightweight state management with friendly compatibility strategy.
* **TypeScript Support**: Provide complete type definitions to support intelliSense in VS Code.
- **Minimal & Familiar API**: No additional learning costs, easy to get started with the knowledge of Redux && React Hooks.
- **Built in Async Status**: Records loading and error status of effects, simplifying the rendering logic in the view layer.
- **Class Component Support**: Make old projects enjoying the fun of lightweight state management with friendly compatibility strategy.
- **TypeScript Support**: Provide complete type definitions to support intelliSense in VS Code.

See the [comparison table](docs/recipes.md#Comparison) for more details.

Expand All @@ -44,21 +44,22 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from '@ice/store';

const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), time));
const delay = (time) =>
new Promise((resolve) => setTimeout(() => resolve(), time));

// 1️⃣ Use a model to define your store
const counter = {
state: 0,
reducers: {
increment:(prevState) => prevState + 1,
decrement:(prevState) => prevState - 1,
increment: (prevState) => prevState + 1,
decrement: (prevState) => prevState - 1,
},
effects: () => ({
async asyncDecrement() {
await delay(1000);
this.decrement();
},
})
}),
};

const models = {
Expand All @@ -71,13 +72,17 @@ const store = createStore(models);
// 3️⃣ Consume model
const { useModel } = store;
function Counter() {
const [ count, dispatchers ] = useModel('counter');
const [count, dispatchers] = useModel('counter');
const { increment, asyncDecrement } = dispatchers;
return (
<div>
<span>{count}</span>
<button type="button" onClick={increment}>+</button>
<button type="button" onClick={asyncDecrement}>-</button>
<button type="button" onClick={increment}>
+
</button>
<button type="button" onClick={asyncDecrement}>
-
</button>
</div>
);
}
Expand Down Expand Up @@ -123,55 +128,31 @@ npm install @ice/store --save

| ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![UC](https://raw.github.com/alrra/browser-logos/master/src/uc/uc_48x48.png) |
| :--------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :--------------------------------------------------------------------------: |
||||9+ ✔||||
|||| 9+ ✔ ||||

## Inspiration

icestore refines and builds upon the ideas of [rematch](https://github.com/rematch/rematch) & [constate](https://github.com/diegohaz/constate).

## Contributors

Feel free to report any questions as an [issue](https://github.com/alibaba/ice/issues/new), we'd love to have your helping hand on icestore.
Feel free to report any questions as an [issue](https://github.com/ice-lab/icestore/issues/new), we'd love to have your helping hand on icestore.

If you're interested in icestore, see [CONTRIBUTING.md](https://github.com/alibaba/ice/blob/master/.github/CONTRIBUTING.md) for more information to learn how to get started.

## ICE Ecosystem
Develop:

| Project | Version | Docs | Description |
|----------------|------------------|--------------|-----------|
| [icejs] | [![icejs-status]][icejs-package] | [docs][icejs-docs] | A universal framework based on react.js |
| [icestark] | [![icestark-status]][icestark-package] | [docs][icestark-docs] | Micro Frontends solution for large application |
| [icestore] | [![icestore-status]][icestore-package] | [docs][icestore-docs] | Simple and friendly state for React |
| [iceworks]| [![iceworks-status]][iceworks-package] | [docs][iceworks-docs] | Universal Application Development Pack for VS Code |

[icejs]: https://github.com/alibaba/ice
[icestark]: https://github.com/ice-lab/icestark
[icestore]: https://github.com/ice-lab/icestore
[iceworks]: https://github.com/ice-lab/iceworks

[icejs-status]: https://img.shields.io/npm/v/ice.js.svg
[icestark-status]: https://img.shields.io/npm/v/@ice/stark.svg
[icestore-status]: https://img.shields.io/npm/v/@ice/store.svg
[iceworks-status]: https://vsmarketplacebadge.apphb.com/version/iceworks-team.iceworks.svg

[icejs-package]: https://npmjs.com/package/ice.js
[icestark-package]: https://npmjs.com/package/@ice/stark
[icestore-package]: https://npmjs.com/package/@ice/store
[iceworks-package]: https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks

[icejs-docs]: https://ice.work/docs/guide/intro
[icestark-docs]: https://ice.work/docs/icestark/guide/about
[icestore-docs]: https://github.com/ice-lab/icestore#icestore
[iceworks-docs]: https://ice.work/docs/iceworks/about

## Community

| DingTalk community | GitHub issues | Gitter |
|-------------------------------------|--------------|---------|
| <a href="https://ice.alicdn.com/assets/images/qrcode.png"><img src="https://ice.alicdn.com/assets/images/qrcode.png" width="150" /></a> | [issues] | [gitter]|

[issues]: https://github.com/alibaba/ice/issues
[gitter]: https://gitter.im/alibaba/ice
```bash
$ cd icestore/
$ npm install
$ npm run watch

$ cd examples/counter
$ npm install
$ npm link ../../ # link icestore
$ npm link ../../node_modules/react # link react
$ npm start
```

## License

Expand Down
40 changes: 1 addition & 39 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,48 +131,10 @@ npm install @ice/store --save

## 参与贡献

欢迎通过 [issue](https://github.com/alibaba/ice/issues/new) 反馈问题。
欢迎通过 [issue](https://github.com/ice-lab/icestore/issues/new) 反馈问题。

如果对 `icestore` 感兴趣,请参考 [CONTRIBUTING.md](https://github.com/alibaba/ice/blob/master/.github/CONTRIBUTING.md) 学习如何贡献代码。

## ICE 生态

| Project | Version | Docs | Description |
|----------------|------------------|--------------|-----------|
| [icejs] | [![icejs-status]][icejs-package] | [docs][icejs-docs] | 基于 React.js 的通用框架 |
| [icestark] | [![icestark-status]][icestark-package] | [docs][icestark-docs] | 面向大型应用的微前端解决方案 |
| [icestore] | [![icestore-status]][icestore-package] | [docs][icestore-docs] | 简单友好的轻量级状态管理方案 |
| [iceworks]| [![iceworks-status]][iceworks-package] | [docs][iceworks-docs] | 基于 VS Code 的多端研发套件 |

[icejs]: https://github.com/alibaba/ice
[icestark]: https://github.com/ice-lab/icestark
[icestore]: https://github.com/ice-lab/icestore
[iceworks]: https://github.com/ice-lab/iceworks

[icejs-status]: https://img.shields.io/npm/v/ice.js.svg
[icestark-status]: https://img.shields.io/npm/v/@ice/stark.svg
[icestore-status]: https://img.shields.io/npm/v/@ice/store.svg
[iceworks-status]: https://vsmarketplacebadge.apphb.com/version/iceworks-team.iceworks.svg

[icejs-package]: https://npmjs.com/package/ice.js
[icestark-package]: https://npmjs.com/package/@ice/stark
[icestore-package]: https://npmjs.com/package/@ice/store
[iceworks-package]: https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks

[icejs-docs]: https://ice.work/docs/guide/intro
[icestark-docs]: https://ice.work/docs/icestark/guide/about
[icestore-docs]: https://github.com/ice-lab/icestore#icestore
[iceworks-docs]: https://ice.work/docs/iceworks/about

## 社区

| 钉钉群 | GitHub issues | Gitter |
|-------------------------------------|--------------|---------|
| <a href="https://ice.alicdn.com/assets/images/qrcode.png"><img src="https://ice.alicdn.com/assets/images/qrcode.png" width="150" /></a> | [issues] | [gitter]|

[issues]: https://github.com/alibaba/ice/issues
[gitter]: https://gitter.im/alibaba/ice

## License

[MIT](LICENSE)
4 changes: 4 additions & 0 deletions examples/classComponent/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"disableRuntime": true,
"entry": "src/index"
}
9 changes: 4 additions & 5 deletions examples/classComponent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"@ice/store": "^1.4.0",
"react": "^16.8.6",
"@ice/store": "^1.3.4",
"react-dom": "^16.8.6"
},
"devDependencies": {
"@types/jest": "^24.0.0",
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"react-scripts": "3.4.0",
"ice.js": "^1.18.1",
"typescript": "^3.7.5",
"utility-types": "^3.10.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
"start": "icejs start",
"build": "icejs build"
},
"browserslist": {
"production": [
Expand Down
7 changes: 3 additions & 4 deletions examples/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"@ice/store": "^1.3.4",
"react": "^16.8.6",
"react-app-polyfill": "^1.0.6",
"react-dom": "^16.8.6"
},
Expand All @@ -13,11 +12,11 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"react-scripts": "3.4.0",
"react-scripts": "^3.4.0",
"typescript": "^3.7.5"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand All @@ -34,4 +33,4 @@
"ie 11"
]
}
}
}
4 changes: 2 additions & 2 deletions examples/migration-redux-1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"react-redux": "^7.2.0"
},
"devDependencies": {
"react-scripts": "3.4.0"
"react-scripts": "^3.4.0"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand Down
4 changes: 2 additions & 2 deletions examples/migration-redux-2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"react-redux": "^7.2.0"
},
"devDependencies": {
"react-scripts": "3.4.0"
"react-scripts": "^3.4.0"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand Down
4 changes: 2 additions & 2 deletions examples/migration-redux-3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"react-redux": "^7.2.0"
},
"devDependencies": {
"react-scripts": "3.4.0"
"react-scripts": "^3.4.0"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand Down
4 changes: 2 additions & 2 deletions examples/migration-redux-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"react-redux": "^7.2.0"
},
"devDependencies": {
"react-scripts": "3.4.0"
"react-scripts": "^3.4.0"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand Down
4 changes: 2 additions & 2 deletions examples/todos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"react-scripts": "3.4.0",
"react-scripts": "^3.4.0",
"typescript": "^3.7.5",
"utility-types": "^3.10.0"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand Down
4 changes: 2 additions & 2 deletions examples/withModel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"react-scripts": "3.4.0",
"react-scripts": "^3.4.0",
"typescript": "^3.7.5"
},
"scripts": {
"start": "react-scripts start",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build"
},
"browserslist": {
Expand Down
Loading

0 comments on commit de76ab8

Please sign in to comment.