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
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 원
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
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
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