Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

[WIP] Update React Native to 0.57.4 #1210

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7aa00ad
Update the React Native version, and get types up to date
orta Oct 30, 2018
c732afa
Update native deps
orta Oct 31, 2018
535d359
React Native upgrade for rutime behavior
orta Oct 31, 2018
7c4cb28
WIP on React NAtive upgrade for jest tests
orta Nov 2, 2018
b9511bc
Resolve a version of fsevents that doesn't crash on node 10
orta Nov 13, 2018
1703442
Gets some of the tests to compile
orta Nov 13, 2018
aeffc47
Dep updates
orta Nov 15, 2018
9dbd415
Try updating to RN 0.58
orta Dec 10, 2018
7c3a201
Downgrade rn to 57
zephraph Dec 12, 2018
1894ce5
Update snapshots
zephraph Dec 12, 2018
205b466
Fix react-tracking mock failing
zephraph Dec 12, 2018
712068b
Clean up comments
zephraph Dec 12, 2018
21f30bd
[babel] Strip Flow type annotations before any other transforms.
alloy Feb 21, 2019
8a5046b
[test] Update snapshots with new default values.
alloy Feb 21, 2019
6a35072
[test] Fail on error/warn logs with helpful message.
alloy Feb 21, 2019
a4f82bf
[package] Pin exact RN/React/ReactDOM/Enzyme deps
alloy Feb 21, 2019
8b26f80
[test] Ignore ReactDOM warnings that don’t apply to RN.
alloy Feb 21, 2019
42d1a3a
[test] Fix tests that were logging.
alloy Feb 21, 2019
373c444
[test] A few more snapshot updates after dep updates.
alloy Feb 21, 2019
fac389a
[MockRelayRenderer] Properly name test
alloy Feb 21, 2019
f173ff1
[test] Fix test that was bleeding failing async code into other tests
alloy Feb 21, 2019
666a9eb
[styled-components] Remove usage of deprecated API.
alloy Feb 21, 2019
c0c1b0e
[ci] Make fsevents optional
orta Mar 21, 2019
c179cfd
[tsc] Makes types green
orta Mar 21, 2019
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
Next Next commit
Update the React Native version, and get types up to date
  • Loading branch information
orta committed Oct 30, 2018
commit 7aa00ad2393ad811a113d5f5f495336c35dc86b7
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
"moment-timezone": "^0.5.17",
"prop-types": "^15.5.10",
"query-string": "^4.1.0",
"react": "^16.3.0-alpha.1",
"react-native": "0.54.4",
"react": "^16.6.0",
"react-native": "0.57.4",
"react-native-hyperlink": "0.0.11",
"react-native-parallax-scroll-view": "https://github.com/orta/react-native-parallax-scroll-view",
"react-native-scrollable-tab-view": "^0.8.0",
Expand All @@ -96,7 +96,7 @@
"@types/moment-timezone": "^0.5.4",
"@types/query-string": "^5.0.0",
"@types/react": "^16.3.0",
"@types/react-native": "^0.52.1",
"@types/react-native": "^0.57.7",
"@types/react-relay": "^1.3.9",
"@types/react-test-renderer": "^16.0.2",
"@types/react-tracking": "^5.0.0",
Expand Down
19 changes: 19 additions & 0 deletions src/ambient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Exists in JS runtime, needed by relay
interface File {
_?: boolean
}

// Exists in JS runtime *when running in a web inspector
interface Console {
groupCollapsed(message?: any, ...optionalParams: any[]): void
groupEnd(): void
}

// Needed by styled components, normally comes from the DOM d.ts
interface StyleSheet {
_?: boolean
}

interface Node {
_?: boolean
}
12 changes: 6 additions & 6 deletions src/lib/Components/Bidding/Components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ export class Input extends Component<InputProps, InputState> {
}
}

