Skip to content

Commit 1438557

Browse files
committed
update: pacakges
1 parent b9aaca1 commit 1438557

File tree

16 files changed

+96
-488
lines changed

16 files changed

+96
-488
lines changed

package.json

+26-27
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"pnp": false
2424
},
2525
"dependencies": {
26-
"@rematch/core": "^2.1.1",
27-
"antd": "^4.16.13",
26+
"@rematch/core": "^2.2.0",
27+
"antd": "^4.17.3",
2828
"axios": "^0.24.0",
29-
"core-js": "^3.19.0",
30-
"history": "^5.1.0",
29+
"core-js": "^3.19.3",
30+
"eslint": "^7.32.0",
3131
"lodash": "^4.17.21",
3232
"react": "^17.0.2",
3333
"react-dom": "^17.0.2",
@@ -37,32 +37,31 @@
3737
"redux": "^4.1.2"
3838
},
3939
"devDependencies": {
40-
"@babel/core": "^7.15.8",
41-
"@babel/plugin-proposal-class-properties": "^7.14.5",
42-
"@babel/plugin-proposal-decorators": "^7.15.8",
43-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
44-
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
45-
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
40+
"@babel/core": "^7.16.5",
41+
"@babel/plugin-proposal-class-properties": "^7.16.5",
42+
"@babel/plugin-proposal-decorators": "^7.16.5",
43+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.5",
44+
"@babel/plugin-proposal-object-rest-spread": "^7.16.5",
45+
"@babel/plugin-proposal-optional-chaining": "^7.16.5",
4646
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
47-
"@babel/plugin-transform-runtime": "^7.15.8",
48-
"@babel/preset-env": "^7.15.8",
49-
"@babel/preset-react": "^7.14.5",
50-
"@babel/runtime": "^7.15.4",
47+
"@babel/plugin-transform-runtime": "^7.16.5",
48+
"@babel/preset-env": "^7.16.5",
49+
"@babel/preset-react": "^7.16.5",
50+
"@babel/runtime": "^7.16.5",
5151
"antd-dayjs-webpack-plugin": "^1.0.6",
52-
"autoprefixer": "^10.3.7",
52+
"autoprefixer": "^10.4.0",
5353
"babel-eslint": "^10.1.0",
5454
"babel-loader": "^8.2.3",
5555
"babel-plugin-import": "^1.13.3",
5656
"clean-webpack-plugin": "^4.0.0",
5757
"copy-webpack-plugin": "^10.1.0",
58-
"css-loader": "^6.5.0",
59-
"css-minimizer-webpack-plugin": "^3.1.1",
58+
"css-loader": "^6.5.1",
59+
"css-minimizer-webpack-plugin": "^3.2.0",
6060
"dayjs": "^1.10.7",
61-
"eslint": "^7.32.0",
6261
"eslint-loader": "^4.0.2",
6362
"eslint-plugin-prettier": "^4.0.0",
64-
"eslint-plugin-react": "^7.26.1",
65-
"eslint-plugin-react-hooks": "^4.2.0",
63+
"eslint-plugin-react": "^7.27.1",
64+
"eslint-plugin-react-hooks": "^4.3.0",
6665
"express": "^4.17.1",
6766
"favicons": "^6.2.2",
6867
"favicons-webpack-plugin": "^5.0.2",
@@ -72,19 +71,19 @@
7271
"less-loader": "^10.2.0",
7372
"mini-css-extract-plugin": "^2.4.5",
7473
"mockjs": "^1.1.0",
75-
"postcss": "^8.3.11",
76-
"postcss-loader": "^6.2.0",
77-
"prettier": "^2.4.1",
74+
"postcss": "^8.4.5",
75+
"postcss-loader": "^6.2.1",
76+
"prettier": "^2.5.1",
7877
"style-loader": "^3.3.1",
7978
"sw-precache-webpack-plugin": "^1.0.0",
80-
"terser-webpack-plugin": "^5.2.4",
81-
"webpack": "^5.60.0",
79+
"terser-webpack-plugin": "^5.2.5",
80+
"webpack": "^5.65.0",
8281
"webpack-bundle-analyzer": "^4.5.0",
8382
"webpack-cli": "^4.9.1",
84-
"webpack-dev-middleware": "^5.2.1",
83+
"webpack-dev-middleware": "^5.2.2",
8584
"webpack-hot-middleware": "^2.25.1",
8685
"webpackbar": "^5.0.2",
87-
"workbox-webpack-plugin": "^6.3.0",
86+
"workbox-webpack-plugin": "^6.4.2",
8887
"xml-loader": "^1.2.1"
8988
},
9089
"browserslist": [

src/component/menu/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ export default function Menu() {
2525
pathname: "/test",
2626
search: "?a=123&b=abc",
2727
}}
28-
state={{ c: 456, d: "ABC" }}>
28+
state={{ c: 456, d: "ABC" }}
29+
>
2930
测试:api跳转
3031
</span>
3132
|
32-
<a href="https://github.com/javaLuo/react-luo" target="_blank" rel="noopener noreferrer">
33+
<a
34+
href="https://github.com/javaLuo/react-luo"
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
>
3338
GitHub
3439
</a>
3540
</div>

