SlideShare a Scribd company logo
1 of 30
Ultimate Survival
React Native edition
We experiment, we move fast,
we make it happen
At Supercharge we build high-impact mobile products making life easier for millions of users. Creating
stunning experiences can only happen if you stretch yourself. To supercharge means to go that extra
mile.
Getting started
Folder structure
Supercharge 4
BAD >
Folder structure
Supercharge 5
import { connect } from 'react-redux';
import LandingScreen from './LandingScreen';
function mapStateToProps(state) {
const { app } = state;
const { landing } = app;
return {
...landing,
};
}
export default connect(mapStateToProps)(LandingScreen);
yarn over npm
Supercharge 6
yarn add react-native-extended-stylesheet
‣ Under construction
Supercharge 7
yarn add redux
‣ Plan redux store
‣ reselect
‣ https://github.com/reactjs/reselect
‣ redux-batched-actions
‣ https://github.com/tshelburne/redux-batched-actions
Supercharge 8
yarn add react-navigation
‣ Redux integration
‣ https://github.com/react-community/react-navigation/blob/master/docs/guides/Redux-
Integration.md
‣ Keep in mind that when a navigator is given a navigation prop, it relinquishes control of its
internal state. That means you are now responsible for persisting its state, handling any
deep linking, Handling the Hardware Back Button in Android, etc.
‣ Replace a screen when navigate
‣ https://medium.com/handlebar-labs/replace-a-screen-using-react-navigation-
a503eab207eb
Supercharge 9
yarn add react-native-offline
Supercharge 10
‣ Reducer to keep your connectivity state in the Redux store
‣ Redux middleware to intercept internet request actions in offline mode and apply DRY
principle
‣ A step further than NetInfo detecting internet access besides network connectivity
Avoid react-native link
‣ Sometimes fails (duplicated packages)
‣ Lifesaver if you know, how it works
‣ Android: Gradle
‣ iOS: Cocoapods support from React Native 0.50
Supercharge 11
yarn add patch-package --dev
‣ https://github.com/ds300/patch-package
‣ Lets app authors instantly make and keep fixes to npm dependencies
‣ No more forking repos just to fix that one tiny thing preventing your app from
working.
Supercharge 12
# fix a bug in one of your dependencies
vim node_modules/some-package/brokenFile.js
# run patch-package to create a .patch file
patch-package some-package
# commit the patch file to share the fix with your team
git add patches/some-package+3.14.15.patch
git commit -m "fix brokenFile.js in some-package"
Working with React-Native
Component lifecycle
Supercharge 14
https://github.com/react-community/react-navigation/issues/51
Rendering components
Supercharge 15
https://www.youtube.com/watch?v=HXKFQu2cP4c
Rendering components
Supercharge 16
Rendering components
Supercharge 17
https://github.com/wix/rn-synchronous-render
yarn add react-native-debugger-open --dev
Supercharge 18
yarn add reactotron-react-native --dev
Supercharge 19
yarn scripts
Supercharge 20
"scripts": {
"cleanup": "watchman watch-del-all && rm -rf node_modules ; rm -rf $TMPDIR/react-* ; rm -rf $TMPDIR/npm-* ; yarn install && rm -
rf ./android/build ; rm -rf ./android/app/build ; rm -rf ios/build ; rm –rf ios/Pods",
"bundle:android-debug":"react-native bundle --platform android --dev true --entry-file index.js --bundle-output
android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/",
"bundle:ios-debug":"react-native bundle --platform ios --dev true --entry-file index.js --bundle-output iOS/main.jsbundle",
"run:android-uat": "export ENVFILE=.env.uat && react-native run-android --variant=uatDebug && adb shell monkey -p com.app.uat 1",
"run:ios-uat": ”export ENVFILE=.env.uat react-native run-ios --configuration uat-debug --scheme uat-app",
...
}
Releasing the app
Flavors and schemes and signings
‣ iOS Build Configurations and Android Build Variants
‣ https://medium.com/@ywongcode/building-multiple-versions-of-a-react-native-app-
4361252ddde5
‣ Must solve it natively
‣ Learn the following definitions:
‣ iOS: keychain access, signing identity, auth key, (wildcard) app id, device udid,
provisioning profile, development/distribution certificate, development/ad-
hoc/appstore profile, developer portal != itunes connect,
‣ Android: debug/release keystore, (upload and signing key!)
Supercharge 22
yarn add react-native-config
‣ Expose config variables to javascript code in React Native, supporting both iOS and Android
‣ Android: dotenv.gradle
‣ iOS: BuildDotenvConfig.ruby
‣ Supports flavors and schemes
‣ Recompile needed
‣ A babel plugin for react-native-config to avoid clean/rebuild for javascript config changes
‣ https://github.com/j2kun/babel-plugin-react-native-config
Supercharge 23
yarn add react-native-schemes-manager --dev
Supercharge 24
react-native/scripts/react-native-xcode.sh
. . .
case "$CONFIGURATION" in*Debug*)
if [[ "$PLATFORM_NAME" == *simulator ]]; then
. . .
. . .
if [[ "$CONFIGURATION" = "Debug" && ! "$PLATFORM_NAME" == *simulator ]]; then
PLISTBUDDY='/usr/libexec/PlistBuddy'
PLIST=$TARGET_BUILD_DIR/$INFOPLIST_PATH
. . .
‣ Swap its own version of react-native-xcode.sh in instead of the stock one that assumes all
debug schemes are named 'Debug'.
‣ Add your build configurations to all library Xcode projects.
‣ Hide any schemes that come from your library projects so they don't show up in the me
Fastlane
Supercharge 25
source "https://rubygems.org"
ruby "2.3.1"
gem 'fastlane'
gem 'xcode-install'
gem 'cocoapods'
gem 'fastlane-plugin-increment_version_code’ # android version code
gem 'fastlane-plugin-yarn'
fastlane init
fastlane ios beta scheme:scheme …
Supercharge 26
platform :ios do
before_all do
# xcode_select "/Applications/Xcode.app"
# xcversion(version: "8.3.2")
yarn(command: "install", package_path: "../package.json")
cocoapods(use_bundle_exec: true, repo_update: true)
end
lane :beta do |options|
build_nr = `git rev-list --count HEAD`
increment_build_number(xcodeproj: "./app.xcodeproj", build_number: build_nr)
update_app_identifier(xcodeproj: "./app.xcodeproj", plist_path: "app/Info.plist", app_identifier: options[:app_id])
gym(clean: true, scheme: options[:scheme], export_method: 'ad-hoc', configuration: options[:config], project:
'./app.xcodeproj')
crashlytics(api_token: "appToken", build_secret: "buildSecret", emails: emails, groups: groups,
notifications: true)
end
end
fastlane android beta task:task …
Supercharge 27
platform :android do
before_all do
yarn(command: "install", package_path: "../package.json")
end
lane :beta do |options|
build_nr = `git rev-list --count HEAD`
increment_version_code(version_code: build_nr.to_i)
gradle(task: options[:task])
crashlytics(api_token: "appToken", build_secret: "buildSecret", emails: emails,
groups: groups, notifications: true)
end
end
Push notifications
‣ https://github.com/zo0r/react-native-push-notification
‣ https://github.com/invertase/react-native-firebase
‣ https://github.com/evollu/react-native-fcm
Supercharge 28
Thank you!
We are hiring!
Richard Radics
Supercharge
Lead Developer
richard.radics@supercharge.io // www.supercharge.io
Ultimate Survival - React-Native edition

