Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to react 16 #191

Merged
merged 21 commits into from
Oct 15, 2017
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1367edf
Upgrade react to version 16, update to enzyme 3
tobilen Sep 30, 2017
e66261f
Use enzyme adapter, start fixing tests
tobilen Sep 30, 2017
bc9f6a7
Upgrade storybook, babel and webpack dependencies
tobilen Sep 30, 2017
465fe66
Upgrade babel-preset-flow, fix testrunner to work with webpack 3
tobilen Sep 30, 2017
67a280f
Accept react 0.13 to 16 as peer dependency
tobilen Sep 30, 2017
31916e0
Remove setProps calls, since they dont seem to be working right
tobilen Sep 30, 2017
b5bb104
Refactor test component to use state and setState instead of setProps
tobilen Oct 1, 2017
214e081
Fix linting
tobilen Oct 1, 2017
a3960fe
Remove chai-enzyme
tobilen Oct 1, 2017
5952e41
Remove unused import
tobilen Oct 1, 2017
a13a89b
Remove flow typechecking from storybook until its upgraded to flow 0.54+
tobilen Oct 1, 2017
01ac104
Require node_js version > 5
tobilen Oct 1, 2017
878bf30
Ignore flow typechecks for radium depdendency
tobilen Oct 1, 2017
ee2f614
Fix webpack config to match new api
tobilen Oct 1, 2017
9022b85
Add test for react16 fragment support
tobilen Oct 1, 2017
a4673cf
Extended fragment test to also render a string component
tobilen Oct 1, 2017
4963f88
Include react 0.13.x and 16.x.x in peer dependency version range
tobilen Oct 5, 2017
784a04c
Fix prop type and make sure we dont pass style props to flipMove
tobilen Oct 5, 2017
f096d29
Upgrade to storybook 3.2.12
tobilen Oct 5, 2017
d3304dc
Individually check if items are falsy, return them if they are
tobilen Oct 5, 2017
96779a7
disable linting error for prop filtering
tobilen Oct 5, 2017
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
2 changes: 2 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.*/node_modules/editions/.*
.*/node_modules/flow-coverage-report/.*
.*/node_modules/preact/.*
.*/node_modules/@storybook/.*
.*/node_modules/radium/.*
Copy link
Owner

Choose a reason for hiding this comment

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

Guessing modern versions of Storybook use Radium?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not directly, but via react-treebeard. We use glamorous for our own components

Copy link
Owner

Choose a reason for hiding this comment

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

Oh cool! Wasn't aware you were a contributor to Storybook - thanks for your work there :)


[include]

Expand Down
5 changes: 3 additions & 2 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* eslint-disable */
import { configure } from '@kadira/storybook';
import React from 'react';
import { configure } from '@storybook/react';

const req = require.context('../stories', true, /\.stories\.js$/);

function loadStories() {
req.keys().forEach((filename) => req(filename));
}

