á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg...

55
ૡ纷䒍ጱኞ႕憒㴟 REACT NATIVE 樄ত [email protected]

Transcript of á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg...

Page 2: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

github.com/[email protected]@csie.io

ABOUT ME

▸ CCUCSIE 2002 - 2008, BS + MS (GAIS Lab)

▸ CNA 2002 - 2008

▸ Trend Micro, startups…

▸ Bugs

▸ Facebook Facebook Algorithm QQ

▸ React Native

Page 3: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

OUTLINE

▸ React Native

▸ React Native

▸ React Native

Page 4: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

Image from: https://pixabay.com/zh/%E7%8B%AE%E5%AD%90-%E5%8A%A8%E7%89%A9-%E5%8F%AF%E7%88%B1-%E6%A9%99%E8%89%B2-%E5%8D%A1%E9%80%9A-%E5%93%BA%E4%B9%B3%E5%8A%A8%E7%89%A9-%E5%BF%AB%E4%B9%90-158639/

Page 5: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

TEXT

Image from: https://en.wikipedia.org/wiki/Railroad_switch#/media/File:SunsetTracksCrop.JPG

Page 6: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

▸ Work smart & efficiency)

Page 7: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~
Page 8: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

Q:

Page 9: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~
Page 10: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

▸PHP

▸Perl

▸Python

▸Ruby

▸C

▸C++

▸HTML

▸CSS

▸ jQuery

▸JavaScript

▸Java

▸Objective C

▸Swift

Page 11: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

Q:

Page 12: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

▸ Bug

▸ QBQ

Page 13: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~
Page 14: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

React Native

Page 15: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

▸ @Scale 2014 - Facebook’s iOS Architecture

https://www.youtube.com/watch?v=mLSeEoC6GjU

Page 16: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

▸ Immutable data model

▸ Uni-direction data flow

▸ Component

▸ Declarative UI

▸ Flexbox

Page 17: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

▸ A framework for building native apps using React

▸ Consistent developer experience based on JavaScript and React

▸ Learn once, write anywhere

▸ Native, not HTML

▸ Highly shared code between iOS and Android

▸ 85%+ for Facebook Ads Manager app

▸ https://speakerdeck.com/mkonicek/under-the-hood-of-react-native?slide=13

Page 18: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

SHOWCASE

▸ https://facebook.github.io/react-native/showcase.html

Page 19: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

▸ Component based

▸ Always thinking in Custom View for iOS / Android

▸ Flexbox

▸ iOS UIAuto Layout constraints

iOS 9 UIStackView

▸ inline CSS (CSS in JS)

▸ xml source code

Page 20: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

▸ Benefits from React

▸ Virtual DOM

▸ state / props

▸ Integrate with flux implementations for uni-directional data flow

▸ API

Page 21: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

Page 22: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

THIRD PARTY COMPONENTS ▸ https://react.parts/native

Page 23: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

INSTANTLY UPDATE YOUR APPS

AppHubhttps://apphub.io/

Microsoft CodePushhttps://microsoft.github.io/code-push/

Page 24: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

Page 25: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

Page 26: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

TALK DRIVEN LEARNING

▸ JavaScript <-> Native code Bridge

▸ React Native

Page 27: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

Q: MOBILE DEVELOPMENT FRAMEWORK

▸ Q:

▸ A:

Page 28: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

Q: MOBILE DEVELOPMENT FRAMEWORK

▸ Q: mobile development framework

▸ A:

▸ Apple, Google, …

▸ HTML5

▸ Bridge for Native code

Page 29: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

Q: MOBILE DEVELOPMENT FRAMEWORK

▸ Transpiler ?

▸ J2ObjC

▸ Xcode support C++

▸ Android NDK

▸ UI

Page 30: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

CROSS PLATFORM MOBILE DEVELOPMENT FRAMEWORK

▸ PhoneGap

▸ HTML5

▸ WebView performance

▸ Appcelerator Titanium

▸ React Native

