SlideShare a Scribd company logo
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 Native in Production
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
React Native in Production
WE ARE HIRING
JOIN TO WORK TOGETHER
http://socar.recruiter.co.kr
http://seokjun.kr
More stories…

More Related Content

PDF
Dockerize node.js application
Seokjun Kim
 
PDF
Launch Arguments & NSUserDefaults by Franck Lefebvre
CocoaHeads France
 
PDF
vJUG - The JavaFX Ecosystem
Andres Almiray
 
PDF
Play Framework workshop: full stack java web app
Andrew Skiba
 
PDF
HotPush with Ionic 2 and CodePush
Evan Schultz
 
KEY
Intro to PSGI and Plack
Tatsuhiko Miyagawa
 
KEY
Psgi Plack Sfpm
som_nangia
 
PDF
Node.js vs Play Framework
Yevgeniy Brikman
 
Dockerize node.js application
Seokjun Kim
 
Launch Arguments & NSUserDefaults by Franck Lefebvre
CocoaHeads France
 
vJUG - The JavaFX Ecosystem
Andres Almiray
 
Play Framework workshop: full stack java web app
Andrew Skiba
 
HotPush with Ionic 2 and CodePush
Evan Schultz
 
Intro to PSGI and Plack
Tatsuhiko Miyagawa
 
Psgi Plack Sfpm
som_nangia
 
Node.js vs Play Framework
Yevgeniy Brikman
 

What's hot (20)

KEY
Plack at YAPC::NA 2010
Tatsuhiko Miyagawa
 
PDF
Gearman work queue in php
Bo-Yi Wu
 
PPTX
A few good JavaScript development tools
Simon Kim
 
PDF
REST to JavaScript for Better Client-side Development
Hyunghun Cho
 
PDF
Cooking Perl with Chef: Real World Tutorial with Jitterbug
David Golden
 
PDF
Dessi docker kubernetes paas cloud
Massimiliano Dessì
 
PDF
GraphQL IN Golang
Bo-Yi Wu
 
PDF
Vuejs testing
Greg TAPPERO
 
PDF
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
Fwdays
 
PDF
淺談 Groovy 與 AWS 雲端應用開發整合
Kyle Lin
 
PDF
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
NAVER D2
 
PPTX
Vagrant introduction for Developers
Antons Kranga
 
PDF
Nodejs Explained with Examples
Gabriele Lana
 
PDF
Introduction to Grunt.js on Taiwan JavaScript Conference
Bo-Yi Wu
 
PDF
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
 
PDF
The JavaFX Ecosystem
Andres Almiray
 
PDF
Zenly - Reverse geocoding
CocoaHeads France
 
PDF
Unit Testing with Jest
Maayan Glikser
 
PPTX
Intro to Node.js (v1)
Chris Cowan
 
PDF
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB
 
Plack at YAPC::NA 2010
Tatsuhiko Miyagawa
 
Gearman work queue in php
Bo-Yi Wu
 
A few good JavaScript development tools
Simon Kim
 
REST to JavaScript for Better Client-side Development
Hyunghun Cho
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
David Golden
 
Dessi docker kubernetes paas cloud
Massimiliano Dessì
 
GraphQL IN Golang
Bo-Yi Wu
 
Vuejs testing
Greg TAPPERO
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
Fwdays
 
淺談 Groovy 與 AWS 雲端應用開發整合
Kyle Lin
 
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
NAVER D2
 
Vagrant introduction for Developers
Antons Kranga
 
Nodejs Explained with Examples
Gabriele Lana
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Bo-Yi Wu
 
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
 
The JavaFX Ecosystem
Andres Almiray
 
Zenly - Reverse geocoding
CocoaHeads France
 
Unit Testing with Jest
Maayan Glikser
 
Intro to Node.js (v1)
Chris Cowan
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB
 
Ad

Viewers also liked (20)

PDF
신입 개발자 생활백서 [개정판]
Yurim Jin
 
PDF
Introducing hikebike.
Seokjun Kim
 
PDF
Evaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
Schneider Electric
 
PPTX
GraphQL - APIs mais robustas e flexíveis
Bruno Lemos
 
PDF
Playing with arduino open source h/w for mobile-centric services
Junhyuk Lee
 
PPTX
Meetup React Native
Nurielly Caroline Brizola
 
PPT
아두이노 4강 maker_school
Josh Park
 
PDF
강의자료 코딩클럽 아두이노 워크샵-2015.4.11
SongSup Shin
 
PPT
아두이노 5강 maker_school
Josh Park
 
PPT
아두이노 1강 maker_school
Josh Park
 
PDF
React Native Internals
Tadeu Zagallo
 
PPT
아두이노 3강 maker_school
Josh Park
 
PPT
아두이노 2강 maker_school
Josh Park
 
