Skip to content

Commit

Permalink
Merge branch 'migrate/upgrade-flow-to-0.56.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Nov 28, 2017
2 parents 9721aa1 + 52fb714 commit c1cfdf3
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 155 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[ignore]
<PROJECT_ROOT>/lib/.*
<PROJECT_ROOT>/node_modules/immutable/.*
.*/node_modules/.*/tests?/.*\.json
.*/node_modules/fbjs/.*

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
"flow": "flow",
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
"gen-flow-files": "flow gen-flow-files src/ --out-dir lib",
"copy-flow-files": "cd src; copy *.js.flow **/*.js.flow ../lib",
"build": "rimraf lib && babel src --out-dir lib",
"build": "rimraf lib && babel src --out-dir lib && flow-copy-source -v src/ lib",
"test": "NODE_ENV=test karma start --single-run",
"test:watch": "NODE_ENV=test karma start",
"commitmsg": "validate-commit-msg",
"precommit": "npm run lint && flow",
"prepush": "npm test",
"prepublish": "npm run lint && flow && npm test && npm run build && npm run copy-flow-files",
"prepublish": "npm run lint && flow && npm test && npm run build",
"open:coverage": "open coverage/lcov-report/index.html",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"storybook": "start-storybook -p 6006",
Expand Down Expand Up @@ -67,7 +65,7 @@
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"babel-plugin-flow-react-proptypes": "^2.2.1",
"babel-plugin-flow-react-proptypes": "^9.1.1",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-transform-react-constant-elements": "^6.9.1",
"babel-plugin-transform-runtime": "^6.22.0",
Expand All @@ -86,7 +84,8 @@
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^7.0.0",
"eslint-watch": "^3.0.0",
"flow-bin": "^0.46.0",
"flow-bin": "^0.56.0",
"flow-copy-source": "^1.2.1",
"flow-watch": "^1.1.0",
"get-node-dimensions": "^1.2.0",
"husky": "^0.13.1",
Expand All @@ -103,6 +102,7 @@
"karma-webpack": "^2.0.3",
"mocha": "^3.2.0",
"nyc": "^10.1.2",
"phantomjs-prebuilt": "^2.1.16",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-bootstrap": "^0.31.3",
Expand All @@ -111,8 +111,8 @@
"react-router": "^4.2.0",
"react-router-bootstrap": "^0.24.4",
"react-router-dom": "^4.2.2",
"react-router-transition-switch": "^1.0.0",
"react-transition-context": "^1.0.0",
"react-router-transition-switch": "^1.0.1",
"react-transition-context": "^2.0.0",
"rimraf": "^2.5.4",
"semantic-release": "^6.3.6",
"sinon": "^2.3.5",
Expand All @@ -126,6 +126,6 @@
"prop-types": "^15.0.0"
},
"optionalDependencies": {
"react-transition-context": "^1.0.0"
"react-transition-context": "^2.0.0"
}
}
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */
/* eslint-env browser */

import React, {Component} from 'react'
import * as React from 'react'
import Prefixer from 'inline-style-prefixer'

export type TransitionState = 'in' | 'out' | 'entering' | 'leaving'
Expand Down Expand Up @@ -50,7 +50,7 @@ export type Options = {
wrapChildren?: (children: any, transitionState: TransitionState) => React.Element<any>,
}

export function defaultWrapChildren(children: any, transitionState: TransitionState): React.Element<any> {
export function defaultWrapChildren(children: any, transitionState: TransitionState): React.Element<'div'> {
const {prefixer, fillParent} = this.props
const style: Object = {transitionProperty: 'opacity'}
if (fillParent) {
Expand Down Expand Up @@ -85,9 +85,9 @@ export function defaultWrapChildren(children: any, transitionState: TransitionSt
)
}

export function createFader(options: Options = {}): Class<Component<DefaultProps, Props, State>> {
return class Fader extends Component<DefaultProps, Props, State> {
static defaultProps = {
export function createFader(options: Options = {}): Class<React.Component<Props, State>> {
return class Fader extends React.Component<Props, State> {
static defaultProps: DefaultProps = {
animateHeight: true,
fadeInTransitionDuration: 200,
fadeInTransitionTimingFunction: 'linear',
Expand Down Expand Up @@ -204,7 +204,7 @@ export function createFader(options: Options = {}): Class<Component<DefaultProps
for (let name in this.timeouts) clearTimeout(this.timeouts[name])
}

render(): React.Element<any> {
render(): React.Element<'div'> {
const {height, transitioningHeight, wrappedChildren} = this.state
const {className, prefixer, fillParent, innerRef} = this.props
const style = {...this.props.style}
Expand Down
59 changes: 0 additions & 59 deletions src/index.js.flow

This file was deleted.

4 changes: 2 additions & 2 deletions src/withTransitionContext.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @flow

import React from 'react'
import * as React from 'react'
import {createFader, defaultWrapChildren} from './index'
import TransitionContext from 'react-transition-context'

type TransitionState = 'in' | 'out' | 'entering' | 'leaving'

function wrapChildren(children: any, transitionState: TransitionState): React.Element<any> {
function wrapChildren(children: any, transitionState: TransitionState): React.Element<typeof TransitionContext> {
return defaultWrapChildren.call(
this,
<TransitionContext transitionState={transitionState}>
Expand Down
51 changes: 0 additions & 51 deletions src/withTransitionContext.js.flow

This file was deleted.

0 comments on commit c1cfdf3

Please sign in to comment.