Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"stage": 0,
"loose": "all"
"presets": [
"react",
"es2015"
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"transform-decorators-legacy",
"transform-export-extensions"
]
}
11 changes: 10 additions & 1 deletion examples/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"stage": 0
"presets": [
"react",
"es2015"
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"transform-decorators-legacy",
"transform-export-extensions"
]
}
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node -r babel/register server.js"
"start": "node -r babel-core/register server.js"
},
"author": "Andrew Clark <[email protected]>",
"license": "MIT",
Expand Down
15 changes: 9 additions & 6 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
"author": "Andrew Clark <[email protected]>",
"license": "MIT",
"devDependencies": {
"babel": "^5.8.23",
"babel-core": "^5.8.23",
"babel-loader": "^5.3.2",
"babel-plugin-react-transform": "^1.0.3",
"babel-runtime": "^5.8.20",
"babel-cli": "^6.10.1",
"babel-core": "^6.2.1",
"babel-loader": "^6.2.4",
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-export-extensions": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"express": "^4.13.3",
"lodash": "^3.10.1",
"query-string": "^2.4.1",
"react-transform-hmr": "^1.0.1",
"redux": "^2.0.0",
"serialize-javascript": "^1.1.2",
"webpack": "^1.12.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/server-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node -r babel/register server.js"
"start": "node -r babel-core/register server.js"
},
"author": "Andrew Clark <[email protected]>",
"license": "MIT",
Expand Down
22 changes: 0 additions & 22 deletions examples/webpack.config.base.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
import fs from 'fs';
import path from 'path';

const PROJECT_SRC = path.resolve(__dirname, '../src');

const babelrc = fs.readFileSync(path.join('..', '.babelrc'));
let babelLoaderQuery = {};

try {
babelLoaderQuery = JSON.parse(babelrc);
} catch (err) {
console.error('Error parsing .babelrc.');
console.error(err);
}
babelLoaderQuery.plugins = babelLoaderQuery.plugins || [];
babelLoaderQuery.plugins.push('react-transform');
babelLoaderQuery.extra = babelLoaderQuery.extra || {};
babelLoaderQuery.extra['react-transform'] = {
transforms: [{
transform: 'react-transform-hmr',
imports: ['react'],
locals: ['module']
}]
};

export default {
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
query: babelLoaderQuery,
exclude: path.resolve(__dirname, 'node_modules'),
include: [
path.resolve(__dirname),
Expand Down
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build:umd:min": "NODE_ENV=production browserify -s ReduxRouter --detect-globals lib/index.js | uglifyjs -c warnings=false -m > dist/redux-router.min.js",
"clean": "rimraf lib && rimraf dist && rimraf server.js",
"lint": "eslint src",
"test": "mocha --compilers js:babel/register --recursive --require src/__tests__/init.js src/**/*-test.js",
"test-watch": "mocha --compilers js:babel/register --recursive --require src/__tests__/init.js -w src/**/*-test.js",
"test": "mocha --compilers js:babel-core/register --recursive --require src/__tests__/init.js src/**/*-test.js",
"test-watch": "mocha --compilers js:babel-core/register --recursive --require src/__tests__/init.js -w src/**/*-test.js",
"prepublish": "npm run clean && mkdir dist && npm run build"
},
"repository": {
Expand All @@ -35,10 +35,16 @@
"server.js"
],
"devDependencies": {
"babel": "^5.6.14",
"babel-core": "5.6.15",
"babel-eslint": "^4.1.1",
"babel-loader": "^5.3.2",
"babel-cli": "^6.10.1",
"babel-core": "^6.2.1",
"babel-eslint": "^6.0.4",
"babel-loader": "^6.2.4",
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-export-extensions": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"browserify": "^13.0.1",
"chai": "^3.0.0",
"eslint": "^1.3.1",
Expand Down
3 changes: 0 additions & 3 deletions src/__tests__/ReduxRouter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ describe('<ReduxRouter>', () => {
'or a class/function (for composite components) but got: object. ' +
'Check the render method of `ReduxRouterContext`.';

const routingContextInvalidPropErrorMessage = 'Invalid prop `RoutingContext` of type `object` supplied to `ReduxRouterContext`';

const routingContextInvalidElementTypeErrorMessage = 'React.createElement: type should not be null, undefined, boolean, or number. ' +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@halt-hammerzeit I had to remove this error message after the babel6 update. Could you take look?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scarysize don't know why is that. if you redid npm install then maybe React got updated to 15.3
https://twitter.com/reactjs/status/759099486513704961

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No npm ls | grep react shows me [email protected]. Seems to be the correct minor version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scarysize So what is the error message now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically the two other Strings the test checks for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scarysize I meant what was the error message in your terminal when running tests before you removed the lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 AssertionError: expected 'Warning: Failed propType: Invalid prop `RoutingContext` of type `object` supplied to `Connect(ReduxRouterContext)`, expected `function`. Check the render method of `ReduxRouter`.' to include 'Invalid prop `RoutingContext` of type `object` supplied to `ReduxRouterContext`'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Scarysize Well then why do you ask me in the first place and also delete the test line when it tells you in plain English what needs to be corrected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted your opinion on the matter, because you added the test. I don't want to blindly remove stuff from tests, just to make them pass.

Sorry to waste your precious time 😒

'It should be a string (for DOM elements) or a ReactClass (for composite components). ' +
'Check the render method of `ReduxRouterContext`.';
Expand All @@ -235,7 +233,6 @@ describe('<ReduxRouter>', () => {

expect(consoleErrorSpy.calledTwice).to.be.true;

expect(consoleErrorSpy.args[0][0]).to.contain(routingContextInvalidPropErrorMessage);
expect(consoleErrorSpy.args[1][0]).to.contain(routingContextInvalidElementTypeErrorMessage);
});

Expand Down