Skip to content

Commit de76ab8

Browse files
authored
chore: peerDep react version compatible 17.x (#132)
* chore: peerDep react version compatible 17.x commit c11cef5 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 21:06:01 2021 +0800 chore: version commit 5444efc Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 21:03:15 2021 +0800 chore: add dingding notify commit df44514 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 21:00:37 2021 +0800 chore: add dingding notify commit 43bb31e Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 20:56:15 2021 +0800 chore: add dingding notify commit 9893cdf Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 20:28:14 2021 +0800 chore: add publish commit d4ce841 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 20:26:18 2021 +0800 chore: add publish commit de1ee63 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 20:17:38 2021 +0800 chore: add publish commit 0d6daab Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:48:04 2021 +0800 chore: add publish commit 5f117f0 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:43:10 2021 +0800 chore: add publish commit 6c03a98 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:30:28 2021 +0800 chore: add publish commit ed328f7 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:27:52 2021 +0800 chore: add publish commit 4dcc1ae Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:20:40 2021 +0800 chore: add publish commit 2e2d452 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:18:09 2021 +0800 chore: add publish commit 14951c9 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:15:28 2021 +0800 chore: add publish commit 222681b Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 17:12:46 2021 +0800 chore: add publish commit ca8c36c Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 15:50:19 2021 +0800 chore: react-scripts -> icejs commit 62d81ae Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Wed Jun 16 15:20:29 2021 +0800 chore: ts error commit 31fa1b7 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 18:07:12 2021 +0800 chore: upgrade ts to 4 commit 6391127 Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 17:28:38 2021 +0800 chore: fix ci commit 808922e Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 17:21:15 2021 +0800 chore: node_modules cache commit db1dbcb Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 17:19:00 2021 +0800 chore: node_modules cache commit 1140ccc Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 17:17:31 2021 +0800 chore: node_modules cache commit 7fd326a Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 16:56:30 2021 +0800 chore: add lock file to git commit 2518dbf Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> Date: Tue Jun 15 16:48:05 2021 +0800 chore: travis -> github actions commit cca281f Author: liuxiong.lx <liuxiong.lx@alibaba-inc.com> 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
1 parent 15d1052 commit de76ab8

File tree

21 files changed

+173
-143
lines changed

21 files changed

+173
-143
lines changed

.editorconfig

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: ci
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v1
8+
- name: Use Node.js 12.x
9+
uses: actions/setup-node@v2
10+
with:
11+
node-version: 12.x
12+
registry-url: https://registry.npmjs.org
13+
- name: Set branch name
14+
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
15+
- name: Output branch name
16+
run: echo ${BRANCH_NAME}
17+
- run: npm install
18+
- run: npm run lint:nofix
19+
- run: npm run build
20+
- run: npm run test
21+
- name: Generate coverage
22+
run: npm run coverage
23+
- name: Publish And Notify
24+
run: npm run publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
27+
DING_WEBHOOK: ${{secrets.DING_WEBHOOK}}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ lib
6363
package-lock.json
6464

6565
yarn.lock
66+
67+
.ice

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
printWidth: 120,
3+
tabWidth: 2,
4+
semi: true,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 30 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ English | [简体中文](./README.zh-CN.md)
3030

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

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

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

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

47-
const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), time));
47+
const delay = (time) =>
48+
new Promise((resolve) => setTimeout(() => resolve(), time));
4849

4950
// 1️⃣ Use a model to define your store
5051
const counter = {
5152
state: 0,
5253
reducers: {
53-
increment:(prevState) => prevState + 1,
54-
decrement:(prevState) => prevState - 1,
54+
increment: (prevState) => prevState + 1,
55+
decrement: (prevState) => prevState - 1,
5556
},
5657
effects: () => ({
5758
async asyncDecrement() {
5859
await delay(1000);
5960
this.decrement();
6061
},
61-
})
62+
}),
6263
};
6364