More Related Content

What's hot

Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐KAI CHU CHUNG
 
Development tools at Base
Development tools at BaseDevelopment tools at Base
Development tools at BaseDominik Kapusta
 
Eclipse Mars News @JUG HH
Eclipse Mars News @JUG HHEclipse Mars News @JUG HH
Eclipse Mars News @JUG HHsimonscholz
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in phpBo-Yi Wu
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...Puppet
 
Gretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with GradleGretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with GradleAndrey Hihlovsky
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.jsBo-Yi Wu
 
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...chbornet
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰KAI CHU CHUNG
 
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...KAI CHU CHUNG
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆KAI CHU CHUNG
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end WorkflowPagepro
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?k4200
 
Automating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAutomating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAnderson Aguiar
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Lifthub (rpscala #31)
Lifthub (rpscala #31)Lifthub (rpscala #31)
Lifthub (rpscala #31)k4200
 
Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Tobias Schneck
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開KAI CHU CHUNG
 

What's hot (20)

Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
 
Development tools at Base
Development tools at BaseDevelopment tools at Base
Development tools at Base
 
Eclipse Mars News @JUG HH
Eclipse Mars News @JUG HHEclipse Mars News @JUG HH
Eclipse Mars News @JUG HH
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in php
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
 
Gretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with GradleGretty: Managing Web Containers with Gradle
Gretty: Managing Web Containers with Gradle
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
 
Workshop - Golang language
Workshop - Golang languageWorkshop - Golang language
Workshop - Golang language
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
 
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
 
Nas 也可以揀土豆
Nas 也可以揀土豆Nas 也可以揀土豆
Nas 也可以揀土豆
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end Workflow
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?
 
Automating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAutomating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with Gulp
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Lifthub (rpscala #31)
Lifthub (rpscala #31)Lifthub (rpscala #31)
Lifthub (rpscala #31)
 
Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
 
Arquitecturas de microservicios - Codemotion 2014
Arquitecturas de microservicios  -  Codemotion 2014Arquitecturas de microservicios  -  Codemotion 2014
Arquitecturas de microservicios - Codemotion 2014
 

Similar to Ultimate Survival - React-Native edition

Openshift operator insight
Openshift operator insightOpenshift operator insight
Openshift operator insightRyan ZhangCheng
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践Jacky Chi
 
[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdfFrederik Wouters
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalDrupalDay
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupalsparkfabrik
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and FriendsYun Zhi Lin
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf Conference
 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For DevelopmentLaura Frank Tacho
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseRalf Sternberg
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftEric D. Schabell
 
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...Olivier Destrebecq
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using DjangoSunil kumar Mohanty
 
Creating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactCreating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactAngela Kristine Juvet Branaes
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageAndrii Lundiak
 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDocker, Inc.
 

Similar to Ultimate Survival - React-Native edition (20)

React Native
React NativeReact Native
React Native
 
Openshift operator insight
Openshift operator insightOpenshift operator insight
Openshift operator insight
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For Development
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShift
 
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using Django
 
Creating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactCreating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and react
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker Containers
 

Recently uploaded

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 

Ultimate Survival - React-Native edition

  • 2. We experiment, we move fast, we make it happen At Supercharge we build high-impact mobile products making life easier for millions of users. Creating stunning experiences can only happen if you stretch yourself. To supercharge means to go that extra mile.
  • 5. Folder structure Supercharge 5 import { connect } from 'react-redux'; import LandingScreen from './LandingScreen'; function mapStateToProps(state) { const { app } = state; const { landing } = app; return { ...landing, }; } export default connect(mapStateToProps)(LandingScreen);
  • 7. yarn add react-native-extended-stylesheet ‣ Under construction Supercharge 7
  • 8. yarn add redux ‣ Plan redux store ‣ reselect ‣ https://github.com/reactjs/reselect ‣ redux-batched-actions ‣ https://github.com/tshelburne/redux-batched-actions Supercharge 8
  • 9. yarn add react-navigation ‣ Redux integration ‣ https://github.com/react-community/react-navigation/blob/master/docs/guides/Redux- Integration.md ‣ Keep in mind that when a navigator is given a navigation prop, it relinquishes control of its internal state. That means you are now responsible for persisting its state, handling any deep linking, Handling the Hardware Back Button in Android, etc. ‣ Replace a screen when navigate ‣ https://medium.com/handlebar-labs/replace-a-screen-using-react-navigation- a503eab207eb Supercharge 9
  • 10. yarn add react-native-offline Supercharge 10 ‣ Reducer to keep your connectivity state in the Redux store ‣ Redux middleware to intercept internet request actions in offline mode and apply DRY principle ‣ A step further than NetInfo detecting internet access besides network connectivity
  • 11. Avoid react-native link ‣ Sometimes fails (duplicated packages) ‣ Lifesaver if you know, how it works ‣ Android: Gradle ‣ iOS: Cocoapods support from React Native 0.50 Supercharge 11
  • 12. yarn add patch-package --dev ‣ https://github.com/ds300/patch-package ‣ Lets app authors instantly make and keep fixes to npm dependencies ‣ No more forking repos just to fix that one tiny thing preventing your app from working. Supercharge 12 # fix a bug in one of your dependencies vim node_modules/some-package/brokenFile.js # run patch-package to create a .patch file patch-package some-package # commit the patch file to share the fix with your team git add patches/some-package+3.14.15.patch git commit -m "fix brokenFile.js in some-package"
  • 18. yarn add react-native-debugger-open --dev Supercharge 18
  • 19. yarn add reactotron-react-native --dev Supercharge 19
  • 20. yarn scripts Supercharge 20 "scripts": { "cleanup": "watchman watch-del-all && rm -rf node_modules ; rm -rf $TMPDIR/react-* ; rm -rf $TMPDIR/npm-* ; yarn install && rm - rf ./android/build ; rm -rf ./android/app/build ; rm -rf ios/build ; rm –rf ios/Pods", "bundle:android-debug":"react-native bundle --platform android --dev true --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/", "bundle:ios-debug":"react-native bundle --platform ios --dev true --entry-file index.js --bundle-output iOS/main.jsbundle", "run:android-uat": "export ENVFILE=.env.uat && react-native run-android --variant=uatDebug && adb shell monkey -p com.app.uat 1", "run:ios-uat": ”export ENVFILE=.env.uat react-native run-ios --configuration uat-debug --scheme uat-app", ... }
  • 22. Flavors and schemes and signings ‣ iOS Build Configurations and Android Build Variants ‣ https://medium.com/@ywongcode/building-multiple-versions-of-a-react-native-app- 4361252ddde5 ‣ Must solve it natively ‣ Learn the following definitions: ‣ iOS: keychain access, signing identity, auth key, (wildcard) app id, device udid, provisioning profile, development/distribution certificate, development/ad- hoc/appstore profile, developer portal != itunes connect, ‣ Android: debug/release keystore, (upload and signing key!) Supercharge 22
  • 23. yarn add react-native-config ‣ Expose config variables to javascript code in React Native, supporting both iOS and Android ‣ Android: dotenv.gradle ‣ iOS: BuildDotenvConfig.ruby ‣ Supports flavors and schemes ‣ Recompile needed ‣ A babel plugin for react-native-config to avoid clean/rebuild for javascript config changes ‣ https://github.com/j2kun/babel-plugin-react-native-config Supercharge 23
  • 24. yarn add react-native-schemes-manager --dev Supercharge 24 react-native/scripts/react-native-xcode.sh . . . case "$CONFIGURATION" in*Debug*) if [[ "$PLATFORM_NAME" == *simulator ]]; then . . . . . . if [[ "$CONFIGURATION" = "Debug" && ! "$PLATFORM_NAME" == *simulator ]]; then PLISTBUDDY='/usr/libexec/PlistBuddy' PLIST=$TARGET_BUILD_DIR/$INFOPLIST_PATH . . . ‣ Swap its own version of react-native-xcode.sh in instead of the stock one that assumes all debug schemes are named 'Debug'. ‣ Add your build configurations to all library Xcode projects. ‣ Hide any schemes that come from your library projects so they don't show up in the me
  • 25. Fastlane Supercharge 25 source "https://rubygems.org" ruby "2.3.1" gem 'fastlane' gem 'xcode-install' gem 'cocoapods' gem 'fastlane-plugin-increment_version_code’ # android version code gem 'fastlane-plugin-yarn' fastlane init
  • 26. fastlane ios beta scheme:scheme … Supercharge 26 platform :ios do before_all do # xcode_select "/Applications/Xcode.app" # xcversion(version: "8.3.2") yarn(command: "install", package_path: "../package.json") cocoapods(use_bundle_exec: true, repo_update: true) end lane :beta do |options| build_nr = `git rev-list --count HEAD` increment_build_number(xcodeproj: "./app.xcodeproj", build_number: build_nr) update_app_identifier(xcodeproj: "./app.xcodeproj", plist_path: "app/Info.plist", app_identifier: options[:app_id]) gym(clean: true, scheme: options[:scheme], export_method: 'ad-hoc', configuration: options[:config], project: './app.xcodeproj') crashlytics(api_token: "appToken", build_secret: "buildSecret", emails: emails, groups: groups, notifications: true) end end
  • 27. fastlane android beta task:task … Supercharge 27 platform :android do before_all do yarn(command: "install", package_path: "../package.json") end lane :beta do |options| build_nr = `git rev-list --count HEAD` increment_version_code(version_code: build_nr.to_i) gradle(task: options[:task]) crashlytics(api_token: "appToken", build_secret: "buildSecret", emails: emails, groups: groups, notifications: true) end end
  • 28. Push notifications ‣ https://github.com/zo0r/react-native-push-notification ‣ https://github.com/invertase/react-native-firebase ‣ https://github.com/evollu/react-native-fcm Supercharge 28
  • 29. Thank you! We are hiring! Richard Radics Supercharge Lead Developer richard.radics@supercharge.io // www.supercharge.io