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

upgraded default react-native version #228

Merged
merged 38 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ebce352
upgraded default react-native version
lvlrSajjad Nov 21, 2018
1460488
fixed jest error
lvlrSajjad Nov 21, 2018
88fb4de
updated react-navigation
lvlrSajjad Nov 21, 2018
4b7e688
just linted boilerplate.js
lvlrSajjad Nov 21, 2018
9839c8b
fixed semaphore errors
lvlrSajjad Nov 22, 2018
4a27f09
semaphore lint error again
lvlrSajjad Nov 22, 2018
9f49dc7
removed some awaits
lvlrSajjad Nov 22, 2018
13fbc9c
semaphore debug
lvlrSajjad Nov 22, 2018
d92a4a3
semaphore debug non npm
lvlrSajjad Nov 22, 2018
be8ba57
bumped react-navigation to 3.0.0
lvlrSajjad Nov 25, 2018
18c24c9
added second react-navigation installation step
lvlrSajjad Nov 25, 2018
d04c2ff
copied the circle ci config changes
lvlrSajjad Nov 28, 2018
18f16e9
Delete config.yml
lvlrSajjad Nov 28, 2018
9b92ac8
Create config.yml
lvlrSajjad Nov 28, 2018
c17e145
fixed confilcts
lvlrSajjad Nov 28, 2018
a69782a
bumped up to 0.57.7
lvlrSajjad Nov 28, 2018
cb0b628
Update config.yml
lvlrSajjad Nov 28, 2018
28d1f0e
fix(ci): Testing CI release
lvlrSajjad Nov 29, 2018
c64825a
fix(ci): Testing CI release
lvlrSajjad Nov 29, 2018
3e24e74
Merge branch 'master' into master
lvlrSajjad Nov 29, 2018
d96bd12
fix(ci): Testing CI release
lvlrSajjad Nov 29, 2018
aba5ab1
fix(ci): Testing CI release
lvlrSajjad Nov 29, 2018
72501ef
Merge branch 'master' of https://github.com/lvlrSajjad/ignite-ir-boil…
lvlrSajjad Nov 29, 2018
0d35613
fix(ci): Testing CI release
lvlrSajjad Nov 29, 2018
f7844b3
removed config.yml
lvlrSajjad Nov 30, 2018
ec616b6
Create config.yml
lvlrSajjad Nov 30, 2018
9080a98
circle ci debug
lvlrSajjad Nov 30, 2018
4c86c00
Update generators-integration.test.js
lvlrSajjad Nov 30, 2018
6b41186
copied tests from original repo
lvlrSajjad Nov 30, 2018
c3a6631
Update generators-integration.test.js
lvlrSajjad Nov 30, 2018
bb8dbae
debug flag
lvlrSajjad Nov 30, 2018
13041d1
commented ignite.patchfiles in boilerplate.js
lvlrSajjad Nov 30, 2018
20f8744
debugging pathInFile Situation
lvlrSajjad Nov 30, 2018
614943a
debugging pathInFileSituation
lvlrSajjad Nov 30, 2018
3996277
removed console.logs
lvlrSajjad Nov 30, 2018
a178456
removed another console.log
lvlrSajjad Nov 30, 2018
e68c76c
changed version in readme too
lvlrSajjad Nov 30, 2018
8cd68ec
bumped up reactotron
lvlrSajjad Nov 30, 2018
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ node_modules
testgrounds
IntegrationTest
integration_test