src/container/features/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export default function FeaturesPageContainer(props) {
3939
</div>
4040
<div className="list">
4141
<h2>HMR局部热更新</h2>
42-
<div>使用webpack-dev-middleware 和 webpack-hot-middleware设置了热更新</div>
42+
<div>
43+
使用webpack-dev-middleware 和 webpack-hot-middleware设置了热更新
44+
</div>
4345
</div>
4446
<div className="list">
4547
<h2>代码分割</h2>

src/container/home/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export default function HomePageContainer(props) {
1717
<div className="box">
1818
<img src={ImgLogo} />
1919
<div className="title">React-Luo</div>
20-
<div className="info">react17、redux4、router5、webpack5、eslint、babel7、antd4</div>
20+
<div className="info">
21+
react17、redux4、router5、webpack5、eslint、babel7、antd4
22+
</div>
2123
</div>
2224
</div>
2325
);

src/container/routers/index.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
import React, { useEffect } from "react";
55

66
// import { Router, Route, Switch, Redirect } from "react-router-dom";
7-
import { HashRouter as Router, Routes, Route, Navigate } from "react-router-dom";
7+
import {
8+
HashRouter as Router,
9+
Routes,
10+
Route,
11+
Navigate,
12+
} from "react-router-dom";
813

914
// antd的多语言
1015
import { ConfigProvider } from "antd";
@@ -33,15 +38,18 @@ const Test = Loadable({
3338
loading: Loading,
3439
});
3540
const Page1 = Loadable({
36-
loader: () => import(/* webpackChunkName:'testclass' */ "../test/container/page1"),
41+
loader: () =>
42+
import(/* webpackChunkName:'testclass' */ "../test/container/page1"),
3743
loading: Loading,
3844
});
3945
const Page2 = Loadable({
40-
loader: () => import(/* webpackChunkName:'testclass' */ "../test/container/page2"),
46+
loader: () =>
47+
import(/* webpackChunkName:'testclass' */ "../test/container/page2"),
4148
loading: Loading,
4249
});
4350
const Page3 = Loadable({
44-
loader: () => import(/* webpackChunkName:'testclass' */ "../test/container/page3"),
51+
loader: () =>
52+
import(/* webpackChunkName:'testclass' */ "../test/container/page3"),
4553
loading: Loading,
4654
});
4755
const Features = Loadable({

src/container/test/container/page1.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import React from "react";
2-
import { connect } from "react-redux";
3-
import { bindActionCreators } from "redux";
42

5-
function Page1(props) {
3+
export default function Page1(props) {
64
return <div className="son">A 子container 1</div>;
75
}
8-
9-
export default connect(
10-
(state) => ({}),
11-
(dispatch) => ({
12-
actions: bindActionCreators({}, dispatch),
13-
})
14-
)(Page1);

src/container/test/container/page2.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import React from "react";
2-
import { connect } from "react-redux";
3-
import { bindActionCreators } from "redux";
42

5-
function Page2(props) {
3+
export default function Page2(props) {
64
return <div className="son">B 子container 2</div>;
75
}
8-
9-
export default connect(
10-
(state) => ({}),
11-
(dispatch) => ({
12-
actions: bindActionCreators({}, dispatch),
13-
})
14-
)(Page2);

src/container/test/container/page3.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import React from "react";
2-
import { connect } from "react-redux";
3-
import { bindActionCreators } from "redux";
42

5-
function Page3(props) {
3+
export default function Page3(props) {
64
return <div className="son">C 子container 3</div>;
75
}
8-
9-
export default connect(
10-
(state) => ({}),
11-
(dispatch) => ({
12-
actions: bindActionCreators({}, dispatch),
13-
})
14-
)(Page3);

src/container/test/index.js

+35-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Mp3 from "../../assets/starSky.mp3";
1717
export default function TestPageContainer() {
1818
const dispatch = useDispatch();
1919

20-
const count = useSelector(state => state.test.count); // 引入test model中的count数据
20+
const count = useSelector((state) => state.test.count); // 引入test model中的count数据
2121

2222
const location = useLocation();
2323
console.log("location:=", location);
@@ -60,7 +60,10 @@ export default function TestPageContainer() {
6060
console.log("obj的扩展运算符测试:", b);
6161

6262
// 获取用户信息测试
63-
const userInfo = await dispatch({ type: "app/getUserinfo", payload: { id: 1 } });
63+
const userInfo = await dispatch({
64+
type: "app/getUserinfo",
65+
payload: { id: 1 },
66+
});
6467
console.log("获取到userInfo:", userInfo);
6568
}, []);
6669

@@ -80,11 +83,17 @@ export default function TestPageContainer() {
8083
<span className="backImage" />
8184
<span>上方图片,一张是img,一张是background</span>
8285
<br />
83-
<span>请特别注意,现在webpack.production.config.js中的publicPath配置为"/",</span>
86+
<span>
87+
请特别注意,现在webpack.production.config.js中的publicPath配置为"/",
88+
</span>
8489
<br />
85-
<span>如果你的项目最终打包后放到服务器上的访问路径为https://xxx.com,这没有问题</span>
90+
<span>
91+
如果你的项目最终打包后放到服务器上的访问路径为https://xxx.com,这没有问题
92+
</span>
8693
<br />
87-
<span>如果你的项目访问路径为https://xxx.com/aaa,请把webpack.production.config.js中的publicPath配置为"/aaa/"</span>
94+
<span>
95+
如果你的项目访问路径为https://xxx.com/aaa,请把webpack.production.config.js中的publicPath配置为"/aaa/"
96+
</span>
8897
</p>
8998
</div>
9099
<div className="list">
@@ -118,11 +127,23 @@ export default function TestPageContainer() {
118127
<h2>Antd表单</h2>
119128
<div style={{ maxWidth: "400px" }}>
120129
<Form {...layout} onFinish={handleSubmit}>
121-
<Form.Item label="用户名" name="username" rules={[{ required: true, message: "请输入用户名" }]}>
130+
<Form.Item
131+
label="用户名"
132+
name="username"
133+
rules={[{ required: true, message: "请输入用户名" }]}
134+
>
122135
<Input prefix={<UserOutlined />} placeholder="用户名" />
123136
</Form.Item>
124-
<Form.Item label="密码" name="password" rules={[{ required: true, message: "请输入密码" }]}>
125-
<Input type="password" prefix={<KeyOutlined />} placeholder="密码" />
137+
<Form.Item
138+
label="密码"
139+
name="password"
140+
rules={[{ required: true, message: "请输入密码" }]}
141+
>
142+
<Input
143+
type="password"
144+
prefix={<KeyOutlined />}
145+
placeholder="密码"
146+
/>
126147
</Form.Item>
127148
<Form.Item>
128149
<Button type="primary" htmlType="submit">
@@ -182,7 +203,12 @@ export default function TestPageContainer() {
182203
</div>
183204
</div>
184205
</div>
185-
<Modal title="模态框" visible={visible} onOk={() => setVisible(false)} onCancel={() => setVisible(false)}>
206+
<Modal
207+
title="模态框"
208+
visible={visible}
209+
onOk={() => setVisible(false)}
210+
onCancel={() => setVisible(false)}
211+
>
186212
<p>内容...</p>
187213
</Modal>
188214
</div>

src/container/testclass/container/page1.js

-27
This file was deleted.

src/container/testclass/container/page2.js

-27
This file was deleted.

src/container/testclass/container/page3.js

-27
This file was deleted.

0 commit comments

Comments
 (0)