Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React Native - Bringing modern web technologies to mobile
Search
Lidan
May 25, 2016
Technology
5
520
React Native - Bringing modern web technologies to mobile
Lidan Hifi, Wix.com
Lidan
May 25, 2016
Tweet
Share
More Decks by Lidan
See All by Lidan
Building Event-Driven Microservices with Event Sourcing and CQRS
lidanh
8
3.1k
Dev-Centric Culture at Wix - The Developer's Perspective
lidanh
0
530
How Did Nature Inspire Me To Solve The Ciphertext-only Attack
lidanh
0
140
Object Relational Mapping in Scala
lidanh
0
370
Behavioral Design Patterns
lidanh
2
160
Facebook Platform For .net Developers
lidanh
0
120
Other Decks in Technology
See All in Technology
2024/4/26 コンピュータ歴史博物館解説告知
toshi_atsumi
0
190
少数チームで挑む: SwiftUI, TCA, KMPを用いた 新規動画配信アプリ 「ABEMA Live」の開発について
tomu28
0
530
Algyan イベント振り返り
linyixian
0
180
カオナビの利用実績をアウトカムへつなげる旅 / example-of-data-management-startup-in-kaonavi
kaonavi
0
120
Databricks:『生成AI World Cup』のご案内
databricksjapan
1
130
20240416_devopsdaystokyo
kzkmaeda
1
180
Janus
bkuhlmann
0
490
Signals Unleashed: The Full Guide
rainerhahnekamp
0
360
オブザーバビリティの Primary Signals
onk
PRO
0
540
スタートアップの技術顧問を3年間続けて発生した事と気付き
biwakonbu
0
150
A (short) History of AI
harishpillay
0
110
転移学習とドメイン適応の基礎
kmatsui
2
570
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
92
4.8k
Embracing the Ebb and Flow
colly
78
4.1k
The Invisible Side of Design
smashingmag
293
49k
Statistics for Hackers
jakevdp
789
220k
In The Pink: A Labor of Love
frogandcode
137
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
13k
The Brand Is Dead. Long Live the Brand.
mthomps
48
28k
Faster Mobile Websites
deanohume
296
30k
Scaling GitHub
holman
457
140k
Robots, Beer and Maslow
schacon
PRO
154
7.9k
Atom: Resistance is Futile
akmur
258
25k
Being A Developer After 40
akosma
56
580k
Transcript
React Native Lidan Hifi Fullstack Developer, Wix Bringing modern web
technologies to mobile Engineering
Native Java Objective-C Swift
Cross Platform PhoneGap Titanium Ionic Sencha Touch
Native Development Sucks*
Slow Development Cycle
Slow Development Cycle Different APIs to Code Same Things
Slow Development Cycle Different APIs to Code Same Things Slow
Deployment Cycle
Slow Development Cycle Different APIs to Code Same Things Slow
Deployment Cycle Separate Platform Teams
Slow Development Cycle Different APIs to Code Same Things Slow
Deployment Cycle Separate Platform Teams
let [ PhoneGap, Trigger.io, Cordova, Ionic, Sencha Touch, Appcelerator Titanium,
...rest ] = stuffWeTriedBefore;
Native Development is more powerful
Stunning UX Develop Quickly
None
Everything was Native
No HTML
No WebView
Wix App is completely powered by JavaScript
React Native
Slow Development Cycle?
Instant Reload
Different APIs to Code Same Things?
90% up to code reuse
Slow Deployment Cycle?
OTA Updates Deploy like you’re on the web
Native Experience
UX of Native Developer Experience of the web
Where’s the Catch?
Many Unsolved Problems
Many Unsolved Problems No Best Practices
Many Unsolved Problems No Best Practices Hard to Test
Many Unsolved Problems No Best Practices Hard to Test Instability
Large Community
How does it work?
Bridge Your App Code Native App React JS
Bridge Your App Code Native App React JS
Bridge Your App Code Native App React JS
Bridge Your App Code Native App React JS
Bridge Your App Code Native App React JS
Bridge Main Thread Background Thread Your App Code Native App
React JS
React JS
Components
Functional UI
Declarative UI Imperative UI: Define Transitions (“how”) Declarative UI: Define
States (“what”)
Declarative UI Predictable
Predictable Confidence
Predictable Confidence
99+ 10
99+ 10
99+ 10
99+ 10
99+ 10 set badge to 99+! sad face! add badge!
remove stars!
10 Imperative UI: Define Transitions 10 99+ 10 10 99+
10 99+ 99+ 99+ 99+ 10 3 states, 9 transitions
10 Imperative UI: Define Transitions 10 99+ 10 10 99+
10 99+ 99+ 99+ 99+ 10 3 states, 9 transitions O(n2)
Imperative UI: Define Transitions if (count == 0) { if
(hasBadge()) { removeBadge(); } if (isSad()) { removeSadFace(); } addStars(); smile(); return; }
Imperative UI: Define Transitions else if (count <= 99) {
if (isSmile()) { removeSmile(); } if (sad()) { removeSadFace(); } if (hasStars()) { removeStars(); } if (!hasBadge()) { addBadge(); } }
Imperative UI: Define Transitions else { if (hasStars()) { removeStars();
} if (!hasBadge()) { addBadge(); } if (isSmile()) { removeSmile(); } setSadFace(); } let count = count > 99 ? '99+' : count.toString(); getBadge().setText(count);
Imperative UI: Define Transitions
Declarative UI: Define States if (count === 0) { return
<Bell style={styles.smile} /> }
Declarative UI: Define States if (count === 0) { return
<Bell style={styles.smile} /> } else if (count <= 99) { return ( <Bell> <Bedge count={count} /> </Bell> ); }
Declarative UI: Define States if (count === 0) { return
<Bell style={styles.smile} /> } else { return ( <Bell style={styles.sad}> <Badge count="99+" /> </Bell> ); } else if (count <= 99) { return ( <Bell> <Bedge count={count} /> </Bell> ); }
React Component render() { } } class HelloMessage extends React.Component
{ return <div>Hello {this.props.name}</div>;
React Component render() { } } class HelloMessage extends React.Component
{ return <div>Hello {this.props.name}</div>;
React Component render() { } } class HelloMessage extends React.Component
{ return <div>Hello {this.props.name}</div>;
React Component render() { } } class HelloMessage extends React.Component
{ return <div>Hello {this.props.name}</div>;
React Component render() { } } class HelloMessage extends React.Component
{ return <div>Hello {this.props.name}</div>; <HelloMessage name="Lidan" />
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); }
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); }
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); }
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); }
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); }
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); }
React Component: Adding State class Counter extends React.Component { }
constructor(props) { super(props); this.state = {count: 0}; this.tick = this.tick.bind(this); } tick() { this.setState({count: this.state.count + 1}); } render() { return ( <div onClick={this.tick}> Clicks: {this.state.count} </div> ); } <Counter />
From Web to Mobile <div /> <View /> UIView <span
/> <Text /> UILabel <img /> <Image /> UIImageView web react-native iOS native
React Native Components ActivityIndicatorIOS DatePickerIOS DrawerLayoutAndroid Image ListView MapView Modal
Navigator PickerIOS Picker ProgressBarAndroid ProgressViewIOS WebView ScrollView SegmentedControlIOS Slider SliderIOS StatusBar Switch TabBarIOS TabBarIOS.Item Text TextInput ToolbarAndroid View
None
react-native-controllers https://github.com/wix/react-native-controllers
react-native-notifications Interactive Notifications Background Notifications Managed Notifications https://github.com/wix/react-native-controllers
Getting Started • Install NodeJS • Install React Native npm
install -g react-native-cli • Create a new RN project react-native init MyProject • Run the application react-native run-ios react-native run-android
References React Native Official docs- facebook.github.io/react-native Make it Open- Building
the F8 App— makeitopen.com Wix Engineering- www.wix.engineering Awesome react native- https://github.com/jondot/awesome-react-native
References React Native Official docs- facebook.github.io/react-native Make it Open- Building
the F8 App— makeitopen.com Wix Engineering- www.wix.engineering Awesome react native- https://github.com/jondot/awesome-react-native
References React Native Official docs- facebook.github.io/react-native Make it Open- Building
the F8 App— makeitopen.com Wix Engineering- www.wix.engineering Awesome react native- https://github.com/jondot/awesome-react-native
References React Native Official docs- facebook.github.io/react-native Make it Open- Building
the F8 App— makeitopen.com Wix Engineering- www.wix.engineering Awesome react native- https://github.com/jondot/awesome-react-native
References React Native Official docs- facebook.github.io/react-native Make it Open- Building
the F8 App— makeitopen.com Wix Engineering- www.wix.engineering Awesome react native- https://github.com/jondot/awesome-react-native
Questions? Engineering @lidanh