SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
React Native in Production
Build Native Mobile Apps using JavaScript and React
Kim Seokjun aka alma
Front-end web developer at SOCAR
Working as DevOps
- react.js, react-native, node.js, express.js, docker
Interested in
- go, tensorflow, functional programming
React.js React Native
React.js React Native
WHY REACT-NATIVE?
오늘부터 2차 모집중!
http://zerocar.socar.kr
WHY? 1. To avoid risk mixing
Single bug may affect two services
SOCAR is already huge and complex application
WHY? 2. Not much to share with SOCAR
ZEROCAR is running over SOCAR
but in behavioral standpoint it’s not
WHY? 3. Minimize features and quick updates
Feature list was too long for 3 weeks
So decided to spec out most and focus on criticals
WHY? 4. iOS and Android
Android
60%
iOS
40%
WHY? 5. React experienced web developer
OPTIONS
Cordova + React
NativeScript
React Native
PROS
PROS 1. It’s REACT!
React + Redux + ES6 = Awesome!
import { ScrollView } from ‘react-native’
import { Profile, SharingStatus, Scheduler } from ‘@components’
class HomeContainer extends React {
refresh() {
fetch(‘http://api.url).then((res) => this.props.getSharingStatus(res))
}
render() {
<ScrollView>
<Profile />
<SharingStatus />
<Scheduler />
</ScrollView>
}
}
PROS 2. FLEX Layout
CSS the good parts : Flex layout is very Flexible
<View style={{ flex: 1 }}>
<View style={{ flex: 1 }} />
<View style={{ flex: 1 }} />
<View style={{ height: 100 }} />
</View>
height: 100
flex: 1
flex: 1
Viewport
PROS 2. FLEX Layout
CSS the good parts : Flex layout is very Flexible
flex: 1 flex: 1
Viewport
<View style={{ height: 50,
flexDirection: ‘row’ }}>
<View style={{ flex: 1 }} />
<View style={{ flex: 1 }} />
</View>
height: 50
flexDirection: ‘row’
PROS 2. FLEX Layout
CSS the good parts : Flex layout is very Flexible
<View
style={{
justifyContent: ‘center’,
alignItems: ‘center’,
}}
>
<Text
style={{
width: 50,
}}
>
Centered
</Text>
</View>
Centered
Viewport
justifyContent: ‘center’
alignItems: ‘center’
PROS 3. No compile, Hot-reload
Thank you Dan!
I love you!
Really!
Love you!
My Jesus!
Dan Abramov, author of Redux and React Hot Reloader
PROS 4. The Javascript
Lodash
Moment.js
Accounting
PROS 4. The Javascript
Lodash : the functional programming
const getCamelCased = (text: string) => {
if (!text) return null;
return text.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
};
const getButtonStyle = (className) => {
if (!className) return null;
return _.chain(['btn', 'normal', ...className.split(/s/)])
.map(elem => styles[getCamelCased(elem)])
.value();
};
PROS 4. The Javascript
Moment : date-time eternal villain for developer
const getMinStartDate = (endDate) => {
if (endDate) return moment(endDate).subtract(120, 'minutes');
const now = moment();
const currentMinute = now.minute();
const currentSeconds = now.second();
const currentMilliSeconds = now.millisecond();
const remainder = (currentMinute > 0) ? 10 - (currentMinute % 10) : 10;
return moment(start)
.add(remainder, 'minutes')
.subtract(currentSeconds, 'seconds')
.subtract(currentMilliSeconds, 'milliseconds');
},
PROS 4. The Javascript
Accounting : the easiest way to format number to currency
// Default usage:
accounting.formatMoney(12345678); // $12,345,678.00
// European formatting (custom symbol and separators), can also use options
object as second parameter:
accounting.formatMoney(4999.99, "₩", 2, ".", ","); // ₩4.999,99
// Negative values can be formatted nicely:
accounting.formatMoney(-500000, "£ ", 0); // £ -500,000
// Simple `format` string allows control of symbol position (%v = value, %s =
symbol):
accounting.formatMoney(5318008, { symbol: "원", format: "%v %s" }); //
5,318,008.00 원
PROS 5. CodePush
React-Native runs main.jsbundle over JS thread
… which means you can REPLACE bundle to UPDATE
PROS 5. CodePush
3.3.2 An Application may not download or install executable code.
Interpreted code may only be used in an Application if all scripts,
code and interpreters are packaged in the Application and not
downloaded. The only exception to the foregoing is scripts and
code downloaded and run by Apple's built-in WebKit
framework, provided that such scripts and code do not change
the primary purpose of the Application by providing features
or functionality that are inconsistent with the intended and
advertised purpose of the Application as submitted to the App
Store.
but … it crashes often. don’t rely on it too much…
Apple officially allows code-push
PROS 6. Unit Test
Integration test sucks
1. difficult to write test,
2. impossible to keep it updated
3. takes forever but unreliable
PROS 6. Unit Test
MOCHA ENZYMECHAI
PROS 6. Unit Test
Writing test for react-native is actually fun and easy
Mocha, Enzyme and Chai make it possible
PROS 6. Unit Test
import { expect } from ‘chai’;
import reducer, { resetDate } from ‘./reducer’;
describe(‘reducer’, () => {
it(‘should reset date keeping its duration’, () => {
const startDate = ‘2015-06-05 03:30’, endDate = ‘2015-06-05 06:30’;
expect(
reducer({ startDate, endDate }, resetDate())
).to.deep.equal({
startDate: ‘2015-06-05 04:30’,
endDate: ‘2015-06-05 07:30’,
});
});
});
Writing test for redux with Mocha, Chai
PROS 6. Unit Test
import React, { View, Text } from 'react-native';
import { shallow } from 'enzyme';
import { expect } from ‘chai’;
import Test from ‘./Test’;
describe('<Test />', () => {
it('it should render 1 view component', () => {
const wrapper = shallow(<Test/>);
expect(wrapper.find(View)).to.have.length(1);
});
it('it should render 2 text components', () => {
const wrapper = shallow(<Test/>);
expect(wrapper.find(Text)).to.have.length(2);
});
});
Component test with Enzyme
shallow rendering from `render()`
CONS
CONS 1. Navigation, Navigator, Navigation Bar …
Navigator
Navigator.NavigationBar
NavigatorExperimental
NavigatorIOS
TabBarIOS
DrawerLayoutAndroid
ToolBarAndroid
…
WTF?
CONS 2. Poor documentation, frequent updates
Pooooooooooooor documentation
frequent breaking changes updates
CONS 3. Native Modules
Comparably easier than others
But it take time, efforts and native developer
CONS 4. Schrodinger’s cat in the box
You know nothing Jon Snow inside
CONS 5. Performance
Everyone talks about this but we never felt that yet
performance has never been an issue
there are a lot of other problems to solve…
CONS 5. Performance
Don’t forget this is not meant to work for everything
it has pros and cons and things getting better
but it is true that native app is faster in many ways
POST-MORTEM
POST-MORTEM
Easy to develop
Okay to distribute
Hard to keep it updated
POST-MORTEM
DOs
use redux and code-push
abstract react-native apis
wrap components with container
use npm private registry to share validation
use setState carefully
POST-MORTEM
DON’Ts
don’t believe in react-native packages
use carefully custom router to maximize native experience
don’t think of it as native environment
code-push has problem with redux
nesting components is harmful
SUMMARY
Easy for web front-end developer
Apple allows code-push update for sure
It is almost impossible to catch run-time crash
react-native packages always make problems
build just broke sometimes especially on android
POST-MORTEM
POST-MORTEM
comparatively performant
from both develop and application standpoint
POST-MORTEM
Active and Enthusiastic community
CONCLUSION
Applicable for production use
WE ARE HIRING
JOIN TO WORK TOGETHER
http://socar.recruiter.co.kr
http://seokjun.kr
More stories…