# WebStorm
.idea
26 changes: 24 additions & 2 deletions boilerplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,33 @@ async function install (context) {

// now run install of Ignite Plugins
if (answers['dev-screens'] === 'Yes') {
await system.spawn(`ignite add dev-screens@"~>2.2.0" ${debugFlag}`, {
await system.spawn(`ignite add dev-screens@"~>2.3.0" ${debugFlag}`, {
stdio: 'inherit'
})
}
await ignite.addModule('react-navigation', { version: '3.0.0' })
await ignite.addModule('react-native-gesture-handler', { version: '1.0.9', link: true })

ignite.patchInFile(`${process.cwd()}/android/app/src/main/java/com/${name.toLowerCase()}/MainActivity.java`, {
after: 'import com.facebook.react.ReactActivity;',
insert: `
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;`
})

ignite.patchInFile(`${process.cwd()}/android/app/src/main/java/com/${name.toLowerCase()}/MainActivity.java`, {
after: `public class MainActivity extends ReactActivity {`,
insert: '\n @Override\n' +
' protected ReactActivityDelegate createReactActivityDelegate() {\n' +
' return new ReactActivityDelegate(this, getMainComponentName()) {\n' +
' @Override\n' +
' protected ReactRootView createRootView() {\n' +
' return new RNGestureHandlerEnabledRootView(MainActivity.this);\n' +
' }\n' +
' };\n' +
' }'
})
if (answers['vector-icons'] === 'react-native-vector-icons') {
await system.spawn(`ignite add vector-icons@"~>1.0.0" ${debugFlag}`, {
stdio: 'inherit'
Expand All @@ -197,7 +219,7 @@ async function install (context) {
}

if (answers['redux-persist'] === 'Yes') {
await system.spawn(`ignite add redux-persist@"~>1.0.1" ${debugFlag}`, {
await system.spawn(`ignite add redux-persist@"~>5.10.0" ${debugFlag}`, {
Copy link
Member

Choose a reason for hiding this comment

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

HOLY CRAP that's a massive version upgrade!

stdio: 'inherit'
})
}
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["react-native"],
"presets": ["module:metro-react-native-babel-preset"],
"env": {
"production": {
"plugins": ["ignite-ignore-reactotron"]
Expand Down
5 changes: 0 additions & 5 deletions boilerplate/App/Config/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { Text } from 'react-native'
import DebugConfig from './DebugConfig'
import AppConfig from './AppConfig'

// Allow/disallow font-scaling in app
Text.defaultProps.allowFontScaling = AppConfig.allowTextFontScaling

if (__DEV__) {
// If ReactNative's yellow box warnings are too much, it is possible to turn
Expand Down
6 changes: 3 additions & 3 deletions boilerplate/App/Navigation/AppNavigation.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { StackNavigator } from 'react-navigation'
import { createStackNavigator, createAppContainer } from 'react-navigation'
import LaunchScreen from '../Containers/LaunchScreen'

import styles from './Styles/NavigationStyles'

// Manifest of possible screens
const PrimaryNav = StackNavigator({
const PrimaryNav = createStackNavigator({
LaunchScreen: { screen: LaunchScreen }
}, {
// Default config for all screens
Expand All @@ -15,4 +15,4 @@ const PrimaryNav = StackNavigator({
}
})

export default PrimaryNav
export default createAppContainer(PrimaryNav)
25 changes: 18 additions & 7 deletions boilerplate/App/Navigation/ReduxNavigation.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import React from 'react'
import * as React from 'react'
import { BackHandler, Platform } from 'react-native'
import { addNavigationHelpers } from 'react-navigation'
import { createReduxBoundAddListener } from 'react-navigation-redux-helpers'
import {
createReactNavigationReduxMiddleware,
reduxifyNavigator
} from 'react-navigation-redux-helpers'
import { connect } from 'react-redux'
import AppNavigation from './AppNavigation'

createReactNavigationReduxMiddleware(
'root',
(state) => state.nav
)

const ReduxAppNavigator = reduxifyNavigator(AppNavigation, 'root')

class ReduxNavigation extends React.Component {
componentWillMount () {
componentDidMount () {
if (Platform.OS === 'ios') return
BackHandler.addEventListener('hardwareBackPress', () => {
const { dispatch, nav } = this.props
Expand All @@ -22,13 +31,15 @@ class ReduxNavigation extends React.Component {

componentWillUnmount () {
if (Platform.OS === 'ios') return
BackHandler.removeEventListener('hardwareBackPress')
BackHandler.removeEventListener('hardwareBackPress', undefined)
}

render () {
return <AppNavigation navigation={addNavigationHelpers({ dispatch: this.props.dispatch, state: this.props.nav, addListener: createReduxBoundAddListener('root') })} />
return <ReduxAppNavigator dispatch={this.props.dispatch} state={this.props.nav} />
}
}

const mapStateToProps = state => ({ nav: state.nav })
const mapStateToProps = state => ({
nav: state.nav
})
export default connect(mapStateToProps)(ReduxNavigation)
14 changes: 8 additions & 6 deletions boilerplate/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
"querystringify": "1.0.0",
"ramda": "^0.25.0",
"react-native-config": "^0.10.0",
"react-navigation": "^1.5.11",
"react-navigation-redux-helpers": "^1.0.4",
"react-navigation-redux-helpers": "^2.0.6",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux": "^4.0.0",
"redux-saga": "^0.16.0",
"reduxsauce": "0.7.0",
"seamless-immutable": "^7.1.2"
Expand All @@ -45,9 +44,9 @@
"mockery": "^2.1.0",
"babel-plugin-ignite-ignore-reactotron": "^0.3.0",
"react-dom": "16.3.0",
"reactotron-react-native": "^2.0.0-alpha.3",
"reactotron-redux": "^2.0.0-alpha.3",
"reactotron-redux-saga": "^2.0.0-alpha.3"
"reactotron-react-native": "^2.1.0",
"reactotron-redux": "^2.1.0",
"reactotron-redux-saga": "^2.1.0"
},
"jest": {
"testMatch": [
Expand All @@ -61,6 +60,9 @@
"moduleNameMapper": {
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "identity-obj-proxy"
},
"transform": {
"^.+\\.(js)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
},
"setupFiles": [
"<rootDir>/Tests/Setup"
],
Expand Down
4 changes: 3 additions & 1 deletion lib/patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ const constants = {
PATTERN_IMPORTS: 'imports',
PATTERN_ROUTES: 'routes'
}
// [constants.PATTERN_IMPORTS]: `import[\\s\\S]*from\\s+'react-navigation';?`,

module.exports = {
constants,
[constants.PATTERN_IMPORTS]: `import[\\s\\S]*from\\s+'react-navigation';?`,

[constants.PATTERN_IMPORTS]: `import { createStackNavigator, createAppContainer } from 'react-navigation'`,
[constants.PATTERN_ROUTES]: 'const PrimaryNav'
}
2 changes: 1 addition & 1 deletion lib/react-native-version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { pathOr, is } = require('ramda')

// the default React Native version for this boilerplate
const REACT_NATIVE_VERSION = '0.55.1'
const REACT_NATIVE_VERSION = '0.57.7'

// where the version lives under gluegun
const pathToVersion = ['parameters', 'options', 'react-native-version']
Expand Down
Loading