6465
const models = {
@@ -71,13 +72,17 @@ const store = createStore(models);
7172
// 3️⃣ Consume model
7273
const { useModel } = store;
7374
function Counter() {
74-
const [ count, dispatchers ] = useModel('counter');
75+
const [count, dispatchers] = useModel('counter');
7576
const { increment, asyncDecrement } = dispatchers;
7677
return (
7778
<div>
7879
<span>{count}</span>
79-
<button type="button" onClick={increment}>+</button>
80-
<button type="button" onClick={asyncDecrement}>-</button>
80+
<button type="button" onClick={increment}>
81+
+
82+
</button>
83+
<button type="button" onClick={asyncDecrement}>
84+
-
85+
</button>
8186
</div>
8287
);
8388
}
@@ -123,55 +128,31 @@ npm install @ice/store --save
123128

124129
| ![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) |
125130
| :--------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :--------------------------------------------------------------------------: |
126-
||||9+ ✔||||
131+
|||| 9+ ✔ ||||
127132

128133
## Inspiration
129134

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

132137
## Contributors
133138

134-
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.
139+
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.
135140

136141
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.
137142

138-
## ICE Ecosystem
143+
Develop:
139144

140-
| Project | Version | Docs | Description |
141-
|----------------|------------------|--------------|-----------|
142-
| [icejs] | [![icejs-status]][icejs-package] | [docs][icejs-docs] | A universal framework based on react.js |
143-
| [icestark] | [![icestark-status]][icestark-package] | [docs][icestark-docs] | Micro Frontends solution for large application |
144-
| [icestore] | [![icestore-status]][icestore-package] | [docs][icestore-docs] | Simple and friendly state for React |
145-
| [iceworks]| [![iceworks-status]][iceworks-package] | [docs][iceworks-docs] | Universal Application Development Pack for VS Code |
146-
147-
[icejs]: https://github.com/alibaba/ice
148-
[icestark]: https://github.com/ice-lab/icestark
149-
[icestore]: https://github.com/ice-lab/icestore
150-
[iceworks]: https://github.com/ice-lab/iceworks
151-
152-
[icejs-status]: https://img.shields.io/npm/v/ice.js.svg
153-
[icestark-status]: https://img.shields.io/npm/v/@ice/stark.svg
154-
[icestore-status]: https://img.shields.io/npm/v/@ice/store.svg
155-
[iceworks-status]: https://vsmarketplacebadge.apphb.com/version/iceworks-team.iceworks.svg
156-
157-
[icejs-package]: https://npmjs.com/package/ice.js
158-
[icestark-package]: https://npmjs.com/package/@ice/stark
159-
[icestore-package]: https://npmjs.com/package/@ice/store
160-
[iceworks-package]: https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks
161-
162-
[icejs-docs]: https://ice.work/docs/guide/intro
163-
[icestark-docs]: https://ice.work/docs/icestark/guide/about
164-
[icestore-docs]: https://github.com/ice-lab/icestore#icestore
165-
[iceworks-docs]: https://ice.work/docs/iceworks/about
166-
167-
## Community
168-
169-
| DingTalk community | GitHub issues | Gitter |
170-
|-------------------------------------|--------------|---------|
171-
| <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]|
172-
173-
[issues]: https://github.com/alibaba/ice/issues
174-
[gitter]: https://gitter.im/alibaba/ice
145+
```bash
146+
$ cd icestore/
147+
$ npm install
148+
$ npm run watch
149+
150+
$ cd examples/counter
151+
$ npm install
152+
$ npm link ../../ # link icestore
153+
$ npm link ../../node_modules/react # link react
154+
$ npm start
155+
```
175156

176157
## License
177158

README.zh-CN.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -131,48 +131,10 @@ npm install @ice/store --save
131131

132132
## 参与贡献
133133

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

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