Contenu connexe

Tendances

Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in phpBo-Yi Wu
 
A few good JavaScript development tools
A few good JavaScript development toolsA few good JavaScript development tools
A few good JavaScript development toolsSimon Kim
 
REST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentREST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentHyunghun Cho
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugDavid Golden
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudMassimiliano Dessì
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav DukhinFwdays
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合Kyle Lin
 
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARSNAVER D2
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with ExamplesGabriele Lana
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceBo-Yi Wu
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondRamon Ribeiro Rabello
 
Unit Testing with Jest
Unit Testing with JestUnit Testing with Jest
Unit Testing with JestMaayan Glikser
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)Chris Cowan
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB
 

Tendances (20)

Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in php
 
A few good JavaScript development tools
A few good JavaScript development toolsA few good JavaScript development tools
A few good JavaScript development tools
 
REST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentREST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side Development
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
Vuejs testing
Vuejs testingVuejs testing
Vuejs testing
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合
 
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript Conference
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
Zenly - Reverse geocoding
Zenly - Reverse geocodingZenly - Reverse geocoding
Zenly - Reverse geocoding
 
Unit Testing with Jest
Unit Testing with JestUnit Testing with Jest
Unit Testing with Jest
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
 

En vedette

신입 개발자 생활백서 [개정판]
신입 개발자 생활백서 [개정판]신입 개발자 생활백서 [개정판]
신입 개발자 생활백서 [개정판]Yurim Jin
 
