Skip to content

Commit

Permalink
v0.11.2 (#947)
Browse files Browse the repository at this point in the history
* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Revert "Added HtmlWebpackPlugin (#916)"

This reverts commit f36e9d26791d2c2389187cbdb9647f7335578516.

* Second attempt fix of script race condition

* Fixed flow-typed Overwrite (#940)

* Release 0.11.0 (#921)

* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Update package.json

* Added temporary hack to fix flow-typed

* Updated repo badge to reflect github releases

* Fixed unexpected merge override of changes

* Added support for debugging prod build, fixed prod styles, updated deps

* Updated CHANGELOG [ci skip]

* Used hash history instead of html5 router to fix route resolution

* Added snapshots to version control

* Fix router (#949)

* v0.11.1 (#941)

* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Revert "Added HtmlWebpackPlugin (#916)"

This reverts commit f36e9d26791d2c2389187cbdb9647f7335578516.

* Second attempt fix of script race condition

* Fixed flow-typed Overwrite (#940)

* Release 0.11.0 (#921)

* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Update package.json

* Added temporary hack to fix flow-typed

* Updated repo badge to reflect github releases

* Fixed unexpected merge override of changes

* Added support for debugging prod build, fixed prod styles, updated deps

* Updated CHANGELOG [ci skip]

* Used hash history instead of html5 router to fix route resolution

* Use local flow-bin package (#945)

If this setting is not present then flow extension suggests to install
flow globally which should is not necessary at all because locally
flow-bin is already available.

* Fix router

* Updated all deps to latest semver

* Switch from BrowserHistory to HashHistory (#958)

* Fixed yarn package semver lock

* Renamed `./app/main.development.js` => `./app/main.{dev,prod}.js` (#963)

* Renamed `./app/main.js` => `./app/main.{dev,prod}.js`

* Renamed configStore files to keep filenames consistent

* Removed ./app/main.prod.* files from version control

* Updated CHANGELOG

* Migrated all tests to jest snapshot tests

* Added erb-sqlite-example to README [ci skip]

* Updated deps to latest semver

* Updated CHANGELOG release date [ci skip]
  • Loading branch information
amilajack authored May 1, 2017
1 parent 4d46ca8 commit 2b37c30
Show file tree
Hide file tree
Showing 19 changed files with 469 additions and 269 deletions.
53 changes: 50 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
flow-typed/
app/dist/
app/main.js
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
.eslintcache

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
app/node_modules

# OSX
.DS_Store

# flow-typed
flow-typed/npm/*
!flow-typed/npm/module_vx.x.x.js

# App packaged
release
app/main.prod.js
app/main.prod.js.map
app/bundle.js
app/bundle.js.map
app/style.css
app/style.css.map
dist
dll
main.js
main.js.map

.idea
npm-debug.log.*
__snapshots__
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.*/node_modules/fbjs/.*
.*/node_modules/stylelint/.*
.*/node_modules/babel-plugin-flow-runtime/.*
.*/app/main.js
.*/app/main.prod.js
.*/app/main.prod.js.map
.*/app/dist/.*
.*/release/.*
.*/git/.*
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ flow-typed/npm/*

# App packaged
release
app/main.js
app/main.js.map
app/main.prod.js
app/main.prod.js.map
app/bundle.js
app/bundle.js.map
app/style.css
Expand All @@ -50,4 +50,3 @@ main.js.map

.idea
npm-debug.log.*
__snapshots__
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# 0.11.2 (2017.5.1)

Yay! Another patch release. This release mostly includes refactorings and router bug fixes. Huge thanks to @anthonyraymond!

⚠️ Windows electron builds are failing because of [this issue](https://github.com/electron/electron/issues/9321). This is not an issue with the boilerplate ⚠️

#### Breaking
- **Renamed `./app/main.development.js` => `./app/main.{dev,prod}.js`:** [#963](https://github.com/chentsulin/electron-react-boilerplate/pull/963)

#### Fixes
- **Fixed reloading when not on `/` path:** [#958](https://github.com/chentsulin/electron-react-boilerplate/pull/958) [#949](https://github.com/chentsulin/electron-react-boilerplate/pull/949)

#### Additions
- **Added support for stylefmt:** [#960](https://github.com/chentsulin/electron-react-boilerplate/pull/960)

# 0.11.1 (2017.4.23)

You can now debug the production build with devtools like so:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ See [electron-builder CLI Usage](https://github.com/electron-userland/electron-b

#### Module Structure

This boilerplate uses a [two package.json structure](https://github.com/electron-userland/electron-builder/wiki/Two-package.json-Structure).
This boilerplate uses a [two package.json structure](https://github.com/electron-userland/electron-builder/wiki/Two-package.json-Structure). For an example app that uses this boilerplate and packages native dependencies, see [erb-sqlite-example](https://github.com/amilajack/erb-sqlite-example).

1. If the module is native to a platform or otherwise should be included with the published package (i.e. bcrypt, openbci), it should be listed under `dependencies` in `./app/package.json`.
2. If a module is `import`ed by another module, include it in `dependencies` in `./package.json`. See [this ESLint rule](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md).
Expand Down
16 changes: 15 additions & 1 deletion app/main.development.js → app/main.dev.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* eslint global-require: 1, flowtype-errors/show-errors: 0 */
// @flow

/**
* This module executes inside of electron's main process. You can start
* electron renderer process from here and communicate with the other processes
* through IPC.
*
* When running `npm run build` or `npm run build-main`, this file is compiled to
* `./app/main.prod.js` using webpack. This gives us some performance wins.
*
* @flow
*/
import { app, BrowserWindow } from 'electron';
import MenuBuilder from './menu';

Expand Down Expand Up @@ -31,6 +41,10 @@ const installExtensions = async () => {
};


/**
* Add event listeners...
*/

app.on('window-all-closed', () => {
// Respect the OSX convention of having the application in memory even
// after all windows have been closed
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"productName": "electron-react-boilerplate",
"version": "1.0.0",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "./main.js",
"main": "./main.prod.js",
"author": {
"name": "C. T. Lin",
"email": "[email protected]",
"url": "https://github.com/chentsulin"
},
"scripts": {
"postinstall": "npm rebuild --runtime=electron --target=1.6.1 --disturl=https://atom.io/download/atom-shell --build-from-source"
"postinstall": "npm rebuild --runtime=electron --target=1.6.6 --disturl=https://atom.io/download/atom-shell --build-from-source"
},
"license": "MIT",
"dependencies": {
Expand Down
15 changes: 6 additions & 9 deletions app/routes.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
/* eslint flowtype-errors/show-errors: 0 */
import React from 'react';
import { HashRouter as Router } from 'react-router-dom';
import { Switch, Route } from 'react-router';
import App from './containers/App';
import HomePage from './containers/HomePage';
import CounterPage from './containers/CounterPage';

export default () => (
<Router>
<App>
<Switch>
<Route path="/counter" component={CounterPage} />
<Route path="/" component={HomePage} />
</Switch>
</App>
</Router>
<App>
<Switch>
<Route path="/counter" component={CounterPage} />
<Route path="/" component={HomePage} />
</Switch>
</App>
);
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { hashHistory } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { routerMiddleware, push } from 'react-router-redux';
import { createHashHistory } from 'history';
import { routerMiddleware, routerActions } from 'react-router-redux';
import { createLogger } from 'redux-logger';
import rootReducer from '../reducers';
import * as counterActions from '../actions/counter';
import type { counterStateType } from '../reducers/counter';

const history = createBrowserHistory();
const history = createHashHistory();

const configureStore = (initialState: ?counterStateType) => {
// Redux Configuration
Expand All @@ -26,13 +25,13 @@ const configureStore = (initialState: ?counterStateType) => {
middleware.push(logger);

// Router Middleware
const router = routerMiddleware(hashHistory);
const router = routerMiddleware(history);
middleware.push(router);

// Redux DevTools Configuration
const actionCreators = {
...counterActions,
push,
...routerActions,
};
// If Redux DevTools Extension is installed use it, otherwise use Redux compose
/* eslint-disable no-underscore-dangle */
Expand Down
4 changes: 2 additions & 2 deletions app/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
if (process.env.NODE_ENV === 'production') {
module.exports = require('./configureStore.production'); // eslint-disable-line global-require
module.exports = require('./configureStore.prod'); // eslint-disable-line global-require
} else {
module.exports = require('./configureStore.development'); // eslint-disable-line global-require
module.exports = require('./configureStore.dev'); // eslint-disable-line global-require
}
File renamed without changes.
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "electron-react-boilerplate",
"productName": "ElectronReact",
"version": "0.11.0",
"version": "0.11.2",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "main.js",
"scripts": {
"test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js",
"test-all": "npm run lint && npm run flow && npm run test && npm run build && npm run test-e2e",
Expand All @@ -22,7 +21,7 @@
"prestart": "npm run build",
"flow": "flow",
"flow-typed": "rm -rf flow-typed && flow-typed install --overwrite || true",
"start-hot-renderer": "cross-env HOT=1 NODE_ENV=development electron -r babel-register -r babel-polyfill ./app/main.development",
"start-hot-renderer": "cross-env HOT=1 NODE_ENV=development electron -r babel-register -r babel-polyfill ./app/main.dev",
"postinstall": "concurrently \"npm run flow-typed\" \"npm run build-dll\" \"install-app-deps\" \"node node_modules/fbjs-scripts/node/check-dev-engines.js package.json\"",
"dev": "cross-env START_HOT=1 npm run hot-updates-server",
"package": "npm run build && build --publish never",
Expand All @@ -39,8 +38,8 @@
"dist/",
"node_modules/",
"app.html",
"main.js",
"main.js.map",
"main.prod.js",
"main.prod.js.map",
"package.json"
],
"dmg": {
Expand Down Expand Up @@ -123,7 +122,7 @@
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-dynamic-import-webpack": "^1.0.1",
"babel-plugin-flow-runtime": "^0.10.0",
"babel-plugin-flow-runtime": "^0.11.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-es2015-classes": "^6.24.1",
"babel-polyfill": "^6.23.0",
Expand All @@ -141,17 +140,18 @@
"cross-spawn": "^5.1.0",
"css-loader": "^0.28.0",
"devtron": "^1.4.0",
"electron": "^1.6.5",
"electron-builder": "^17.0.1",
"electron": "^1.6.6",
"electron-builder": "^17.1.1",
"electron-devtools-installer": "^2.2.0",
"enzyme": "^2.8.2",
"enzyme-to-json": "^1.5.1",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-formatter-pretty": "^1.1.0",
"eslint-import-resolver-webpack": "^0.8.1",
"eslint-plugin-compat": "^1.0.2",
"eslint-plugin-flowtype": "^2.32.1",
"eslint-plugin-flowtype-errors": "^3.0.3",
"eslint-plugin-flowtype-errors": "^3.2.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jest": "^19.0.1",
"eslint-plugin-jsx-a11y": "^4.0.0",
Expand All @@ -160,13 +160,13 @@
"express": "^4.15.2",
"fbjs-scripts": "^0.7.1",
"file-loader": "^0.11.1",
"flow-bin": "^0.44.2",
"flow-runtime": "^0.10.0",
"flow-typed": "^2.1.1",
"flow-bin": "^0.45.0",
"flow-runtime": "^0.11.1",
"flow-typed": "^2.1.2",
"html-webpack-plugin": "^2.28.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^19.0.2",
"jsdom": "^9.12.0",
"jsdom": "^10.1.0",
"minimist": "^1.2.0",
"node-sass": "^4.5.2",
"react-addons-test-utils": "^15.5.1",
Expand All @@ -182,7 +182,7 @@
"url-loader": "^0.5.8",
"webpack": "^2.4.1",
"webpack-bundle-analyzer": "^2.4.0",
"webpack-dev-server": "^2.4.3",
"webpack-dev-server": "^2.4.5",
"webpack-merge": "^4.1.0"
},
"dependencies": {
Expand All @@ -199,11 +199,11 @@
"react-router-redux": "^5.0.0-alpha.6",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0",
"source-map-support": "^0.4.14"
"source-map-support": "^0.4.15"
},
"devEngines": {
"node": ">=6.x",
"npm": ">=3.x",
"yarn": "0.21.3"
"yarn": ">=0.21.3"
}
}
13 changes: 13 additions & 0 deletions test/actions/__snapshots__/counter.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`actions should decrement should create decrement action 1`] = `
Object {
"type": "DECREMENT_COUNTER",
}
`;

exports[`actions should increment should create increment action 1`] = `
Object {
"type": "INCREMENT_COUNTER",
}
`;
4 changes: 2 additions & 2 deletions test/actions/counter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as actions from '../../app/actions/counter';

describe('actions', () => {
it('should increment should create increment action', () => {
expect(actions.increment()).toEqual({ type: actions.INCREMENT_COUNTER });
expect(actions.increment()).toMatchSnapshot();
});

it('should decrement should create decrement action', () => {
expect(actions.decrement()).toEqual({ type: actions.DECREMENT_COUNTER });
expect(actions.decrement()).toMatchSnapshot();
});

it('should incrementIfOdd should create increment action', () => {
Expand Down
Loading

0 comments on commit 2b37c30

Please sign in to comment.