▸ JS <-> Native bridge

Page 31: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

JAVASCRIPT <-> NATIVE CODE BRIDGE

▸ JavascriptCore / V8

▸ Chrome extension

▸ RPC

▸ eval()

▸ event

Page 32: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

JAVASCRIPT <-> NATIVE CODE BRIDGE

▸ Framework eval()

▸ IDL (Interface Description Language)

▸ MIDL for Windows COM/DCOM

▸ AIDL for Android

▸ JSON

▸ protobuf / Thrift

Page 33: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

JAVASCRIPT <-> NATIVE CODE BRIDGE

UIevent queue

Nativeevent queue

JS event queue

JSON IDL

Page 34: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

JAVASCRIPT <-> NATIVE CODE BRIDGE

▸ Export module/method JSON config

▸ iOS by Macro

▸ Android by Java Annotation

Page 35: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

JAVASCRIPT <-> NATIVE CODE BRIDGE

▸ iOS

▸ JavaScriptCore

▸ Android

▸ JavaScriptCore JNI

▸ V8 ?

▸ https://news.ycombinator.com/item?id=10216234

▸ We designed React Native to run with any JS engine by @vjeux

▸ Chakra XD

Page 36: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

JAVASCRIPT <-> NATIVE CODE BRIDGE

▸ Debugging JS mode

▸ Leverage Chrome Devtool

▸ V8

Page 37: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

▸ React

▸ Code share

▸ Keep 60fps in mind

▸ Profiler

▸ HTML5

Image from: https://facebook.github.io/react-native/docs/android-ui-performance.html

Page 38: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

▸ flux

▸ redux

▸ Fat Controller, MVC, MVP, MVVM, MVW

▸ Live Reload

▸ Hot Reload

▸ build

Page 39: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACT NATIVE

▸ React Native Playground

▸ https://rnplay.org/

Page 40: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

Page 41: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

▸ mobile app

▸ mobile app

Page 42: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

SOURCE CODE

▸ commits

▸ contributors

▸ Facebook

▸ commits

▸ Facebook keeps sync with internal repo

Facebook internal

repogithub

Page 43: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

SOURCE CODE - FACEBOOK-GITHUB-BOT

▸ https://github.com/facebook/mention-bot

Page 44: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

GITHUB

▸ GitHub issues

▸ StackOverflow #react-native

▸ Feature Request ProductPains

▸ bug

▸ PR Facebook roadmap

Page 45: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

REACTIFLUX

Page 46: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

TWITTER

▸ Follow

▸ #reactnative

Page 47: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

RXRNBRIDGE

▸ React Native project/toy

▸ Android RxJava

▸ RxJava libraries RxJava RN

▸ Java annotation processing

▸ https://medium.com/@kudochien/introduce-rxrnbridge-the-bridge-helper-between-rxjava-and-react-native-94e5a43d8583

▸ https://github.com/Kudo/RxRNBridge

Page 48: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

OPEN SOURCE FRAMEWORK / LIBRARY

REACT NATIVE

Page 49: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~
Page 50: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REACT NATIVE

▸ React Native ?

Page 51: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

▸ QBQ

▸ ?

▸ UI Flow ?

▸ PM ?

Page 52: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

Image from: https://en.wikipedia.org/wiki/Final_Fantasy_VII_Remake#/media/File:FFVIIRemake.png

Page 53: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

HOW ABOUT YOU?

Page 54: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REFERENCE

REACT NATIVE

▸ React Native Tutorial: Building Apps with JavaScript

▸ Navigating the React.JS Ecosystem

Page 55: á~·D 1 a = ! REACT NATIVE jtechccu.csie.io/2015/slides/kudo.pdfOUTLINE _bV á~·D React Native UYg r ÞL, 1 React Native UYg o 1 React Native BÊ \ Y~

REFERENCE

REACT NATIVE

▸ Under the hood of React Native

▸ From React web to native mobile: mapping out the unknown unknowns | Brent Vatne | Reactive 2015