Introducing hikebike.
Introducing hikebike.Introducing hikebike.
Introducing hikebike.Seokjun Kim
 
Evaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
Evaluating the Arc-Flash Protection Benefits of IEC 61850 CommunicationEvaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
Evaluating the Arc-Flash Protection Benefits of IEC 61850 CommunicationSchneider Electric
 
GraphQL - APIs mais robustas e flexíveis
GraphQL - APIs mais robustas e flexíveisGraphQL - APIs mais robustas e flexíveis
GraphQL - APIs mais robustas e flexíveisBruno Lemos
 
Playing with arduino open source h/w for mobile-centric services
Playing with arduino open source h/w for mobile-centric servicesPlaying with arduino open source h/w for mobile-centric services
Playing with arduino open source h/w for mobile-centric servicesJunhyuk Lee
 
아두이노 4강 maker_school
아두이노 4강 maker_school아두이노 4강 maker_school
아두이노 4강 maker_schoolJosh Park
 
강의자료 코딩클럽 아두이노 워크샵-2015.4.11
강의자료 코딩클럽 아두이노 워크샵-2015.4.11강의자료 코딩클럽 아두이노 워크샵-2015.4.11
강의자료 코딩클럽 아두이노 워크샵-2015.4.11SongSup Shin
 
아두이노 5강 maker_school
아두이노 5강 maker_school아두이노 5강 maker_school
아두이노 5강 maker_schoolJosh Park
 
아두이노 1강 maker_school
아두이노 1강 maker_school아두이노 1강 maker_school
아두이노 1강 maker_schoolJosh Park
 
React Native Internals
React Native InternalsReact Native Internals
React Native InternalsTadeu Zagallo
 
아두이노 3강 maker_school
아두이노 3강 maker_school아두이노 3강 maker_school
아두이노 3강 maker_schoolJosh Park
 
아두이노 2강 maker_school
아두이노 2강 maker_school아두이노 2강 maker_school
아두이노 2강 maker_schoolJosh Park
 
Introduzione a React Native - Alessandro Giannini
Introduzione a React Native - Alessandro GianniniIntroduzione a React Native - Alessandro Giannini
Introduzione a React Native - Alessandro GianniniDeveler S.R.L.
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoSeokjun Kim
 
Universal Rendering
Universal RenderingUniversal Rendering
Universal RenderingTaegon Kim
 

En vedette (20)

신입 개발자 생활백서 [개정판]
신입 개발자 생활백서 [개정판]신입 개발자 생활백서 [개정판]
신입 개발자 생활백서 [개정판]
 