configure(loadStories, module);
configure(loadStories, module);
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cache:
directories:
- node_modules
node_js:
- "4"
- "6"
- "8"
before_script:
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function createConfig(config) {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
loader: 'babel-loader',
exclude: /node_modules/,
},
],
Expand Down
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,29 @@
"web-animations"
],
"peerDependencies": {
"react": "0.13.x || 0.14.x || 15.x.x",
"react-dom": "0.13.x || 0.14.x || 15.x.x"
"react": ">0.13.x <16.x.x",
Copy link
Collaborator

@Hypnosphi Hypnosphi Oct 4, 2017

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

Good catch 👍

Copy link
Owner

@joshwcomeau joshwcomeau Oct 5, 2017

Choose a reason for hiding this comment

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

Looks like >=0.13.x <=16.x.x works

screen shot 2017-10-05 at 8 12 33 am

screen shot 2017-10-05 at 8 12 26 am

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

😊

"react-dom": ">0.13.x <16.x.x"
},
"devDependencies": {
"@kadira/storybook": "2.30.1",
"@types/react": "15.0.24",
"babel": "6.1.18",
"babel-cli": "6.2.0",
"babel-core": "6.2.1",
"@storybook/react": "^3.2.8",
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: can we omit the ^?

I don't really think this even matters anymore, with Yarn/NPM5. But, my inner OCD wants it to be consistent, haha.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You probably also want to upgrade it to 3.2.12, there has been some critical bugfixes

"@types/react": "16.0.7",
"babel": "6.23.0",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-loader": "6.2.1",
"babel-loader": "7.1.2",
"babel-plugin-add-module-exports": "0.1.1",
"babel-plugin-istanbul": "4.1.4",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-object-assign": "6.3.13",
"babel-preset-es2015": "6.1.18",
"babel-preset-flow": "6.23.0",
"babel-preset-react": "6.3.13",
"babel-preset-stage-0": "6.1.18",
"chai": "3.5.0",
"chai-enzyme": "0.7.1",
"create-react-class": "15.5.2",
"enzyme": "2.8.2",
"babel-preset-es2015": "6.24.1",
"babel-preset-flow": "7.0.0-beta.2",
"babel-preset-react": "6.24.1",
"babel-preset-stage-0": "6.24.1",
"chai": "4.1.2",
"create-react-class": "15.6.2",
"enzyme": "3.0.0",
"enzyme-adapter-react-16": "^1.0.0",
"eslint": "3.10.0",
"eslint-config-airbnb": "12.0.0",
"eslint-config-prettier": "^2.3.0",
Expand All @@ -82,28 +82,28 @@
"flow-bin": "0.54.0",
"flow-coverage-report": "0.3.0",
"husky": "0.14.1",
"karma": "0.13.19",
"karma": "1.7.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "0.2.2",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.1",
"karma-mocha": "0.2.1",
"karma-sinon": "1.0.4",
"karma-sinon-chai": "1.1.0",
"karma-mocha": "1.3.0",
"karma-sinon": "1.0.5",
"karma-sinon-chai": "1.3.2",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "1.7.0",
"karma-webpack": "2.0.4",
"lodash": "4.3.0",
"mocha": "2.4.5",
"mocha": "3.5.3",
"preact": "8.1.0",
"preact-compat": "3.16.0",
"prettier": "^1.6.1",
"prop-types": "15.5.8",
"react": "15.6.1",
"react-dom": "15.6.1",
"react-test-renderer": "15.6.1",
"react": "16.0.0",
"react-dom": "16.0.0",
"react-test-renderer": "16",
"sinon": "1.17.3",
"sinon-chai": "2.8.0",
"tslint": "5.2.0",
"typescript": "2.3.2",
"webpack": "1.12.11"
"webpack": "3.6.0"
}
}
2 changes: 1 addition & 1 deletion stories/appear-animations.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';
import FlipMoveListItem from './helpers/FlipMoveListItem';
Expand Down
2 changes: 1 addition & 1 deletion stories/enter-leave-animations.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';
import FlipMoveListItem from './helpers/FlipMoveListItem';
Expand Down
2 changes: 1 addition & 1 deletion stories/github-issues.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-plusplus */
import React, { Component } from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';
import range from 'lodash/range';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';
Expand Down
2 changes: 1 addition & 1 deletion stories/hooks.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';

Expand Down
2 changes: 1 addition & 1 deletion stories/invalid.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';

Expand Down
2 changes: 1 addition & 1 deletion stories/legacy.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/forbid-prop-types */
import React, { Component } from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';
import shuffle from 'lodash/shuffle';
import range from 'lodash/range';
import PropTypes from 'prop-types';
Expand Down
2 changes: 1 addition & 1 deletion stories/misc.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMove from '../src';
import FlipMoveWrapper from './helpers/FlipMoveWrapper';
Expand Down
2 changes: 1 addition & 1 deletion stories/primary.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';
import FlipMoveListItem from './helpers/FlipMoveListItem';
Expand Down
2 changes: 1 addition & 1 deletion stories/sequencing.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';
import FlipMoveListItem from './helpers/FlipMoveListItem';
Expand Down
2 changes: 1 addition & 1 deletion stories/special-props.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { storiesOf } from '@storybook/react';

import FlipMoveWrapper from './helpers/FlipMoveWrapper';

Expand Down
Loading