Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit 5f4edda

Browse files
committed
Update
1 parent 74e9d25 commit 5f4edda

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ Example application demonstrating react-hot-loader-3 with webpack-2, react and f
1212

1313
> Type `rs` with a carriage return to restart nodemon if you make changes to the `server.js` file or any files within the `server` folder. It's not efficient to automatically restart nodemon on file changes.
1414
15+
###### Note: Saga's do not hot load. You will have to reload the browser. [Read more about potential issues](https://github.com/redux-saga/redux-saga/issues/22#issuecomment-218737951) and/or [implement yourself](https://gist.github.com/markerikson/dc6cee36b5b6f8d718f2e24a249e0491).
16+
17+
1518
## production tasks
1619
- $ `yarn prod` (production build w/ server)
1720
- $ `yarn prod:build` (production build)
1821

1922
## staging tasks
2023
- $ `yarn staging` (staging build w/ server)
2124
- $ `yarn staging:build` (staging build)
22-
23-
24-
###### Note: Saga's do not hot load.
25-
> [Read more about potential issues](https://github.com/redux-saga/redux-saga/issues/22#issuecomment-218737951) and/or [implement yourself](https://gist.github.com/markerikson/dc6cee36b5b6f8d718f2e24a249e0491).
26-
27-

src/client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import ProviderService from './services/ProviderService';
99
import IStore from './interfaces/IStore';
1010
import ISagaStore from './interfaces/ISagaStore';
1111

12-
const rootEl: HTMLElement = document.getElementById('root');
1312
const initialState: IStore = {
1413
...(window as any)['__STATE__'],
1514
renderReducer: {
1615
isServerSide: false,
1716
},
1817
};
1918
const store: ISagaStore<IStore> = ProviderService.createProviderStore(initialState);
19+
const rootEl: HTMLElement = document.getElementById('root');
2020

2121
delete (window as any)['__STATE__'];
2222

src/server/plugin/HapiWebpackHotPlugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import ServerManager from '../ServerManager';
77
class HapiWebpackHotPlugin {
88

99
constructor(server: Hapi.Server) {
10-
const compiler: any = new Webpack(require('../../../webpack.config.js'));
10+
const config: Webpack.Configuration = require('../../../webpack.config.js');
11+
const compiler: any = Webpack(config);
1112

1213
compiler.plugin('done', (stats: any) => this._onDone(stats));
1314

src/views/Contact.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import IStore from '../interfaces/IStore';
66
import {Dispatch} from 'redux';
77
import IContactForm from '../interfaces/IContactForm';
88
import IMetaReducerState from '../interfaces/reducers/IMetaReducerState';
9+
import IAction from '../interfaces/IAction';
910

1011
const mapStateToProps = (state: IStore) => ({});
1112

1213
const mapDispatchToProps = (dispatch: Dispatch<any>) => ({
13-
setMeta: (meta: IMetaReducerState) => dispatch(MetaAction.setMeta(meta)),
14+
setMeta: (meta: IMetaReducerState): IAction<IMetaReducerState> => dispatch(MetaAction.setMeta(meta)),
1415
});
1516

1617
interface IContactProps extends FormProps {
18+
setMeta: (meta: IMetaReducerState) => IAction<IMetaReducerState>;
1719
}
1820

19-
class Contact extends React.Component {
21+
class Contact extends React.Component<IContactProps, {}> {
2022

2123
private _handleSubmitHandler: Function = (formData: IContactForm) => this._onFormSubmit(formData);
2224

webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ const config = {
107107
? null
108108
: new webpack.optimize.CommonsChunkPlugin({name: 'manifest'}),
109109

110-
isDevelopment
111-
? null
112-
: new webpack.optimize.UglifyJsPlugin(),
110+
isProduction
111+
? new webpack.optimize.UglifyJsPlugin()
112+
: null,
113113

114114
new HtmlWebpackPlugin({
115115
template: path.resolve(__dirname, 'src/index.html'),

0 commit comments

Comments
 (0)