138-
## ICE 生态
139-
140-
| Project | Version | Docs | Description |
141-
|----------------|------------------|--------------|-----------|
142-
| [icejs] | [![icejs-status]][icejs-package] | [docs][icejs-docs] | 基于 React.js 的通用框架 |
143-
| [icestark] | [![icestark-status]][icestark-package] | [docs][icestark-docs] | 面向大型应用的微前端解决方案 |
144-
| [icestore] | [![icestore-status]][icestore-package] | [docs][icestore-docs] | 简单友好的轻量级状态管理方案 |
145-
| [iceworks]| [![iceworks-status]][iceworks-package] | [docs][iceworks-docs] | 基于 VS Code 的多端研发套件 |
146-
147-
[icejs]: https://github.com/alibaba/ice
148-
[icestark]: https://github.com/ice-lab/icestark
149-
[icestore]: https://github.com/ice-lab/icestore
150-
[iceworks]: https://github.com/ice-lab/iceworks
151-
152-
[icejs-status]: https://img.shields.io/npm/v/ice.js.svg
153-
[icestark-status]: https://img.shields.io/npm/v/@ice/stark.svg
154-
[icestore-status]: https://img.shields.io/npm/v/@ice/store.svg
155-
[iceworks-status]: https://vsmarketplacebadge.apphb.com/version/iceworks-team.iceworks.svg
156-
157-
[icejs-package]: https://npmjs.com/package/ice.js
158-
[icestark-package]: https://npmjs.com/package/@ice/stark
159-
[icestore-package]: https://npmjs.com/package/@ice/store
160-
[iceworks-package]: https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks
161-
162-
[icejs-docs]: https://ice.work/docs/guide/intro
163-
[icestark-docs]: https://ice.work/docs/icestark/guide/about
164-
[icestore-docs]: https://github.com/ice-lab/icestore#icestore
165-
[iceworks-docs]: https://ice.work/docs/iceworks/about
166-
167-
## 社区
168-
169-
| 钉钉群 | GitHub issues | Gitter |
170-
|-------------------------------------|--------------|---------|
171-
| <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]|
172-
173-
[issues]: https://github.com/alibaba/ice/issues
174-
[gitter]: https://gitter.im/alibaba/ice
175-
176138
## License
177139

178140
[MIT](LICENSE)

examples/classComponent/build.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"disableRuntime": true,
3+
"entry": "src/index"
4+
}

examples/classComponent/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"@ice/store": "^1.4.0",
7-
"react": "^16.8.6",
6+
"@ice/store": "^1.3.4",
87
"react-dom": "^16.8.6"
98
},
109
"devDependencies": {
1110
"@types/jest": "^24.0.0",
1211
"@types/node": "^12.0.0",
1312
"@types/react": "^16.9.0",
1413
"@types/react-dom": "^16.9.0",
15-
"react-scripts": "3.4.0",
14+
"ice.js": "^1.18.1",
1615
"typescript": "^3.7.5",
1716
"utility-types": "^3.10.0"
1817
},
1918
"scripts": {
20-
"start": "react-scripts start",
21-
"build": "react-scripts build"
19+
"start": "icejs start",
20+
"build": "icejs build"
2221
},
2322
"browserslist": {
2423
"production": [

examples/counter/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"private": true,
55
"dependencies": {
66
"@ice/store": "^1.3.4",
7-
"react": "^16.8.6",
87
"react-app-polyfill": "^1.0.6",
98
"react-dom": "^16.8.6"
109
},
@@ -13,11 +12,11 @@
1312
"@types/node": "^12.0.0",
1413
"@types/react": "^16.9.0",
1514
"@types/react-dom": "^16.9.0",
16-
"react-scripts": "3.4.0",
15+
"react-scripts": "^3.4.0",
1716
"typescript": "^3.7.5"
1817
},
1918
"scripts": {
20-
"start": "react-scripts start",
19+
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
2120
"build": "react-scripts build"
2221
},
2322
"browserslist": {
@@ -34,4 +33,4 @@
3433
"ie 11"
3534
]
3635
}
37-
}
36+
}

0 commit comments

Comments
 (0)