PDF
Introduzione a React Native - Alessandro Giannini
Develer S.R.L.
 
PDF
React & Redux
Federico Bond
 
PDF
Introduction to Arduino
Seokjun Kim
 
PDF
React native - What, Why, How?
Teerasej Jiraphatchandej
 
PDF
Universal Rendering
Taegon Kim
 
PPTX
SONY BBS - React Native
Mehmet Ali Bağcı
 
PPTX
Conhecendo API do Facebook
Virtualize Interatividade Digital
 
신입 개발자 생활백서 [개정판]
Yurim Jin
 
Introducing hikebike.
Seokjun Kim
 
Evaluating the Arc-Flash Protection Benefits of IEC 61850 Communication
Schneider Electric
 
GraphQL - APIs mais robustas e flexíveis
Bruno Lemos
 
Playing with arduino open source h/w for mobile-centric services
Junhyuk Lee
 
Meetup React Native
Nurielly Caroline Brizola
 
아두이노 4강 maker_school
Josh Park
 
강의자료 코딩클럽 아두이노 워크샵-2015.4.11
SongSup Shin
 
아두이노 5강 maker_school
Josh Park
 
아두이노 1강 maker_school
Josh Park
 
React Native Internals
Tadeu Zagallo
 
아두이노 3강 maker_school
Josh Park
 
아두이노 2강 maker_school
Josh Park
 
Introduzione a React Native - Alessandro Giannini
Develer S.R.L.
 
React & Redux
Federico Bond
 
Introduction to Arduino
Seokjun Kim
 
React native - What, Why, How?
Teerasej Jiraphatchandej
 
Universal Rendering
Taegon Kim
 
SONY BBS - React Native
Mehmet Ali Bağcı
 
Conhecendo API do Facebook
Virtualize Interatividade Digital
 
Ad

Similar to React Native in Production (20)

PDF
The Gist of React Native
Darren Cruse
 
PDF
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Codemotion
 
PPTX
React Native - Build Native Mobile App
Mobio Solutions
 
PDF
Introduzione a React Native - Facebook Developer Circle Rome
Matteo Manchi
 
PDF
This is the Ultimate Guide to React Native App Development.pdf
Nevina Infotech
 
PPTX
Advantages and Disadvantages of React Native App Development
APPNWEB Technologies
 
PDF
How Can the Hermes Engine Help React Native Apps.
Techugo
 
PPTX
React native
Vikrant Negi
 
PDF
React Native
Craig Jolicoeur
 
PDF
How Can the Hermes Engine Help React Native Apps.docx.pdf
Techugo
 
PDF
Lessons from a year of building apps with React Native
Ryan Boland
 
PDF
What Is React Native? Guide to Mobile App Development
GrapesTech Solutions
 
PDF
PDF React and React Native - Fifth Edition Mikhail Sakhniuk download
tzuramsazak
 
PPTX
9 reasons why programmers should learn react native
React Sharing
 
PPTX
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
 
PDF
React js vs react native a comparative analysis
Shelly Megan
 
PPTX
React native - React(ive) Way To Build Native Mobile Apps
Jimit Shah
 
PPT
React native
Mohammed El Rafie Tarabay
 
PPTX
React native introduction (Mobile Warsaw)
Jarek Potiuk
 
PDF
Build a real app with react native
John Pham
 
The Gist of React Native
Darren Cruse
 
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Codemotion
 
React Native - Build Native Mobile App
Mobio Solutions
 
Introduzione a React Native - Facebook Developer Circle Rome
Matteo Manchi
 
This is the Ultimate Guide to React Native App Development.pdf
Nevina Infotech
 
Advantages and Disadvantages of React Native App Development
APPNWEB Technologies
 
How Can the Hermes Engine Help React Native Apps.
Techugo
 
React native
Vikrant Negi
 
React Native
Craig Jolicoeur
 
How Can the Hermes Engine Help React Native Apps.docx.pdf
Techugo
 
Lessons from a year of building apps with React Native
Ryan Boland
 
What Is React Native? Guide to Mobile App Development
GrapesTech Solutions
 
PDF React and React Native - Fifth Edition Mikhail Sakhniuk download
tzuramsazak
 
9 reasons why programmers should learn react native
React Sharing
 
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
 
React js vs react native a comparative analysis
Shelly Megan
 
React native - React(ive) Way To Build Native Mobile Apps
Jimit Shah
 
React native introduction (Mobile Warsaw)
Jarek Potiuk
 
Build a real app with react native
John Pham
 

Recently uploaded (20)

PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Software Development Methodologies in 2025
KodekX
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Doc9.....................................
SofiaCollazos
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 

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
  • 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
  • 48. WE ARE HIRING JOIN TO WORK TOGETHER http://socar.recruiter.co.kr