Introducing hikebike.
Introducing hikebike.Introducing hikebike.
Introducing hikebike.
 
Evaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
Evaluating the Arc-Flash Protection Benefits of IEC 61850 CommunicationEvaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
Evaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
 
GraphQL - APIs mais robustas e flexíveis
GraphQL - APIs mais robustas e flexíveisGraphQL - APIs mais robustas e flexíveis
GraphQL - APIs mais robustas e flexíveis
 
Playing with arduino open source h/w for mobile-centric services
Playing with arduino open source h/w for mobile-centric servicesPlaying with arduino open source h/w for mobile-centric services
Playing with arduino open source h/w for mobile-centric services
 
Meetup React Native
Meetup React NativeMeetup React Native
Meetup React Native
 
아두이노 4강 maker_school
아두이노 4강 maker_school아두이노 4강 maker_school
아두이노 4강 maker_school
 
강의자료 코딩클럽 아두이노 워크샵-2015.4.11
강의자료 코딩클럽 아두이노 워크샵-2015.4.11강의자료 코딩클럽 아두이노 워크샵-2015.4.11
강의자료 코딩클럽 아두이노 워크샵-2015.4.11
 
아두이노 5강 maker_school
아두이노 5강 maker_school아두이노 5강 maker_school
아두이노 5강 maker_school
 
아두이노 1강 maker_school
아두이노 1강 maker_school아두이노 1강 maker_school
아두이노 1강 maker_school
 
React Native Internals
React Native InternalsReact Native Internals
React Native Internals
 
아두이노 3강 maker_school
아두이노 3강 maker_school아두이노 3강 maker_school
아두이노 3강 maker_school
 
아두이노 2강 maker_school
아두이노 2강 maker_school아두이노 2강 maker_school
아두이노 2강 maker_school
 
Introduzione a React Native - Alessandro Giannini
Introduzione a React Native - Alessandro GianniniIntroduzione a React Native - Alessandro Giannini
Introduzione a React Native - Alessandro Giannini
 
React & Redux
React & ReduxReact & Redux
React & Redux
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
React native - What, Why, How?
React native - What, Why, How?React native - What, Why, How?
React native - What, Why, How?
 
Universal Rendering
Universal RenderingUniversal Rendering
Universal Rendering
 
SONY BBS - React Native
SONY BBS - React NativeSONY BBS - React Native
SONY BBS - React Native
 
Conhecendo API do Facebook
Conhecendo API do FacebookConhecendo API do Facebook
Conhecendo API do Facebook
 

Similaire à React Native in Production

Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeRyan Boland
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS DevsBarak Cohen
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsMatteo Manchi
 
7 Redux challenges
7 Redux challenges7 Redux challenges
7 Redux challengesreactima
 
Building cross-platform mobile apps with React Native (Jfokus 2017)
Building cross-platform mobile apps with React Native (Jfokus 2017)Building cross-platform mobile apps with React Native (Jfokus 2017)
Building cross-platform mobile apps with React Native (Jfokus 2017)Maarten Mulders
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend DevelopersSergio Nakamura
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e bigAndy Peterson
 
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...UA Mobile
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QAFest
 
How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.Techugo
 
React Native: Introduction
React Native: IntroductionReact Native: Introduction
React Native: IntroductionInnerFood
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Previewvaluebound
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
Redux at scale
Redux at scaleRedux at scale
Redux at scaleinovia
 
10 tips for Redux at scale
10 tips for Redux at scale10 tips for Redux at scale
10 tips for Redux at scaleinovia
 

Similaire à React Native in Production (20)

Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
7 Redux challenges
7 Redux challenges7 Redux challenges
7 Redux challenges
 
Building cross-platform mobile apps with React Native (Jfokus 2017)
Building cross-platform mobile apps with React Native (Jfokus 2017)Building cross-platform mobile apps with React Native (Jfokus 2017)
Building cross-platform mobile apps with React Native (Jfokus 2017)
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...
 
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
QA Fest 2018. Adam Stasiak. React Native is Coming – the story of hybrid mobi...
 
