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 Code Reuse: Architecture that Works
Search
Aaron Greenwald
September 13, 2016
Programming
1
720
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
320
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
91
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
840
Other Decks in Programming
See All in Programming
유연한 Composable 설계
l2hyunwoo
0
380
はしめてのプログラミングとロボット制御
watawatavoltage
0
290
Advanced App Shrinking Techniques
cbeyls
2
150
CSC307 Lecture 06
javiergs
PRO
0
360
Architectures with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
100
Trial
cairolibrary720
1
130
Harnessing Large Language Models for Training-free Video Anomaly Detection
tereka114
1
1.3k
MIERUNE BBQにおけるユーザー中心設計()
mierune
PRO
1
110
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
140
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
250
リハビリmruby
kishima
1
160
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
323
37k
Clear Off the Table
cherdarchuk
89
320k
Teambox: Starting and Learning
jrom
130
8.6k
It's Worth the Effort
3n
181
27k
Large-scale JavaScript Application Architecture
addyosmani
506
110k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
52k
How to train your dragon (web standard)
notwaldorf
79
5.5k
Producing Creativity
orderedlist
PRO
340
39k
Building Effective Engineering Teams - LeadDev
addyosmani
47
2.2k
Rails Girls Zürich Keynote
gr2m
93
13k
Done Done
chrislema
179
15k
Raft: Consensus for Rubyists
vanstee
134
6.5k
Transcript
Architecture that Works React Native Code Reuse Aaron Greenwald github.com/aarongreenwald
@aaronjgreenwald
[email protected]
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
[email protected]