Skip to content

Commit a0909d3

Browse files
committed
Rewrite pack tool
1 parent 4806a99 commit a0909d3

15 files changed

+1129
-9018
lines changed

src/index.html renamed to index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5-
<title>redux-mode-ts-demo</title>
5+
<title>redux-mode-demo</title>
66
</head>
77
<body>
88
<div id="root"></div>
9+
<script type="module" src="./src/index.tsx"></script>
910
</body>
1011
</html>

package.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
{
22
"name": "demo-react-hooks",
3-
"version": "1.0.0",
43
"main": "src/index.tsx",
54
"license": "MIT",
65
"scripts": {
7-
"start": "yarn && webpack-genius start",
8-
"build": "webpack-genius build --env production"
6+
"start": "yarn && vite-react",
7+
"build": "vite-react build"
98
},
109
"dependencies": {
11-
"@redux-model/react": "^8.2.0",
10+
"@redux-model/react": "^9.0.4",
1211
"lodash": "^4.17.15",
1312
"react": "^16.12.0",
14-
"react-dom": "^16.12.0",
15-
"react-redux": "^7.1.3",
16-
"redux": "^4.0.5"
13+
"react-dom": "^16.12.0"
1714
},
1815
"devDependencies": {
1916
"@types/lodash": "^4.14.149",
2017
"@types/node": "^13.1.6",
2118
"@types/react": "^16.9.17",
2219
"@types/react-dom": "^16.9.4",
23-
"@types/react-redux": "^7.1.5",
2420
"@types/redux-logger": "^3.0.7",
2521
"redux-logger": "^3.0.6",
2622
"typescript": "^4.0.2",
27-
"webpack-genius": "^4.13.7"
23+
"vite-react": "^0.0.23"
2824
}
2925
}
File renamed without changes.

src/components/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { FunctionComponent } from 'react';
22
import Normal from './Normal';
33
import Request from './Request';
44
import Summary from './Summary';
5-
import styles from './App.styl';
5+
import styles from './App.module.styl';
66

77
const App: FunctionComponent = () => {
88
return (
File renamed without changes.

src/components/Normal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { FunctionComponent, useCallback } from 'react';
22
import { counterModel } from '../models/CounterModel';
3-
import styles from './Normal.scss';
3+
import styles from './Normal.module.scss';
44

55
const Normal: FunctionComponent = () => {
66
const count = counterModel.useData((data) => data.amount);
File renamed without changes.

src/components/Request.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { FunctionComponent, useCallback } from 'react';
22
import { npmInfoModel } from '../models/NpmInfoModel';
3-
import styles from './Request.less';
3+
import styles from './Request.module.less';
44
import { Model } from '@redux-model/react';
55

66
const Request: FunctionComponent = () => {
File renamed without changes.

src/components/Summary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { FunctionComponent } from 'react';
22
import { summaryModel } from '../models/SummaryModel';
3-
import styles from './Summary.css';
3+
import styles from './Summary.module.css';
44

55
const Summary: FunctionComponent = () => {
66
const { times, lastTime } = summaryModel.useData();

src/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from 'react';
22
import ReactDom from 'react-dom';
3-
import { Provider } from 'react-redux';
4-
import { Middleware } from 'redux';
53
import App from './components/App';
6-
import { createReduxStore, PersistGate } from '@redux-model/react';
4+
import { createReduxStore, PersistGate, Middleware, Provider } from '@redux-model/react';
75
import { createLogger } from 'redux-logger';
86
import { summaryModel } from './models/SummaryModel';
97

src/models/SummaryModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Effects, Model } from '@redux-model/react';
1+
import { Model, Subscriptions } from '@redux-model/react';
22
import { counterModel } from './CounterModel';
33
import { npmInfoModel } from './NpmInfoModel';
44

@@ -14,7 +14,7 @@ class SummaryModel extends Model<Data> {
1414
};
1515
}
1616

17-
protected effects(): Effects<Data> {
17+
protected subscriptions(): Subscriptions<Data> {
1818
return [
1919

2020
counterModel.increase.onSuccess((state) => {

vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite-react';
2+
3+
export default defineConfig({
4+
server: {
5+
port: 3000,
6+
}
7+
});

webpack.config.ts

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

0 commit comments

Comments
 (0)