From f5848691e91a5b0b2aa1ee42ae0c07c2ca132d8c Mon Sep 17 00:00:00 2001 From: SandeshVakale Date: Sat, 18 Jul 2020 02:11:26 +0200 Subject: [PATCH 1/5] upgrade to RN 0.63 and class component to functional component --- boilerplate/package.json.ejs | 41 +++++++++++++++++++++++------------- lib/react-native-version.js | 2 +- readme.md | 4 ++-- templates/component.ejs | 29 +++++++++++++------------ templates/container.ejs | 10 ++------- 5 files changed, 46 insertions(+), 40 deletions(-) diff --git a/boilerplate/package.json.ejs b/boilerplate/package.json.ejs index 1183fa1a..01de0749 100644 --- a/boilerplate/package.json.ejs +++ b/boilerplate/package.json.ejs @@ -16,20 +16,27 @@ "storybook": "storybook start -p 7007" }, "dependencies": { + "@react-native-community/async-storage": "^1.11.0", + "@react-native-community/masked-view": "^0.1.10", "apisauce": "^1.1.1", + "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.2", "format-json": "^1.0.3", "identity-obj-proxy": "^3.0.0", - "lodash": "^4.17.15", + "lodash": "^4.17.17", "prop-types": "^15.7.2", "querystringify": "^2.1.1", - "ramda": "^0.26.1", + "ramda": "^0.27.0", "ramdasauce": "^2.1.3", - "react": "16.9.0", - "react-native": "0.61.4", + "react": "16.13.1", + "react-native": "0.63.0", "react-native-config": "^0.12.0", "react-native-device-info": "^5.3.0", - "react-native-gesture-handler": "^1.5.0", - "react-navigation": "^4.0.10", + "react-native-gesture-handler": "1.6.1", + "react-native-safe-area-context": "^3.0.7", + "react-native-safe-area-view": "^1.1.1", + "react-native-screens": "^2.9.0", + "react-navigation": "4.0.0", "react-navigation-redux-helpers": "^4.0.1", "react-navigation-stack": "^1.10.3", "react-navigation-tabs": "^2.5.6", @@ -40,23 +47,27 @@ "seamless-immutable": "^7.1.4" }, "devDependencies": { - "@storybook/addons": "^4.1.11", + "@babel/core": "^7.8.4", + "@babel/runtime": "^7.8.4", + "@react-native-community/eslint-config": "^1.1.0", "@storybook/addon-actions": "5.0.11", "@storybook/addon-links": "5.0.11", "@storybook/addon-storyshots": "^4.1.11", + "@storybook/addons": "^4.1.11", "@storybook/channels": "^4.1.11", "@storybook/react-native": "^4.1.11", - "@babel/core": "^7.7.2", - "@babel/runtime": "^7.7.2", - "@react-native-community/eslint-config": "^0.0.5", - "babel-jest": "^24.9.0", + "babel-eslint": "7.1.1", + "babel-jest": "^25.1.0", + "babel-plugin-ignite-ignore-reactotron": "^0.3.0", "eslint": "^6.6.0", - "jest": "^24.9.0", - "metro-react-native-babel-preset": "^0.57.0", - "react-test-renderer": "16.9.0", + "jest": "^25.1.0", + "metro-react-native-babel-preset": "^0.59.0", + "react-test-renderer": "16.13.1", "reactotron-react-native": "^4.0.2", "reactotron-redux": "^3.1.2", - "reactotron-redux-saga": "^4.2.2" + "reactotron-redux-saga": "^4.2.2", + "snazzy": "^8.0.0", + "standard": "10.0.2" }, "jest": { "testMatch": [ diff --git a/lib/react-native-version.js b/lib/react-native-version.js index c49d7353..d1f070f0 100644 --- a/lib/react-native-version.js +++ b/lib/react-native-version.js @@ -1,7 +1,7 @@ const { pathOr, is } = require('ramda') // the default React Native version for this boilerplate -const REACT_NATIVE_VERSION = '0.61.4' +const REACT_NATIVE_VERSION = '0.63.0' // where the version lives under gluegun const pathToVersion = ['parameters', 'options', 'react-native-version'] diff --git a/readme.md b/readme.md index cc6ae24a..34ff509d 100644 --- a/readme.md +++ b/readme.md @@ -10,8 +10,8 @@ NOTE: This repo has been renamed from ignite-ir-boilerplate-andross to ignite-an Currently includes: -* React Native 0.59.9 -* React Navigation 3.11.0 +* React Native 0.63 +* React Navigation 4.0.0 * Redux * Redux Sagas * And more! diff --git a/templates/component.ejs b/templates/component.ejs index 2e96e965..3609e223 100644 --- a/templates/component.ejs +++ b/templates/component.ejs @@ -1,25 +1,26 @@ -import React, { Component } from 'react' +import React from 'react' // import PropTypes from 'prop-types'; import { View, Text } from 'react-native' import styles from './Styles/<%= props.name %>Style' -export default class <%= props.name %> extends Component { - // // Prop type warnings - // static propTypes = { - // someProperty: PropTypes.object, - // someSetting: PropTypes.bool.isRequired, - // } - // - // // Defaults for props - // static defaultProps = { - // someSetting: false - // } +const <%= props.name %> = () => { - render () { return ( <%= props.name %> Component ) } -} + +// // Prop type warnings +// <%= props.name %>.propTypes = { +// someProperty: PropTypes.object, +// someSetting: PropTypes.bool.isRequired, +// } +// +// // Defaults for props +// <%= props.name %>.defaultProps = { +// someSetting: false +// } + +export default <%= props.name %> diff --git a/templates/container.ejs b/templates/container.ejs index 3a47ed5a..b4299b24 100644 --- a/templates/container.ejs +++ b/templates/container.ejs @@ -1,4 +1,4 @@ -import React, { Component } from 'react' +import React from 'react' import { ScrollView, Text } from 'react-native' import { connect } from 'react-redux' // Add Actions - replace 'Your' with whatever your reducer is called :) @@ -7,20 +7,14 @@ import { connect } from 'react-redux' // Styles import styles from './Styles/<%= props.name %>Style' -class <%= props.name %> extends Component { - // constructor (props) { - // super(props) - // this.state = {} - // } +const <%= props.name %> = () => { - render () { return ( <%= props.name %> Container ) } -} const mapStateToProps = (state) => { return { From 3d8c24600d8e8d75dabbc4a02d6e221db479b5ee Mon Sep 17 00:00:00 2001 From: SandeshVakale Date: Sat, 18 Jul 2020 02:34:24 +0200 Subject: [PATCH 2/5] changes in boilerplate --- boilerplate.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/boilerplate.js b/boilerplate.js index bd4755d8..013d205c 100644 --- a/boilerplate.js +++ b/boilerplate.js @@ -132,10 +132,10 @@ async function install(context) { spinner.stop() // react native link -- must use spawn & stdio: ignore or it hangs!! :( - spinner.text = `▸ linking native libraries` - spinner.start() - await system.spawn('npx react-native link', { stdio: 'ignore' }) - spinner.stop() + // spinner.text = `▸ linking native libraries` + // spinner.start() + // await system.spawn('npx react-native link', { stdio: 'ignore' }) + // spinner.stop() // pass long the debug flag if we're running in that mode const debugFlag = parameters.options.debug ? '--debug' : '' @@ -151,8 +151,8 @@ async function install(context) { await system.spawn(`npx ignite-cli add ${boilerplate} ${debugFlag}`, { stdio: 'inherit' }) // now run install of Ignite Plugins - await ignite.addModule('react-navigation', { version: '3.11.0' }) - await ignite.addModule('react-native-gesture-handler', { version: '1.3.0', link: true }) + await ignite.addModule('react-navigation', { version: '4.0.0' }) + await ignite.addModule('react-native-gesture-handler', { version: '1.6.1', link: true }) ignite.patchInFile(`${process.cwd()}/android/app/src/main/java/com/${name.toLowerCase()}/MainActivity.java`, { after: 'import com.facebook.react.ReactActivity;', @@ -200,7 +200,7 @@ async function install(context) { } if (answers['redux-persist'] === 'Yes') { - await system.spawn(`npx ignite-cli add redux-persist@1.1.2 ${debugFlag}`, { + await system.spawn(`npx ignite-cli add redux-persist@2.0.0 ${debugFlag}`, { stdio: 'inherit' }) } From 7d662712a39446c092536256fd9640e7edddabe3 Mon Sep 17 00:00:00 2001 From: SandeshVakale Date: Fri, 24 Jul 2020 12:36:32 +0200 Subject: [PATCH 3/5] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d91c70bb..6b53145e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ defaults: &defaults docker: # Choose the version of Node you want here - - image: circleci/node:13.5 + - image: circleci/node:12.16 working_directory: ~/repo version: 2 From 855b9ffbbb2c70dc6b35a1e26d41e2cf1f7a4c8a Mon Sep 17 00:00:00 2001 From: SandeshVakale Date: Fri, 24 Jul 2020 12:56:07 +0200 Subject: [PATCH 4/5] standard js issue fix for component --- templates/component.ejs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/templates/component.ejs b/templates/component.ejs index 3609e223..e5fbd931 100644 --- a/templates/component.ejs +++ b/templates/component.ejs @@ -4,13 +4,12 @@ import { View, Text } from 'react-native' import styles from './Styles/<%= props.name %>Style' const <%= props.name %> = () => { - - return ( - - <%= props.name %> Component - - ) - } + return ( + + <%= props.name %> Component + + ) +} // // Prop type warnings // <%= props.name %>.propTypes = { From 393c792d86209d3e7e2ba47f0a7a86ab9c9b69ec Mon Sep 17 00:00:00 2001 From: SandeshVakale Date: Fri, 24 Jul 2020 12:58:28 +0200 Subject: [PATCH 5/5] standard js fixes for containers --- templates/container.ejs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/templates/container.ejs b/templates/container.ejs index b4299b24..78ed8787 100644 --- a/templates/container.ejs +++ b/templates/container.ejs @@ -8,13 +8,12 @@ import { connect } from 'react-redux' import styles from './Styles/<%= props.name %>Style' const <%= props.name %> = () => { - - return ( - - <%= props.name %> Container - - ) - } + return ( + + <%= props.name %> Container + + ) +} const mapStateToProps = (state) => { return {