Skip to content

Commit

Permalink
Fix HMR 'Aborted because 0 is not accepted' issue (#1386) (#1404)
Browse files Browse the repository at this point in the history
v0.13.2
  • Loading branch information
amilajack authored Feb 1, 2018
1 parent 066f022 commit 8595fee
Show file tree
Hide file tree
Showing 7 changed files with 2,158 additions and 2,044 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.13.2 (2018.1.31)
- Hot Module Reload (HMR) fixes
- Bumped all dependencies to latest semver
- Prevent error propagation of `CheckNativeDeps` script

# 0.13.1 (2018.1.13)
- Hot Module Reload (HMR) fixes
- Bumped all dependencies to latest semver
Expand Down
4 changes: 1 addition & 3 deletions app/components/Counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Props = {
counter: number
};

class Counter extends Component<Props> {
export default class Counter extends Component<Props> {
props: Props;

render() {
Expand Down Expand Up @@ -42,5 +42,3 @@ class Counter extends Component<Props> {
);
}
}

export default Counter;
22 changes: 12 additions & 10 deletions app/containers/Root.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
// @flow
import React from 'react';
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'react-router-redux';
import Routes from '../routes';

type RootType = {
type Props = {
store: {},
history: {}
};

export default function Root({ store, history }: RootType) {
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<Routes />
</ConnectedRouter>
</Provider>
);
export default class Root extends Component<Props> {
render() {
return (
<Provider store={this.props.store}>
<ConnectedRouter history={this.props.history}>
<Routes />
</ConnectedRouter>
</Provider>
);
}
}
28 changes: 16 additions & 12 deletions internals/scripts/CheckNativeDep.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ import { dependencies } from '../../package.json';
fs.readdirSync('node_modules')
.filter(folder => fs.existsSync(`node_modules/${folder}/binding.gyp`));

// Find the reason for why the dependency is installed. If it is installed
// because of a devDependency then that is okay. Warn when it is installed
// because of a dependency
const dependenciesObject = JSON.parse(execSync(`npm ls ${nativeDeps.join(' ')} --json`).toString());
const rootDependencies = Object.keys(dependenciesObject.dependencies);
const filteredRootDependencies = rootDependencies
.filter(rootDependency => dependenciesKeys.includes(rootDependency));

if (filteredRootDependencies.length > 0) {
const plural = filteredRootDependencies.length > 1;
console.log(`
try {
// Find the reason for why the dependency is installed. If it is installed
// because of a devDependency then that is okay. Warn when it is installed
// because of a dependency
const dependenciesObject = JSON.parse(execSync(`npm ls ${nativeDeps.join(' ')} --json`).toString());
const rootDependencies = Object.keys(dependenciesObject.dependencies);
const filteredRootDependencies = rootDependencies
.filter(rootDependency => dependenciesKeys.includes(rootDependency));

if (filteredRootDependencies.length > 0) {
const plural = filteredRootDependencies.length > 1;
console.log(`
${chalk.whiteBright.bgYellow.bold('Webpack does not work with native dependencies.')}
${chalk.bold(filteredRootDependencies.join(', '))} ${plural ? 'are native dependencies' : 'is a native dependency'} and should be installed inside of the "./app" folder.
Expand All @@ -44,6 +45,9 @@ ${chalk.bold('https://github.com/chentsulin/electron-react-boilerplate/wiki/Modu
`);

process.exit(1);
process.exit(1);
}
} catch (e) {
console.log('Native dependencies could not be checked');
}
})();
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "electron-react-boilerplate",
"productName": "ElectronReact",
"version": "0.13.1",
"version": "0.13.2",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"scripts": {
"build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",
Expand Down Expand Up @@ -119,8 +119,8 @@
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.0",
"babel-jest": "^22.0.4",
"babel-eslint": "^8.2.1",
"babel-jest": "^22.1.0",
"babel-loader": "^7.1.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
Expand All @@ -137,55 +137,55 @@
"chalk": "^2.3.0",
"concurrently": "^3.5.1",
"cross-env": "^5.1.3",
"cross-spawn": "^5.1.0",
"css-loader": "^0.28.8",
"cross-spawn": "^6.0.4",
"css-loader": "^0.28.9",
"detect-port": "^1.2.2",
"electron": "^1.7.10",
"electron-builder": "^19.52.1",
"electron": "^1.7.11",
"electron-builder": "^19.55.3",
"electron-devtools-installer": "^2.2.3",
"electron-rebuild": "^1.6.0",
"electron-rebuild": "^1.7.3",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.0",
"eslint": "^4.15.0",
"enzyme-to-json": "^3.3.1",
"eslint": "^4.16.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-formatter-pretty": "^1.3.0",
"eslint-import-resolver-webpack": "^0.8.4",
"eslint-plugin-compat": "^2.1.0",
"eslint-plugin-flowtype": "^2.41.0",
"eslint-plugin-compat": "^2.2.0",
"eslint-plugin-flowtype": "^2.42.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.5.0",
"eslint-plugin-jest": "^21.7.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-react": "^7.6.1",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.2",
"fbjs-scripts": "^0.8.1",
"file-loader": "^1.1.6",
"flow-bin": "^0.63.1",
"flow-bin": "^0.64.0",
"flow-runtime": "^0.16.0",
"flow-typed": "^2.2.3",
"flow-typed": "^2.3.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.0.4",
"jsdom": "^11.5.1",
"jest": "^22.1.4",
"jsdom": "^11.6.2",
"minimist": "^1.2.0",
"node-sass": "^4.7.2",
"npm-logical-tree": "^1.2.0",
"npm-logical-tree": "^1.2.1",
"react-test-renderer": "^16.2.0",
"redux-logger": "^3.0.6",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"sinon": "^4.1.4",
"spectron": "^3.7.2",
"style-loader": "^0.19.1",
"sinon": "^4.2.2",
"spectron": "^3.8.0",
"style-loader": "^0.20.1",
"stylefmt": "^6.0.0",
"stylelint": "^8.4.0",
"stylelint-config-standard": "^18.0.0",
"uglifyjs-webpack-plugin": "1.1.6",
"uglifyjs-webpack-plugin": "1.1.8",
"url-loader": "^0.6.2",
"webpack": "^3.10.0",
"webpack-bundle-analyzer": "^2.9.2",
"webpack-dev-server": "^2.10.0",
"webpack-dev-server": "^2.11.1",
"webpack-merge": "^4.1.1"
},
"dependencies": {
Expand All @@ -202,7 +202,7 @@
"react-router-redux": "^5.0.0-alpha.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"source-map-support": "^0.5.0"
"source-map-support": "^0.5.3"
},
"devEngines": {
"node": ">=7.x",
Expand Down
1 change: 0 additions & 1 deletion webpack.config.main.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default merge.smart(baseConfig, {

entry: './app/main.dev',

// 'main.js' in root
output: {
path: __dirname,
filename: './app/main.prod.js'
Expand Down
Loading

0 comments on commit 8595fee

Please sign in to comment.