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

React Native 0.46 #7759

Merged
merged 10 commits into from
Jul 25, 2017
Merged
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
5 changes: 3 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
machine:
xcode:
version: 7.2
version: 8.3.3
node:
version: 5.7.0
version: 6
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new rn tooling requires some things not in 5

java:
version: oraclejdk8
environment:
Expand All @@ -18,6 +18,7 @@ general:
build_dir: shared
dependencies:
pre:
- nvm ls-remote
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just so we can see available versions

- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
Expand Down
1 change: 1 addition & 0 deletions shared/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.*/node_modules/fbjs/.*
.*/node_modules/is-my-json-valid/.*
.*/node_modules/json5/.*
.*/node_modules/metro-bundler/.*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the rn packager got moved here and has a lot of errors

.*/node_modules/npm/.*
.*/node_modules/react-native/.*
.*/node_modules/react-navigation/.*
Expand Down
21 changes: 12 additions & 9 deletions shared/actions/gregor.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,18 @@ function* handleKbfsFavoritesOOBM(kbfsFavoriteMessages: Array<OutOfBandMessage>)
const createdTLFs = msgsWithParsedBodies.filter(m => m.body.action === 'create')

const username: string = (yield select(usernameSelector): any)
yield createdTLFs
.map(m => {
const folder = m.body.tlf ? markTLFCreated(folderFromPath(username, m.body.tlf)) : null
if (folder != null) {
return put(folder)
}
console.warn('Failed to parse tlf for oobm:', m)
})
.filter(i => !!i)
// Must do this else we get weird errors from redux-saga, see https://github.com/redux-saga/redux-saga/issues/1000#issuecomment-315180255
yield Promise.resolve(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

have to wrap this in Promise else redux-saga thinks we're returning other generators and gives us yellow boxes

createdTLFs
.map(m => {
const folder = m.body.tlf ? markTLFCreated(folderFromPath(username, m.body.tlf)) : null
if (folder != null) {
return put(folder)
}
console.warn('Failed to parse tlf for oobm:', m)
})
.filter(i => !!i)
)
}

function* handlePushOOBM(pushOOBM: pushOOBM) {
Expand Down
4 changes: 2 additions & 2 deletions shared/actions/login/saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {configurePush} from '../push/creators'
import {pathSelector, navigateTo, navigateAppend} from '../route-tree'
import {overrideLoggedInTab} from '../../local-debug'
import {toDeviceType} from '../../constants/types/more'
import {call, put, take, race, select} from 'redux-saga/effects'
import {call, put, take, race, select, all} from 'redux-saga/effects'
import * as Saga from '../../util/saga'

import type {DeviceRole} from '../../constants/login'
Expand Down Expand Up @@ -137,7 +137,7 @@ function* navBasedOnLoginState() {
}
} else if (registered) {
// relogging in
yield [put.resolve(getExtendedStatus()), put.resolve(getAccounts())]
yield all([put.resolve(getExtendedStatus()), put.resolve(getAccounts())])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

redux-saga wants arrays to be wrapped in all()

Copy link
Contributor

Choose a reason for hiding this comment

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

There's another spot that causes this warning. I have a fix in a perf commit

yield put(navigateTo(['login'], [loginTab]))
} else if (loginError) {
// show error on login screen
Expand Down
5 changes: 5 additions & 0 deletions shared/actions/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import engine from '../engine'
import openUrl from '../util/open-url'
import {requestIdleCallback} from '../util/idle-callback'
import {showAllTrackers} from '../local-debug'
import {isMobile} from '../constants/platform'

import type {Action, Dispatch, AsyncAction} from '../constants/types/flux'
import type {CancelHandlerType} from '../engine/session'
Expand Down Expand Up @@ -184,6 +185,10 @@ function registerIdentifyUi(): TrackerActionCreator {
let trackerTimeoutError = 0

const onStart = username => {
// Don't do this on mobile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Android complains about long timeouts (over 1m) and likely this doesn't make sense in the mobile context anyways. its not a tracker card that hangs out on the side, it'd be your whole screen. no one is waiting 5 minutes...

if (isMobile) {
return
}
trackerTimeoutError = setTimeout(() => {
dispatch({
type: Constants.identifyFinished,
Expand Down
4 changes: 2 additions & 2 deletions shared/app/main.android.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import {connector, Main} from './main-shared.native'
import {compose, lifecycle, withProps} from 'recompose'
import {NativeBackAndroid} from '../common-adapters/index.native'
import {NativeBackHandler} from '../common-adapters/index.native'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This got renamed

import {getPath} from '../route-tree'

module.hot &&
Expand All @@ -17,7 +17,7 @@ export default compose(
connector,
lifecycle({
componentWillMount: function() {
NativeBackAndroid.addEventListener('hardwareBackPress', () => {
NativeBackHandler.addEventListener('hardwareBackPress', () => {
if (getPath(this.props.routeState).size === 1) {
return false
}
Expand Down
Loading