onBlur() {
onBlur(e) {
if (this.props.onBlur) {
this.props.onBlur()
this.props.onBlur(e)
}

this.setState({
borderColor: this.props.error ? "red100" : "black10",
})
}

onFocus() {
onFocus(e) {
if (this.props.onFocus) {
this.props.onFocus()
this.props.onFocus(e)
}

this.setState({ borderColor: "purple100" })
Expand All @@ -55,8 +55,8 @@ export class Input extends Component<InputProps, InputState> {
{...this.props}
// These props should not be overridden so they are declared after `{...this.props}`
ref={this.props.inputRef}
onBlur={() => this.onBlur()}
onFocus={() => this.onFocus()}
onBlur={e => this.onBlur(e)}
onFocus={e => this.onFocus(e)}
/>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Components/Consignments/Components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export default class TextInputField extends React.Component<TextInputProps, Stat
placeholderTextColor={this.state.focused ? "white" : Colors.GraySemibold}
selectionColor={Colors.GrayMedium}
{...this.props.text}
onFocus={() => this.setState({ focused: true }, this.props.text.onFocus)}
onBlur={() => this.setState({ focused: false }, this.props.text.onBlur)}
onFocus={e => this.setState({ focused: true }, () => this.props.text.onFocus(e))}
onBlur={e => this.setState({ focused: false }, () => this.props.text.onBlur(e))}
/>
)}

Expand Down
4 changes: 0 additions & 4 deletions src/lib/Components/Home/SectionTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import React from "react"
import { StyleSheet, Text, TextStyle } from "react-native"

export default class SectionTitle extends React.Component<any, any> {
static propTypes = {
...Text.propTypes,
}

render() {
const { children, ...props } = this.props
return (
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Components/Inbox/Conversations/Messages.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { Dimensions, FlatList, RefreshControl, ScrollViewStyle } from "react-native"
import { Dimensions, FlatList, RefreshControl, ViewStyle } from "react-native"
import { ConnectionData, createPaginationContainer, graphql, RelayPaginationProp } from "react-relay"
import styled from "styled-components/native"

Expand Down Expand Up @@ -131,7 +131,7 @@ export class Messages extends React.Component<Props, State> {

const refreshControl = <RefreshControl refreshing={this.state.reloadingData} onRefresh={this.reload.bind(this)} />

const messagesStyles: Partial<ScrollViewStyle> = isPad
const messagesStyles: Partial<ViewStyle> = isPad
? {
width: 708,
alignSelf: "center",
Expand Down
7 changes: 5 additions & 2 deletions src/lib/Components/Inbox/Conversations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ export class Conversations extends Component<Props, State> {
keyExtractor={(_item, index) => String(index)}
scrollEventThrottle={500}
renderItem={({ item }) => {
// TODO: What is up with this `as any`?
// there's a type mismatch here, as item above is a `ConversationSnippetProps`
// but conversation is a `ConversationSnippet_conversation`
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be:

interface State {
  conversations: Array<Props["me"]["conversations"]["edges"][0]["node"]> | null
}

(That could be simplified by making a separate fragment/container for the individual (conversation) nodes, which would give you a new type.)

And me should get typed here

Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, in that example Props["me"] is equal to Conversations_me, I go back and forth on what way to use 🤔

return (
<ConversationSnippet
conversation={item}
onSelected={() => SwitchBoard.presentNavigationViewController(this, `conversation/${item.id}`)}
conversation={item as any}
onSelected={() => SwitchBoard.presentNavigationViewController(this, `conversation/${(item as any).id}`)}
/>
)
}}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Components/OpaqueImageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ export default class OpaqueImageView extends React.Component<Props, State> {
}
}

const NativeOpaqueImageView = requireNativeComponent("AROpaqueImageView", OpaqueImageView)
const NativeOpaqueImageView = requireNativeComponent<Props>("AROpaqueImageView", OpaqueImageView)
4 changes: 0 additions & 4 deletions src/lib/Scenes/Home/Components/SectionTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import React from "react"
import { StyleSheet, Text, TextStyle } from "react-native"

export default class SectionTitle extends React.Component<any, any> {
static propTypes = {
...Text.propTypes,
}

render() {
const { children, ...props } = this.props
return (
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"baseUrl": "src",
"experimentalDecorators": true,
"jsx": "react",
"lib": ["es2015"],
"jsx": "react",
"keyofStringsOnly": true,
"module": "es2015",
"moduleResolution": "node",
Expand Down
Loading