Vince Liu and Suntian Song
Cortana Mobile team
Suzhou, China
Cordova family |
Xamarin | React Native | Portable C++ |
---|
Performance | 😕 | 😀 | 😀 | 😀 |
---|
Learning curve | 😀 | 😀 | 😀 | 😕 |
---|---|---|---|---|
Support hybrid model | 😀 | 😕 | 😀 | 😀 |
* Portable C++ is only used for non-UX logic.
UI
React
js
Virtual DOM
Event triggered
Apply diff & render
Update & caculate diff
JavaScript
Bridge
Native
queue event
send event
Handle event
update virtual dom
& diff
send diff
call native
click
render
Scenario: select a color to change theme of the App
JS Thread
Thread pool
Main Thread
Strategy
Hybrid development model
Helplist InputBox Profile page Reminder 2.0
Upcoming view
Home
View
Aug
2016
Now
Nov 2016
Dec 2016
Mar
2017
FY
2018
All
UI
Jul
2016
RN
CoA
CoI
Git submodule
Git subtree
Shared sub folder
( hard to rollback )
Single repo
.ts, .tsx
.js, .jsx
.jsbundle
Compile
Bundle
developer
debug
production
SourceMap
Startup latency
iPhone 6s - iOS 10.3.2 | SAMSUNG S8 - 7.0 | Nexus 5 - 7.0 | |
---|---|---|---|
RN initialization | 69ms | 340ms | 567ms |
JS bundle loading |
48ms | 20ms | 17ms |
JS parsing & execution | 544ms | 348ms | 885ms |
---|
Render of full DOM | 25ms | 180ms | 338ms |
---|
{
Action plan:
Footprint
Bundle size | RN Core components |
3rd-party components |
Cortana components |
---|---|---|---|
iOS (~1.2mb) | 577kb | ~256kb | ~370kb |
Android (~1.5mb) | 577kb | ~271kb | ~669kb |
* Data was collected from Huawei P9 phone
Rendering
Cloud
C o r ta na App
Check
install update
Immediate
Next restart
Next resume
on app start
on app resume
manual
Developer
Push
Store
Action
View
Action Creator
Reducer
Provider + Connect
Update state
Store.subscribe()
create actions
( App State )