Skip to content

Commit ae32e71

Browse files
authored
update flow to 63.1 (keybase#10144)
* update flow to 63.1 * WIP
1 parent 2f2a4bc commit ae32e71

107 files changed

Lines changed: 1129 additions & 785 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.eslintignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
/shared/markdown/parser.js
1919
/shared/node_modules
2020
/shared/test/setupTestFrameworkScriptFile.js
21+
/shared/flow-typed/**
2122
/visdiff
2223
/shared/react-native/react-native-contacts

‎shared/.flowconfig‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ sketchy-null-mixed=off
4747
sketchy-null-number=off
4848
unclear-type=off
4949
untyped-import=off
50+
deprecated-declare-exports=off
5051

5152
[version]
52-
0.62
53+
0.63.1

‎shared/actions/tracker.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ function _setupTrackerHandlers() {
588588
(param: any, response: ?Object, dispatch: Dispatch, getState: () => TypedState) => {
589589
// If we don't finish the session by our timeout, we'll display an error
590590
const trackerTimeout = 1e3 * 60 * 5
591-
let trackerTimeoutError = 0
591+
let trackerTimeoutError = null
592592

593593
const onStart = username => {
594594
// Don't do this on mobile
@@ -602,7 +602,7 @@ function _setupTrackerHandlers() {
602602

603603
const onFinish = () => {
604604
session.end()
605-
clearTimeout(trackerTimeoutError)
605+
trackerTimeoutError && clearTimeout(trackerTimeoutError)
606606
}
607607

608608
const cancelHandler: CancelHandlerType = session => {

‎shared/chat/conversation/rekey/container.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,12 @@ const Impossible = () => null
6767
export default compose(
6868
connect(mapStateToProps, mapDispatchToProps, mergeProps),
6969
branch(
70-
(props: StateProps) => !!props.rekeyInfo && !!props.rekeyInfo.get('youCanRekey'),
70+
props => !!props.rekeyInfo && !!props.rekeyInfo.get('youCanRekey'),
7171
// $FlowIssue doesn't like sending onEnterPaperkey into it cause it doens't use it
7272
renderComponent(YouRekey)
7373
),
7474
branch(
75-
(props: StateProps) => !!props.rekeyInfo && !!props.rekeyInfo.get('rekeyParticipants').count(),
76-
// $FlowIssue doesn't like sending mixed props down
75+
props => !!props.rekeyInfo && !!props.rekeyInfo.get('rekeyParticipants').count(),
7776
renderComponent(ParticipantRekey)
7877
),
7978
renderNothing

‎shared/common-adapters/hoc-timers.js‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,11 @@
22
import * as React from 'react'
33

44
// duplicating this from the .flow file as we don't pull in those files for rn
5-
type TimerFunc = (func: () => void, timing: number) => number
6-
type ClearTimerFunc = (id: ?number) => void
75
type TimerProps = {
8-
setTimeout: TimerFunc,
9-
clearTimeout: ClearTimerFunc,
10-
setInterval: TimerFunc,
11-
clearInterval: ClearTimerFunc,
12-
}
13-
14-
function clearId(clearFunc: (id?: number) => void, array: Array<number>, id?: ?number): void {
15-
if ((id || id === 0) && array.includes(id)) {
16-
array.splice(array.indexOf(id), 1)
17-
clearFunc(id)
18-
}
6+
setTimeout: (func: () => void, timing: number) => TimeoutID,
7+
clearTimeout: (id: TimeoutID) => void,
8+
setInterval: (func: () => void, timing: number) => IntervalID,
9+
clearInterval: (id: IntervalID) => void,
1910
}
2011

2112
function getDisplayName(WrappedComponent): string {
@@ -25,8 +16,8 @@ function getDisplayName(WrappedComponent): string {
2516
export default function HOCTimers(ComposedComponent: any) {
2617
class TimersComponent extends React.Component<any> {
2718
static displayName = `HOCTimers(${getDisplayName(ComposedComponent)})`
28-
_timeoutIds: Array<number>
29-
_intervalIds: Array<number>
19+
_timeoutIds: Array<TimeoutID>
20+
_intervalIds: Array<IntervalID>
3021
_timerFuncs: TimerProps
3122

3223
constructor(props: any) {
@@ -40,15 +31,21 @@ export default function HOCTimers(ComposedComponent: any) {
4031
return id
4132
},
4233
clearTimeout: id => {
43-
clearId(clearTimeout, this._timeoutIds, id)
34+
if ((id || id === 0) && this._timeoutIds.includes(id)) {
35+
this._timeoutIds.splice(this._timeoutIds.indexOf(id), 1)
36+
clearTimeout(id)
37+
}
4438
},
4539
setInterval: (f, n) => {
4640
const id = setInterval(f, n)
4741
this._intervalIds.push(id)
4842
return id
4943
},
5044
clearInterval: id => {
51-
clearId(clearInterval, this._intervalIds, id)
45+
if ((id || id === 0) && this._intervalIds.includes(id)) {
46+
this._intervalIds.splice(this._intervalIds.indexOf(id), 1)
47+
clearInterval(id)
48+
}
5249
},
5350
}
5451
}

‎shared/desktop/app/app-state.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type Options = {
3333

3434
export type Managed = {
3535
winRef: ?any,
36-
debounceChangeTimer: ?number,
36+
debounceChangeTimer: ?TimeoutID,
3737
showHandlers: Array<Function>,
3838
resizeHandlers: Array<Function>,
3939
moveHandlers: Array<Function>,
@@ -224,7 +224,7 @@ export default class AppState {
224224
this.managed.closedHandlers = []
225225
this.managed.winRef = null
226226
}
227-
clearTimeout(this.managed.debounceChangeTimer)
227+
this.managed.debounceChangeTimer && clearTimeout(this.managed.debounceChangeTimer)
228228
}
229229

230230
_isValidWindowState(state: State): boolean {
@@ -302,7 +302,7 @@ export default class AppState {
302302
}
303303

304304
_debounceChangeHandler() {
305-
clearTimeout(this.managed.debounceChangeTimer)
305+
this.managed.debounceChangeTimer && clearTimeout(this.managed.debounceChangeTimer)
306306
this.managed.debounceChangeTimer = setTimeout(() => {
307307
this._updateState()
308308
}, this.config.eventHandlingDelay)

‎shared/flow-typed/npm/@storybook/addon-storyshots_vx.x.x.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: c444c4d026ba0c9eabeaf7307b0c3979
2-
// flow-typed version: <<STUB>>/@storybook/addon-storyshots_v3.2.13/flow_v0.60.1
1+
// flow-typed signature: f301dd0749339100485763f9e60130bc
2+
// flow-typed version: <<STUB>>/@storybook/addon-storyshots_v3.2.17/flow_v0.63.1
33

44
/**
55
* This is an autogenerated libdef stub for:

‎shared/flow-typed/npm/@storybook/addons_vx.x.x.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: d2262047b9478f425f263d1c4a9b27ce
2-
// flow-typed version: <<STUB>>/@storybook/addons_v3.2.13/flow_v0.60.1
1+
// flow-typed signature: c6ae1dfebdd24ab87b3adb200b706d8c
2+
// flow-typed version: <<STUB>>/@storybook/addons_v3.2.17/flow_v0.63.1
33

44
/**
55
* This is an autogenerated libdef stub for:

‎shared/flow-typed/npm/@storybook/channels_vx.x.x.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 75a0e336bda770c0d8a712d4863fbf28
2-
// flow-typed version: <<STUB>>/@storybook/channels_v3.2.13/flow_v0.60.1
1+
// flow-typed signature: f007ca88b2462288c4b56c0976d72be1
2+
// flow-typed version: <<STUB>>/@storybook/channels_v3.2.17/flow_v0.63.1
33

44
/**
55
* This is an autogenerated libdef stub for:

‎shared/flow-typed/npm/@storybook/react-native_vx.x.x.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 1d78124ada440d22eef152ba64abaae3
2-
// flow-typed version: <<STUB>>/@storybook/react-native_v3.2.12/flow_v0.60.1
1+
// flow-typed signature: 8baa7b9dc563fd6bfba84ed465cf5aba
2+
// flow-typed version: <<STUB>>/@storybook/react-native_v3.2.17/flow_v0.63.1
33

44
/**
55
* This is an autogenerated libdef stub for:

0 commit comments

Comments
 (0)