Skip to content

Commit fe38b41

Browse files
authored
Merge pull request #20 from PDFTron/hot-loader
[update] resolves #19
2 parents 2aa4e15 + 0ee4b99 commit fe38b41

File tree

26 files changed

+35
-61
lines changed

26 files changed

+35
-61
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"presets": [ "react", "env", "stage-2" ]
2+
"presets": [ "react", "env", "stage-2" ],
3+
"plugins": [ "react-hot-loader/babel" ]
34
}

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"babel-core": "^6.24.1",
2222
"babel-eslint": "^8.2.3",
2323
"babel-loader": "^7.1.4",
24-
"babel-plugin-transform-react-remove-prop-types": "^0.4.15",
2524
"babel-polyfill": "^6.26.0",
2625
"babel-preset-env": "^1.7.0",
2726
"babel-preset-react": "^6.24.1",
@@ -39,14 +38,12 @@
3938
"i18next": "^11.3.2",
4039
"i18next-xhr-backend": "^1.5.1",
4140
"ip": "^1.1.5",
42-
"jest": "^23.4.2",
4341
"mini-css-extract-plugin": "^0.4.2",
4442
"node-sass": "^4.5.3",
4543
"opn": "^5.4.0",
4644
"postcss-loader": "^2.1.5",
4745
"prop-types": "^15.6.2",
4846
"react": "^16.4.2",
49-
"react-color": "^2.14.1",
5047
"react-dom": "^16.3.2",
5148
"react-hot-loader": "^4.3.0",
5249
"react-i18next": "^7.6.1",
@@ -55,18 +52,16 @@
5552
"react-tooltip": "^3.6.0",
5653
"redux": "^4.0.0",
5754
"redux-logger": "^3.0.6",
58-
"redux-mock-store": "^1.5.3",
5955
"redux-thunk": "^2.3.0",
6056
"rimraf": "^2.6.1",
6157
"sass-loader": "^7.0.1",
6258
"style-loader": "^0.21.0",
6359
"svg-sprite-loader": "^3.9.2",
6460
"webpack": "^4.8.1",
6561
"webpack-bundle-analyzer": "^2.13.1",
66-
"webpack-cli": "^2.1.3",
62+
"webpack-cli": "^3.1.2",
6763
"webpack-dev-middleware": "^3.1.3",
68-
"webpack-hot-middleware": "^2.18.0",
69-
"webpack-version-file": "^0.1.3"
64+
"webpack-hot-middleware": "^2.18.0"
7065
},
7166
"dependencies": {},
7267
"author": "PDFTron Systems Inc.",

src/components/ActionButton/ActionButton.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const mapStateToProps = (state, ownProps) => ({
1212
const mapDispatchToProps = (dispatch, ownProps) => ({
1313
onClick: e => {
1414
e.stopPropagation();
15-
1615
ownProps.onClick(dispatch);
1716
}
1817
});

src/components/AnnotationPopup/AnnotationPopup.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
4-
import { hot } from 'react-hot-loader';
54
import ReactTooltip from 'react-tooltip';
65

76
import ActionButton from 'components/ActionButton';
@@ -184,4 +183,4 @@ const mapDispatchToProps = {
184183
setActiveLeftPanel: actions.setActiveLeftPanel
185184
};
186185

187-
export default hot(module)(connect(mapStateToProps, mapDispatchToProps)(AnnotationPopup));
186+
export default connect(mapStateToProps, mapDispatchToProps)(AnnotationPopup);

src/components/App/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
44
import { translate } from 'react-i18next';
5+
import { hot } from 'react-hot-loader';
56
import ReactTooltip from 'react-tooltip';
67

78
import Header from 'components/Header';
@@ -128,4 +129,4 @@ const mapDispatchToProps = {
128129
closeElements: actions.closeElements
129130
};
130131

131-
export default connect(mapStateToProps, mapDispatchToProps)(translate()(App));
132+
export default hot(module)(connect(mapStateToProps, mapDispatchToProps)(translate()(App)));

src/components/ContextMenuPopup/ContextMenuPopup.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
4-
import { hot } from 'react-hot-loader';
5-
64
import ActionButton from 'components/ActionButton';
75

86
import getClassName from 'helpers/getClassName';
@@ -129,4 +127,4 @@ const mapDispatchToProps = dispatch => ({
129127
closeElements: dataElements => dispatch(actions.closeElements(dataElements))
130128
});
131129

132-
export default hot(module)(connect(mapStateToProps, mapDispatchToProps)(ContextMenuPopup));
130+
export default connect(mapStateToProps, mapDispatchToProps)(ContextMenuPopup);

src/components/ErrorModal/ErrorModal.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
44
import { translate } from 'react-i18next';
5-
import { hot } from 'react-hot-loader';
65

76
import getClassName from 'helpers/getClassName';
87
import actions from 'actions';
@@ -74,4 +73,4 @@ const mapDispatchToProps = {
7473
closeElements: actions.closeElements,
7574
};
7675

77-
export default hot(module)(connect(mapStateToProps, mapDispatchToProps)(translate()(ErrorModal)));
76+
export default connect(mapStateToProps, mapDispatchToProps)(translate()(ErrorModal));

src/components/Header/Header.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
4-
import { hot } from 'react-hot-loader';
54

65
import HeaderItems from 'components/HeaderItems';
76

@@ -39,4 +38,4 @@ const mapStateToProps = state => ({
3938
activeHeaderItems: selectors.getActiveHeaderItems(state),
4039
});
4140

42-
export default hot(module)(connect(mapStateToProps)(Header));
41+
export default connect(mapStateToProps)(Header);

src/components/LeftPanel/LeftPanel.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
4-
import { hot } from 'react-hot-loader';
54

65
import LeftPanelTabs from 'components/LeftPanelTabs';
76
import NotesPanel from 'components/NotesPanel';
@@ -70,4 +69,4 @@ const mapDispatchToProps = {
7069
closeElement: actions.closeElement,
7170
};
7271

73-
export default hot(module)(connect(mapStatesToProps, mapDispatchToProps)(LeftPanel));
72+
export default connect(mapStatesToProps, mapDispatchToProps)(LeftPanel);

src/components/LeftPanelTabs/LeftPanelTabs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { connect } from 'react-redux';
4-
import { hot } from 'react-hot-loader';
54
import { translate } from 'react-i18next';
65

76
import Button from 'components/Button';
@@ -87,4 +86,4 @@ const mapDispatchToProps = {
8786
setActiveLeftPanel: actions.setActiveLeftPanel
8887
};
8988

90-
export default hot(module)(connect(mapStateToProps, mapDispatchToProps)(translate()(LeftPanelTabs)));
89+
export default connect(mapStateToProps, mapDispatchToProps)(translate()(LeftPanelTabs));

0 commit comments

Comments
 (0)