How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.
 
React Native: Introduction
React Native: IntroductionReact Native: Introduction
React Native: Introduction
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
React native
React nativeReact native
React native
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
Redux at scale
Redux at scaleRedux at scale
Redux at scale
 
10 tips for Redux at scale
10 tips for Redux at scale10 tips for Redux at scale
10 tips for Redux at scale
 
Programming
ProgrammingProgramming
Programming
 

Dernier

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

React Native in Production

  • 1. React Native in Production Build Native Mobile Apps using JavaScript and React
  • 2. Kim Seokjun aka alma Front-end web developer at SOCAR Working as DevOps - react.js, react-native, node.js, express.js, docker Interested in - go, tensorflow, functional programming
  • 4.
  • 8. WHY? 1. To avoid risk mixing Single bug may affect two services SOCAR is already huge and complex application
  • 9. WHY? 2. Not much to share with SOCAR ZEROCAR is running over SOCAR but in behavioral standpoint it’s not
  • 10. WHY? 3. Minimize features and quick updates Feature list was too long for 3 weeks So decided to spec out most and focus on criticals
  • 11. WHY? 4. iOS and Android Android 60% iOS 40%
  • 12. WHY? 5. React experienced web developer
  • 14. PROS
  • 15. PROS 1. It’s REACT! React + Redux + ES6 = Awesome! import { ScrollView } from ‘react-native’ import { Profile, SharingStatus, Scheduler } from ‘@components’ class HomeContainer extends React { refresh() { fetch(‘http://api.url).then((res) => this.props.getSharingStatus(res)) } render() { <ScrollView> <Profile /> <SharingStatus /> <Scheduler /> </ScrollView> } }
  • 16. PROS 2. FLEX Layout CSS the good parts : Flex layout is very Flexible <View style={{ flex: 1 }}> <View style={{ flex: 1 }} /> <View style={{ flex: 1 }} /> <View style={{ height: 100 }} /> </View> height: 100 flex: 1 flex: 1 Viewport
  • 17. PROS 2. FLEX Layout CSS the good parts : Flex layout is very Flexible flex: 1 flex: 1 Viewport <View style={{ height: 50, flexDirection: ‘row’ }}> <View style={{ flex: 1 }} /> <View style={{ flex: 1 }} /> </View> height: 50 flexDirection: ‘row’
  • 18. PROS 2. FLEX Layout CSS the good parts : Flex layout is very Flexible <View style={{ justifyContent: ‘center’, alignItems: ‘center’, }} > <Text style={{ width: 50, }} > Centered </Text> </View> Centered Viewport justifyContent: ‘center’ alignItems: ‘center’
  • 19. PROS 3. No compile, Hot-reload Thank you Dan! I love you! Really! Love you! My Jesus! Dan Abramov, author of Redux and React Hot Reloader
  • 20. PROS 4. The Javascript Lodash Moment.js Accounting
  • 21. PROS 4. The Javascript Lodash : the functional programming const getCamelCased = (text: string) => { if (!text) return null; return text.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); }; const getButtonStyle = (className) => { if (!className) return null; return _.chain(['btn', 'normal', ...className.split(/s/)]) .map(elem => styles[getCamelCased(elem)]) .value(); };
  • 22. PROS 4. The Javascript Moment : date-time eternal villain for developer const getMinStartDate = (endDate) => { if (endDate) return moment(endDate).subtract(120, 'minutes'); const now = moment(); const currentMinute = now.minute(); const currentSeconds = now.second(); const currentMilliSeconds = now.millisecond(); const remainder = (currentMinute > 0) ? 10 - (currentMinute % 10) : 10; return moment(start) .add(remainder, 'minutes') .subtract(currentSeconds, 'seconds') .subtract(currentMilliSeconds, 'milliseconds'); },
  • 23. PROS 4. The Javascript Accounting : the easiest way to format number to currency // Default usage: accounting.formatMoney(12345678); // $12,345,678.00 // European formatting (custom symbol and separators), can also use options object as second parameter: accounting.formatMoney(4999.99, "₩", 2, ".", ","); // ₩4.999,99 // Negative values can be formatted nicely: accounting.formatMoney(-500000, "£ ", 0); // £ -500,000 // Simple `format` string allows control of symbol position (%v = value, %s = symbol): accounting.formatMoney(5318008, { symbol: "원", format: "%v %s" }); // 5,318,008.00 원
  • 24. PROS 5. CodePush React-Native runs main.jsbundle over JS thread … which means you can REPLACE bundle to UPDATE
  • 25. PROS 5. CodePush 3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework, provided that such scripts and code do not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store. but … it crashes often. don’t rely on it too much… Apple officially allows code-push
  • 26. PROS 6. Unit Test Integration test sucks 1. difficult to write test, 2. impossible to keep it updated 3. takes forever but unreliable
  • 27. PROS 6. Unit Test MOCHA ENZYMECHAI
  • 28. PROS 6. Unit Test Writing test for react-native is actually fun and easy Mocha, Enzyme and Chai make it possible
  • 29. PROS 6. Unit Test import { expect } from ‘chai’; import reducer, { resetDate } from ‘./reducer’; describe(‘reducer’, () => { it(‘should reset date keeping its duration’, () => { const startDate = ‘2015-06-05 03:30’, endDate = ‘2015-06-05 06:30’; expect( reducer({ startDate, endDate }, resetDate()) ).to.deep.equal({ startDate: ‘2015-06-05 04:30’, endDate: ‘2015-06-05 07:30’, }); }); }); Writing test for redux with Mocha, Chai
  • 30. PROS 6. Unit Test import React, { View, Text } from 'react-native'; import { shallow } from 'enzyme'; import { expect } from ‘chai’; import Test from ‘./Test’; describe('<Test />', () => { it('it should render 1 view component', () => { const wrapper = shallow(<Test/>); expect(wrapper.find(View)).to.have.length(1); }); it('it should render 2 text components', () => { const wrapper = shallow(<Test/>); expect(wrapper.find(Text)).to.have.length(2); }); }); Component test with Enzyme shallow rendering from `render()`
  • 31. CONS
  • 32. CONS 1. Navigation, Navigator, Navigation Bar … Navigator Navigator.NavigationBar NavigatorExperimental NavigatorIOS TabBarIOS DrawerLayoutAndroid ToolBarAndroid … WTF?
  • 33. CONS 2. Poor documentation, frequent updates Pooooooooooooor documentation frequent breaking changes updates
  • 34. CONS 3. Native Modules Comparably easier than others But it take time, efforts and native developer
  • 35. CONS 4. Schrodinger’s cat in the box You know nothing Jon Snow inside
  • 36. CONS 5. Performance Everyone talks about this but we never felt that yet performance has never been an issue there are a lot of other problems to solve…
  • 37. CONS 5. Performance Don’t forget this is not meant to work for everything it has pros and cons and things getting better but it is true that native app is faster in many ways
  • 39. POST-MORTEM Easy to develop Okay to distribute Hard to keep it updated
  • 40. POST-MORTEM DOs use redux and code-push abstract react-native apis wrap components with container use npm private registry to share validation use setState carefully
  • 41. POST-MORTEM DON’Ts don’t believe in react-native packages use carefully custom router to maximize native experience don’t think of it as native environment code-push has problem with redux nesting components is harmful
  • 42. SUMMARY Easy for web front-end developer Apple allows code-push update for sure It is almost impossible to catch run-time crash react-native packages always make problems build just broke sometimes especially on android POST-MORTEM
  • 43. POST-MORTEM comparatively performant from both develop and application standpoint
  • 47.
  • 48. WE ARE HIRING JOIN TO WORK TOGETHER http://socar.recruiter.co.kr