Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
React Native Code Reuse: Architecture that Works
Aaron Greenwald
September 13, 2016
Programming
1
520
React Native Code Reuse: Architecture that Works
Talk from React Native Tel Aviv (RN_TLV) meetup on the Wix roof, 2016/09/13
Aaron Greenwald
September 13, 2016
Tweet
Share
More Decks by Aaron Greenwald
See All by Aaron Greenwald
Learn Once, Write Anywhere: Intro to React Native (3)
aarongreenwald
0
170
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
69
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
3
630
Other Decks in Programming
See All in Programming
開発速度を5倍早くするVSCodeの拡張機能を作った
purp1eeeee
2
170
Beyond Micro Frontends: Frontend Moduliths for the Enterprise @enterjs2022
manfredsteyer
PRO
0
200
Power Automateドリブンのチームマネジメント
hanaseleb
0
200
Chart実装が楽になりました。
keisukeyamagishi
0
120
Get Ready for Jakarta EE 10
ivargrimstad
0
3k
Angular-basierte Micro Frontends mit Module Federation @API Summit
manfredsteyer
PRO
0
120
Android Compose Component - mapping.
taehwandev
0
140
NEWT.net: Frontend Technology Selection
xpromx
0
280
Imperative is dead, long live Declarative! | Appdevcon
prof18
0
120
JetPackComposeは宣言型プログラミングパラダイムって実はよくわかってないんですが、別に使ってもいいんですよね、
conigashima
0
190
模組化的Swift架構(二) DDD速成
haifengkao
0
390
I/O Extended 2022 in Android ~ Whats new in Android development tools
pluu
0
570
Featured
See All Featured
Unsuck your backbone
ammeep
659
55k
The Invisible Customer
myddelton
110
11k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
5
520
The Cult of Friendly URLs
andyhume
68
4.8k
Designing Experiences People Love
moore
130
22k
Large-scale JavaScript Application Architecture
addyosmani
499
110k
Writing Fast Ruby
sferik
612
57k
A better future with KSS
kneath
225
15k
Optimizing for Happiness
mojombo
365
63k
Infographics Made Easy
chrislema
233
17k
Designing for humans not robots
tammielis
241
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
337
17k
Transcript
Architecture that Works React Native Code Reuse Aaron Greenwald github.com/aarongreenwald
@aaronjgreenwald aarong@wix.com
01 / The Promise
“...that approach yielded around 85% reuse of app code” -
Facebook
“...that approach yielded around 85% reuse of app code” -
Facebook “Don’t repeat yourself. It’s not only repetitive, it’s redundant, and people have heard it before.” - Lemony Snicket
Is it true?
Yes!
(Mostly)
Android & iOS
Web Apps Android & iOS
Web Apps Other RN Projects Android & iOS
02 / Android & iOS
Platform-Specific Code Platform Module Conditional statements in code
Platform-Specific Code Filename Suffixes Separate files per platform
Composition > Inheritance
Platform-Specific Code Platform Module Conditional statements in code Filename Suffixes
Separate files per platform
Architecture Matters
Keep logic out of views
Presenters/Dispatchers Keep logic out of views
Presenters/Dispatchers Logic should be cross-platform Keep logic out of views
Presenters/Dispatchers Logic should be cross-platform Keep logic out of views
Small & modular views
03 / Web Apps
Architecture Matters
Reusable application logic
Compilation gets complicated Reusable application logic
Create a separate module Compilation gets complicated Reusable application logic
Create a separate module Compilation gets complicated Reusable application logic
npm link...
04 / Multiple Projects
Architecture Matters
Binaries
Dependency Hell Binaries
Is it worthwhile? Dependency Hell Binaries
Architecture Matters
#architecture_matters github.com/aarongreenwald @aaronjgreenwald aarong@wix.com