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
830
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
420
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
120
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
950
Other Decks in Programming
See All in Programming
実践AIチャットボットUI実装入門
syumai
7
2.5k
ててべんす独演会〜Flowの全てを語ります〜
tbsten
1
220
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
480
iOS 17で追加されたSubscriptionStoreView を利用して5分でサブスク実装チャレンジ
natmark
0
640
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
630
ポスターセッション: 「まっすぐ行って、右!」って言ってラズパイカーを動かしたい 〜生成AI × Raspberry Pi Pico × Gradioの試作メモ〜
komofr
0
1k
CSC509 Lecture 05
javiergs
PRO
0
300
非同期jobをtransaction内で 呼ぶなよ!絶対に呼ぶなよ!
alstrocrack
0
560
Catch Up: Go Style Guide Update
andpad
0
200
育てるアーキテクチャ:戦い抜くPythonマイクロサービスの設計と進化戦略
fujidomoe
1
160
CSC305 Lecture 03
javiergs
PRO
0
240
CSC305 Lecture 06
javiergs
PRO
0
210
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
53
7.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Context Engineering - Making Every Token Count
addyosmani
5
200
Code Review Best Practice
trishagee
72
19k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
960
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
890
Optimizing for Happiness
mojombo
379
70k
Statistics for Hackers
jakevdp
799
220k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
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]